Submission #575012

#TimeUsernameProblemLanguageResultExecution timeMemory
575012DosCarnival (CEOI14_carnival)C++14
100 / 100
23 ms208 KiB
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif //#define int long long; typedef long long ll; using namespace std; const int M = 31; //#define int ll int main(){ int n; cin >> n; int ans[n+1]; for(int i = 0; i <= n; i++) { ans[i] = -1; } cout << n << ' '; for(int i = 1; i <= n; i++) { cout << i << ' '; } cout << endl; cout.flush(); int c; cin >> c; int first[c+1]; for(int i = 0; i <= c; i++) { first[i] = -1; } first[1] = 1; ans[1] = 1; int cnt = 1; for(int i = 2; i <= n; i++) { cout << i << ' '; for(int j = 1; j <= i; j++) { cout << j << ' '; } cout << endl; cout.flush(); int num; cin >> num; if(num > cnt) { ans[i] = cnt+1; first[cnt+1] = i; cnt++; } else { for(int j = 1; j <= cnt; j++) { cout << 2 << ' ' << first[j] << ' ' << i << endl; cout.flush(); int x; cin >> x; if(x == 1) { ans[i] = j; break; } } } } cout << 0 << " "; for(int i = 1; i <= n; i++) { cout << ans[i] << " "; } cout << endl; cout.flush(); } //1 4 5 2 3
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...