QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#831516#8903. Тайное посланиеas_lyr0 44ms7508kbC++14857b2024-12-25 15:13:552024-12-25 15:14:04

Judging History

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

  • [2024-12-25 15:14:04]
  • 评测
  • 测评结果:0
  • 用时:44ms
  • 内存:7508kb
  • [2024-12-25 15:13:55]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int INF=2e9;
int id,n,k;
vector <int> T,R;
void work(){
	int cnt=0;
	for(int i=0;i<k;i++){
		cnt++;
		for(int j=T[i]+1;cnt&&j<(i==k-1?INF:T[i+1]);j++){
			R.push_back((j-1)%n+1);
			cnt--;
		}
	}
}
void solve(){
	scanf("%d%d",&n,&k);
	T.clear(),R.clear();
	for(int i=0;i<k;i++){
		int x;
		scanf("%d",&x);
		T.push_back(x);
	}
	if(id==1){
		sort(T.begin(),T.end());
		work();
		sort(R.begin(),R.end());
		for(int i=0;i<k;i++)
			printf("%d ",R[i]);
		puts("");
	}
	else{
		for(int &x:T)
			x=n-x+1;
		sort(T.begin(),T.end());
		work();
		for(int &x:R)
			x=n-x+1;
		sort(R.begin(),R.end());
		for(int i=0;i<k;i++)
			printf("%d ",R[i]);
		puts("");
	}
}
int main(){
	int id;
	scanf("%d",&id);
	int T;
	scanf("%d",&T);
	while(T--)
		solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3836kb

input:

1
1
5000 1
1666

output:

1665 

input:

2
1
5000 1
1665

output:

1664 

result:

wrong answer Integer parameter [name=R_i] equals to 1664, violates the range [1666, 1666] (test case 1)

Subtask #2:

score: 0
Wrong Answer

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 3940kb

input:

1
1
5000 2
90 2207

output:

89 2206 

input:

2
1
5000 2
89 2206

output:

88 2205 

result:

wrong answer Integer parameter [name=R_i] equals to 88, violates the range [90, 90] (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:

1 2 3 5 11 12 13 14 15 16 18 21 22 24 26 27 29 30 31 34 35 37 38 39 40 42 43 44 47 48 49 50 52 54 55 57 59 63 70 74 76 78 79 80 81 82 83 84 85 86 87 89 91 94 95 96 98 102 103 104 105 106 109 114 115 116 119 120 125 127 128 129 132 133 134 135 136 137 141 143 145 146 147 148 152 154 156 157 162 163 1...

input:


output:


result:

wrong answer you used 299699 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:

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

input:


output:


result:

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

Subtask #5:

score: 0
Wrong Answer

Test #17:

score: 0
Wrong Answer
time: 35ms
memory: 7312kb

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:

883 1149 3662 8800 12243 12285 12379 12405 15957 18961 23630 23705 26156 30338 30373 34574 37124 48952 50416 51664 54113 54299 55775 58494 63401 63486 67515 69175 70682 72866 73467 74809 80998 87486 93186 97367 97543 97890 101279 105463 110295 122350 124948 131539 136868 136935 141502 143254 146415 ...

input:

2
1
1000000000 300000
883 1149 3662 8800 12243 12285 12379 12405 15957 18961 23630 23705 26156 30338 30373 34574 37124 48952 50416 51664 54113 54299 55775 58494 63401 63486 67515 69175 70682 72866 73467 74809 80998 87486 93186 97367 97543 97890 101279 105463 110295 122350 124948 131539 136868 136935...

output:

882 1148 3661 8799 12242 12284 12378 12404 15956 18960 23629 23704 26155 30337 30372 34573 37123 48951 50415 51663 54112 54298 55774 58493 63400 63485 67514 69174 70681 72865 73466 74808 80997 87485 93185 97366 97542 97889 101278 105462 110294 122349 124947 131538 136867 136934 141501 143253 146414 ...

result:

wrong answer Integer parameter [name=R_i] equals to 882, violates the range [884, 884] (test case 1)

Subtask #6:

score: 0
Wrong Answer

Test #30:

score: 0
Wrong Answer
time: 44ms
memory: 7508kb

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:

408756051 408756978 408759606 408760031 408760050 408761092 408761415 408761493 408761725 408764754 408767604 408776554 408778462 408781170 408781315 408782319 408785970 408787247 408787811 408790956 408791685 408794838 408794849 408796476 408797482 408799151 408799164 408799297 408806127 408809964 ...

input:

2
1
1000000000 300000
408756051 408756978 408759606 408760031 408760050 408761092 408761415 408761493 408761725 408764754 408767604 408776554 408778462 408781170 408781315 408782319 408785970 408787247 408787811 408790956 408791685 408794838 408794849 408796476 408797482 408799151 408799164 40879929...

output:

408756050 408756977 408759605 408760030 408760049 408761091 408761414 408761492 408761724 408764753 408767603 408776553 408778461 408781169 408781314 408782318 408785969 408787246 408787810 408790955 408791684 408794837 408794848 408796475 408797481 408799150 408799163 408799296 408806126 408809963 ...

result:

wrong answer Integer parameter [name=R_i] equals to 408756050, violates the range [408756052, 408756052] (test case 1)

Subtask #7:

score: 0
Wrong Answer

Test #45:

score: 0
Wrong Answer
time: 1ms
memory: 3828kb

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:

7 10 11 24 36 37 38 40 42 43 45 49 53 55 59 63 67 69 71 75 79 87 88 96 98 102 109 111 114 115 116 120 121 127 128 129 130 140 156 165 169 172 186 187 188 191 193 194 209 216 217 219 221 228 234 237 239 247 248 250 253 264 265 269 273 275 280 281 283 284 285 287 289 290 301 302 303 304 308 315 320 32...

input:

2
1
5000 1000
7 10 11 24 36 37 38 40 42 43 45 49 53 55 59 63 67 69 71 75 79 87 88 96 98 102 109 111 114 115 116 120 121 127 128 129 130 140 156 165 169 172 186 187 188 191 193 194 209 216 217 219 221 228 234 237 239 247 248 250 253 264 265 269 273 275 280 281 283 284 285 287 289 290 301 302 303 304 ...

output:

6 8 9 23 32 33 34 35 39 41 44 48 52 54 58 62 66 68 70 74 78 85 86 95 97 101 107 108 110 112 113 118 119 123 124 125 126 139 155 164 168 171 183 184 185 189 190 192 208 214 215 218 220 227 233 236 238 245 246 249 252 262 263 268 271 272 274 276 277 278 279 282 286 288 297 298 299 300 307 314 319 321 ...

result:

wrong answer Integer parameter [name=R_i] equals to 6, violates the range [8, 8] (test case 1)

Subtask #8:

score: 0
Wrong Answer

Test #55:

score: 0
Wrong Answer
time: 0ms
memory: 3896kb

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:

5 6 7 11 15 16 18 19 20 21 23 26 30 31 41 44 46 49 51 53 55 61 70 78 80 83 84 89 93 100 

input:

2
1
100 30
5 6 7 11 15 16 18 19 20 21 23 26 30 31 41 44 46 49 51 53 55 61 70 78 80 83 84 89 93 100

output:

2 3 4 8 9 10 12 13 14 17 22 25 28 29 40 43 45 48 50 52 54 60 69 77 79 81 82 88 92 99 

result:

wrong answer Integer parameter [name=R_i] equals to 2, violates the range [1, 1] (test case 1)

Subtask #9:

score: 0
Skipped

Subtask #10:

score: 0
Skipped

Subtask #11:

score: 0
Skipped

Subtask #12:

score: 0
Skipped