#include "swaps.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long lo;
typedef pair< lo,lo > PII;
#define fi first
#define se second
#define mp make_pair
#define endl "\n"
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)
const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 505;
const lo mod = 1000000007;
int n,m,b[li],a[li],k,flag,t;
int cev;
string s;
vector<int> v;
int cmp[li][li],vis[li],viss[li][li];
void solve(int n, int V) {
vector<int> v;
int sayac=0;
while(1){
sayac++;
if(sayac>V)break;
FOR vis[i]=0;
vector<pair<int,int>> vv;
int flagg=0;
for(int i=1;i<=n;i++){
//~ cout<<"**\n";
if(vis[i])continue;
for(int j=1;j<=n;j++){
if(vis[j])continue;
if(i==j)continue;
if(viss[i][j] || viss[j][i])continue;
viss[i][j]=1;
vis[i]=1;
vis[j]=1;
schedule(i,j);
flagg=1;
vv.pb({i,j});
break;
//~ printf("%d %d %d\n",i,j,sayac);
}
}
if(flagg==0)break;
v=visit();
int say=0;
for(auto go:vv){
if(v[say]==0){
cmp[go.se][go.fi]=1;
}
else{
cmp[go.fi][go.se]=1;
}
say++;
}
}
vector<int> vec;
vector<pair<int,int>> vv;
for(int i=1;i<=n;i++){
cev=0;
for(int j=1;j<=n;j++){
cev+=cmp[i][j];
}
vv.pb({cev,i});
}
sort(vv.begin(),vv.end());
reverse(vv.begin(),vv.end());
for(auto go:vv)vec.pb(go.se);
answer(vec);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1284 KB |
Correct |
4 |
Correct |
120 ms |
2272 KB |
Correct |
5 |
Correct |
127 ms |
2268 KB |
Correct |
6 |
Correct |
124 ms |
2248 KB |
Correct |
7 |
Correct |
120 ms |
2276 KB |
Correct |
8 |
Correct |
122 ms |
2380 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1280 KB |
Correct |
4 |
Correct |
121 ms |
2272 KB |
Correct |
5 |
Correct |
121 ms |
2296 KB |
Correct |
6 |
Correct |
119 ms |
2372 KB |
Correct |
7 |
Correct |
119 ms |
2300 KB |
Correct |
8 |
Correct |
118 ms |
2268 KB |
Correct |
9 |
Correct |
122 ms |
2268 KB |
Correct |
10 |
Correct |
120 ms |
2288 KB |
Correct |
11 |
Correct |
121 ms |
2292 KB |
Correct |
12 |
Correct |
127 ms |
2272 KB |
Correct |
13 |
Correct |
119 ms |
2288 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
704 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
704 KB |
Correct |
3 |
Incorrect |
1 ms |
328 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Correct |
2 |
Correct |
6 ms |
704 KB |
Correct |
3 |
Correct |
24 ms |
1224 KB |
Correct |
4 |
Correct |
118 ms |
2316 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Correct |
2 |
Correct |
6 ms |
704 KB |
Correct |
3 |
Correct |
24 ms |
1224 KB |
Correct |
4 |
Correct |
118 ms |
2316 KB |
Correct |
5 |
Correct |
1 ms |
328 KB |
Correct |
6 |
Correct |
6 ms |
584 KB |
Correct |
7 |
Correct |
26 ms |
1296 KB |
Correct |
8 |
Correct |
118 ms |
2268 KB |
Correct |
9 |
Correct |
121 ms |
2272 KB |
Correct |
10 |
Correct |
122 ms |
2300 KB |
Correct |
11 |
Correct |
144 ms |
2416 KB |
Correct |
12 |
Correct |
126 ms |
2304 KB |
Correct |
13 |
Incorrect |
1 ms |
328 KB |
Not correct |
14 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
24 ms |
1224 KB |
Correct |
4 |
Correct |
126 ms |
2384 KB |
Correct |
5 |
Incorrect |
120 ms |
2372 KB |
Not correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
24 ms |
1224 KB |
Correct |
4 |
Correct |
126 ms |
2384 KB |
Correct |
5 |
Incorrect |
120 ms |
2372 KB |
Not correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1288 KB |
Correct |
4 |
Correct |
117 ms |
2424 KB |
Correct |
5 |
Incorrect |
118 ms |
2272 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1288 KB |
Correct |
4 |
Correct |
117 ms |
2424 KB |
Correct |
5 |
Incorrect |
118 ms |
2272 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1224 KB |
Correct |
4 |
Correct |
120 ms |
2288 KB |
Correct |
5 |
Incorrect |
117 ms |
2272 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Correct |
2 |
Correct |
6 ms |
584 KB |
Correct |
3 |
Correct |
25 ms |
1224 KB |
Correct |
4 |
Correct |
120 ms |
2288 KB |
Correct |
5 |
Incorrect |
117 ms |
2272 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |