제출 #1268577

#제출 시각아이디문제언어결과실행 시간메모리
1268577IcelastSuper Dango Maker (JOI22_dango3)C++20
7 / 100
678 ms720 KiB
#include "dango3.h" #include <iostream> #include <bits/stdc++.h> #define ll long long using namespace std; const ll maxn = 2*1e5+5, INF = 4e18+9; namespace { int variable_example = 1; } // namespace void Solve(int N, int M) { vector<int> d(N*M+1, 0); vector<int> has; auto ask = [&](int r) -> int{ vector<int> a; for(int i : has){ a.push_back(i); } for(int i = 1; i <= r; i++){ if(d[i]) continue; a.push_back(i); } if(a.empty()){ cout << "SIU"; exit(0); } return Query(a); }; auto bs = [&]() -> int{ int l = 1, r = N*M; while(l < r){ int mid = (l+r)/2; if(ask(mid) > 0){ r = mid; }else{ l = mid+1; } } return l; }; vector<vector<int>> res(N+1); for(int i = 1; i <= N; i++){ for(int j = 1; j <= M; j++){ int p = bs(); res[i].push_back(p); d[p] = 1; } for(int j : res[i]){ has.push_back(j); } } for(int j = 0; j < M; j++){ vector<int> a; for(int i = 1; i <= N; i++){ a.push_back(res[i][j]); // cout << res[i][j] << "s\n"; } Answer(a); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...