Submission #1986072


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 32);
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/


int main() {
    cin >> m >> n;
    vi v(n);
    REP(i,n) {
        cin >> v[i];
    }
    REP(i,n){
        ll a = 2 * v[i] - 1 - m;
        vv.push_back(a);
    }
    vv.push_back(sum);
    sort(ALL(vv));
    cout << vv.back() << endl;
}

Submission Info

Submission Time
Task B - K Cakes
User tettchan
Language C++14 (GCC 5.4.1)
Score 0
Code Size 974 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:37:9: error: ‘vv’ was not declared in this scope
         vv.push_back(a);
         ^
./Main.cpp:39:5: error: ‘vv’ was not declared in this scope
     vv.push_back(sum);
     ^