QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#773291 | #9785. Shrooks | ucup-team3555# | WA | 1ms | 5660kb | C++20 | 431b | 2024-11-23 08:18:03 | 2024-11-23 08:18:03 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+3;
int n,m,a[N],f[N];
map<int,int>mp;
int main()
{
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i],mp[a[i]]=1;
for(auto &p:mp)p.second=++m,f[m]=-1e9;
for(int i=1;i<=n;i++)
{
a[i]=mp[a[i]];
ll t0=max(f[a[i]]+2,f[0]),t1=max(f[a[i]]+1,f[0]);
f[0]=t0;f[a[i]]=t1;
}
cout<<f[0];
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5660kb
input:
6 2 1 2 3 -1 -1 -1 4 1 -1 -1 -1 5 1 -1 -1 -1 5 6 3 -1 -1 -1 -1 4 10 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
output:
4
result:
wrong answer 1st numbers differ - expected: '1', found: '4'