QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#118398 | #1132. Financial Report | lmeowdn# | 0 | 23ms | 7336kb | C++14 | 1.7kb | 2023-07-03 14:40:32 | 2024-05-31 18:53:15 |
Judging History
answer
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x) {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x) {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x) {return (x==0?-1:__builtin_ctzll(x));}
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
int x=0,w=1; char c=getchar();
while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();}
return x*w;
}
const int N=3e5+5;
int n,D,a[N],f[N],p[N],ans;
signed main() {
n=read(), D=read();
rep(i,1,n) a[i]=read();
rep(i,2,n) {
int cur=0; p[i]=i-1;
per(j,i-1,2) {
if(a[j]<a[i]) cur=0;
else cur++;
if(cur>=D) break;
p[i]=j-1;
}
}
f[1]=1;
rep(i,2,n) {
f[i]=1;
rep(j,p[i],i-1) if(a[j]<a[i]) chmax(f[i],f[j]+1);
chmax(ans,f[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: 1ms
memory: 5836kb
input:
1 1 314159265
output:
0
result:
wrong answer 1st lines differ - expected: '1', found: '0'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Time Limit Exceeded
Test #62:
score: 12
Accepted
time: 9ms
memory: 7236kb
input:
300000 1 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 285899902 2...
output:
1
result:
ok single line: '1'
Test #63:
score: 0
Accepted
time: 10ms
memory: 7236kb
input:
299971 1 213313757 312061773 790195557 213313757 0 790195557 30936680 832403554 312061773 30936680 0 213313757 329317874 329317874 0 0 329317874 329317874 0 213313757 329317874 790195557 832403554 832403554 329317874 312061773 832403554 832403554 329317874 329317874 312061773 790195557 790195557 790...
output:
7
result:
ok single line: '7'
Test #64:
score: 0
Accepted
time: 13ms
memory: 7336kb
input:
299964 1 999391533 795527538 725929353 340564009 761636306 1000000000 266904585 105958508 549383838 340564009 431998269 141078858 236783723 651207509 554129129 514310143 802266954 185376130 366537845 883789079 688298181 621545068 692525271 555960625 415080461 468820678 149895819 709946893 415080461 ...
output:
15
result:
ok single line: '15'
Test #65:
score: 0
Accepted
time: 11ms
memory: 7236kb
input:
300000 1 548117244 559216957 507201469 40534874 269192764 516346951 183733704 869745777 781914589 551408564 699975473 735567843 438862496 240429620 67594019 153803925 72746062 343276550 121453383 412576614 208627475 771041507 950354624 832001069 221477371 192349583 674402432 552830114 73583781 83795...
output:
27
result:
ok single line: '27'
Test #66:
score: 0
Accepted
time: 23ms
memory: 7296kb
input:
300000 1 691596759 196814375 574002903 594314532 982102853 676133704 51798090 506287024 603831698 332571699 178065016 71628067 59716653 762524657 554265870 950792677 301567670 821363269 109779474 783340951 247333489 525773395 351088520 438229302 527706457 82894430 867332858 179925618 508622616 66518...
output:
884
result:
ok single line: '884'
Test #67:
score: 0
Accepted
time: 19ms
memory: 7272kb
input:
300000 1 508573390 653912933 525806709 842004427 840728278 229089762 812466273 74713576 264668073 60014628 114629166 490347940 65502437 978210434 145920485 2253440 570123282 966368812 123749349 598895954 650307775 739167010 695523885 568813226 673823768 163707323 266177084 902827760 68463107 2067017...
output:
103
result:
ok single line: '103'
Test #68:
score: -12
Time Limit Exceeded
input:
298001 1 0 3000 6000 9000 12000 15000 18000 21000 24000 27000 30000 33000 36000 39000 42000 45000 48000 51000 54000 57000 60000 63000 66000 69000 72000 75000 78000 81000 84000 87000 90000 93000 96000 99000 102000 105000 108000 111000 114000 117000 120000 123000 126000 129000 132000 135000 138000 141...
output:
result:
Subtask #5:
score: 0
Time Limit Exceeded
Test #76:
score: 0
Time Limit Exceeded
input:
300000 300000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...
output:
result:
Subtask #6:
score: 0
Skipped
Dependency #1:
0%