Contest Duration: - (local time) (100 minutes) Back to Home

Submission #6071438

Source Code Expand

Copy
```#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define FOR(i,a) for (int i=0;i<(a);++i)
#define FORD(i,a) for (int i=(a)-1;i>=0;i--)
#define FORT(i,a,b) for (int i=(a);i<=(b);++i)
#define FORTD(i,b,a) for (int i=(b);i>=(a);--i)
#define trav(i,v) for (auto i : v)
#define all(v) v.begin(),v.end()
#define fr first
#define sc second
#define mpr(a,b) make_pair(a,b)
#define pir pair<int,int>
#define all(v) v.begin(),v.end()
#define make_unique(v) v.erase(unique(all(v),v.end()))
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define dbg(x);
#define dbgv(v);
#define y1 EsiHancagorcRepa
#ifdef ALEXPC
#define dbg(x); cout<<#x<<" = "<<x<<endl
#define dbgv(v); cout<<#v<<" = ["; trav(tv,v)cout<<"tv,";cout<<"]"<<endl
#endif

//const int N=100,M=N*N;
const ll MOD=1000*1000*1000+7;

const int N=1e5+6;

vector<int> g[2*N];
ll qan1[2*N],qan2[2*N];
bool col[2*N];
void dfs(int v,int comp){
if (v>N) qan1[comp]++;
else qan2[comp]++;
col[v]=true;
trav(to,g[v]){
if (!col[to])dfs(to,comp);
}
}

int main(){
fastio;
srng;
int n,k;
cin>>n>>k;
if (k>(n-1)*(n-2)/2){
cout<<-1<<endl;
return 0;
}
vector<pir> pat;
FORT(i,2,n){
}
int qan=(n-1)*(n-2)/2;
while(qan!=k){
FORT(i,2,n){
FORT(j,i+1,n){
qan--;
if (qan==k)break;
}
if (qan==k)break;
}
}
cout<<pat.size()<<endl;
trav(tv,pat){
cout<<tv.fr<<" "<<tv.sc<<endl;
}
return 0;
}
```

#### Submission Info

Submission Time 2019-06-22 21:53:27+0900 E - Friendships Abelyan C++14 (GCC 5.4.1) 500 1850 Byte AC 11 ms 6400 KB

#### Judge Result

Set Name All Sample
Score / Max Score 500 / 500 0 / 0
Status
 AC × 18
 AC × 2
Set Name Test Cases
All sample_01, sample_02, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_15, testcase_16
Sample sample_01, sample_02
Case Name Status Exec Time Memory
sample_01 AC 4 ms 6272 KB
sample_02 AC 4 ms 6272 KB
testcase_01 AC 4 ms 6272 KB
testcase_02 AC 4 ms 6272 KB
testcase_03 AC 4 ms 6272 KB
testcase_04 AC 11 ms 6400 KB
testcase_05 AC 4 ms 6272 KB
testcase_06 AC 4 ms 6272 KB
testcase_07 AC 4 ms 6272 KB
testcase_08 AC 4 ms 6272 KB
testcase_09 AC 4 ms 6272 KB
testcase_10 AC 4 ms 6272 KB
testcase_11 AC 4 ms 6272 KB
testcase_12 AC 3 ms 6272 KB
testcase_13 AC 4 ms 6272 KB
testcase_14 AC 4 ms 6272 KB
testcase_15 AC 11 ms 6400 KB
testcase_16 AC 4 ms 6272 KB