# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1122318 | khome | 콤보 (IOI18_combo) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;}
컴파일 시 표준 에러 (stderr) 메시지
combo.cpp:1:25: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:43: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:65: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:97: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:100: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:118: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:121: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:147: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:150: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string res, cur; char per; int ab = press("AB"), bx = press("BX"), id=2; if (ab == 1) { id = 2; per = 'A'; res = "AB"; } if (ab == 1) { if (bx == 1) { //BX = 1; per = 'B'; id=3; int by = press("BY"); if (by == 2) res = "BY"; else res = "BY"; } if (bx == 2) { per = 'B'; id = 3; res += "BX"; } if (bx == 0) { // BX = 0; AY, AX per = 'A'; id = 2; int ay = press("AY"); if (ay == 2) res = "AY"; else res = "AX"; } } else if (ab == 0) { if (bx == 1) { // XA, XB, XY per = 'X'; id = 0; int xa = press("XA"), xb = press("XB"); if (xa == 2) res = "XA"; else if (xb == 2) res = "XB"; else res = "XY"; } else { // YA, YB, YX per = 'Y'; id = 1; int yb = press("YAAYABYAXYB"); if (yb == 3) res = "YA"; else if (yb == 2) res = "YB"; else res = "YX"; } } int n = res.size(); if (N==3){ int x = press(res+a[(id+1)%4]), y = press(res+a[(id+2)%4]); if (x == 3) return res+a[(id+1)%4]; else if (y == 3) return res+a[(id+2)%4]; else return res+a[(id+3)%4]; } char c = a[(id+1)%4], d = a[(id+2)%4], e = a[(id+3)%4]; int ask; while (n!=N-1){ n=res.size(); if (res.size()==N-1) break; ask = press(res+c+c+res+c+d+res+c+e+res+d); if (ask == n+2) res += c; else if (ask == n+1) res += d; else res += e; } ask = press(res+c); if (ask == N) res+=c; else{ int ask2 = press(res+d); if (ask2 == N) res+=d; else res+=e;} return res;} | ^ combo.cpp:1:169: error: extended character is not valid in an identifier 1 | #include <bits/stdc++.h>#include "combo.h" using namespace std; string guess_sequence(int N) { vector<char> a; a={'X', 'Y', 'A', 'B'}; string