QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#773291#9785. Shrooksucup-team3555#WA 1ms5660kbC++20431b2024-11-23 08:18:032024-11-23 08:18:03

Judging History

This is the latest submission verdict.

  • [2024-11-23 08:18:03]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 5660kb
  • [2024-11-23 08:18:03]
  • Submitted

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'