제출 #685738

#제출 시각아이디문제언어결과실행 시간메모리
685738grossly_overconfidentFish (IOI08_fish)C++17
0 / 100
3081 ms65536 KiB
#include <bits/stdc++.h> using namespace std; #define endl "\n" int main() { int f, k, m; vector<pair<int, int>> fish; cin >> f >> k >> m; for (int i = 0; i < f; ++i) { int a, b; cin >> a >> b; fish.push_back(make_pair(a, b)); } multiset<int> alright; sort(fish.begin(), fish.end()); set<multiset<int>> s; set<pair<int, multiset<int>>> take; s.insert(alright); take.insert(make_pair(0, alright)); long long count = 0; for (auto i : fish) { for (auto k = take.begin(); k != take.end(); ++k) { auto j = *k; if (i.first >= 2 * j.first) { j.second.insert(i.second); if (s.count(j.second) == 0) { s.insert(j.second); take.insert(make_pair(i.first, j.second)); ++count; count %= m; } } } } cout << (count % m); 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...