QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#734638#9600. Eat, Sleep, RepeatLightFeatherWA 2ms5632kbC++201.2kb2024-11-11 13:32:332024-11-11 13:32:36

Judging History

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

  • [2024-11-11 13:32:36]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:5632kb
  • [2024-11-11 13:32:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
typedef long long ll;

constexpr int N = 5e5;
int lim[N], a[N];

void solve(){
    int n, k, ans = 0;
    cin >> n >> k;
    set<int> s;
    map<int, int> mp;
    for(int i = 1; i <= n; i ++)
        cin >> a[i];
    sort(a + 1, a + n + 1);
    s.insert(-1);
    lim[-1] = 1;
    for(int i = 1; i <= k; i ++){
        int t1, t2;
        cin >> t1 >> t2;
        lim[t1] = t2 + 1;
        if(lim[t1] == 1)
            s.insert(t1);
    }
    for(int i = 1; i <= n; i ++)
        lim[a[i]] --;
    for(int i = 1; i <= n; i ++){
        auto it = s.upper_bound(a[i]);
        it --;
        ans += max(a[i] - *it - 1, 0ll);
        if(*it == a[i])
            continue;
        lim[a[i]] ++;
        lim[*it + 1] --;
        if(lim[*it + 1] == 1)
            s.insert(*it + 1);
    }
    // cout << ans << " ";
    if(ans % 2)
        cout << "Pico" << endl;
    else
        cout << "FuuFuu" << endl;
}

signed main(){
    cin.tie(nullptr) -> ios::sync_with_stdio(false);
    int t = 1;
    cin >> t;
    while(t --)
        solve();
    return 0;
}

详细

Test #1:

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

input:

5
2 0
1 2
2 1
1 2
0 1
3 2
3 3 4
0 2
1 1
3 2
2 3 3
1 2
0 1
5 4
6 7 8 12 17
1 1
2 1
9 0
10 1

output:

Pico
FuuFuu
Pico
FuuFuu
Pico

result:

ok 5 lines

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 5632kb

input:

10
1385 1384
914 1004 3060 1953 2517 745 879 849 3254 2069 3574 3705 2941 760 2522 3548 616 1328 1732 2420 2789 2448 3533 2058 308 3094 222 1960 3569 1463 2242 3258 1528 2779 1511 2855 1482 3304 2258 3525 3039 1489 3272 3295 1389 109 3370 2750 2207 1400 1570 888 422 646 3541 202 3384 2874 723 1157 3...

output:

Pico
Pico
FuuFuu
FuuFuu
Pico
Pico
Pico
FuuFuu
FuuFuu
FuuFuu

result:

wrong answer 3rd lines differ - expected: 'Pico', found: 'FuuFuu'