Блог пользователя Avishek99

Автор Avishek99, 6 лет назад, По-английски

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

  • Проголосовать: нравится
  • -6
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

Try adding this to your code inside main function