QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#251663 | #5163. 喵了个喵 | xaphoenix | 0 | 453ms | 52128kb | C++14 | 1.7kb | 2023-11-14 22:49:44 | 2023-11-14 22:49:46 |
Judging History
answer
#include<iostream>
#include<vector>
#define int long long
using namespace std;
int b[2000010][2],a[2000010],t,n,m,k,cnt;
pair<int,pair<int,int> > opt[2000010];
string ans;
/* utility */
/* checker */
/* Solution */
signed main()
{
cin >> t;
while(t--) {
cin >> n >> m >> k;
for(int i = 1;i <= max(m,k);i++) {
cin >> a[i];
b[i][0] = b[i][1] = -1;
}
cnt = 0;
if(k == 2 * n - 2) {
for(int i = 1;i <= m;i++) {
int id = (a[i] - 1) / 2 + 1;
if(b[id][0] == -1 && b[id][1] != -1) {
if(b[id][1] == a[i]) {
//ans += "1 " + to_string(n) + "\n";
//ans += "2 " + to_string(id) + " " + to_string(n) + "\n";
opt[++cnt] = {1,{n,0}};
opt[++cnt] = {2,{id,n}};
b[id][1] = -1;
} else {
//ans += "1 " + to_string(id) + "\n";
opt[++cnt] = {1,{id,0}};
b[id][0] = a[i];
}
} else if(b[id][0] == -1 && b[id][1] == -1) {
//ans += "1 " + to_string(id) + "\n";
opt[++cnt] = {1,{id,0}};
b[id][1] = id;
} else if(b[id][0] != -1 && b[id][1] != -1) {
if(b[id][0] == a[i]) {
//ans += "1 " + to_string(id) + "\n";
opt[++cnt] = {1,{id,0}};
b[id][0] = -1;
} else {
//ans += "1 " + to_string(n) + "\n";
//ans += "2 " + to_string(id) + " " + to_string(n) + "\n";
opt[++cnt] = {1,{id,0}};
opt[++cnt] = {2,{id,n}};
b[id][1] = b[id][0];
b[id][0] = -1;
}
}
}
cout << cnt << "\n";
for(int i = 1;i <= cnt;i++) {
cout << opt[i].first << " " << opt[i].second.first;
if(opt[i].first - 1) {
cout << " " << opt[i].second.second << "\n";
} else {
cout << "\n";
}
}
}
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 453ms
memory: 7544kb
input:
1001 300 1814 598 483 60 555 101 51 354 9 252 396 527 380 573 243 98 143 305 16 355 479 117 594 369 522 368 133 534 598 353 475 161 68 250 4 119 137 12 370 532 72 152 40 314 249 182 397 71 164 513 198 539 283 121 440 548 56 439 434 64 336 132 514 339 52 350 21 421 304 156 268 87 338 419 540 583 139 ...
output:
2454 1 242 1 30 1 278 1 51 1 26 1 177 1 5 1 126 1 198 1 264 1 190 1 287 1 122 1 49 1 72 1 153 1 8 1 178 1 240 1 59 1 297 1 185 1 261 1 184 1 67 1 267 1 299 1 177 1 238 1 81 1 34 1 125 1 2 1 60 1 69 1 6 1 185 1 266 1 36 1 76 1 20 1 157 1 125 1 91 1 199 1 36 1 82 1 257 1 99 1 270 1 142 1 61 1 220 1 27...
result:
wrong answer Wrong Answer (test case 1)
Test #2:
score: 0
Wrong Answer
time: 448ms
memory: 12848kb
input:
1001 300 99724 598 345 381 76 48 555 574 99 55 233 363 511 21 268 552 390 442 284 356 291 572 132 251 185 123 247 436 410 254 74 507 567 418 421 44 597 510 151 229 98 516 591 10 70 392 562 592 236 379 349 60 485 480 71 136 222 40 546 476 113 586 444 64 540 195 583 304 423 214 221 548 224 422 341 319...
output:
138100 1 173 1 191 1 38 1 24 1 278 1 287 1 50 1 28 1 117 1 182 1 256 1 11 1 134 1 276 1 195 1 221 1 142 1 178 1 146 1 286 1 66 1 126 1 93 1 62 1 124 1 218 1 205 1 127 1 37 1 254 1 284 1 209 1 211 1 22 1 299 1 255 1 76 1 115 1 49 1 258 1 296 1 5 1 35 1 196 1 281 1 296 1 118 1 190 1 175 1 30 1 243 1 2...
result:
wrong answer Wrong Answer (test case 1)
Test #3:
score: 0
Wrong Answer
time: 435ms
memory: 7524kb
input:
1001 300 1870 598 232 396 237 207 403 576 164 510 388 568 180 574 321 589 140 209 129 420 555 124 575 552 415 486 143 85 275 421 267 408 55 64 46 393 598 155 556 542 60 91 52 455 543 42 153 303 548 241 426 59 194 243 78 469 459 352 291 128 161 477 323 339 272 493 361 366 569 456 22 409 532 195 537 8...
output:
2508 1 116 1 198 1 119 1 104 1 202 1 288 1 82 1 255 1 194 1 284 1 90 1 287 1 161 1 295 1 70 1 105 1 65 1 210 1 278 1 62 1 288 1 276 1 208 1 243 1 72 1 43 1 138 1 211 1 134 1 204 1 28 1 32 1 23 1 197 1 299 1 78 1 278 1 271 1 30 1 46 1 26 1 228 1 272 1 21 1 77 1 152 1 274 1 121 1 213 1 30 1 97 1 122 1...
result:
wrong answer Wrong Answer (test case 1)
Test #4:
score: 0
Wrong Answer
time: 154ms
memory: 7388kb
input:
1002 2 100000 3 2 3 1 2 1 1 2 2 1 2 1 3 2 3 1 2 1 1 2 1 2 1 3 3 1 2 1 2 2 3 2 1 3 3 2 1 2 1 3 2 1 3 2 3 1 1 3 1 2 1 3 1 2 2 2 2 1 1 2 1 2 1 1 1 2 3 1 2 2 1 3 2 3 3 2 3 3 2 2 1 3 2 1 2 3 2 3 1 3 2 1 2 3 3 2 1 2 3 2 3 1 2 2 3 1 2 1 2 3 1 2 3 3 1 2 1 2 2 1 1 2 1 3 3 2 2 2 2 1 3 3 1 2 1 1 1 1 2 2 3 3 1 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #5:
score: 0
Wrong Answer
time: 151ms
memory: 7468kb
input:
1002 2 1994 3 3 1 2 1 1 3 2 1 3 2 1 1 3 1 2 3 3 2 1 3 3 2 3 2 1 3 1 1 3 1 3 1 3 3 1 3 1 2 2 3 2 3 3 2 2 1 1 2 3 2 3 1 3 2 1 3 2 1 1 2 3 1 2 1 2 3 1 1 3 2 1 2 2 3 2 3 1 1 2 2 1 1 2 3 2 3 1 2 1 3 1 2 3 2 2 2 1 3 1 3 2 1 3 1 3 3 3 3 3 2 1 3 3 2 1 2 1 2 1 1 2 3 1 3 2 2 1 3 2 1 3 1 2 3 2 1 3 1 3 3 1 2 3 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #6:
score: 0
Wrong Answer
time: 156ms
memory: 11488kb
input:
1002 2 99998 3 2 3 1 3 3 1 3 1 3 1 3 3 1 1 2 2 1 1 2 1 1 1 3 3 3 3 2 1 3 1 3 1 1 3 3 1 1 2 2 1 1 2 2 1 3 3 1 1 1 2 2 3 3 1 2 1 1 1 3 2 1 1 3 3 3 1 3 3 2 1 3 1 2 3 3 3 3 1 1 2 3 2 2 2 1 3 3 2 2 2 2 2 2 2 3 2 2 2 3 3 2 3 2 3 3 2 1 1 2 2 3 2 3 1 2 2 1 2 3 1 2 1 2 2 3 3 1 1 2 3 3 3 3 1 3 2 3 1 2 1 1 2 2...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #7:
score: 0
Wrong Answer
time: 1ms
memory: 7460kb
input:
3 3 14 5 1 2 3 4 5 1 5 5 4 3 5 4 2 4 3 14 5 1 2 3 4 5 2 5 3 5 1 1 4 5 1 3 14 5 1 2 3 4 5 1 4 1 4 1 5 4 2 3
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 7624kb
input:
3 3 14 5 1 2 3 4 5 4 1 1 3 2 4 1 4 5 3 14 5 1 2 3 4 5 4 3 5 3 5 1 2 3 5 3 14 5 1 2 3 4 5 5 3 2 5 5 1 2 2 4
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #9:
score: 0
Wrong Answer
time: 1ms
memory: 7428kb
input:
3 3 14 5 1 2 3 4 5 3 4 1 2 4 1 1 4 5 3 14 5 1 2 3 4 5 3 2 2 3 5 4 2 3 1 3 14 5 1 2 3 4 5 4 3 2 5 1 1 1 5 5
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 7416kb
input:
3 3 14 5 1 2 3 4 5 5 2 3 1 5 3 3 5 4 3 14 5 1 2 3 4 5 4 5 2 5 5 5 5 1 3 3 14 5 1 2 3 4 5 5 5 4 5 4 4 2 3 1
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #11:
score: 0
Wrong Answer
time: 156ms
memory: 7460kb
input:
1004 3 1992 5 4 5 2 3 1 5 5 1 4 3 5 1 4 5 3 5 3 1 4 4 5 3 1 2 2 1 3 2 5 2 5 3 1 4 5 5 3 5 4 2 1 3 2 5 1 1 4 5 5 4 1 4 2 2 4 4 2 3 3 2 4 2 1 5 1 3 4 3 2 4 5 2 3 3 5 1 3 5 2 3 1 4 1 4 4 5 2 2 4 1 5 2 2 4 1 3 1 3 4 4 4 2 5 3 5 4 1 2 1 4 3 3 3 3 3 3 3 2 4 2 4 1 1 5 2 1 2 2 1 5 4 3 1 4 1 3 2 3 1 4 1 2 1 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #12:
score: 0
Wrong Answer
time: 157ms
memory: 9668kb
input:
1004 3 100000 5 3 5 2 4 1 5 3 2 1 5 3 2 1 5 3 2 4 5 3 2 4 5 3 1 2 5 3 1 2 5 3 1 2 5 3 1 2 5 3 4 2 5 3 4 2 5 1 3 4 5 1 3 4 2 1 3 4 2 1 5 3 4 1 5 2 3 1 5 2 3 1 5 2 3 1 4 5 3 2 4 5 1 2 4 5 1 2 4 5 3 1 4 5 3 2 1 4 5 2 1 4 3 2 1 4 3 2 1 5 3 4 1 5 3 4 2 5 1 3 2 5 1 3 4 2 5 1 4 2 5 1 4 3 2 5 4 3 2 5 4 1 3 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #13:
score: 0
Wrong Answer
time: 167ms
memory: 7508kb
input:
1004 3 1990 5 1 2 4 5 3 3 1 5 4 4 5 3 1 5 2 5 4 4 2 1 2 1 1 3 4 4 2 3 1 3 1 4 5 3 5 4 1 2 2 2 5 3 5 5 4 3 5 4 2 2 5 5 5 1 4 5 2 4 1 3 1 2 4 1 2 3 4 1 3 3 4 2 2 4 1 4 5 2 2 4 5 4 2 2 5 4 4 4 5 1 2 1 4 2 2 4 4 2 5 5 4 3 4 4 5 3 1 3 2 3 5 2 1 1 1 4 5 3 5 3 4 1 4 1 4 2 4 4 4 5 1 5 1 2 4 4 4 3 3 1 3 1 2 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #14:
score: 0
Wrong Answer
time: 156ms
memory: 11548kb
input:
1004 3 99998 5 2 1 3 4 5 2 1 3 4 2 1 3 4 2 1 5 3 2 1 5 3 4 2 5 1 4 2 5 1 3 4 5 1 3 4 5 1 3 4 5 2 3 4 5 1 2 4 5 1 2 3 4 5 2 3 4 1 5 2 4 1 5 2 4 1 3 2 4 1 3 2 5 4 1 3 5 4 1 3 2 4 1 3 2 4 1 3 2 4 5 1 3 4 5 2 1 3 4 5 1 2 4 5 1 2 3 5 1 4 3 5 1 4 2 3 1 4 2 3 1 4 2 5 1 3 2 5 1 3 4 2 1 3 4 2 1 3 5 4 1 3 5 2...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #15:
score: 0
Wrong Answer
time: 166ms
memory: 7428kb
input:
1005 300 1908 599 161 199 80 536 40 121 528 569 337 568 8 547 86 424 333 220 439 500 210 515 593 5 75 466 537 352 372 513 451 87 554 209 261 482 415 597 450 422 182 535 484 580 506 563 200 582 101 409 135 95 51 198 587 561 514 359 112 429 435 383 418 96 266 233 331 116 293 150 289 414 130 432 377 56...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #16:
score: 0
Wrong Answer
time: 166ms
memory: 9680kb
input:
1005 300 99936 599 512 185 499 176 447 476 341 332 298 68 191 231 198 536 252 220 259 113 265 438 579 284 418 212 179 467 498 105 361 170 205 273 354 104 87 201 217 427 171 152 494 382 329 535 34 186 194 146 88 32 362 372 449 573 550 553 109 292 315 278 496 225 270 237 311 470 453 375 242 269 40 24 ...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #17:
score: 0
Wrong Answer
time: 164ms
memory: 7464kb
input:
1005 300 1886 599 451 344 162 305 593 146 549 590 299 495 258 419 77 45 171 220 48 246 124 560 317 321 131 588 500 395 207 460 34 240 123 583 194 427 215 339 377 205 275 509 101 95 585 145 502 442 193 148 566 390 464 524 520 90 62 315 296 521 535 553 108 157 147 371 213 398 458 313 492 81 394 523 28...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #18:
score: 0
Wrong Answer
time: 176ms
memory: 9468kb
input:
1005 300 99736 599 497 195 73 245 116 464 389 581 366 205 272 386 586 471 22 590 112 345 138 236 219 243 524 392 302 306 62 157 465 399 380 1 593 452 346 317 35 327 83 476 237 106 462 127 91 456 110 228 329 328 470 491 121 409 434 419 565 300 455 86 435 182 431 453 396 109 330 270 214 429 15 578 519...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #19:
score: 0
Wrong Answer
time: 169ms
memory: 7616kb
input:
1005 300 1966 599 291 319 439 495 23 192 348 560 588 454 219 46 564 99 322 503 272 246 350 41 284 337 335 168 573 491 50 94 59 96 413 497 590 435 327 576 33 552 68 252 597 587 557 488 128 229 135 477 506 56 451 241 224 62 370 273 466 463 332 562 513 190 585 430 403 19 382 471 507 18 141 494 574 29 2...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)
Test #20:
score: 0
Wrong Answer
time: 219ms
memory: 52128kb
input:
1005 300 1997946 599 492 539 331 519 105 510 521 334 251 416 147 16 528 224 469 253 309 53 57 567 60 502 151 533 522 283 599 355 197 484 531 527 41 274 76 561 166 47 449 219 194 465 417 571 38 126 25 94 84 596 119 18 156 402 254 148 394 88 270 326 252 310 237 327 509 374 358 259 205 460 405 22 432 4...
output:
result:
wrong output format Unexpected end of file - int32 expected (test case 1)