# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1181266 | KhoaDuy | 은하철도 (APIO24_train) | C++17 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int GetRand(int l,int r){
return (rng()%(r-l+1)+l);
}
signed main(){
int n=GetRand(2,1e3);
int m=GetRand(0,min((int)1e3,n*(n-1)/2));
int w=GetRand(0,1e3);
cout << n << ' ' << m << ' ' << w << endl;
for(int i=0;i<n;i++){
int t=GetRand(1,1e3);
cout << t << ' ';
}
cout << endl;
for(int i=0;i<m;i++){
int x=GetRand(0,n-1),y=GetRand(0,n-1);
if(x==y){
y=(y+1)%n;
}
int a=GetRand(1,1e3),b=GetRand(1,1e3),c=GetRand(1,1e3);
if(a>b){
swap(a,b);
}
if(a==b){
b++;
}
cout << x << ' ' << y << ' ' << a << ' ' << b << ' ' << c << endl;
}
for(int i=0;i<w;i++){
int l=GetRand(1,1e3),r=GetRand(1,1e3);
if(l>r){
swap(l,r);
}
cout << l << ' ' << r << endl;
}
}