Submission #1148010

#TimeUsernameProblemLanguageResultExecution timeMemory
1148010modwweCombo (IOI18_combo)C++20
100 / 100
8 ms524 KiB
#include "combo.h" #pragma GCC optimize("Ofast,unroll-loops") #include<bits/stdc++.h> //#define int long long #define ll long long #define down cout<<'\n'; #define debug cout<<" cucuucucuuu",down #define modwwe int t;cin>>t; while(t--) #define bit(i,j) (i>>j&1) #define sobit(a) __builtin_popcountll(a) #define task2 "ftree" #define task "test" #define fin(x) freopen(x".inp","r",stdin) #define fou(x) freopen(x".out","w",stdout) #define pb push_back #define mask(k) (1<<k) #define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms"; using namespace std; #define getchar_unlocked getchar mt19937 rd(chrono::steady_clock::now().time_since_epoch().count()); int rand(int l,int r) { return uniform_int_distribution<int>(l,r)(rd); } void phongbeo(); const int inf = 1e16; const ll mod2 = 1e9+7; const ll base=67; int n,m,s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center; int i, s10, s12,k1,k2,k3,s11,lim,w,l,r,last; int kk; int t; int el = 19;/* main() { if(fopen(task2".inp","r")) { fin(task2); fou(task2); } if(fopen(task".inp","r")) { fin(task); fou(task); } ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); /// cin>>s1; //int t;cin>>t; while(t--) phongbeo(),down // checktime } int press(string s) { return 0; }*/ string guess_sequence(int n) { string s; string start="ABXY"; if(press("AB")) { if(press("A"))s='A'; else s='B'; } else { if(press("X"))s='X'; else s='Y'; } if(n==1) return s; string nex; for(char x:start) if(x!=s[0]) nex+=x; while(s.size()+1<n) { string ask=s+nex[0]+nex[0]+s+nex[0]+nex[1]+s+nex[0]+nex[2]+s+nex[1]; int hihi=press(ask); if(hihi==s.size()+2) { s=s+nex[0]; } else if(hihi==s.size()+1) { s=s+nex[1]; } else { s=s+nex[2]; } } string ask=s+nex[0]; if(press(ask)==n) { s=s+nex[0]; return s; } ask=s+nex[1]; if(press(ask)==n) { s=s+nex[1]; return s; } s=s+nex[2]; return s; }

Compilation message (stderr)

combo.cpp:26:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+16' to '2147483647' [-Woverflow]
   26 | const int inf = 1e16;
      |                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...