제출 #945353

#제출 시각아이디문제언어결과실행 시간메모리
945353Syrius콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; // #define int long long #define pint pair < int , int > #define ll long long #define ff first #define ss second #define fast ios_base::sync_with_stdio(NULL); cin.tie(NULL) const int inf = 1e9 + 9; const int mxn = 2e5 + 2; const int mod = 1e9 + 7; int press(string p) {} string guess_sequence(int n) { int t1 = press("AB"); int t2 = press("BX"); char a , b , c , z; if (t1 == 0) { a = 'A'; b = 'B'; if (t2 == 0) { z = 'Y'; c = 'X'; } else { z = 'X'; c = 'Y'; } } else { c = 'Y'; if (t2 == 0) { a = 'B'; b = 'X'; z = 'A'; } else { a = 'A'; b = 'X'; z = 'B'; } } string str; str += z; int prev = 1; for (int i = 0; i < n-2; i++) { int t = press(str + a + str + b + a + str + b + b + str + b + c); if (t - prev == 0) str += c; if (t - prev == 1) str += a; if (t - prev == 2) str += b; prev = t; } int t = press(str + a); if (t == n) str += a; if (t == n-1) { if (press(str + b) == n) str += b; else str += c; } return str; }

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

combo.cpp: In function 'int press(std::string)':
combo.cpp:15:22: warning: no return statement in function returning non-void [-Wreturn-type]
   15 | int press(string p) {}
      |                      ^
/usr/bin/ld: /tmp/ccTbkp1N.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/ccGNnHzR.o:combo.cpp:(.text.unlikely+0x0): first defined here
collect2: error: ld returned 1 exit status