제출 #597136

#제출 시각아이디문제언어결과실행 시간메모리
597136ttamxAliens (IOI07_aliens)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>

#define ll long long;

using namespace std;

ll n,xo,yo;

bool check(ll x,ll y){
    cout << "examine " << x << " " << y << endl;
    string ret;
    cin >> ret;
    return ret=="true";
}

int main(){
    cin.tie(nullptr)->sync_with_stdio(false);
    cin >> n >> xo >> yo;
    ll l=xo,r=n;
    for(ll i=1;xo+i<=n;i<<=1){
        if(!check(xo+i,yo)){
            r=xo+i;
            break;
        }else{
            l=xo+i;
        }
    }
    while(r-1>l){
        ll m=(l+r)>>1;
        if(check(m,yo)){
            l=m;
        }else{
            r=m;
        }
    }
    ll xr=l;
    l=1,r=xo;
    for(ll i=1;xo-i>=1;i<<=1){
        if(!check(xo-i,yo)){
            l=xo-i;
            break;
        }else{
            r=xo-i;
        }
    }
    while(r-1>l){
        ll m=(l+r)>>1;
        if(check(m,yo)){
            r=m;
        }else{
            l=m;
        }
    }
    ll xl=r;
    ll sz=xr-xl+1;
    l=xr,r=n;
    for(ll i=2*sz;xr+i<=n;i<<=1){
        if(!check(xr+i,yo)){
            r=xr+i;
            break;
        }else{
            l=xr+i;
        }
    }
    while(r-sz>l){
        ll m=(l+r)>>1;
        if(check(m,yo)){
            l=m;
        }else{
            r=m;
        }
    }
    ll Xr=l;
    l=1,r=xl;
    for(ll i=2*sz;xl-i>=1;i<<=1){
        if(!check(xl-i,yo)){
            l=xl-i;
            break;
        }else{
            r=xl-i;
        }
    }
    while(r-sz>l){
        ll m=(l+r)>>1;
        if(check(m,yo)){
            r=m;
        }else{
            l=m;
        }
    }
    ll Xl=r;
    l=yo,r=n;
    for(ll i=2*sz;yo+i<=n;i<<=1){
        if(!check(Xl,yo+i)){
            r=yo+i;
            break;
        }else{
            l=yo+i;
        }
    }
    while(r-sz>l){
        ll m=(l+r)>>1;
        if(check(Xl,m)){
            l=m;
        }else{
            r=m;
        }
    }
    while(r-1>l){
        ll m=(l+r)>>1;
        if(check(Xl,m)){
            l=m;
        }else{
            r=m;
        }
    }
    ll Yr=l;
    sz=(Xr-Xl)/2;
    cout << "solution " << Xl+sz << " " << Yr-sz << endl;
}

컴파일 시 표준 에러 (stderr) 메시지

aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:7:1: note: in expansion of macro 'll'
    7 | ll n,xo,yo;
      | ^~
aliens.cpp:7:4: error: 'n' does not name a type; did you mean 'yn'?
    7 | ll n,xo,yo;
      |    ^
      |    yn
aliens.cpp:3:21: error: expected ')' before ';' token
    3 | #define ll long long;
      |                     ^
aliens.cpp:9:12: note: in expansion of macro 'll'
    9 | bool check(ll x,ll y){
      |            ^~
aliens.cpp:9:11: note: to match this '('
    9 | bool check(ll x,ll y){
      |           ^
aliens.cpp:9:15: error: 'x' does not name a type
    9 | bool check(ll x,ll y){
      |               ^
aliens.cpp:9:20: error: 'y' does not name a type; did you mean 'yn'?
    9 | bool check(ll x,ll y){
      |                    ^
      |                    yn
aliens.cpp: In function 'int main()':
aliens.cpp:18:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   18 |     cin >> n >> xo >> yo;
      |            ^
      |            yn
aliens.cpp:18:17: error: 'xo' was not declared in this scope
   18 |     cin >> n >> xo >> yo;
      |                 ^~
aliens.cpp:18:23: error: 'yo' was not declared in this scope; did you mean 'yn'?
   18 |     cin >> n >> xo >> yo;
      |                       ^~
      |                       yn
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:19:5: note: in expansion of macro 'll'
   19 |     ll l=xo,r=n;
      |     ^~
aliens.cpp:19:8: error: 'l' was not declared in this scope; did you mean 'll'?
   19 |     ll l=xo,r=n;
      |        ^
      |        ll
aliens.cpp:19:13: error: 'r' was not declared in this scope
   19 |     ll l=xo,r=n;
      |             ^
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:20:9: note: in expansion of macro 'll'
   20 |     for(ll i=1;xo+i<=n;i<<=1){
      |         ^~
aliens.cpp:20:12: error: 'i' was not declared in this scope
   20 |     for(ll i=1;xo+i<=n;i<<=1){
      |            ^
aliens.cpp:20:23: error: expected ')' before ';' token
   20 |     for(ll i=1;xo+i<=n;i<<=1){
      |        ~              ^
      |                       )
aliens.cpp:20:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   20 |     for(ll i=1;xo+i<=n;i<<=1){
      |     ^~~
aliens.cpp:20:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   20 |     for(ll i=1;xo+i<=n;i<<=1){
      |                        ^
aliens.cpp:20:24: error: 'i' was not declared in this scope
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:29:9: note: in expansion of macro 'll'
   29 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:29:12: error: 'm' was not declared in this scope; did you mean 'tm'?
   29 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:36:5: note: in expansion of macro 'll'
   36 |     ll xr=l;
      |     ^~
aliens.cpp:36:8: error: 'xr' was not declared in this scope
   36 |     ll xr=l;
      |        ^~
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:38:9: note: in expansion of macro 'll'
   38 |     for(ll i=1;xo-i>=1;i<<=1){
      |         ^~
aliens.cpp:38:23: error: expected ')' before ';' token
   38 |     for(ll i=1;xo-i>=1;i<<=1){
      |        ~              ^
      |                       )
aliens.cpp:38:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   38 |     for(ll i=1;xo-i>=1;i<<=1){
      |     ^~~
aliens.cpp:38:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   38 |     for(ll i=1;xo-i>=1;i<<=1){
      |                        ^
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:47:9: note: in expansion of macro 'll'
   47 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:47:12: error: 'm' was not declared in this scope; did you mean 'tm'?
   47 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:54:5: note: in expansion of macro 'll'
   54 |     ll xl=r;
      |     ^~
aliens.cpp:54:8: error: 'xl' was not declared in this scope; did you mean 'll'?
   54 |     ll xl=r;
      |        ^~
      |        ll
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:55:5: note: in expansion of macro 'll'
   55 |     ll sz=xr-xl+1;
      |     ^~
aliens.cpp:55:8: error: 'sz' was not declared in this scope
   55 |     ll sz=xr-xl+1;
      |        ^~
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:57:9: note: in expansion of macro 'll'
   57 |     for(ll i=2*sz;xr+i<=n;i<<=1){
      |         ^~
aliens.cpp:57:26: error: expected ')' before ';' token
   57 |     for(ll i=2*sz;xr+i<=n;i<<=1){
      |        ~                 ^
      |                          )
aliens.cpp:57:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   57 |     for(ll i=2*sz;xr+i<=n;i<<=1){
      |     ^~~
aliens.cpp:57:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   57 |     for(ll i=2*sz;xr+i<=n;i<<=1){
      |                           ^
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:66:9: note: in expansion of macro 'll'
   66 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:66:12: error: 'm' was not declared in this scope; did you mean 'tm'?
   66 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:73:5: note: in expansion of macro 'll'
   73 |     ll Xr=l;
      |     ^~
aliens.cpp:73:8: error: 'Xr' was not declared in this scope
   73 |     ll Xr=l;
      |        ^~
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:75:9: note: in expansion of macro 'll'
   75 |     for(ll i=2*sz;xl-i>=1;i<<=1){
      |         ^~
aliens.cpp:75:26: error: expected ')' before ';' token
   75 |     for(ll i=2*sz;xl-i>=1;i<<=1){
      |        ~                 ^
      |                          )
aliens.cpp:75:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   75 |     for(ll i=2*sz;xl-i>=1;i<<=1){
      |     ^~~
aliens.cpp:75:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   75 |     for(ll i=2*sz;xl-i>=1;i<<=1){
      |                           ^
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:84:9: note: in expansion of macro 'll'
   84 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:84:12: error: 'm' was not declared in this scope; did you mean 'tm'?
   84 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:91:5: note: in expansion of macro 'll'
   91 |     ll Xl=r;
      |     ^~
aliens.cpp:91:8: error: 'Xl' was not declared in this scope; did you mean 'll'?
   91 |     ll Xl=r;
      |        ^~
      |        ll
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:93:9: note: in expansion of macro 'll'
   93 |     for(ll i=2*sz;yo+i<=n;i<<=1){
      |         ^~
aliens.cpp:93:26: error: expected ')' before ';' token
   93 |     for(ll i=2*sz;yo+i<=n;i<<=1){
      |        ~                 ^
      |                          )
aliens.cpp:93:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   93 |     for(ll i=2*sz;yo+i<=n;i<<=1){
      |     ^~~
aliens.cpp:93:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   93 |     for(ll i=2*sz;yo+i<=n;i<<=1){
      |                           ^
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:102:9: note: in expansion of macro 'll'
  102 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:102:12: error: 'm' was not declared in this scope; did you mean 'tm'?
  102 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:110:9: note: in expansion of macro 'll'
  110 |         ll m=(l+r)>>1;
      |         ^~
aliens.cpp:110:12: error: 'm' was not declared in this scope; did you mean 'tm'?
  110 |         ll m=(l+r)>>1;
      |            ^
      |            tm
aliens.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
aliens.cpp:117:5: note: in expansion of macro 'll'
  117 |     ll Yr=l;
      |     ^~
aliens.cpp:117:8: error: 'Yr' was not declared in this scope
  117 |     ll Yr=l;
      |        ^~