Submission #524438

# Submission time Handle Problem Language Result Execution time Memory
524438 2022-02-09T08:28:10 Z maks007 Table Tennis (info1cup20_tabletennis) C++14
20 / 100
3000 ms 4596 KB
#include <bits/stdc++.h>
 
using namespace std;
 #define break_it (1/0)
int main(void) {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n, k;
	cin >> n >> k;
	vector <int> a(n+k);
	function <int(vector <int>)> check=[&](vector <int> s) {
		for(int i = 0; i < n; i ++) {
			int j = i + 1;
			if(j >= n or n - i - 1 < 0 or n - j - 1 < 0) break;
			if(s[i] + s[n-i-1] == s[j]+s[n-j-1]) continue;
			return 0;
		}
		return 1;
	};
	for(int i = 0; i < n+k; i ++) cin >> a[i];
	if(k == 1) { 
		for(int i = 0; i < n + k; i ++) {
			vector <int> v;
			for(int j = 0; j < n + k; j ++) {
				if(i == j) continue;
				v.push_back(a[j]);
			}
			if(check(v)){
				for(auto i : v) cout << i << " ";
				return false;
			}
		}
	}else if(n+k<=18) {
		for(int i = 0; i < n; i ++) cout << a[i] << " ";
	}else {
		break_it;
		int l = 0, r = n+k-1;
		while(1) {
			if(a[l] + a[r] == a[l+1]+a[r-1]) {

			}
		}
	}
	return false;
}  

Compilation message

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:4:21: warning: division by zero [-Wdiv-by-zero]
    4 |  #define break_it (1/0)
      |                    ~^~
tabletennis.cpp:36:3: note: in expansion of macro 'break_it'
   36 |   break_it;
      |   ^~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 8 ms 360 KB Output is correct
3 Correct 8 ms 324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 633 ms 964 KB Output is correct
2 Correct 28 ms 4596 KB Output is correct
3 Execution timed out 3057 ms 4252 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3099 ms 2124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3071 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 3071 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3067 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3050 ms 316 KB Time limit exceeded
2 Halted 0 ms 0 KB -