QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#107812 | #6337. Mizuyokan 2 | zhouhuanyi | 0 | 240ms | 5800kb | C++23 | 948b | 2023-05-22 21:08:30 | 2023-05-22 21:08:31 |
Judging History
answer
#include<iostream>
#include<cstdio>
#define N 250000
#define inf 1e9
using namespace std;
int read()
{
char c=0;
int sum=0;
while (c<'0'||c>'9') c=getchar();
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum;
}
void Adder(int &x,int d)
{
x=(x<d)?d:x;
return;
}
int n,q,ans,tong[N+1],length,L[N+1],dp[N+1],dp2[N+1];
int main()
{
int x,y,l,r;
n=read();
for (int i=1;i<=n;++i) L[i]=read();
q=read();
while (q--)
{
x=read(),y=read(),l=read()+1,r=read(),L[x]=y,length=ans=0;
for (int i=l;i<=r;++i) tong[++length]=L[i];
for (int i=1;i<=length;++i) dp[i]=dp2[i]=1;
for (int i=1;i<=length;++i)
for (int j=1;j<=i-1;++j)
{
if (tong[j]<tong[i]) Adder(dp2[i],dp[j]+1);
if (tong[j]>tong[i]) Adder(dp[i],dp2[j]+1);
}
for (int i=1;i<=length;++i) Adder(ans,dp[i]),Adder(ans,dp2[i]);
printf("%d\n",ans);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 5584kb
input:
170 581553716 290776853 145388421 581553716 168947671 936760822 849346471 126291564 133104657 125887494 136786623 123143788 137803872 129733949 849346471 880499329 202732710 611312524 152828126 305656257 611312524 121295297 6875889 74507235 419967909 333601507 281557968 740824934 370412466 185206229...
output:
59 55 60 61 55 37 42 46
result:
wrong answer 2nd numbers differ - expected: '56', found: '55'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #59:
score: 0
Wrong Answer
time: 240ms
memory: 5512kb
input:
185137 895278847 447639418 223819705 895278847 25847602 892542542 725274571 68345857 72124244 67050536 71135605 66549838 72378749 66083078 72261084 67667076 70423484 68942136 725274571 798132375 68764887 958288578 703862250 55104628 58120315 54690522 57110282 54279470 56516680 54581941 58474132 5445...
output:
59 26 80 54 43 41 79 37 57 79 69 29 31 25 26 76 32 25 27 36 34 39 67 40 67 71 45 40 49 52 64 61 29 40 39 34 41 19 28 51 31 43 62 23 31 26 73 39 63 35 53 27 46 56 30 66 60 37 71 22 42 59 66 87 16 27 20 38 14 64 20 19 41 34 55 53 15 51 43 29 71 60 49 9 75 18 86 29 73 61 38 46 20 62 20 20 67 71 81 81 5...
result:
wrong answer 4th numbers differ - expected: '55', found: '54'
Subtask #5:
score: 0
Wrong Answer
Test #76:
score: 0
Wrong Answer
time: 201ms
memory: 5800kb
input:
235469 96936 48463 24226 96936 25951 73765 63933 7121 7884 7166 7731 7464 7559 7300 7767 7314 63933 88750 6093 115886 111307 16371 17529 15944 17376 16099 18186 15910 111307 116042 13997 111982 95565 10713 11748 10849 11375 11093 11406 10874 11810 11197 95565 98914 1302 65917 16473 32953 65917 15943...
output:
33 56 73 61 41 13 74 46 33 31 14 53 36 46 18 63 65 79 72 15 20 57 66 81 19 46 62 57 44 76 76 68 41 56 9 29 59 73 64 21 63 33 29 62 27 36 20 65 54 71 28 47 13 32 48 74 63 75 79 17 24 49 20 41 57 16 23 67 67 18 19 54 63 74 72 45 61 30 27 60 33 36 49 49 24 56 42 60 20 53 32 75 44 57 17 34 71 45 25 39 2...
result:
wrong answer 1st numbers differ - expected: '34', found: '33'
Subtask #6:
score: 0
Skipped
Dependency #1:
0%