Submission #390298

#TimeUsernameProblemLanguageResultExecution timeMemory
390298MarceantasyCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int mxN = 2e5, M = 1e9+7; int N; int press(string s){ int points = 0; return points; } string guess_sequence(int N){ string sequence = ""; string chars = "ABXY"; if(press("AB")){ if(press("A")){ sequence+="A"; chars.erase(chars.find("A"), 1); }else{ sequence+="B"; chars.erase(chars.find("B"), 1); } }else{ if(press("X")){ sequence+="X"; chars.erase(chars.find("X"), 1); }else{ sequence+="Y"; chars.erase(chars.find("Y"), 1); } } int val = 1; for(int i = 1; i<N; ++i){ int points = press(sequence+chars[0]+sequence+chars[1]+chars[0]+sequence+chars[1]+chars[1]+sequence+chars[1]+chars[2]); if(points == i){ sequence+=chars[2]; }else if(points == i+1){ sequence+=chars[0]; }else{ sequence+=chars[1]; } val++; } if(press(sequence+chars[0]+sequence+chars[1]) == val+1){ if(press(sequence+chars[0])){ sequence+=chars[0]; }else{ sequence+=chars[1]; } }else{ sequence+=chars[2]; } return sequence; } int main(){ cin >> N; guess_sequence(N); }

Compilation message (stderr)

/usr/bin/ld: /tmp/cctnByoB.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/cccDhZFz.o:combo.cpp:(.text+0xc0): first defined here
/usr/bin/ld: /tmp/cctnByoB.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cccDhZFz.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status