Submission #636029

#TimeUsernameProblemLanguageResultExecution timeMemory
636029shafinalamTarifa (COCI16_tarifa)C++14
50 / 50
1 ms324 KiB
#include "bits/stdc++.h" using namespace std; #define pb push_back #define ff first #define ss second #define endl "\n" #define mod 1000000007 #define int long long #define double long double #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define what_is(x) cerr << #x << " is " << x << endl; const int N=200005; const int LOG=20; typedef pair<int,int> pii; typedef long long ll; //sunlari dusun// /* * kodu kisaltcak fonksiyon * cevaba binary search ya da normal bs * segment tree / sparse table * stack * teklik ciftlik * precomputation * EN ONEMLISI OVERKILLEME * edge case dusunr * constraintlere bak * indisleri kontrol et * dp * greedy * sorting * dfs bfs * sieve */ void solve(){ int x,n;cin >> x >> n; int sum=0; for(int i=0;i<n;i++) { int a;cin >> a;sum+=a; } cout << (n+1)*x-sum << endl; } int32_t main(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); int t=1;//cin>> t; while(t--) solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...