Submission #890364

# Submission time Handle Problem Language Result Execution time Memory
890364 2023-12-21T04:48:38 Z Sir_Ahmed_Imran Aliens (IOI07_aliens) C++17
40 / 100
2 ms 444 KB
                              ///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
bool query(int x,int y){
    string s;
    cout<<"examine "<<x<<' '<<y<<endl;
    cin>>s;
    return (s=="true");
}
void solve(){
    int n,m,o,p,q,x1,x2,y1,y2;
    cin>>n>>p>>q;
    for(x2=p+1;x2<=n;x2++)
        if(!query(x2,q))
            break; 
    for(x1=p-1;x1>0;x1--)
        if(!query(x1,q))
            break;
    p=(x1+x2)/2;
    m=2*(x2-x1-1);
    for(y2=q+1;y2<=n;y2++)
        if(!query(p,y2))
            break;
    for(y1=q-1;y1>0;y1--)
        if(!query(p,y1))
            break;
    q=(y2+y1)/2;
    for(x1=p-m;x1>0;x1-=m)
        if(!query(x1,q))
            break;
    for(x2=p+m;x2<=n;x2+=m)
        if(!query(x2,q))
            break;
    for(y1=q-m;y1>0;y1-=m)
        if(!query(p,y1))
            break;
    for(y2=q+m;y2<=n;y2+=m)
        if(!query(p,y2))
            break;
    cout<<"solution "<<(x1+x2)/2<<' '<<(y1+y2)/2<<endl;
}
int main(){
    solve();
    return 0;
}

Compilation message

aliens.cpp: In function 'void solve()':
aliens.cpp:11:13: warning: unused variable 'o' [-Wunused-variable]
   11 |     int n,m,o,p,q,x1,x2,y1,y2;
      |             ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Runtime error 1 ms 436 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Runtime error 2 ms 444 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 436 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 440 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -