제출 #77144

#제출 시각아이디문제언어결과실행 시간메모리
77144dooweyAliens (IOI07_aliens)C++14
0 / 100
3 ms540 KiB
#pragma optimize ("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double ld; typedef pair<ll,int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ab(x) ((x) < 0 ? -(x) : (x)) #define all(x) ((x).begin(),(x).end()) #define len(x) ((int)(x).size()) ll n; bool ask(ll xi, ll yi){ if(xi <= 0) return false; if(yi <= 0) return false; if(xi > n) return false; if(yi > n) return false; printf("examine %d %d\n", (int)xi, (int)yi); fflush(stdout); string answer; cin >> answer; return answer == "true"; } int main(){ ll x0, y0; scanf("%lld %lld %lld", &n, &x0, &y0); ll L = x0 + 1, R = x0 + 1; for(ll i = 0;i < 32; i ++ ){ if(!ask(x0 + (1 << i), y0)){ R = x0 + (1 << i); break; } } ll md; ll lasx, lasy; while(L < R){ md = (L + R) / 2; if(ask(md, y0)) L = md + 1; else R = md; } ll tl = R - x0; lasx = R - 1; R = x0; L = x0; for(ll i = 0;i < 32; i ++ ){ if(!ask(x0 - (1 << i), y0)){ L = x0 - (1 << i); break; } } while(L < R){ md = (L + R) / 2; if(ask(md, y0)) R = md; else L = md + 1; } tl += x0 - L; ll M = tl; L = y0, R = y0 + M - 1; while(L < R){ md = (L + R) / 2; if(!ask(x0, md)) R = md; else L = md + 1; } -- L; lasy = L + 1; for(ll i = 1;i <= 3; i ++ ){ if(ask(lasx + 2 * M, lasy)) lasx += 2 * M; else break; } for(ll i = 1; i <= 3; i ++ ){ if(ask(lasx, lasy + 2 * M)) lasy += 2 * M; else break; } if(ask(lasx + M, lasy + M)) lasx += M, lasy += M; lasx -= 2 * M; lasy -= 2 * M; lasx -= M / 2; lasy -= M / 2; printf("solution %d %d\n", (int)lasx, (int)lasy); fflush(stdout); return 0; }

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

aliens.cpp:1:0: warning: ignoring #pragma optimize  [-Wunknown-pragmas]
 #pragma optimize ("O3")
 
aliens.cpp: In function 'int main()':
aliens.cpp:38:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld %lld", &n, &x0, &y0);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...