Submission #690921

#TimeUsernameProblemLanguageResultExecution timeMemory
690921vladiliusTable Tennis (info1cup20_tabletennis)Cpython 3
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
bool check(vector<ll> a){
    int n = a.size();
    ll k = a[0] + a.back();
    for (int i = 1; i < n - i - 1; i++){
        if (a[i] + a[n - i - 1] != k){
            return false;
        }
    }
    return true;
}
 
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
 
	int n, k; cin>>n>>k;
    vector<ll> a(n + k);
    for (int i = 0; i < n + k; i++){
        cin>>a[i];
    }
    
    for (int i = 0; i < k; i++){
        vector<ll> b;
        for (int j = 0; j < n; j++){
            b.push_back(a[i + j]);
        }
        if (check(b)){
            for (int j: b){
                cout<<j<<" ";
            }
            return 0;
        }
    }
}

Compilation message (stderr)

File "tabletennis.py", line 2
    using namespace std;
          ^
SyntaxError: invalid syntax