Submission #475230

# Submission time Handle Problem Language Result Execution time Memory
475230 2021-09-21T14:56:36 Z bigo Table Tennis (info1cup20_tabletennis) C++14
0 / 100
185 ms 7892 KB
#include <iostream>
#include <vector>		
#include <cmath>
#include <set>
using namespace std;
#define pii pair<int, int>
vector<vector<int>>vec;
vector<bool>visit;
int main() {
	int n, k;
	cin >> n >> k;
	vector<int>vec(n+k);
	set<int>set1;
	for (int i = 0; i < n + k; i++) {
		cin >> vec[i];
		set1.insert(vec[i]);
	}
	long long sum1 = 0;
	for (int i = 1; i <= n + k; i++) {
		sum1 += vec[i - 1];
	}
	for (int i = 0; i < n + k; i++) {
		long long sum = sum1 - vec[i];
		set1.erase(set1.find(vec[i]));
		auto it = set1.begin();
		auto it1 = it;
		++it;
		int d = *it - *it1;
		int a1 = *it1;
		long long sum2 = (n / 2) * (2 * a1 + d * (n - 1));
		if (sum2 == sum) {
			for (it1; it1 != set1.end(); ++it1) {
				cout << *it1 << " ";
			}
			break;
		}
		else {
			set1.insert(vec[i]);
		}
	}
}

Compilation message

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:32:9: warning: statement has no effect [-Wunused-value]
   32 |    for (it1; it1 != set1.end(); ++it1) {
      |         ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 1228 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 185 ms 7892 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -