QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#498914 | #1139. Stations | Dan4Life# | 0 | 48ms | 3792kb | C++23 | 742b | 2024-07-30 21:29:16 | 2024-07-30 21:29:16 |
Judging History
stations
#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ll = long long;
using vi = vector<int>;
const int mxN = 1010;
vi labels;
int dfs_timer = 0;
vi adj[mxN];
void dfs(int s, int p){
labels[s] = dfs_timer++;
for(auto u : adj[s])
if(u!=p) dfs(u,s);
}
vi label(int n, int k, vi u, vi v) {
labels.resize(n,0); dfs_timer=0;
for(int i = 0; i < sz(u); i++){
int a = u[i], b = v[i];
adj[a].pb(b), adj[b].pb(a);
}
dfs(0,-1);
return labels;
}
int find_next_station(int s, int t, vi c) {
if(t < s) return c[0];
int pos = lower_bound(all(c),t)-begin(c)-1;
if(pos!=-1) return c[pos];
return c[0];
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Stage 1: Program stations Time Limit Exceeded
Test #1:
score: 0
Stage 1: Program stations Time Limit Exceeded
input:
0 10 10 1000 4 5 9 0 2 6 5 2 8 3 1 4 8 1 6 0 3 7 3 1000 0 1 1 2 998 1000 166 178 393 452 389 179 622 429 892 866 872 18 899 227 835 637 587 769 504 386 369 577 65 441 523 17 803 221 878 321 637 892 696 473 16 146 840 322 495 986 353 275 330 585 831 402 719 810 704 830 780 940 53 901 894 911 394 482 ...
output:
input:
output:
result:
Subtask #2:
score: 0
Stage 1: Program stations Time Limit Exceeded
Test #11:
score: 0
Stage 1: Program stations Time Limit Exceeded
input:
0 10 996 1000 0 1 2 0 1 3 4 1 5 2 6 2 7 3 3 8 4 9 10 4 11 5 12 5 6 13 14 6 7 15 7 16 17 8 18 8 19 9 9 20 21 10 10 22 23 11 24 11 12 25 26 12 27 13 13 28 14 29 30 14 15 31 15 32 16 33 34 16 35 17 17 36 18 37 38 18 39 19 40 19 41 20 42 20 43 21 44 21 45 22 46 22 23 47 48 23 49 24 24 50 25 51 52 25 26 ...
output:
996 0 1 512 2 257 513 768 3 130 258 385 514 641 769 896 4 67 131 194 259 322 386 449 515 578 642 705 770 833 897 960 5 36 68 99 132 163 195 226 260 291 323 354 387 418 450 481 516 547 579 610 643 674 706 737 771 802 834 865 898 929 961 981 6 21 37 52 69 84 100 115 133 148 164 179 196 211 227 242 261...
input:
output:
result:
Subtask #3:
score: 0
Stage 1: Program stations Runtime Error
Test #17:
score: 0
Stage 1: Program stations Runtime Error
input:
0 10 2 1000000 1 0 997 1000000 830 513 223 672 727 200 763 415 581 440 34 42 267 325 912 693 753 59 401 289 198 641 982 214 41 49 453 107 940 806 905 732 153 482 248 405 102 79 480 837 534 620 564 856 679 178 278 247 899 206 333 672 297 308 407 863 26 752 272 178 204 603 208 10 715 562 785 285 184 5...
output:
input:
output:
result:
Subtask #4:
score: 0
Stage 1: Program stations Runtime Error
Test #34:
score: 10
Accepted
time: 48ms
memory: 3792kb
input:
0 10 2 1000000000 0 1 2 1000000000 0 1 2 1000000000 1 0 2 1000000000 1 0 2 1000000000 0 1 2 1000000000 1 0 2 1000000000 1 0 2 1000000000 0 1 2 1000000000 0 1 2 1000000000 0 1
output:
2 0 1 2 0 2 2 0 3 2 0 4 2 0 5 2 0 6 2 0 7 2 0 8 2 0 9 2 0 10
input:
1 100000 8 0 1 0 0 6 1 6 0 1 1 1 10 0 1 0 0 10 1 10 6 0 1 0 2 0 1 0 5 0 1 0 5 0 1 0 6 0 1 0 0 2 1 2 9 0 1 0 0 6 1 6 8 0 1 0 0 5 1 5 0 9 1 9 0 9 1 9 10 0 1 0 7 0 1 0 0 6 1 6 1 0 1 0 0 1 1 1 0 4 1 4 2 0 1 0 4 0 1 0 0 10 1 10 0 4 1 4 4 0 1 0 0 7 1 7 0 6 1 6 9 0 1 0 10 0 1 0 8 0 1 0 4 0 1 0 1 0 1 0 0 10...
output:
0 6 1 0 10 0 0 0 0 0 2 0 6 0 5 9 9 0 0 6 0 1 4 0 0 10 4 0 7 6 0 0 0 0 0 10 0 4 0 0 0 4 8 0 1 5 8 5 0 0 1 9 0 0 0 6 10 0 2 3 0 4 6 0 0 0 1 0 10 8 7 6 9 3 0 10 0 5 6 9 0 0 0 0 6 0 0 7 0 2 7 0 2 6 8 0 0 0 9 3 8 0 7 0 0 1 0 2 0 1 7 0 0 2 0 0 0 2 8 7 0 0 0 5 9 0 0 9 2 3 0 5 0 5 0 8 10 8 3 0 0 0 0 3 0 0 1...
result:
ok
Test #35:
score: 0
Stage 1: Program stations Runtime Error
input:
0 10 3 1000000000 2 1 2 0 3 1000000000 1 0 2 0 3 1000000000 2 0 0 1 3 1000000000 0 2 1 2 3 1000000000 1 2 1 0 3 1000000000 1 0 2 1 3 1000000000 0 2 1 2 3 1000000000 1 2 1 0 3 1000000000 0 2 1 0 3 1000000000 2 0 1 2
output:
input:
output:
result:
Subtask #5:
score: 0
Stage 1: Program stations Runtime Error
Test #54:
score: 0
Stage 1: Program stations Runtime Error
input:
0 10 3 1000000000 1 0 2 1 998 1000000000 928 443 90 795 55 379 957 417 759 300 960 136 309 858 833 370 228 827 876 955 619 365 15 108 243 388 54 925 141 894 272 634 0 989 600 346 380 277 350 113 326 613 975 946 660 98 34 538 220 864 9 585 185 860 458 424 509 14 22 275 109 872 153 233 76 834 972 736 ...