10816번 - 숫자 카드 2
#include
int main() {
int a,b;
int c[500000]={0};
int d[500000]={0};
int result[500000]={0};
scanf("%d",&a);
for (int i=0; i
이중 for문을 사용하면 연산횟수가 500000 * 500000이므로 1초 안에 연산을 끝낼 수가 없죠 조금 다르게 접근하실 필요가 있습니다.
댓글을 작성하려면 로그인해야 합니다.
scg9767 2년 전
#include
int main() {
int a,b;
int c[500000]={0};
int d[500000]={0};
int result[500000]={0};
scanf("%d",&a);
for (int i=0; i