제출 #477958

#제출 시각아이디문제언어결과실행 시간메모리
477958omohamadooo콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
/* ___ ___ ___ ___ ___ ___ ___ _____ ___ ___ ___ / /\ /__/\ / /\ /__/\ / /\ /__/\ / /\ / /::\ / /\ / /\ / /\ / /::\ | |::\ / /::\ \ \:\ / /::\ | |::\ / /::\ / /:/\:\ / /::\ / /::\ / /::\ / /:/\:\ | |:|:\ / /:/\:\ \__\:\ / /:/\:\ | |:|:\ / /:/\:\ / /:/ \:\ / /:/\:\ / /:/\:\ / /:/\:\ / /:/ \:\ __|__|:|\:\ / /:/ \:\ ___ / /::\ / /:/~/::\ __|__|:|\:\ / /:/~/::\ /__/:/ \__\:| / /:/ \:\ / /:/ \:\ / /:/ \:\ /__/:/ \__\:\ /__/::::| \:\ /__/:/ \__\:\ /__/\ /:/\:\ /__/:/ /:/\:\ /__/::::| \:\ /__/:/ /:/\:\ \ \:\ / /:/ /__/:/ \__\:\ /__/:/ \__\:\ /__/:/ \__\:\ \ \:\ / /:/ \ \:\~~\__\/ \ \:\ / /:/ \ \:\/:/__\/ \ \:\/:/__\/ \ \:\~~\__\/ \ \:\/:/__\/ \ \:\ /:/ \ \:\ / /:/ \ \:\ / /:/ \ \:\ / /:/ \ \:\ /:/ \ \:\ \ \:\ /:/ \ \::/ \ \::/ \ \:\ \ \::/ \ \:\/:/ \ \:\ /:/ \ \:\ /:/ \ \:\ /:/ \ \:\/:/ \ \:\ \ \:\/:/ \ \:\ \ \:\ \ \:\ \ \:\ \ \::/ \ \:\/:/ \ \:\/:/ \ \:\/:/ \ \::/ \ \:\ \ \::/ \ \:\ \ \:\ \ \:\ \ \:\ \__\/ \ \::/ \ \::/ \ \::/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ \__\/ */ #include "bits/stdc++.h" #include "combo.h" //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #define ll long long #define pb push_back #define endl '\n' #define pii pair<ll,ll > #define F first #define S second #define ld long double using namespace std; //using namespace __gnu_pbds; //typedef tree<ll , null_type , less_equal<ll> ,rb_tree_tag ,tree_order_statistics_node_update >ordered_set; const int MOD=1e9+7; const int N=3e5+7; long long po(ll x,ll y) { ll ans=1; while(y){ if(y & 1) ans=(ans*x);//%MOD; y/=2; x=(x*x);//%MOD; } return ans; } set<char>a; string guess_sequence(int n) { a.insert('A'); a.insert('B'); a.insert('X'); a.insert('Y'); string s=""; for(ll i=1;i<=n;i++){ bool f=0; for(set<char> :: iterator it=a.begin(); it!=a.end(); it++){ if(*it == *a.rbegin()) break; if( press((string)(s+ *it])) == i){ f=1; s+=*it; if(i==1){ a.erase(*it); } break; } } if(!f){ s+=*a.rbegin(); if(i==1){ a.erase(*a.rbegin()); } } } return s; } /* int main() { // ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); //freopen(".in","r",stdin);freopen("timeline.out","w",stdout); int t=1; //cin>>t; while(t--) solve(); return 0; } */

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:60:38: error: expected ')' before ']' token
   60 |             if( press((string)(s+ *it])) == i){
      |                               ~      ^
      |                                      )
combo.cpp:67:14: error: expected ')' before '}' token
   67 |             }
      |              ^
      |              )
   68 |         }
      |         ~     
combo.cpp:60:22: note: to match this '('
   60 |             if( press((string)(s+ *it])) == i){
      |                      ^
combo.cpp:67:14: error: expected ')' before '}' token
   67 |             }
      |              ^
      |              )
   68 |         }
      |         ~     
combo.cpp:60:15: note: to match this '('
   60 |             if( press((string)(s+ *it])) == i){
      |               ^
combo.cpp:68:9: error: expected primary-expression before '}' token
   68 |         }
      |         ^