# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
589690 | 2022-07-05T06:33:57 Z | LastRonin | Super Dango Maker (JOI22_dango3) | C++17 | 1845 ms | 668 KB |
#include "dango3.h" #include <bits/stdc++.h> #include <vector> #define pb push_back using namespace std; mt19937_64 bruh(chrono::steady_clock::now().time_since_epoch().count()); namespace { int variable_example = 1; } // namespace void Solve(int N, int M) { vector<int> x; for(int i = 0; i < N; i++) { for(int j = 0; j < M; j++) { x.pb(M * i + j + 1); } } int kek = 0; vector<int> y; while(kek < M) { shuffle(x.begin(), x.end(), bruh); int za = Query(x); int f = x.size(); vector<int> ans; if(kek <= 25 ) { ans.pb(x.back()); x.pop_back(); for(int j = f - 2; j >= 0; j--) { int mem = x.back(); x.pop_back(); for(auto u : y) x.pb(u); int answ = Query(x); for(auto u : y)x.pop_back(); if(answ == za - 2) y.pb(mem); else ans.pb(mem); if(ans.size() == N)break; } for(auto u : x)y.pb(u); x = y; y.clear(); } else { ans.pb(x.back()); x.pop_back(); for(int j = f - 2; j >= 0; j--) { int mem = x.back(); x.pop_back(); for(auto u : y) x.pb(u); int answ = Query(x); for(auto u : y)x.pop_back(); if(answ == za - 2) y.pb(mem); else ans.pb(mem); } x = y; y.clear(); } kek++; Answer(ans); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 300 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 312 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 380 KB | Output is correct |
2 | Correct | 8 ms | 376 KB | Output is correct |
3 | Correct | 7 ms | 376 KB | Output is correct |
4 | Correct | 8 ms | 340 KB | Output is correct |
5 | Correct | 11 ms | 340 KB | Output is correct |
6 | Correct | 10 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 319 ms | 468 KB | Output is correct |
2 | Correct | 272 ms | 472 KB | Output is correct |
3 | Correct | 286 ms | 472 KB | Output is correct |
4 | Correct | 312 ms | 480 KB | Output is correct |
5 | Correct | 194 ms | 444 KB | Output is correct |
6 | Correct | 311 ms | 476 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1845 ms | 596 KB | Output is correct |
2 | Correct | 1402 ms | 528 KB | Output is correct |
3 | Correct | 1705 ms | 652 KB | Output is correct |
4 | Correct | 1496 ms | 600 KB | Output is correct |
5 | Correct | 1819 ms | 596 KB | Output is correct |
6 | Correct | 1729 ms | 668 KB | Output is correct |