제출 #685694

#제출 시각아이디문제언어결과실행 시간메모리
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; }

컴파일 시 표준 에러 (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...