Submission #1006313

#TimeUsernameProblemLanguageResultExecution timeMemory
1006313MilosMilutinovicFish (IOI08_fish)C++14
16 / 100
3060 ms12480 KiB
#include <bits/stdc++.h> using namespace std; int md; int add(int a, int b) { return a + b < md ? a + b : a + b - md; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k >> md; vector<int> l(n); vector<int> t(n); for (int i = 0; i < n; i++) { cin >> l[i] >> t[i]; } set<vector<int>> st; for (int mask = 1; mask < (1 << n); mask++) { vector<int> v; vector<int> f; for (int i = 0; i < n; i++) { if (mask >> i & 1) { v.push_back(l[i]); f.push_back(t[i]); } } sort(v.begin(), v.end()); sort(f.begin(), f.end()); if ((int) v.size() == 1 || v.back() >= v.rbegin()[1] * 2) { st.insert(f); } } cout << (int) st.size() % md << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...