#include "dango3.h"
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define in insert
#define pb push_back
#define ppb pop_back()
#define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cans cout << ans << "\n";
#define yes cout << "Yes" << "\n";
#define no cout << "No" << "\n";
#define pll pair<ll,ll>
#define lin cout << "\n";
#define sqr 340
#define mod 1000000007
#define mid ((l+r)/2)
#define lc (2*x)
#define rc (2*x+1)
using namespace std;
ll n , m;
ll c[1009];
set<ll> cu[109];
void Solve(int N, int M)
{
n=N;
m=M;
set<ll> s;
for(int i = 1 ; n*m>=i ; i++)
s.in(i);
ll co = 0;
while(!s.empty())
{
co++;
auto it1 = s.begin();
c[*it1]=co;
cu[co].in(*it1);
ll st = *it1;
s.erase(it1);
vector<ll> e;
for(auto it : s)
{
vector<int> v;
for(int i = 1 ; n*m>=i ; i++)
{
if(i==st||i==it)
continue;
v.pb(i);
}
ll x = Query(v);
if(x==m-2)
{
c[it]=co;
e.pb(it);
cu[co].in(it);
}
}
for(auto it : e)
s.erase(it);
}
for(int i = 0 ; m>i ; i++)
{
vector<int> ans;
for(int j = 1 ; n>=j ; j++)
{
auto it = cu[j].begin();
ans.pb(*it);
cu[j].erase(it);
}
Answer(ans);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
179 ms |
344 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1199 ms |
604 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2578 ms |
1140 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |