제출 #428579

#제출 시각아이디문제언어결과실행 시간메모리
428579SAAD콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#define F first #define S second #define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1)) #define pb push_back #define Fbitl __builtin_ffs #define bit1 __builtin_popcount //#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <algorithm> #include <string.h> #include <vector> #include <queue> #include <map> #include <unordered_map> #include "combo.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vvl; int press(string s) { int res = 0; return res; } string sw = " ABXY"; int howto[6000]; int fidx; string guess_sequence(int N) { if (press("ABA")) { if (press("B")) fidx = 2; else fidx = 1; } else { if (press("X")) fidx = 3; else fidx = 4; } string res = { sw[fidx] }; string t = res, s = ""; if (N == 1) return res; for (int j = 1; j < N-1; j++) { t += ' '; int c = 0; for (int i = 1; i <= 4; i++) { if (i == fidx) continue; t[j] = sw[i]; if (!c) { s = t; howto[j+1] = i; } else if (c==1) { howto[j+2] = i; for (int i1 = 1; i1 <= 4; i1++) { if (i1 == fidx) continue; s += t; s += sw[i1]; } } c++; if (c == 3) { howto[j] = i; int a = press(s); res += sw[howto[a]]; t[j] = sw[howto[a]]; } } } res += ' '; for (int i = 1; i <= 4; i++) { if (i == fidx) continue; if (i == 4 || (fidx == 4 && i == 3)) { res[N-1] = sw[i]; break; } res[N - 1] = sw[i]; if (press(res)==N) return res; } return res; }

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

/usr/bin/ld: /tmp/cc6M5hnK.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccgIb42K.o:combo.cpp:(.text+0xc0): first defined here
collect2: error: ld returned 1 exit status