Submission #685694

# Submission time Handle Problem Language Result Execution time Memory
685694 2023-01-24T21:04:46 Z grossly_overconfident Fish (IOI08_fish) C++17
0 / 100
353 ms 12256 KB
#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

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 time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 132 ms 4332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 210 ms 8156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 289 ms 10356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 206 ms 8420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 304 ms 10220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 341 ms 11700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 317 ms 9708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 326 ms 10944 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 266 ms 9100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 353 ms 12256 KB Output isn't correct
2 Halted 0 ms 0 KB -