QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#828250 | #9914. 前往何方 | zhenjianuo2025 | 10 | 1185ms | 5416kb | C++20 | 1.1kb | 2024-12-23 15:04:00 | 2024-12-23 15:04:02 |
Judging History
answer
#include<bits/stdc++.h>
#include "wheretoreach.h"
using namespace std;
#define vec vector
#define pb push_back
#define eb emplace_back
#define siz(vec) ((int)(vec).size())
#define all(vec) (vec).begin(),(vec).end()
template<class T>
void operator +=(vec<T> &a,T b){a.push_back(b);}
template<class T>
void operator --(vec<T> &a){a.pop_back();}
#define pii pair<int,int>
#define x first
#define y second
#define mp make_pair
#define exc(exp) if(exp)continue;
#define stop(exp) if(exp)break;
#define ret(exp) if(exp)return;
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define debl(var) cerr<<#var<<'='<<(var)<<";\n"
#define ins insert
#define era erase
#define lb lower_bound
#define inf (long long)(1e18)
template<class T>
bool Min(T &x,T y){return x>y?x=y,1:0;}
template<class T>
bool Max(T &x,T y){return x<y?x=y,1:0;}
int add(int x);
int remove(int x);
void report(int x,int y);
void solve(int n){
for(int i=1;i<n;i++){
add(i);
for(int j=i+1;j<=n;j++){
if(add(j)==2){
report(i,j);
}
remove(j);
}
remove(i);
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 72ms
memory: 4008kb
input:
500 310 77 468 235 218 93 58 406 223 334 159 243 204 48 144 107 492 288 447 165 102 407 340 299 450 126 140 234 209 62 111 204 453 306 4 476 126 358 183 317 360 489 149 158 232 22 326 372 92 383 410 24 199 14 401 480 69 329 192 167 409 152 426 354 435 60 146 404 334 187 208 305 123 55 30 79 469 72 2...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #2:
score: 10
Accepted
time: 75ms
memory: 3904kb
input:
500 60 412 153 399 248 57 59 152 349 209 303 223 412 181 6 375 158 63 490 178 176 462 313 417 187 411 19 431 30 448 302 264 252 56 427 269 53 429 147 358 417 154 21 326 358 157 450 340 256 324 489 160 193 72 491 65 259 17 153 368 484 55 294 305 27 420 144 119 229 70 22 32 90 432 150 356 398 42 473 2...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #3:
score: 10
Accepted
time: 76ms
memory: 3996kb
input:
500 434 238 470 430 111 20 414 129 408 188 220 491 483 375 203 240 315 401 344 357 315 429 246 486 291 403 465 23 477 67 155 34 27 457 349 305 220 496 384 242 87 8 74 141 458 119 206 177 246 125 332 461 111 343 413 210 280 405 288 407 60 84 70 140 31 482 110 473 94 6 361 294 96 279 438 428 295 379 1...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #4:
score: 10
Accepted
time: 75ms
memory: 3872kb
input:
500 358 385 92 131 274 356 210 2 35 490 296 407 58 286 37 111 60 291 199 463 325 346 356 309 169 213 165 28 373 176 80 274 331 446 358 345 229 75 426 264 223 318 487 478 415 183 418 339 405 133 180 441 485 41 493 445 187 238 249 76 7 419 264 105 103 321 288 287 20 1 172 391 365 88 247 396 402 206 31...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #5:
score: 10
Accepted
time: 62ms
memory: 3928kb
input:
500 457 191 315 191 191 459 163 191 416 191 217 191 279 191 75 191 7 191 206 191 191 317 108 191 223 191 225 191 191 414 196 191 191 248 191 264 38 191 15 191 406 191 191 480 454 191 191 212 99 191 321 191 415 191 191 240 298 191 468 191 191 187 191 340 191 19 170 191 191 430 191 496 222 191 191 386...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #6:
score: 10
Accepted
time: 70ms
memory: 3984kb
input:
500 136 391 151 227 114 291 227 444 481 304 227 139 450 55 227 117 109 343 441 227 398 436 248 181 485 227 167 358 227 174 228 206 107 213 227 331 279 447 321 65 208 440 288 183 470 227 227 380 427 227 408 162 493 196 56 378 434 266 227 9 54 227 227 491 227 469 151 191 92 496 265 227 242 296 456 349...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #7:
score: 10
Accepted
time: 69ms
memory: 4008kb
input:
500 32 112 430 35 282 448 388 442 25 72 281 420 9 27 245 294 28 470 119 144 343 6 4 31 236 429 230 264 285 469 463 303 365 443 169 297 374 7 345 475 420 143 388 31 403 175 51 67 288 311 86 473 349 488 239 105 402 328 9 164 150 370 205 260 439 11 62 245 115 409 272 439 319 142 466 409 407 478 89 197 ...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Test #8:
score: 10
Accepted
time: 70ms
memory: 4016kb
input:
500 237 221 171 286 204 484 179 375 401 385 84 107 167 463 459 69 326 325 234 72 500 138 291 498 80 204 339 383 369 240 344 335 68 327 193 7 294 389 364 102 369 69 495 187 445 386 18 6 144 25 287 205 356 347 143 49 90 74 450 386 55 477 480 11 309 227 63 332 257 23 414 431 207 151 449 19 393 118 441 ...
output:
250498 1
result:
ok Accepted. 250498 queries used.
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 835ms
memory: 4348kb
input:
2500 887 818 1296 878 1605 2107 803 2410 1919 1135 860 1160 1364 2414 1375 500 894 2173 2322 2449 211 1732 1821 573 413 1556 1574 1977 709 162 2002 1577 1626 1895 1563 688 2151 2293 661 69 317 1170 2335 1549 1481 1349 1500 779 1593 735 1824 2380 639 2334 1496 2335 1956 1384 2476 1583 1035 163 720 70...
output:
-1 2
result:
wrong answer Wrong Answer (or #queries exceeded).
Subtask #3:
score: 0
Wrong Answer
Test #17:
score: 0
Wrong Answer
time: 1185ms
memory: 5416kb
input:
10000 6139 8917 131 5800 5366 5247 1298 5035 3966 3518 4889 7202 6547 1919 5829 9494 8012 6029 3868 6403 1909 8116 5734 6122 2683 4779 9275 6673 7433 9042 7646 2032 3547 6306 1943 8382 4061 6428 8240 3548 460 2795 3451 4320 5904 6627 8709 7621 8706 3534 748 4873 8101 4261 5359 3304 6254 4687 6492 53...
output:
-1 3
result:
wrong answer Wrong Answer (or #queries exceeded).