Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

一组数据 和造数据程序

Posted by renhaooo at 2018-08-14 10:44:36 on Problem 2449
8 18
3 6 2
7 2 2
7 4 7
5 2 3
8 1 10
1 6 8
8 1 3
7 2 9
1 2 2
6 2 2
2 8 8
5 1 4
4 7 6
6 5 9
1 3 4
1 4 4
7 4 4
8 6 4
6 6 5

21

#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("data.in","w",stdout);
	srand(time(NULL));
	int n,m;
	n=8,m=18;
	printf("%d %d\n",n,m);
	for(int i=1;i<=m;i++){
		int a=rand()%n+1,b=rand()%n+1,c=rand()%10+2;
		printf("%d %d %d\n",a,b,c);	
	}
	int s=rand()%n+1,t=rand()%n+1,k=rand()%5+1;
	printf("%d %d %d",s,t,k);
	return 0;
}	

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator