Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Avishek99's blog

By Avishek99, 6 years ago, In English

I'm getting runtime error with exit code -1073741571.Help please problem link : https://codeforces.me/problemset/problem/254/A Here is my submission screenshot url : https://www.imageupload.net/image/capture2.dbfwh

  • Vote: I like it
  • -6
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Here is my code :

include<stdio.h>

int main() { int n,i,j,c=0; scanf("%d",&n); n*=2; int a[n]; for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(a[i]==a[j]) { printf("%d %d\n",i+1,j+1); c++; break; } } } if(c==0) printf("-1");

return 0;

}

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

Try adding this to your code inside main function