Skip to content

Commit 6e6bc41

Browse files
committed
hunnu monthly programming contest designed by openinx
1 parent fefdc2e commit 6e6bc41

File tree

111 files changed

+65449
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+65449
-0
lines changed

codeforces/round253/div2/a.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<iostream>
2+
#include<stdlib.h>
3+
#include<stdio.h>
4+
#include<string.h>
5+
6+
int main(){
7+
char c;
8+
int cnt[100];
9+
while((c=getchar())!='{');
10+
memset(cnt, 0 ,sizeof(cnt));
11+
while((c=getchar())!='}'){
12+
if(c >= 'a' && c <= 'z' )
13+
cnt[c - 'a'] ++ ;
14+
}
15+
int size = 0;
16+
for(int i = 0 ; i < 100; ++ i)
17+
size += (cnt[i] > 0 ? 1: 0);
18+
printf("%d\n", size);
19+
return 0;
20+
}
21+

codeforces/round253/div2/a.out

8.73 KB
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include<iostream>
2+
using namespace std ;
3+
4+
char Month[][30]={"January" , "February" , "March" , "April" , "May" , "June" ,"July" , "August" , "September" ,"October" , "November" , "December" } ;
5+
6+
void random_case(){
7+
int id = rand()%12 , K = rand()%101;
8+
9+
printf("%s\n" , Month[id]);
10+
printf("%d\n" , K);
11+
12+
}
13+
14+
int main(){
15+
16+
//freopen("1.std.in" ,"w" , stdout);
17+
18+
srand((int)time(NULL));
19+
int testCase = 500 ;
20+
while(testCase--){
21+
random_case();
22+
}
23+
24+
//fclose(stdout);
25+
26+
return 0 ;
27+
28+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include<iostream>
2+
using namespace std ;
3+
4+
const int MOD = 1000000 ;
5+
6+
void random_case(){
7+
int M = rand() % 100 + 1 , N = rand() % 100 + 1 ;
8+
9+
printf("%d %d\n" , M , N);
10+
11+
for(int i = 0 ; i < N + M ; ++ i){
12+
printf("%d\n" , rand()%MOD);
13+
}
14+
}
15+
16+
17+
int main(){
18+
19+
//freopen("2.std.in" , "w" , stdout);
20+
21+
srand((unsigned int) time(NULL));
22+
int testCase = 98 ;
23+
printf("%d\n" , testCase);
24+
while(testCase--){
25+
random_case();
26+
}
27+
28+
//fclose(stdout);
29+
30+
return 0 ;
31+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include<iostream>
2+
#include<stdlib.h>
3+
using namespace std ;
4+
5+
int main(){
6+
7+
///freopen("2.std.in" , "w" , stdout);
8+
9+
int testCase = 10 ;
10+
printf("%d\n\n" , testCase);
11+
12+
printf("%d\n" , 1);
13+
printf("%d\n" , 10);
14+
printf("%d\n" , 1000000000);
15+
16+
srand((unsigned int) time(NULL));
17+
18+
for(int i = 4 ; i <= testCase ; ++ i){
19+
__int64 a = (__int64)rand() , b = (__int64)rand();
20+
printf("%d\n" , (int)(a*b%1000000000) );
21+
}
22+
23+
// fclose(stdout);
24+
25+
return 0 ;
26+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#include<iostream>
2+
using namespace std ;
3+
4+
const int maxn = 101 ;
5+
6+
7+
/*
8+
Êý¾Ý¸ñʽ£º
9+
CaseNumber
10+
N M K
11+
....
12+
....
13+
....
14+
15+
*/
16+
17+
18+
void special_case0(){
19+
20+
printf("\n\n");
21+
22+
printf("3 4 3\n");
23+
printf("T.*.\n");
24+
printf("*.*.\n");
25+
printf("...J\n");
26+
printf("3 3 3\n");
27+
}
28+
29+
30+
void special_case1(){
31+
32+
printf("\n\n");
33+
34+
printf("5 5 4\n");
35+
printf("T..*.\n");
36+
printf("*.*..\n");
37+
printf("*...*\n");
38+
printf("..*.*\n");
39+
printf("**J.*\n");
40+
printf("1 2 2 3\n");
41+
42+
}
43+
44+
45+
46+
void random_case(int N , int M , int K , int obstacle){
47+
48+
printf("\n\n");
49+
50+
printf("%d %d %d\n" , N , M , K);
51+
52+
char bd[200][200] ;
53+
int i , j , x, y , tx , ty , jx , jy , cx , cy ;
54+
int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};
55+
56+
for(i = 0 ; i < N ; ++ i)
57+
for(j = 0 ; j < M ;++ j)
58+
bd[i][j] = '.' ;
59+
60+
for(i = 0 ; i < obstacle ; ++ i){
61+
x = rand() % N ; y = rand() % M ;
62+
bd[x][y] = '*' ;
63+
}
64+
65+
tx = rand() % N ; ty = rand() % M ; bd[tx][ty] = 'T' ;
66+
67+
while(1){
68+
jx = rand()%N ; jy = rand()%M ;
69+
if(!((jx == tx )&&(jy == ty)))
70+
break ;
71+
}
72+
bd[jx][jy] = 'J' ;
73+
74+
for(i = 0 ; i < N ; ++ i){
75+
for(j = 0 ; j < M ; ++ j) printf("%c" , bd[i][j]);
76+
printf("\n");
77+
}
78+
79+
80+
for(int step = 0 ; step < K ; ++ step){
81+
82+
int d ;
83+
while(1){
84+
d = rand() % 4 ;
85+
cx = jx + dx[d] , cy = jy + dy[d] ;
86+
if((cx<0||cy<0||cx>=N||cy>=M)|| bd[cx][cy] == '*') continue ;
87+
break ;
88+
}
89+
90+
jx = cx , jy = cy ;
91+
92+
printf("%d " , d );
93+
94+
}
95+
96+
printf("\n");
97+
}
98+
99+
100+
int main(){
101+
102+
//freopen("1.std.in", "w" , stdout);
103+
104+
srand((int)time(NULL));
105+
106+
printf("%d\n" , 10);
107+
108+
special_case0();
109+
special_case1();
110+
111+
random_case(20 , 20 , 45 , 145);
112+
random_case(30 , 30 , 100, 560);
113+
random_case(100 , 100 , 100 , 1000);
114+
random_case(100 , 100 , 100 , 2000);
115+
random_case(10 , 10 , 70 , 56);
116+
random_case(35 , 78 , 100 , 700 );
117+
random_case(100 , 100 , 100 , 5000);
118+
random_case(5 , 5 , 14 , 15);
119+
120+
//fclose(stdout);
121+
122+
return 0 ;
123+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#include<iostream>
2+
using namespace std ;
3+
4+
typedef __int64 lld ;
5+
6+
void special_case0(){
7+
8+
//printf("\n");
9+
10+
printf("3 1 2 3\n");
11+
}
12+
13+
void special_case1(){
14+
15+
// printf("\n");
16+
17+
printf("5 5 1 2 4 3\n");
18+
}
19+
20+
void special_case2(){
21+
22+
//printf("\n");
23+
24+
printf("10 1 1 1 1 1 1 1 1 1 1\n");
25+
}
26+
27+
void random_case(int n , int K){
28+
29+
//printf("\n");
30+
31+
printf("%d" , n);
32+
33+
for(int i = 0 ; i < n ;++ i){
34+
lld x = rand() ;
35+
printf(" %I64d" , x * x % K);
36+
}
37+
printf("\n");
38+
39+
}
40+
41+
42+
43+
int main(){
44+
int testCase = 10 ;
45+
46+
//freopen("1.std.in" , "w" ,stdout );
47+
48+
cout<<testCase <<endl;
49+
50+
srand((int)time(NULL));
51+
52+
special_case0();
53+
special_case1();
54+
special_case2();
55+
56+
random_case(10 , 200000);
57+
random_case(100 , 100);
58+
random_case(1000 , 5000);
59+
random_case(10000 , 200000);
60+
random_case(50000 , 100000);
61+
random_case(80000 , 100);
62+
random_case(100000 , 200000);
63+
64+
//fclose(stdout);
65+
66+
return 0 ;
67+
68+
}

0 commit comments

Comments
 (0)