# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
473611 |
2021-09-15T17:19:16 Z |
OttoTheDino |
Fish (IOI08_fish) |
C++17 |
|
213 ms |
31916 KB |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,e) for (ll i = s; i <= e; ++i)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
const ll mx = 5e5+5;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll f, k, m, ans = 0; cin >> f >> k >> m;
vii bois;
rep (i,0,f-1) {
ll l, tp; cin >> l >> tp;
bois.pb({l, tp});
}
sort(all(bois));
ll last[mx], cnt[mx] = {}, num[mx] = {}, done[mx] = {}, id = 0;
rep (i,0,f-1) last[bois[i].se] = bois[i].fi;
set<ll> st;
rep (i,0,f-1) {
ll l = bois[i].fi, tp = bois[i].se;
while (l>=2*bois[id].fi) {
ll c = ++cnt[bois[id].se];
if (done[bois[id].se]) {
if (--num[c-1]==0) st.erase(c-1);
if (++num[c]==1) st.insert(c);
}
++id;
}
if (last[tp]==l) {
ll res = cnt[tp]+1;
for (ll el : st) res = res*(el+1)*num[el];
ans = (ans+res);
done[tp] = 1;
if (cnt[tp] && ++num[cnt[tp]]==1) st.insert(cnt[tp]);
}
}
cout << ans << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
15948 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
15948 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
15884 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
15948 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
16008 KB |
Output is correct |
2 |
Incorrect |
9 ms |
15972 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
15972 KB |
Output is correct |
2 |
Incorrect |
173 ms |
29964 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
15948 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
16108 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
89 ms |
21948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
16076 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
113 ms |
27952 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
166 ms |
30004 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
118 ms |
28152 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
169 ms |
29404 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
190 ms |
31192 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
170 ms |
28536 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
190 ms |
30116 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
28280 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
213 ms |
31916 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |