제출 #742421

#제출 시각아이디문제언어결과실행 시간메모리
742421jamezzzWorm Worries (BOI18_worm)C++17
0 / 100
1350 ms208 KiB
#include <bits/stdc++.h> using namespace std; #define sf scanf #define pf printf int ask(int a,int b,int c){ pf("? %d %d %d\n",a,b,c); fflush(stdout); int x;sf("%d",&x); return x; } void submit(int a,int b,int c){ pf("! %d %d %d\n",a,b,c); fflush(stdout); exit(0); } int n,m,k,q; mt19937 rng(time(0)); int main(){ sf("%d%d%d%d",&n,&m,&k,&q); tuple<int,int,int,int> ans={0,0,0,0}; for(int i=0;i<q;++i){ int x=rng()%n+1,y=rng()%m+1,z=rng()%k+1; ans=max(ans,{ask(x,y,z),x,y,z}); } auto[_,x,y,z]=ans; submit(x,y,z); }

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

worm.cpp: In function 'int ask(int, int, int)':
worm.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  int x;sf("%d",&x);
      |          ^
worm.cpp: In function 'int main()':
worm.cpp:24:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |  sf("%d%d%d%d",&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...