Submission #898383

# Submission time Handle Problem Language Result Execution time Memory
898383 2024-01-04T15:04:14 Z abcvuitunggio Fish (IOI08_fish) C++17
0 / 100
3000 ms 30804 KB
#include <bits/stdc++.h>
using namespace std;
int n,k,m,res;
pair <int, int> f[500001];
map <int, int> pos,ch,ban,cnt;
int main(){
    ios_base::sync_with_stdio(NULL);cin.tie(nullptr);
    cin >> n >> k >> m;
    for (int i=0;i<n;i++){
        cin >> f[i].first >> f[i].second;
        if (!pos.count(f[i].second))
            pos[f[i].second]=f[i].first;
        pos[f[i].second]=min(pos[f[i].second],f[i].first);
    }
    sort(f,f+n);
    for (int i=n-1;i>=0;i--){
        if (ch.count(f[i].second))
            continue;
        for (int j=n-1;j>i;j--)
            if (f[j].first>=pos[f[i].second]*2)
                ban[f[j].second]=1;
        for (int j=0;j<i;j++)
            if (f[j].first*2<=f[i].first&&!ban.count(f[j].second))
                cnt[f[j].second]++;
        int x=1;
        for (auto [i,j]:cnt)
            x=x*(j+1)%m;
        res=(res+x)%m;
        ban.clear();
        cnt.clear();
        ch[f[i].second]=1;
    }
    cout << res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 245 ms 10412 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1109 ms 5408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 600 KB Output is correct
2 Incorrect 299 ms 708 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3011 ms 6996 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3054 ms 10896 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3032 ms 7516 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3060 ms 11432 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3039 ms 13392 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3065 ms 14460 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3012 ms 24128 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3044 ms 23048 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3061 ms 30804 KB Time limit exceeded
2 Halted 0 ms 0 KB -