Avishek99's blog

By Avishek99, 5 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?
»
5 years ago, # |
  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;

}

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    At least give code in proper manner so that someone can understand it.You can paste code in ide like geeksforgeeks and generate link.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      sorry for that inconvenience,i am new in codeforces.So i don't know how to do that,i have tried.

»
5 years ago, # |
  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