#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Solve(int n, int m) {
vector<int>jakie, T;
rep(i, n*m) {
int po=0, ko=T.size();
while(po<ko) {
int sr=(po+ko)/2;
vector<int>czy(n*m, 1);
rep(j, sr+1) if(j!=T.size()) czy[T[j]]=0;
czy[i]=0;
vector<int>V;
rep(j, n*m) if(czy[j]) V.pb(j+1);
if(Query(V)==m-1) po=sr+1; else ko=sr;
}
if(po==T.size()) {
jakie.pb(i);
T.pb(i);
} else jakie.pb(T[po]);
}
vector<pair<int,int>>P;
rep(i, n*m) P.pb({jakie[i], i});
sort(all(P));
rep(i, m) {
vector<int>ans;
rep(j, n) ans.pb(P[j*m+i].nd+1);
Answer(ans);
}
}
Compilation message
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:18:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
18 | rep(j, sr+1) if(j!=T.size()) czy[T[j]]=0;
| ~^~~~~~~~~~
dango3.cpp:24:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
24 | if(po==T.size()) {
| ~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
308 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
460 KB |
Output is correct |
2 |
Correct |
58 ms |
356 KB |
Output is correct |
3 |
Correct |
46 ms |
468 KB |
Output is correct |
4 |
Correct |
49 ms |
356 KB |
Output is correct |
5 |
Correct |
58 ms |
380 KB |
Output is correct |
6 |
Correct |
56 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1622 ms |
496 KB |
Output is correct |
2 |
Correct |
1584 ms |
488 KB |
Output is correct |
3 |
Correct |
1252 ms |
488 KB |
Output is correct |
4 |
Correct |
1274 ms |
612 KB |
Output is correct |
5 |
Correct |
1573 ms |
596 KB |
Output is correct |
6 |
Correct |
1584 ms |
588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4296 ms |
980 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |