QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#663586 | #6604. Kobolds and Catacombs | Dixiky_215 | WA | 125ms | 15192kb | C++20 | 706b | 2024-10-21 16:19:57 | 2024-10-21 16:19:57 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAXN=2e6+7;
const int ep=505;
int t;
int n;
int a[MAXN],c[MAXN];
int main()
{
cin.tie(nullptr) ->sync_with_stdio(false);
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],c[i]=a[i];
sort(c+1,c+1+n);
int maxl=0,ans=0,pre_max=0;
int minl=1e9+7;
for(int i=1;i<=n;i++)
{
maxl=max(maxl,a[i]);
minl=min(minl,a[i]);
if(minl>=pre_max)
{
pre_max=maxl;
maxl=0;minl=1e9+7;
ans++;
}
}
if(maxl>0) ans++;
cout<<ans;
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 5780kb
input:
5 1 3 2 7 4
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: -100
Wrong Answer
time: 125ms
memory: 15192kb
input:
1000000 524227301 431992275 758916082 293029389 719487809 413407585 7533705 414925441 87316769 639877621 980912701 739058961 277730843 958292661 778325685 500280161 782766985 339709027 1968001 842653531 847517701 989893001 97622801 728458741 612188545 787566057 981715521 281901909 804267925 89113887...
output:
2
result:
wrong answer 1st numbers differ - expected: '1', found: '2'