QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#632239 | #4096. 코딩 테스트 | C1942huangjiaxu | 3 | 208ms | 9384kb | C++14 | 1.1kb | 2024-10-12 13:05:36 | 2024-10-12 13:05:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+9;
typedef long long ll;
int n,m,a[N],b[N];
ll sa[N],sb[N];
bool check(int l,int r,int d){
ll mx=-1e18;
for(int i=l;i<=r;++i){
mx=max(mx,sa[i-1]+sb[i-1]-1ll*d*i);
if(1ll*d*(i+1)-sb[i+1]-sa[i]+mx>0)return false;
}
return true;
}
vector<int> testset(vector<int> A, vector<int> B, vector<int> L, vector<int> U){
n=A.size(),m=L.size();
for(int i=1;i<=n;++i)a[i]=A[i-1];
for(int i=2;i<=n;++i)b[i]=B[i-2];
for(int i=1;i<=n+1;++i)sa[i]=sa[i-1]+a[i],sb[i]=sb[i-1]+b[i];
vector<int>ans(m);
for(int i=0;i<m;++i){
int l=0,r=2e8;
while(l<r){
int mid=l+r+1>>1;
if(check(L[i]+1,U[i]+1,mid))l=mid;
else r=mid-1;
}
ans[i]=l;
}
return ans;
}
/*
int main(){
freopen("a.in","r",stdin);
freopen("a.out","w",stdout);
scanf("%d%d",&n,&m);
vector<int>A(n),B(n-1),L(m),U(m);
for(int i=0;i<n;++i)scanf("%d",&A[i]);
for(int i=0;i<n-1;++i)scanf("%d",&B[i]);
for(int i=0;i<m;++i)scanf("%d%d",&L[i],&U[i]);
vector<int>ans=testset(A,B,L,U);
for(int i=0;i<m;++i)printf("%d\n",ans[i]);
return 0;
}*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 3
Accepted
Test #1:
score: 3
Accepted
time: 0ms
memory: 3800kb
input:
2 1 746 733 619 0 1
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 1049
result:
ok 2 lines
Test #2:
score: 3
Accepted
time: 0ms
memory: 6104kb
input:
3 1 620 302 785 59 605 0 2
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 679
result:
ok 2 lines
Test #3:
score: 3
Accepted
time: 45ms
memory: 8968kb
input:
100000 100000 85 25 780 928 387 223 750 400 72 245 24 189 172 110 18 2 18 53 578 143 175 117 40 143 2 308 297 201 531 265 10 117 68 13 763 171 288 107 338 815 16 767 533 57 343 63 936 886 2 220 832 302 203 431 8 158 886 16 43 471 103 441 3 349 228 29 84 110 396 36 276 139 13 321 71 36 5 34 59 730 69...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 893 205 67 1121 1029 468 632 325 466 370 618 1722 379 160 444 211 492 131 561 348 298 282 829 465 613 572 432 297 412 535 1106 754 192 291 1164 435 737 1078 395 557 12 729 268 141 454 968 812 697 835 571 528 203 159 444 204 341 920 769 734 1310 337 204 932 556 33...
result:
ok 100001 lines
Test #4:
score: 3
Accepted
time: 45ms
memory: 9200kb
input:
100000 100000 593 696 4 127 111 10 342 630 380 126 136 361 16 511 56 193 131 289 292 54 218 75 144 262 409 446 428 15 96 71 56 38 99 35 174 553 37 117 827 187 137 15 9 55 704 119 477 70 251 219 833 498 233 127 94 53 128 201 286 128 16 532 236 24 38 895 213 513 240 221 41 770 269 499 271 160 227 12 4...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 176 828 597 165 169 445 459 787 172 930 611 645 454 735 500 644 287 437 365 347 286 554 365 915 564 791 22 658 275 476 706 579 390 263 331 171 416 442 534 377 210 153 281 245 452 159 773 755 439 115 781 449 37 568 441 261 607 222 128 210 195 125 209 497 86 251 38...
result:
ok 100001 lines
Test #5:
score: 3
Accepted
time: 46ms
memory: 8940kb
input:
100000 100000 610 525 738 808 913 811 459 795 540 643 308 759 486 194 549 916 168 999 501 576 699 540 922 919 768 78 851 878 313 874 239 309 100 1000 220 654 922 858 119 482 645 963 125 511 730 329 105 193 931 444 442 1000 28 664 254 555 597 150 292 311 928 195 39 849 201 323 345 985 82 653 35 298 9...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 1183 755 992 1803 620 904 1460 387 1320 573 752 915 581 890 1381 993 1695 1470 1340 1222 1271 836 1519 890 1091 2394 1052 1101 930 1024 546 1331 1414 1697 1235 1261 1670 1605 367 839 1183 1290 1417 633 2291 864 1639 1884 1474 1551 220 407 902 1011 719 1671 1643 1...
result:
ok 100001 lines
Test #6:
score: 3
Accepted
time: 46ms
memory: 8988kb
input:
100000 100000 534 445 777 649 627 525 630 634 82 950 103 189 934 533 535 576 553 282 760 148 675 916 49 254 484 0 822 975 980 829 409 239 824 16 564 872 282 897 454 318 259 35 639 945 752 953 972 582 661 911 442 777 628 32 863 868 549 373 79 968 367 283 986 850 420 183 111 802 529 998 462 543 945 15...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 270 967 1254 1076 847 893 1262 1079 728 1284 315 1372 1339 1267 1445 962 1502 1297 1377 1646 691 1222 425 779 654 1020 850 1229 984 1468 646 1270 1257 1431 541 1324 399 1456 266 1228 664 744 879 918 463 1446 1033 1355 1032 1477 758 1344 883 747 984 1149 888 1201 ...
result:
ok 100001 lines
Test #7:
score: 3
Accepted
time: 39ms
memory: 8980kb
input:
100000 100000 996 987 1000 1000 995 1000 956 997 1000 960 983 995 1000 1000 1000 959 1000 993 991 976 986 1000 796 988 939 982 999 967 996 981 1000 983 952 1000 1000 994 998 892 1000 895 1000 988 999 952 994 1000 985 998 995 992 991 1000 990 984 961 1000 993 996 889 999 968 982 998 899 965 999 1000 ...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 2975 2487 2879 2244 2984 2388 2303 2164 2879 2259 2474 2484 2138 2479 2930 2281 2442 2394 2292 2822 2425 2866 2453 2466 2888 2450 2989 2461 2460 2214 2461 2398 2959 2989 2455 2480 2744 2282 2866 2244 2264 2490 2297 2300 2278 2448 2425 2492 2161 2169 2973 2470 287...
result:
ok 100001 lines
Test #8:
score: 3
Accepted
time: 38ms
memory: 9384kb
input:
100000 100000 998 1000 995 998 997 999 950 988 981 999 735 977 973 967 1000 996 1000 984 999 976 912 978 1000 993 942 996 992 996 997 1000 999 994 987 1000 1000 983 893 813 984 998 989 991 909 918 968 995 1000 1000 1000 976 993 999 999 1000 1000 998 957 999 974 998 944 998 999 839 945 998 998 993 99...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 2275 2247 2210 2240 2238 2302 2329 2271 2224 2307 2250 2257 2278 2294 2272 2298 2319 2255 2253 2289 2262 2254 2256 2245 2311 2323 2288 2217 2315 2310 2276 2277 2326 2208 2297 2195 2292 2275 2300 2208 2286 2259 2326 2252 2295 2309 2263 2200 2270 2275 2280 2230 215...
result:
ok 100001 lines
Test #9:
score: 3
Accepted
time: 40ms
memory: 8968kb
input:
100000 100000 998 997 979 985 1000 941 999 1000 925 980 999 999 996 997 1000 999 995 1000 997 999 991 1000 997 1000 1000 919 895 1000 987 1000 999 1000 987 960 1000 953 1000 993 935 963 999 941 1000 993 982 974 997 1000 988 980 1000 976 988 990 997 998 795 997 1000 984 999 928 1000 1000 1000 999 941...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 2261 2989 2290 2898 2314 2467 2974 2958 2975 2308 2313 2830 2303 2322 2477 2330 2477 2309 2414 2968 2936 2452 2997 2299 2995 2281 2286 2288 2326 2808 2447 2986 2275 2998 2995 2453 2484 2926 2477 2290 2307 2446 2311 2493 2889 2320 2483 2992 2929 2963 2434 2498 299...
result:
ok 100001 lines
Test #10:
score: 3
Accepted
time: 39ms
memory: 8892kb
input:
100000 100000 984 968 971 986 993 1000 953 988 1000 1000 1000 985 970 1000 959 1000 997 967 1000 1000 964 996 850 983 930 999 1000 997 1000 958 1000 993 1000 998 1000 976 1000 997 879 992 994 981 1000 1000 988 996 992 1000 972 993 1000 1000 1000 1000 993 1000 999 998 984 976 933 999 965 1000 959 967...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 2252 2249 2208 2300 2284 2293 2306 2322 2306 2316 2288 2254 2142 2323 2324 2261 2290 2316 2321 2304 2279 2289 2309 2325 2311 2292 2321 2324 2265 2323 2323 2320 2306 2318 2266 2330 2279 2265 2317 2292 2314 2313 2302 2305 2317 2293 2323 2301 2194 2322 2323 2306 229...
result:
ok 100001 lines
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 15
Accepted
time: 128ms
memory: 7040kb
input:
100000 100 19808256 24285218 35700559 40271678 34848402 69357487 68150704 33167327 11009744 51263605 95965914 99915162 98938894 25021047 41422333 21862896 68096319 74258633 12048507 49456137 34627666 2028097 39447833 88604280 58491153 12515029 84711345 70929241 88589416 4246292 47068575 45272978 203...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 3433250 3433250 3433250 3433250 6853805 3433250 3433250 3433250 9902417 50171137 3440995 3433250 3433250 3433250 3433250 3433250 3440995 3433250 3433250 3433250 3440995 8010470 3433250 3433250 10706953 3433250 3433250 3433250 3433250 3433250 3433250 3433250 34332...
result:
ok 101 lines
Test #12:
score: 15
Accepted
time: 179ms
memory: 7120kb
input:
100000 100 88921421 99159549 93816734 72130021 96471468 89534281 92956917 92652520 94338754 99863235 99504357 92733129 67148282 99991598 98200140 89661108 99619071 99871162 93032209 98704373 98556888 68858432 99926054 99434030 99007615 96916459 86485887 98774714 92174853 89083931 79005091 99971472 9...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 133927502 155648888 133927502 155648888 155648888 133927502 155648888 133927502 133927502 155648888 174139225 155648888 133927502 133927502 133927502 133927502 133927502 133927502 133927502 164356276 133927502 133927502 133927502 174973218 133927502 133927502 133...
result:
ok 101 lines
Test #13:
score: 15
Accepted
time: 186ms
memory: 7040kb
input:
100000 100 99734214 99853669 99614609 99918192 96454897 99996685 99098030 93989335 96585609 99996695 98678066 99900592 99494392 99626642 99210853 99961421 99987995 99653875 99592931 99987711 99812612 99987799 98743364 99919644 99125267 99998801 97887938 99382342 99962374 99853232 98756057 99997548 9...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 198003283 198173206 198225435 198003283 198025309 198003283 198003283 198032626 198003283 198311576 198025309 198256611 198003283 198003283 198173206 198032626 198003283 198539948 198032626 198003283 198032626 198003283 198003283 198003283 198040768 198025309 198...
result:
ok 101 lines
Test #14:
score: 15
Accepted
time: 207ms
memory: 7152kb
input:
100000 100 99982075 99945005 99999993 99999407 99999872 99999415 99999726 100000000 99987465 99995262 99999470 99996049 99998857 99298344 99990597 99989903 99758575 99974392 98921822 99908251 99998463 99995643 99963584 99458099 99933018 99999195 99352604 99800551 99977580 99994686 99990057 99999990 ...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 199800476 199805496 199800476 199800476 199800476 199800476 199800476 199800476 199800476 199807625 199800476 199807255 199810970 199800476 199800476 199800476 199800476 199800476 199800476 199800476 199800476 199800476 199807640 199815600 199800476 199803693 199...
result:
ok 101 lines
Test #15:
score: 0
Wrong Answer
time: 208ms
memory: 7336kb
input:
100000 100 99999934 99999995 99999991 99999865 99958637 99999917 99996758 99999998 99974500 99999089 99999906 99998406 99998960 99999897 99999911 99973867 99991317 99999861 99999034 99995700 99995890 99999870 99999815 99998962 99999996 99998725 99999610 99999956 100000000 99998973 99999999 99999978 ...
output:
e4bc1609-b8fd-4286-b31c-e5e8e5765738 199991330 199976655 199983745 199977521 199976035 199976035 199982726 199976035 199977406 199976035 199977204 199976035 199976580 199976035 199977149 199976526 199976275 199977209 199976035 199976035 199977586 199976036 199976854 199976037 199976342 199977329 199...
result:
wrong answer 47th lines differ - expected: '200015659', found: '200000000'
Subtask #3:
score: 0
Time Limit Exceeded
Test #31:
score: 0
Time Limit Exceeded
input:
5000 100000 93608251 16211038 93349835 94727166 27749929 28580474 39398397 58978075 32539760 49630110 14330110 62149976 63372420 45530888 44815920 40624609 4942456 35245376 9509556 17318048 91459277 83937735 82541206 16905922 22994630 56339982 33531160 45581398 67402358 51369287 2786263 53237145 830...
output:
Unauthorized output
result:
Subtask #4:
score: 0
Time Limit Exceeded
Test #51:
score: 0
Time Limit Exceeded
input:
100000 100000 8220608 27643636 9653375 7527483 4568995 4937547 27001430 10512886 14865249 54452685 31213146 1223559 25266797 9367382 5798933 1485258 33036920 2988776 5046089 41823731 6136379 20608943 10327625 90179994 75745370 21933251 3376845 19790905 52189711 21570452 18938610 18445540 26257950 24...
output:
Unauthorized output
result:
Subtask #5:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%