제출 #857077

#제출 시각아이디문제언어결과실행 시간메모리
857077alicanyaz콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update #include <ext/pb_ds/detail/standard_policies.hpp> #define xc3(x) (x*(x-1)*(x-2)/6) #define xc2(x) ((x)*((x)-1)/2) #define abs(x) ((x)>0?(x):-((x))) #define min(x,y) ((x)>(y)?(y):(x)) //#define debug 1 using namespace std; using namespace __gnu_pbds; //void FILEREAD(){freopen("text_input.txt","r",stdin);freopen("output.txt","w",stdout);} #define ll long long #define ull unsigned long long #define pi pair<int,int> #define pll pair<long long,long long> #define pli pair<long long,int> #define pil pair<int,long long> #define vi vector<int> #define vll vector<long long> #define vpi vector<pair<int,int>> #define vpll vector<pair<long long,long long>> #define vvi vector<vector<int>> #define vvll vector<vector<long long>> #define vvpi vector<vector<pair<int,int>>> #define vvpll vector<vector<pair<long,long>>> #define vec vector #define pr pair #define fi first #define se second #define fr(i,j) for(int i=0;i<j;i++) #define testcase(x) int x;cin>>x;while(x--)solve() #define vecinp(v) for(auto &in_vx:v)cin>>in_vx #define pb push_back typedef tree<ll,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_Set; ordered_Set os; #define MAX 99999997 #define MOD 92182 #define maxM 1000005 #include<combo.h> string guess_sentence(int N){ string K = ""; #define sz K.size() char inital = '#'; // find the inital one int r = press("AB");if(r)inital = (press("A")==1?'A':'B');else inital = (press("X")==1?'X':'Y'); K += inital; char C1='B',C2='X',C3='Y'; if(inital == 'B')C1='A';if(inital == 'X')C2='A';if(inital == 'Y')C3='A'; // find the middle ones for(int i=1;i<N-1;i++){ string qs=""; // K+X+FILL(X) + K+X+FILL(Y) + K+X+FILL(B) + K+Y qs+=K;qs+=C1;qs+=C1; qs+=K;qs+=C1;qs+=C2; qs+=K;qs+=C1;qs+=C3; qs+=K;qs+=C2; r = press(qs); if(r == sz)K+=C3; else if(r == sz+1)K+=C2; else K+=C1; } // find the last one string qs = ""; qs+=K;qs+=C1; qs+=K;qs+=C2; r = press(qs); if(r == sz+1){ qs = K;qs+=C1; r = press(qs); if(r == sz+1)K+=C1; else K+=C2; } else{ K+=C3; } return K; } /* int main(){ int N,K; N = 11; K = 12; cin>>N>>K; int H[N-1][2]; int L[N-1]; for(int i=0;i<N-1;i++){ cin >> H[i][0] >> H[i][1] >> L[i]; } cout << best_path(N,K,H,L); }*/

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

combo.cpp: In function 'std::string guess_sentence(int)':
combo.cpp:50:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   50 |  if(inital == 'B')C1='A';if(inital == 'X')C2='A';if(inital == 'Y')C3='A';
      |  ^~
combo.cpp:50:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   50 |  if(inital == 'B')C1='A';if(inital == 'X')C2='A';if(inital == 'Y')C3='A';
      |                          ^~
combo.cpp:60:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |   if(r == sz)K+=C3;
      |        ^
combo.cpp:61:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |   else if(r == sz+1)K+=C2;
      |           ~~^~~~~~~
combo.cpp:69:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   69 |  if(r == sz+1){
      |     ~~^~~~~~~
combo.cpp:72:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   72 |   if(r == sz+1)K+=C1;
      |      ~~^~~~~~~
/usr/bin/ld: /tmp/ccvDVLWX.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status