Submission #431145

#TimeUsernameProblemLanguageResultExecution timeMemory
431145juggernautAliens (IOI07_aliens)C++17
0 / 100
2 ms200 KiB
#include<bits/stdc++.h> #define fr first #define sc second using namespace std; void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);} typedef long long ll; #define USING_ORDERED_SET 0 #if USING_ORDERED_SET #include<bits/extc++.h> using namespace __gnu_pbds; template<class T>using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; #endif template<class T>void umax(T &a,T b){if(a<b)a=b;} template<class T>void umin(T &a,T b){if(b<a)a=b;} #ifdef IOI2021SG #define printl(args...)printf(args) #else #define printl(args...)((void)0) #endif bool query(int x,int y){ printf("examine %d %d\n",x,y); fflush(stdout); string s; cin>>s; return s=="true"; } int main(){ ll n,x,y,x1,y1,x2,y2; scanf("%lld%lld%lld",&n,&x,&y); int l,r; l=x+1; r=x+n; while(l<r){ int mid=(l+r)>>1; if(query(mid,y))l=mid+1; else r=mid; } x2=l; x1=l-n-1; l=y+1; r=y+n; while(l<r){ int mid=(l+r)>>1; if(query(x,mid))l=mid+1; else r=mid; } y2=l; y1=l-n-1; printf("solution %d %d\n",(x1+x2)/2,(y1+y2)/2); }

Compilation message (stderr)

aliens.cpp: In function 'int main()':
aliens.cpp:49:23: warning: format '%d' expects argument of type 'int', but argument 2 has type 'll' {aka 'long long int'} [-Wformat=]
   49 |     printf("solution %d %d\n",(x1+x2)/2,(y1+y2)/2);
      |                      ~^       ~~~~~~~~~
      |                       |              |
      |                       int            ll {aka long long int}
      |                      %lld
aliens.cpp:49:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'll' {aka 'long long int'} [-Wformat=]
   49 |     printf("solution %d %d\n",(x1+x2)/2,(y1+y2)/2);
      |                         ~^              ~~~~~~~~~
      |                          |                     |
      |                          int                   ll {aka long long int}
      |                         %lld
aliens.cpp: In function 'void usaco(std::string)':
aliens.cpp:5:29: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
      |                      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aliens.cpp:5:66: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void usaco(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
      |                                                           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aliens.cpp: In function 'int main()':
aliens.cpp:29:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   29 |     scanf("%lld%lld%lld",&n,&x,&y);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#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...