QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#67350 | #5098. 第一代图灵机 | sycqwq | 0 | 208ms | 4144kb | C++14 | 1.0kb | 2022-12-10 12:03:45 | 2022-12-10 12:03:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
int n,m,q,a[maxn],c[maxn],bk[maxn];
int main()
{
cin>>n>>m>>q;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<=n;i++)
cin>>c[i];
for(int i=1;i<=q;i++)
{
int op,x,y;
cin>>op>>x>>y;
int l,r;
memset(bk,0,sizeof bk);
if(op==2)
c[x]=y;
else
{
r=i;
int s=a[x-1];
bk[c[x-1]]=1;
int ma=0;
for(int j=x;j<=y;j++)
{
--bk[c[j-1]];
s-=a[j-1];
while(r<=y)
{
if(bk[c[r]]==0)
{
++bk[c[r]];
++r,s+=a[r-1];
}
else
break;
}
ma=max(ma,s);
}
cout<<ma<<endl;
}
}
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: 208ms
memory: 4144kb
input:
5000 200 5000 2315 3433 1793 4621 4627 4561 289 4399 3822 2392 392 4581 2643 2441 4572 4649 2981 3094 4206 2057 761 2516 2849 3509 3033 658 4965 3316 3269 4284 4961 753 1187 2515 1377 1725 4743 4761 3823 3464 4859 989 2401 953 875 1481 2181 103 2067 2625 3296 4721 61 3843 1607 997 4385 1284 4299 441...
output:
26038 58886 43279 38591 55487 77860 86296 60061 45418 42324 36061 65957 63441 60592 57083 54050 53392 45111 41842 43478 32597 31844 38427 61543 55075 50314 56497 43027 38168 37179 34778 33825 32950 29288 38985 46815 42094 42033 35586 25618 21202 20561 16988 14599 11126 7850 3371 46242 34478 5643 531...
result:
wrong answer 1st lines differ - expected: '118571', found: '26038'
Subtask #2:
score: 0
Time Limit Exceeded
Test #3:
score: 0
Time Limit Exceeded
input:
200000 10 200000 55651 97298 108697 86619 60721 199951 10610 162267 154301 138848 39191 18605 101369 57073 34977 101576 71252 143401 89587 160521 166491 38442 150761 35579 25571 121311 38033 38483 144639 41401 179161 54872 157905 137601 46863 187656 171901 43715 41036 150741 69057 102031 130561 4772...
output:
2147434917 2147319512 2147413138 2147391601 2147397508 2147392469 2147457527 2147477567 2147400202 2147481784 264878 445658 2147474514 2147482960 2147397915 2147400217 2147413087 204933 2147474705 2147443306 2147449209 2147477678 2147480442 2147354133 2147483614 2147372891 2147434317 2147373491 2147...
result:
Subtask #3:
score: 0
Time Limit Exceeded
Test #5:
score: 0
Time Limit Exceeded
input:
200000 20000 200000 30681 32496 35471 48191 159123 69792 120915 150673 187226 158493 36275 26856 107976 124777 145229 69745 183961 14497 144808 153612 185893 137681 66417 46802 19345 113322 168046 128149 191001 135433 13201 139214 59489 81178 42343 163158 110121 119201 97501 53079 158755 192241 1132...
output:
2147471708 2147406549 10292428 2147380169 10208766 2147479251 2147447087 2147366264 2147448131 2147451738 9362544 9326269 2147422644 2147477119 2147448857 2147470672 2147480485 2147429635 2147469957 2147416279 2147474992 2147463663 2147412186 7964817 2147480054 2147380459 2147480973 7617302 21474792...
result:
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%