Submission #1986073
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]; } vi vv; 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 | 200 |
Code Size | 986 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 1 ms | 256 KB |
0_001.txt | AC | 1 ms | 256 KB |
0_002.txt | AC | 1 ms | 256 KB |
1_003.txt | AC | 1 ms | 256 KB |
1_004.txt | AC | 1 ms | 256 KB |
1_005.txt | AC | 1 ms | 256 KB |
1_006.txt | AC | 1 ms | 256 KB |
1_007.txt | AC | 1 ms | 256 KB |
1_008.txt | AC | 1 ms | 256 KB |
1_009.txt | AC | 1 ms | 256 KB |