제출 #244367

#제출 시각아이디문제언어결과실행 시간메모리
244367TadijaSebezWorm Worries (BOI18_worm)C++11
10 / 100
6 ms384 KiB
#include <bits/stdc++.h> using namespace std; int Ask(int i,int j,int k){ printf("? %i %i %i\n",i,j,k); fflush(stdout); int b;scanf("%i",&b); return b; } int main(){ int n,m,k,q;scanf("%i %i %i %i",&n,&m,&k,&q); int top=n,bot=1,mid; while(top>bot){ mid=top+bot>>1; if(Ask(mid,1,1)<Ask(mid+1,1,1))bot=mid+1; else top=mid; } printf("! %i 1 1\n",bot); fflush(stdout); return 0; }

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

worm.cpp: In function 'int main()':
worm.cpp:13:10: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid=top+bot>>1;
       ~~~^~~~
worm.cpp: In function 'int Ask(int, int, int)':
worm.cpp:6:13: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int b;scanf("%i",&b);
        ~~~~~^~~~~~~~~
worm.cpp: In function 'int main()':
worm.cpp:10:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int n,m,k,q;scanf("%i %i %i %i",&n,&m,&k,&q);
              ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...