QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#127710#6604. Kobolds and Catacombswhite2718WA 157ms11412kbC++14920b2023-07-19 22:33:132023-07-19 22:33:16

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-19 22:33:16]
  • 评测
  • 测评结果:WA
  • 用时:157ms
  • 内存:11412kb
  • [2023-07-19 22:33:13]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
# define ll long long
# define inf 1000000000
const ll mod = 1000000007;
const double pi = 3.141592653589793;

inline int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }

inline int lcm(int n, int m) { return n * m / gcd(n, m); }

ll powmod(ll a, ll b) {
    ll res = 1;
    a %= mod;
    for (; b; b >>= 1) {
        if (b & 1)res = res * a % mod;
        a = a * a % mod;
    }
    return res;
}

int n;
struct A{
    int id,v;
    bool operator <(const A &a)const {
        if(a.v==v)return id<a.id;
        return v<a.v;
    }
}a[1000010];
int main() {
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i].v);
        a[i].id=i;
    }
    sort(a+1,a+1+n);
    int ans=0,now=0;
    for(int i=1;i<=n;i++){
        if(a[i].id<now)continue;
        now=a[i].id;
        ans++;
    }
    printf("%d",ans);
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3824kb

input:

5
1 3 2 7 4

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: -100
Wrong Answer
time: 157ms
memory: 11412kb

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:

105

result:

wrong answer 1st numbers differ - expected: '1', found: '105'