이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 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... |