제출 #944510

#제출 시각아이디문제언어결과실행 시간메모리
944510study콤보 (IOI18_combo)C++17
10 / 100
32 ms1712 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define REP(i,n) for (int i=0; i<(n); i++) const int M = 4; const char LET[] = "ABXY"; string guess_sequence(int N){ int idx[M]; REP(i,M){idx[i]=i;} string s; REP(i,N){ REP(j,M-1){ if (i != 0 and j == M-1) break; int len = press(s+LET[idx[j]]); if (len == i+1){ s += LET[idx[j]]; if (i == 0) swap(idx[M-1],idx[j]); break; } } if (s.size() != i+1){ if (i == 0) s += LET[idx[M-1]]; else s += LET[idx[M-2]]; } random_shuffle(idx,idx+M-1); } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:25:30: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |                 if (s.size() != i+1){
      |                     ~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...