QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#831106#8903. Тайное посланиеas_lyr9 0ms4104kbC++14638b2024-12-25 10:44:412024-12-25 10:44:42

Judging History

你现在查看的是最新测评结果

  • [2024-12-25 10:44:42]
  • 评测
  • 测评结果:9
  • 用时:0ms
  • 内存:4104kb
  • [2024-12-25 10:44:41]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int main(){
	int id;
	scanf("%d",&id);
	int T;
	scanf("%d",&T);
	while(T--){
		int n,k;
		scanf("%d%d",&n,&k);
		if(id==1){
			vector <int> v;
			for(int i=0;i<k;i++){
				int x;
				scanf("%d",&x);
				v.push_back((x+k-1)%n+1);
			}
			sort(v.begin(),v.end());
			for(int i=0;i<k;i++)
				printf("%d ",v[i]);
			puts("");
		}
		else{
			vector <int> v;
			for(int i=0;i<k;i++){
				int x;
				scanf("%d",&x);
				v.push_back((x+n-k-1)%n+1);
			}
			sort(v.begin(),v.end());
			for(int i=0;i<k;i++)
				printf("%d ",v[i]);
			puts("");
		}
	}
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 9
Accepted

Test #1:

score: 9
Accepted
time: 0ms
memory: 4104kb

input:

1
1
5000 1
1666

output:

1667 

input:

2
1
5000 1
1667

output:

1666 

result:

ok correct! (1 test case)

Test #2:

score: 9
Accepted
time: 0ms
memory: 3880kb

input:

1
1
5000 1
4081

output:

4082 

input:

2
1
5000 1
4082

output:

4081 

result:

ok correct! (1 test case)

Test #3:

score: 9
Accepted
time: 0ms
memory: 4088kb

input:

1
500
8 1
1
9 1
6
7 1
5
7 1
2
8 1
6
5 1
5
8 1
7
5 1
3
6 1
2
9 1
2
8 1
6
10 1
5
5 1
2
10 1
2
9 1
3
4 1
2
10 1
3
7 1
4
10 1
2
4 1
3
6 1
1
6 1
2
5 1
1
6 1
2
8 1
1
8 1
8
10 1
3
6 1
1
8 1
1
9 1
5
10 1
1
4 1
3
10 1
8
5 1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: 0ms
memory: 3856kb

input:

1
100
5 1
1
38 1
31
6 1
3
32 1
12
49 1
7
21 1
8
15 1
5
10 1
7
11 1
3
31 1
1
19 1
8
9 1
3
27 1
27
36 1
18
13 1
12
17 1
6
18 1
16
46 1
21
36 1
1
13 1
3
44 1
34
29 1
5
19 1
1
43 1
7
22 1
19
39 1
36
19 1
2
4 1
3
36 1
26
44 1
4
6 1
5
47 1
29
23 1
8
7 1
7
45 1
35
37 1
9
18 1
11
2 1
1
44 1
3
22 1
22
43 1
9...

output:

2 
32 
4 
13 
8 
9 
6 
8 
4 
2 
9 
4 
1 
19 
13 
7 
17 
22 
2 
4 
35 
6 
2 
8 
20 
37 
3 
4 
27 
5 
6 
30 
9 
1 
36 
10 
12 
2 
4 
1 
10 
1 
7 
34 
17 
2 
26 
14 
6 
11 
15 
3 
1 
1 
3 
6 
3 
4 
3 
28 
10 
24 
4 
7 
9 
35 
9 
38 
4 
6 
37 
22 
18 
35 
3 
26 
3 
4 
3 
7 
5 
3 
2 
2 
10 
27 
30 
13 
9...

input:

2
100
5 1
4
3 1
3
49 1
8
18 1
12
13 1
7
23 1
9
44 1
27
30 1
10
20 1
3
38 1
38
13 1
4
30 1
7
31 1
2
19 1
9
36 1
19
46 1
22
31 1
13
22 1
20
10 1
8
19 1
2
22 1
1
44 1
5
3 1
1
21 1
6
5 1
2
6 1
3
44 1
4
36 1
27
27 1
1
37 1
10
28 1
24
7 1
6
24 1
10
20 1
6
15 1
6
33 1
26
11 1
7
8 1
2
17 1
7
14 1
12
36 1
30...

output:

3 
2 
7 
11 
6 
8 
26 
9 
2 
37 
3 
6 
1 
8 
18 
21 
12 
19 
7 
1 
22 
4 
3 
5 
1 
2 
3 
26 
27 
9 
23 
5 
9 
5 
5 
25 
6 
1 
6 
11 
29 
2 
12 
21 
8 
8 
3 
1 
34 
2 
2 
23 
36 
2 
29 
5 
34 
34 
12 
2 
7 
1 
13 
5 
3 
8 
33 
1 
1 
10 
4 
2 
9 
2 
1 
17 
13 
7 
3 
1 
25 
36 
21 
16 
3 
14 
2 
8 
2 
...

result:

ok correct! (100 test cases)

Subtask #2:

score: 0
Wrong Answer on the first run

Test #5:

score: 11
Accepted
time: 0ms
memory: 3764kb

input:

1
1
5000 2
90 2207

output:

92 2209 

input:

2
1
5000 2
92 2209

output:

90 2207 

result:

ok correct! (1 test case)

Test #6:

score: 11
Accepted
time: 0ms
memory: 3876kb

input:

1
1
5000 2
2142 3937

output:

2144 3939 

input:

2
1
5000 2
2144 3939

output:

2142 3937 

result:

ok correct! (1 test case)

Test #7:

score: 0
Wrong Answer on the first run

input:

1
833
4 2
1 3
6 2
2 4
4 2
1 2
5 2
3 4
6 2
3 5
5 2
2 4
5 2
2 3
6 2
1 6
4 2
1 4
5 2
4 5
6 2
2 3
5 2
1 3
4 2
1 2
4 2
2 3
5 2
2 4
5 2
2 5
4 2
1 3
5 2
2 4
4 2
2 3
5 2
1 5
4 2
2 3
6 2
3 5
6 2
1 2
4 2
2 4
4 2
1 3
5 2
1 3
5 2
2 3
4 2
2 4
6 2
3 6
6 2
1 6
6 2
3 6
5 2
4 5
4 2
1 4
5 2
1 2
4 2
3 4
4 2
1 4
6 2
4 ...

output:

1 3 
4 6 
3 4 
1 5 
1 5 
1 4 
4 5 
2 3 
2 3 
1 2 
4 5 
3 5 
3 4 
1 4 
1 4 
2 4 
1 3 
1 4 
1 4 
2 3 
1 4 
1 5 
3 4 
2 4 
1 3 
3 5 
4 5 
2 4 
2 5 
2 3 
2 5 
1 2 
2 3 
3 4 
1 2 
2 3 
2 6 
1 2 
1 2 
1 4 
3 4 
1 2 
2 6 
1 2 
4 6 
1 2 
2 5 
1 6 
3 4 
1 3 
1 4 
3 4 
3 4 
3 4 
4 5 
1 2 
1 2 
5 6 
3 4 
2 3 
...

input:


output:


result:

wrong answer you used 1 but it is a part of the encrypted message (test case 1)

Subtask #3:

score: 0
Wrong Answer on the first run

Test #10:

score: 0
Wrong Answer on the first run

input:

1
1
300000 150000
4 6 7 8 9 10 17 19 20 23 25 28 32 33 36 41 45 46 51 53 56 58 60 61 62 64 65 66 67 68 69 71 72 73 75 77 88 90 92 93 97 99 100 101 107 108 110 111 112 113 117 118 121 122 123 124 126 130 131 138 139 140 142 144 149 150 151 153 155 158 159 160 161 165 168 172 173 174 177 183 184 185 1...

output:

2 3 5 6 7 8 9 10 12 14 20 21 22 23 26 27 28 30 31 33 34 35 38 39 43 44 46 47 49 54 55 59 60 62 63 69 70 72 73 74 76 77 78 79 80 81 82 84 85 91 92 96 97 98 99 103 106 110 116 118 119 123 125 127 128 131 132 133 134 139 143 145 147 151 153 155 156 157 160 162 165 167 168 169 171 174 175 176 179 184 18...

input:


output:


result:

wrong answer you used 6 but it is a part of the encrypted message (test case 1)

Subtask #4:

score: 0
Wrong Answer on the first run

Test #16:

score: 0
Wrong Answer on the first run

input:

1
714
4 1
4
5 2
2 5
4 2
1 2
4 2
3 4
3 1
3
7 2
2 4
4 1
4
4 2
1 4
2 1
2
6 2
2 3
6 1
4
3 1
1
6 1
4
2 1
2
7 2
4 5
3 1
2
3 1
3
4 2
1 4
7 3
2 4 7
7 3
3 5 7
6 2
2 5
6 2
3 4
7 1
5
3 1
1
7 1
7
6 3
1 2 3
2 1
1
4 1
4
4 1
1
4 2
1 2
5 1
4
6 2
1 2
4 1
3
6 2
3 4
7 1
7
7 2
4 7
6 1
4
7 2
3 5
7 3
3 4 6
4 1
4
6 3
2 4 ...

output:

1 
2 4 
3 4 
1 2 
1 
4 6 
1 
2 3 
1 
4 5 
5 
2 
5 
1 
6 7 
3 
1 
2 3 
3 5 7 
1 3 6 
1 4 
5 6 
6 
2 
1 
4 5 6 
2 
1 
2 
3 4 
5 
3 4 
4 
5 6 
1 
2 6 
5 
5 7 
2 6 7 
1 
1 3 5 
5 
4 
2 5 
1 
4 5 
1 4 
7 
3 
1 
2 
3 
5 
1 4 6 
3 
1 
3 
1 
2 4 5 
1 
5 
2 3 
2 
5 
1 4 
1 
2 
4 5 
1 
1 
6 7 
2 3 
1 
2 3 
1 ...

input:


output:


result:

wrong answer you used 2 but it is a part of the encrypted message (test case 2)

Subtask #5:

score: 0
Wrong Answer on the first run

Test #17:

score: 0
Wrong Answer on the first run

input:

1
1
1000000000 300000
884 1150 3663 8801 12244 12286 12380 12406 15958 18962 23631 23706 26157 30339 30374 34575 37125 48953 50417 51665 54114 54300 55776 58495 63402 63487 67516 69176 70683 72867 73468 74810 80999 87487 93187 97368 97544 97891 101280 105464 110296 122351 124949 131540 136869 136936...

output:

363 1333 4004 6942 8326 9341 10958 16195 16306 18027 21544 25243 29650 29684 31721 35278 37928 41321 41958 49774 50290 51866 55151 55630 58691 60276 63871 74873 78170 83651 84717 86365 95244 99011 99093 100591 102013 102538 105980 106052 108128 108158 108616 111128 111261 118755 119227 121830 126564...

input:


output:


result:

wrong answer you used 2006144 but it is a part of the encrypted message (test case 1)

Subtask #6:

score: 0
Wrong Answer on the first run

Test #30:

score: 0
Wrong Answer on the first run

input:

1
1
1000000000 300000
408756052 408756979 408759607 408760032 408760051 408761093 408761416 408761494 408761726 408764755 408767605 408776555 408778463 408781171 408781316 408782320 408785971 408787248 408787812 408790957 408791686 408794839 408794850 408796477 408797483 408799152 408799165 40879929...

output:

409056052 409056979 409059607 409060032 409060051 409061093 409061416 409061494 409061726 409064755 409067605 409076555 409078463 409081171 409081316 409082320 409085971 409087248 409087812 409090957 409091686 409094839 409094850 409096477 409097483 409099152 409099165 409099298 409106128 409109965 ...

input:


output:


result:

wrong answer you used 413673531 but it is a part of the encrypted message (test case 1)

Subtask #7:

score: 0
Wrong Answer on the first run

Test #45:

score: 0
Wrong Answer on the first run

input:

1
1
5000 1000
8 12 13 25 39 41 44 46 47 48 50 51 54 56 60 64 68 70 72 76 80 89 90 97 99 103 110 112 117 118 119 122 123 131 132 133 134 141 157 166 170 173 189 190 192 195 196 197 210 218 220 222 223 229 235 238 240 249 251 252 254 266 267 270 274 276 282 286 288 291 292 293 294 295 305 306 307 309 ...

output:

1008 1012 1013 1025 1039 1041 1044 1046 1047 1048 1050 1051 1054 1056 1060 1064 1068 1070 1072 1076 1080 1089 1090 1097 1099 1103 1110 1112 1117 1118 1119 1122 1123 1131 1132 1133 1134 1141 1157 1166 1170 1173 1189 1190 1192 1195 1196 1197 1210 1218 1220 1222 1223 1229 1235 1238 1240 1249 1251 1252 ...

input:


output:


result:

wrong answer you used 1008 but it is a part of the encrypted message (test case 1)

Subtask #8:

score: 0
Wrong Answer on the first run

Test #55:

score: 0
Wrong Answer on the first run

input:

1
1
100 30
1 8 9 10 12 17 22 24 25 27 28 29 32 33 34 42 45 47 50 52 54 56 62 71 79 81 85 86 90 94

output:

1 9 11 15 16 20 24 31 38 39 40 42 47 52 54 55 57 58 59 62 63 64 72 75 77 80 82 84 86 92 

input:


output:


result:

wrong answer you used 1 but it is a part of the encrypted message (test case 1)

Subtask #9:

score: 0
Skipped

Subtask #10:

score: 0
Skipped

Subtask #11:

score: 0
Skipped

Subtask #12:

score: 0
Skipped