Submission #685694

#TimeUsernameProblemLanguageResultExecution timeMemory
685694grossly_overconfidentFish (IOI08_fish)C++17
0 / 100
353 ms12256 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)); } sort(fish.begin(), fish.end()); set<set<int>> s; set<set<int>> take; int current = fish[0].first; long long count; for (auto i : fish) { if (i.first != current) { for (auto p = take.begin(); p != take.end(); ++p) { s.insert(*p); ++count; count %= m; } take = {}; current = i.first; } for (auto k = s.begin(); k != s.end(); ++k) { auto j = *k; j.insert(i.second); if (take.count(j) == 0 && s.count(j) == 0) { take.insert(j); } } } for (auto p : take) { s.insert(p); ++count; count %= m; } cout << (count % m); return 0; }

Compilation message (stderr)

fish.cpp: In function 'int main()':
fish.cpp:43:20: warning: 'count' may be used uninitialized in this function [-Wmaybe-uninitialized]
   43 |  cout << (count % m);
      |                    ^
#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...