제출 #534415

#제출 시각아이디문제언어결과실행 시간메모리
534415MrDebooCombo (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> // #define int long long using namespace std; std::string guess_sequence(int n) { srand(time(NULL)); char f[]={'A','B','X','Y'}; string s; bool bl=0; for(auto &i:f){ string g; g+=i; if(press(g)!=0){bl=1;s+=i;break;} if(i=='X')break; } if(!bl)s+='Y'; vector<char>ve; for(auto &i:f)if(i!=s[0])ve.push_back(i); vector<char>v=ve; int cnt=0; while(s.size()!=n){ bool bl=0; vector<bool>pick(3); map<char,bool>mp; for(int w=0;w<v.size()-1;w++){ string G; for(int i=0;i<20;i++)G+=v[rand()%v.size()]; int k=press(s+G); cnt++; for(int i=0;i<k-s.size();i++){ s+=G[i]; } mp[G[k-s.size()]]=1; } if(!bl)s+=v.back(); vector<char>V; for(auto i:ve)if(!mp[i])V.push_back(i); v=V; } return s; // std::string p = ""; // for (int i = 0; i < 4 * N; ++i) { // p += 'A'; // } // int coins = press(p); // std::string S = ""; // for (int i = 0; i < N; ++i) { // S += 'A'; // } // return S; }

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

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