Submission #564905

#TimeUsernameProblemLanguageResultExecution timeMemory
564905heavylightdecompCombo (IOI18_combo)C++14
100 / 100
32 ms584 KiB
#include "combo.h" #include<bits/stdc++.h> #pragma GCC optimize ("Ofast") #pragma GCC target ("avx,avx2,fma") using namespace std; string g[4]; #define a g[0] #define b g[1] #define c g[2] #define d g[3] #define p press string guess_sequence(int N) { a ="A",b = "B", c = "X", d = "Y"; if(N==1) return p(a)?a:p(b)?b:p(c)?c:d; string k; k.reserve(2100); int f = p(a+b); if(f) k += p(a) ? (swap(a,d),d) : (swap(b,d),d); else k += p(c) ? (swap(c,d),d) : d; const string ba=b+a,bb=b+b,bc=b+c; for(int i=0;i<N-2;i++) k+= (f=p(k+a+k+ba+k+bb+k+bc), f==(k.size()+2)) ? b : (f==(k.size()+1) ? a : c); if(p(k+a)>(k.size()))k+=a;else if(p(k+b)>(k.size()))k+=b;else k+=c; return k; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:56: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0;i<N-2;i++) k+= (f=p(k+a+k+ba+k+bb+k+bc), f==(k.size()+2)) ? b : (f==(k.size()+1) ? a : c);
      |                                                       ~^~~~~~~~~~~~~~
combo.cpp:19:80: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0;i<N-2;i++) k+= (f=p(k+a+k+ba+k+bb+k+bc), f==(k.size()+2)) ? b : (f==(k.size()+1) ? a : c);
      |                                                                               ~^~~~~~~~~~~~~~
combo.cpp:20:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  if(p(k+a)>(k.size()))k+=a;else if(p(k+b)>(k.size()))k+=b;else k+=c;
      |           ^
combo.cpp:20:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  if(p(k+a)>(k.size()))k+=a;else if(p(k+b)>(k.size()))k+=b;else k+=c;
      |                                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...