uoj109 【APIO2013】TASKSAUTHOR

OI 非传统题
文章目录

ref

born1

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <cstdio>
using namespace std;
int V=101, m=5000;
int main(){
cout<<V<<endl;
for(int i=0; i<V; i++)
printf("0\n");
cout<<"1\n0 1\n";
return 0;
}

born2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <ctime>
using namespace std;
typedef pair<int,int> par;
int V=100;
vector<par> vec[105];
int rnd(int q){
return (long long)rand()*rand()%q;
}
int main(){
cout<<V<<endl;
for(int i=0; i<V; i++){
for(int j=0; j<9; j++) vec[i].push_back(par(i,999999));
if(i) vec[i].push_back(par(i-1,987654));
if(i<44) vec[i].push_back(par(i, 999999));
cout<<vec[i].size();
for(int j=0; j<vec[i].size(); j++)
printf(" %d %d", vec[i][j].first, vec[i][j].second);
printf("\n");
}
cout<<"10\n";
for(int i=0; i<10; i++)
cout<<"99 0\n";
return 0;
}

born4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int V=33;
vector<pair<int,int> > vec[105];
int main(){
cout<<V<<endl;
int qwq=1<<16;
for(int i=0; i<V; i++){
if(i==0) continue;
else if(i&1)
vec[i-1].push_back(pair<int,int>(i, -1));
else{
vec[i-1].push_back(pair<int,int>(i, -qwq));
vec[i-2].push_back(pair<int,int>(i, -2));
qwq /= 2;
}
}
for(int i=0; i<V; i++){
cout<<vec[i].size();
for(int j=0; j<vec[i].size(); j++)
printf(" %d %d", vec[i][j].first, vec[i][j].second);
printf("\n");
}
cout<<"10\n";
for(int i=0; i<10; i++) cout<<"0 "<<V-1<<endl;
return 0;
}

born5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <ctime>
using namespace std;
typedef pair<int,int> par;
int V=300;
vector<par> vec[305];
int rnd(int q){
return (long long)rand()*rand()%q;
}
int main(){
cout<<V<<endl;
for(int i=0; i<V; i++){
if(i<23) for(int j=0; j<2; j++) vec[i].push_back(par(i,999999));
if(i) vec[i].push_back(par(i-1,987654));
cout<<vec[i].size();
for(int j=0; j<vec[i].size(); j++)
printf(" %d %d", vec[i][j].first, vec[i][j].second);
printf("\n");
}
cout<<"10\n";
for(int i=0; i<10; i++)
cout<<"299 0\n";
return 0;
}

born6

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int V=33;
vector<pair<int,int> > vec[105];
int main(){
cout<<V<<endl;
int qwq=3*(1<<16);
for(int i=0; i<V; i++){
if(i==0) continue;
else if(i&1)
vec[i-1].push_back(pair<int,int>(i, -1));
else{
vec[i-1].push_back(pair<int,int>(i, -qwq));
vec[i-2].push_back(pair<int,int>(i, -2));
qwq /= 2;
}
}
for(int i=0; i<V; i++){
cout<<vec[i].size();
for(int j=0; j<vec[i].size(); j++)
printf(" %d %d", vec[i][j].first, vec[i][j].second);
printf("\n");
}
cout<<"6\n";
for(int i=0; i<6; i++) cout<<"0 "<<V-1<<endl;
return 0;
}

born7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <ctime>
#include <map>
using namespace std;
typedef pair<int,int> par;
map<par,int> mp;
vector<par> vec;
int rnd(int f){
return (long long)rand()*rand()%f;
}
int main(){
srand(time(NULL));
for(int i=1; i<999; i++){
int f=rnd(i);
vec.push_back(par(f, i));
mp[par(f,i)] = 1;
}
int tmp=1501-998;
while(tmp){
int a=rnd(999), b=rnd(999);
if(a>b) swap(a, b);
if(mp[par(a,b)]) continue;
mp[par(a,b)] = 1;
vec.push_back(par(a,b));
tmp--;
}
cout<<"999 "<<vec.size()<<endl;
for(int i=0; i<vec.size(); i++)
cout<<vec[i].first<<" "<<vec[i].second<<endl;
return 0;
}

born8

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
cout<<"999 1501\n";
//0:0
//1-499:1
//500-998:0
for(int i=1; i<=499; i++)
cout<<"0 "<<i<<endl;
for(int i=1; i<=499; i++)
cout<<i<<" "<<i+499<<endl;
int rev=1501-499*2;
for(int i=1; i<=499 && rev; i++){
for(int j=500; j<=998 && rev; j++)
if(i!=j-499){
cout<<i<<" "<<j<<endl;
rev--;
}
}
return 0;
}