제출 #331827

#제출 시각아이디문제언어결과실행 시간메모리
331827Yomapeed콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define pi 3.141592653589793238 #include "combo.h" #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #define MOD 1000000007 #define INF 999999999999999999 #define pb push_back #define ff first #define ss second #define mp make_pair #define mt make_tuple #define ll long long #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string guess_sequence(ll n){ int i; string ans = ""; vector<char> c = {'A', 'B', 'X', 'Y'}; if(press("A") == 1){ ans += 'A'; c.erase(c.begin()); } else if(press("B") == 1){ ans += 'B'; c.erase(c.begin() + 1); } else if(press("X") == 1){ ans += 'X'; c.erase(c.begin() + 2); } else{ ans += 'Y'; c.erase(c.begin() + 3); } for(i = 1; i < n; i++){ string a, b; a = ans + c[0]; b = ans + c[1]; if(press(a) == 1){ ans += c[0]; } else if(press(b) == 1){ ans += c[1]; } else{ ans += c[2]; } } return ans; } int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); fast; ll T = 1, i, j; //cin >> T; while (T--) { } return 0; }

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

combo.cpp:5: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    5 | #pragma GCC optimization ("O3")
      | 
combo.cpp:6: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    6 | #pragma GCC optimization ("unroll-loops")
      | 
combo.cpp: In function 'int main()':
combo.cpp:65:15: warning: unused variable 'i' [-Wunused-variable]
   65 |     ll T = 1, i, j;
      |               ^
combo.cpp:65:18: warning: unused variable 'j' [-Wunused-variable]
   65 |     ll T = 1, i, j;
      |                  ^
/usr/bin/ld: /tmp/cc9p09EP.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cckOhvwT.o:combo.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc9p09EP.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status