QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#516854 | #4563. Radio Towers | kimmoqt | 0 | 50ms | 4728kb | C++20 | 866b | 2024-08-12 22:32:35 | 2024-08-12 22:32:36 |
Judging History
answer
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> H, pos;
void init(int N, std::vector<int> H) {
::N=N, ::H=H;
for(int i=0;i+1<N;) {
if(H[i]<H[i+1]) {
if(pos.empty()|| pos.back()!=i)
pos.push_back(i);
int j=i;
while(j+1<N && H[j]<H[j+1]) j++;
i=j;
} else {
int j=i;
while(j+1<N && H[j]>H[j+1]) j++;
i=j;
pos.push_back(i);
}
}
}
int max_towers(int L, int R, int D) {
auto lf=lower_bound(pos.begin(),pos.end(),L);
auto rg=upper_bound(pos.begin(),pos.end(),R);
return rg-lf;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 26ms
memory: 3868kb
input:
59640 49885 57346 58504 87383 113182 129676 204090 205404 259925 276583 300332 324014 333675 359377 364049 408489 414852 428310 438038 440113 458193 554789 643468 666525 683112 690791 707313 720088 741028 748785 789826 796576 800966 832867 851750 861044 862283 900756 926925 939560 955678 965636 9740...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
wrong answer 3rd lines differ - expected: '1', found: '0'
Subtask #2:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 1ms
memory: 3852kb
input:
425 753881706 405729786 890889563 29736246 598281970 208352067 357783003 663497023 178397034 4832890 562140755 510307001 354540290 538848551 436879256 86659033 42928516 24145404 749159097 118423198 506851985 204895765 719719998 726244368 991372008 681703480 799303017 657138050 88278945 417801236 260...
output:
16
result:
wrong answer 3rd lines differ - expected: '13', found: '16'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #65:
score: 0
Wrong Answer
time: 48ms
memory: 4728kb
input:
99308 491693640 24020487 317364185 726230755 737284540 951143270 709116045 641023337 360629062 964879440 47884022 532494780 803629825 635450854 688041998 573937055 113198481 191311841 929603572 636688 598629732 895342035 396521271 619919754 716589045 657789547 373121546 866402108 609316614 60046511 ...
output:
11902 4770 14278 13956 570 9308 4389 9 22097 16784 26037 2813 8487 16601 2029 6158 17236 29707 19863 12083 20815 18090 4195 11612 4623 6657 7660 623 9837 13012 14474 11799 14795 6364 7308 5981 13613 14208 15922 17325 6019 10291 1819 29076 3116 6638 5810 28745 14944 9540 5498 1014 5001 20938 304 1993...
result:
wrong answer 3rd lines differ - expected: '11903', found: '11902'
Subtask #5:
score: 0
Wrong Answer
Test #86:
score: 0
Wrong Answer
time: 12ms
memory: 4060kb
input:
23881 605288257 422163932 155875880 339929874 76049859 196344969 958160745 767945284 469191956 997116006 387749577 15911341 920437918 367576975 800789357 351557615 283723284 369507452 841548133 643412903 309731505 256549694 370065644 699518122 559017597 347646657 469353381 575240521 501893001 454519...
output:
8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 8004 ...
result:
wrong answer 3rd lines differ - expected: '7197', found: '8004'
Subtask #6:
score: 0
Wrong Answer
Test #97:
score: 0
Wrong Answer
time: 50ms
memory: 4532kb
input:
88768 238644804 620122421 789364401 899010695 885388612 437964772 845379533 657562749 773925456 625793781 916240972 291506550 379611161 905077982 629848170 530056471 520438258 806293637 326792996 785404568 74285074 565304193 846963319 63529729 804909008 212070492 69936548 656129389 408708069 3070450...
output:
8349 21427 5662 21825 26907 2291 23915 10524 24336 18015 129 13455 9770 21975 10776 10480 6181 23042 1918 4552 25920 6777 20509 14798 6559 14190 24784 18071 732 6200 19472 8746 7040 2032 7226 713 876 3518 10083 13229 8251 3018 18151 2596 2308 11129 27487 5329 10158 5747 2767 23134 9529 16660 18864 7...
result:
wrong answer 3rd lines differ - expected: '7293', found: '8349'
Subtask #7:
score: 0
Skipped
Dependency #1:
0%