Submission #890316

#TimeUsernameProblemLanguageResultExecution timeMemory
890316MuhammadSaramAliens (IOI07_aliens)C++17
10 / 100
1 ms436 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,x,y; cin>>n>>x>>y; int m,cor,cor1; for (int i=1;i<min(101,n-x+1);i++) { cout<<"examine "<<x+i<<' '<<y<<endl; string s; cin>>s; if (s=="false") { m=i; break; } if (i==n-x) m=i+1; } for (int i=1;i<min(101,x);i++) { cout<<"examine "<<x-i<<' '<<y<<endl; string s; cin>>s; if (s=="false") { cor=i; m+=i-1; break; } if (i==x-1) { m+=i; cor=x; } } for (int i=1;i<min(101,y);i++) { cout<<"examine "<<x<<' '<<y-i<<endl; string s; cin>>s; if (s=="false") { cor1=i; break; } if (i==y-1) cor1=y; } x+=(m+1)/2-cor; y+=(m+1)/2-cor1; for (int i=1;i<=5;i++) for (int j=1;j<=5;j++) { if (i%2!=j%2) continue; bool b=true; for (int k=1;k<=5 and b;k++) if (i%2==k%2 and k!=j) { int y1=y+(k-j)*m; if (y1<1 or y1>n) b=false; else { cout<<"examine "<<x<<' '<<y1<<endl; string s; cin>>s; if (s=="false") b=false; } } for (int k=1;k<=5 and b;k++) if (j%2==k%2 and k!=i) { int x1=x+(k-i)*m; if (x1<1 or x1>n) b=false; else { cout<<"examine "<<x1<<' '<<y<<endl; string s; cin>>s; if (s=="false") b=false; } } if (b) { cout<<"solution "<<x+(3-i)*m<<' '<<y+(3-j)*m<<endl; return 0; } } }

Compilation message (stderr)

aliens.cpp: In function 'int main()':
aliens.cpp:54:12: warning: 'cor1' may be used uninitialized in this function [-Wmaybe-uninitialized]
   54 |  y+=(m+1)/2-cor1;
      |     ~~~~~~~^~~~~
aliens.cpp:53:12: warning: 'cor' may be used uninitialized in this function [-Wmaybe-uninitialized]
   53 |  x+=(m+1)/2-cor;
      |     ~~~~~~~^~~~
aliens.cpp:31:5: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized]
   31 |    m+=i-1;
      |    ~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...