제출 #979443

#제출 시각아이디문제언어결과실행 시간메모리
979443penguin133Island Hopping (JOI24_island)C++17
100 / 100
6 ms1632 KiB
#include <bits/stdc++.h> using namespace std; #include "island.h" typedef long long ll; #define pi pair<int, int> #define pii pair<int, pi> #define fi first #define se second #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #endif mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); void solve(int N, int L) { vector <int> order; for(int i = 1; i < N; i++)order.push_back(query(1, i)); set <int> s; set <int> ss; ss.insert(1); s.insert(1); for(int i = 0; i < (int)order.size(); i++){ int cnt = 1; if(ss.find(order[i]) != ss.end()){ s.insert(order[i]); continue; } while(1){ int res = query(order[i], cnt); cnt++; answer(res, order[i]); ss.insert(res); if(s.find(res) != s.end()){ break; } } s.insert(order[i]); } }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...