Submission #205091

#TimeUsernameProblemLanguageResultExecution timeMemory
205091Leonardo_PaesFish (IOI08_fish)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int,int> pii; #define f first #define s second const int maxn = 5e5+10, maxk = 30; int qtd[maxn][maxk], mark[maxk]; int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int n, k, m; cin >> n >> k >> m; vector<pii> v(n+1); vector<int> ans(n+1); for(int i=1; i<=n; i++){ cin >> v[i].f >> v[i].s; } sort(v.begin(), v.end()); for(int i=1; i<=n; i++){ ans[i] = 1; qtd[i][v[i].s]++; memset(mark, 0, sizeof mark); mark[v[i].s] = 1; for(int j=1; j<i; j++){ if(!mark[v[j].s] and v[i].f >= v[j].f + v[j].f){ mark[v[j].s] = 1; ans[i] = (ans[i] + ans[j] - qtd[i][v[i].s] - 1 + m)%m; for(int q=1; q<=k; q++){ qtd[i][q] += qtd[j][q]; } } } //cout << ans[i] << " " << qtd[i][v[i].s] << "\n"; } cout << ans[n] << "\n"; return 0; }

Compilation message (stderr)

fish.cpp:16:10: error: '::main' must return 'int'
 int main(){
          ^