Submission #217767

#TimeUsernameProblemLanguageResultExecution timeMemory
2177672fat2codeSecret Permutation (RMI19_permutation)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define sz() size() #define fr first #define sc second #define pi pair<int,int> #define pii pair<pair<int,int>,int> #define mp make_pair //#define int long long #define rc(s) return cout<<s,0 #define rcc(s) cout<<s,exit(0) using namespace std; const int mod=1e9+7; const int modp=1999999973; const int modulo=998244353; vector<char>ch; vector<char>ch2; string guess_sequence(int N) { ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0); srand(chrono::steady_clock::now().time_since_epoch().count()); string tz; ch.push_back('A'); ch.push_back('B'); ch.push_back('X'); ch.push_back('Y'); tz="A"; if(press(tz)==1) goto next; tz="B"; if(press(tz)==1) goto next; tz="X"; if(press(tz)==1) goto next; tz="Y"; next:; for(int i=0;i<ch.size();i++){ if(ch[i]!=tz.back()) ch2.push_back(ch[i]); } for(int i=1;i<(N-1);i++){ random_shuffle(all(ch2)); cout << endl; string ask=(tz+ch2[0]+ch2[0]+tz+ch2[0]+ch2[1]+tz+ch2[0]+ch2[2]+tz+ch2[1]); int g=press(ask); if(g==(i+2)) tz.push_back(ch2[0]); else if(g==(i+1)) tz.push_back(ch2[1]); else tz.push_back(ch2[2]); } if(N>=2){ tz+="A"; if(press(tz)==N) goto next1; tz.pop_back(); tz+="B"; if(press(tz)==N) goto next1; tz.pop_back(); tz+="X"; if(press(tz)==N) goto next1; tz.pop_back(); tz+="Y"; next1:; } return tz; }

Compilation message (stderr)

permutation.cpp:1:10: fatal error: combo.h: No such file or directory
 #include "combo.h"
          ^~~~~~~~~
compilation terminated.
stub.cpp: In function 'int query(int*)':
stub.cpp:15:9: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   fscanf(stdin, "%d", &x);
   ~~~~~~^~~~~~~~~~~~~~~~~
stub.cpp: In function 'int main(int, char**)':
stub.cpp:48:9: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   fscanf(stdin, "%d", &N);
   ~~~~~~^~~~~~~~~~~~~~~~~