# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
386997 | achibasadzishvili | Fish (IOI08_fish) | C++17 | 3102 ms | 43940 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
#define mp make_pair
using namespace std;
ll ans;
ll n,k,mod,l[500005];
vector<ll>v[500005],t[500005];
int main(){
ios::sync_with_stdio(false);
cin >> n >> k >> mod;
for(int i=1; i<=n; i++){
ll x,y;
cin >> x >> y;
v[y].pb(x);
}
vector<pair<ll,ll> >g;
for(int i=1; i<=k; i++){
sort(v[i].begin() , v[i].end());
if(v[i].size()){
g.pb(mp(v[i][v[i].size() - 1] , i));
}
}
sort(g.begin() , g.end());
for(int i=0; i<g.size(); i++){
ll ind = g[i].s;
t[i] = v[ind];
}
for(int i=0; i<=k; i++){
v[i] = t[i];
}
for(int i=0; i<=k; i++){
if(v[i].size() == 0)continue;
ll mx = v[i][(int)v[i].size() - 1],cur = 1;
for(int j=0; j<=i; j++){
while(l[j] != v[j].size() && v[j][l[j]] * 2 <= mx){
l[j]++;
}
cur = (cur * (l[j] + 1)) % mod;
}
ans = (ans + cur) % mod;
}
cout << ans << '\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |