# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004786 | sam__in07 | Tarifa (COCI16_tarifa) | C++14 | 28 ms | 524 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
⣿⣿⣿⣿⡿⠟⠛⠋⠉⠉⠉⠉⠉⠛⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⠟⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠈⠙⠾⣿⣾⣿⣾⣿⣾⣿⣾⣿
⠋⡁⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⢀⠠⠐⠈⠁⠀⠀⠁⠀⠈⠻⢾⣿⣾⣿⣾⣟⣿
⠊⠀⠀⠀⠀⢀⠔⠃⠀⠀⠠⠈⠁⠀⠀⠀⠀⠀⠀⠆⠀⠀⠄⠀⠙⣾⣷⣿⢿⣿
⠀⠀⠀⠀⡠⠉⠀⠀⠀⠀⠠⢰⢀⠀⠀⠀⠀⠀⠀⢰⠀⠀⠈⡀⠀⠈⢿⣟⣿⣿
⠀⠀⢀⡜⣐⠃⠀⠀⠀⣠⠁⡄⠰⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠰⠀⠀⠈⢿⣿⣿
⠀⢠⠆⢠⡃⠀⠀⠀⣔⠆⡘⡇⢘⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿
⢀⡆⠀⡼⢣⠀⢀⠌⢸⢠⠇⡇⢘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿
⣼⣃⠀⠁⢸⢀⠎⠀⢸⠎⠀⢸⢸⡄⠀⠀⠀⠀⠀⠂⢀⠀⠀⠀⠀⠀⠀⠀⠀⣿
⠃⡏⠟⣷⣤⠁⠀⠀⠸⠀⠀⡾⢀⢇⠀⠀⠀⠀⠀⠄⠸⠀⠀⠀⠀⠄⠀⠀⠀⣿
⠀⠀⣀⣿⣿⣿⢦⠀⠀⠀⠀⡧⠋⠘⡄⠀⠀⠀⠀⡇⢸⠀⠀⠠⡘⠀⠀⠀⢠⣿
⠈⠀⢿⢗⡻⠃⠀⠀⠀⠀⠀⠀⠀⠀⠱⡀⠀⠀⢰⠁⡇⠀⠀⢨⠃⡄⢀⠀⣸⣿
⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣱⠀⠀⡎⠸⠁⠀⢀⠞⡸⠀⡜⢠⣿⣿
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣺⣿⣧⢰⣧⡁⡄⠀⡞⠰⠁⡸⣠⣿⣿⣿
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⡿⠏⣿⠟⢁⠾⢛⣧⢼⠁⠀⠀⢰⣿⡿⣷⣿
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠡⠄⠀⡠⣚⡷⠊⠀⠀⠀⣿⡿⣿⡿⣿
⡀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠁⢸⠁⠀⠀⠀⢰⣿⣿⡿⣿⣿
⠱⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠊⠀⠀⠀⡞⠀⠀⠀⠀⢸⣿⣷⣿⣿⣿ /*"kawaiiiiiii!!!!!!!!!!!"*\
⠀⠙⢦⣀⠀⠀⠀⠀⠀⢀⣀⣠⠖⠁⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⣸⣿⣾⡿⣷⣿
⠀⠀⠀⠀⠉⠉⣩⡞⠉⠁⠀⢸⡄⠀⠀⠀⠀⠀⢰⠇⠀⠀⠀⠀⣿⣿⣷⣿⣿⣿
⡆⠀⠀⣀⡠⠞⠁⣧⢤⣀⣀⣀⡇⠀⠀⠀⠀⠀⣸⠀⠀⠀⠀⠀⣿⣷⣿⣷⣿⣿
⣿⣷⠊⠁⠀⠀⡰⠁⠀⠀⠀⠀⣹⠶⢦⡀⠀⠀⡇⠀⠀⠀⠀⠀⢸⣿⣷⣿⣷⣿
⣿⢿⠀⠀⠀⡔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⡄⡇⠀⠀⠀⠀⠀⠈⣿⣾⣷⣿⣿
⠋⠈⠀⢀⠜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠈⣧⠀⠀⠀⠀⠀⠀⠻⣿⣽⣾⣿
⢀⡄⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠁⠀⠀⠀⣸⠀⠀⠀⠀⠀⠀⠀⣿⣿⣻⣿
⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⢰⠀⠐⠀⠀⠀⠀⣀⡿⠀⠀⠀⠀⠀⠀⠀⢹⣿⣻⣿
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼⠀⠀⠀⠀⠀⢀⣃⡇⠀⠲⡀⠀⠀⠀⠀⠈⣿⡿⣿
⣀⠤⠤⠤⡀⠀⠀⠀⠀⡴⠃⠀⠀⠀⠀⠀⢬⠞⡇⠀⠀⠇⠀⠀⠀⠀⠀⣿⣿⣿
⡁⢀⠀⠀⡇⠀⠀⠀⡼⠁⠀⠀⠀⠀⠀⣸⠁⠀⠇⠀⠀⡇⠀⠀⠀⠀⠀⣿⣿⣿
⠔⠃⠀⠀⡇⠀⠀⡼⠁⠀⠀⠀⠀⠀⢀⡇⠀⠀⡃⠀⠀⠙⢄⠀⠀⠀⠀⣿⣷⣿
⠒⠊⠀⠀⢸⠀⣸⠃⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⢅⠀⠀⡂⠸⡄⠀⠀⠀⣿⣟⣿
⠓⠀⠉⠀⢸⣰⠃⠀⠀⠀⠀⠀⠀⡜⡆⠀⠀⠀⢸⠀⠀⡇⢀⠇⠀⠀⠀⣿⣿⣿
⠉⠁⠀⢠⠞⠀⠀⠀⠀⠀⠀⠀⣰⠁⡇⠀⠀⠀⡇⠀⠀⡇⢸⠀⠀⠀⠀⣿⣷⣿
⡀⠀⢀⢿⣥⡤⠤⠤⠤⣀⣀⢠⠇⠀⢸⠀⠀⢰⠁⠀⢨⠀⢸⠀⠀⠀ ⣿⣟⣿
*/
/*
/* writer : chainsa_min *\
time : 20:45:34
*/
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// hellow it's me .. "me ?" you beloved bastard_chao_min :] and tnx to you for reading my code
#define ll long long
#define maxi 1e17
#define MOD 1e9 + 7
#define pie 3.14159265358979323846264338327
#define nissan for (i=0; i<n; i++)
#define skyline for(i=1;i<=n;i++)
#define AE86 for(i=0;i<n-1;i++)
#define Rx7 for(i=1;i<n;i++) //Mazda RX-7 Savana.
#define in cin>>n
#define on string s
#define up cin >> s
#define be(v) v.begin(), v.end()//v(n)
#define sbe(v); sort( v.begin(), v.end())//v(n)
/* ´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´HELLO´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´ */
/* _________________________It's Me DEADPOOL!! (>‿◠)✌´ _________________________*/
#define mii map<int,int>v;
#define mcl map<char,ll>
#define msl map<string,ll>
#define emb emplace_back
#define mpi make_pair
#define seti pair<ll,ll>
#define pub push_back
#define vei vector<int>
#define ves vector<string>
#define vec vector<char>
#define vpl vector<seti>
#define deq deque<ll>
#define maxv(a,b) (a)=max((a),(b)) // set a to the maximum of a and b
#define minv(a,b) (a)=min((a),(b));
#define debv(v) for(auto it : v) cout << it << " ";
#define deb(x) cout << #x << " = " << x << " ";
#define vel vector<ll>
#define bv2 bitset<14> b(v[i])//2^n = x n = 16 32 64 ......
#define b32 bitset<32>
#define chifuyu iota(v.begin(), v.end(), 1)
#define mustano accumulate(v.begin(), v.end(), 0LL)
#define sei set<ll>
#define mappa map<ll,ll>
#define sj7 ara[n]
#define supra ara[i]
#define matsuno nissan { cin >> ara[i] ;}
#define dazai nissan {cin >> v[i];}
#define dbg(a) cerr << __LINE__ << ": " << #a << " = " << a << '\n'
#define optimus_prime vector<int>::iterator it
#define flash cout << *it << endlll // if(*it==n) *it = x (x replacing n && sit on this place)
#define nsx_r cin >> ara[i]
#define evo n = s.size();
#define ash ll j , i, n , m ,sums , a , b, c,d, val_stor , val_stor1 , val_stro2 , val_stor3 , count_kor = 0 , k , sum = 0 , x , y, z , count_kor_1 = 0
#define gtr '\n'
// double sub_x = pow(x1 - x2, 2);
#define chainsaw cout << "YES" <<gtr
#define vapub nissan { cin >> x; v.pub(x);}
#define man cout << "NO"<<gtr
#define se ' '
#define se2 " "
#define tithi s.begin(), s.end() // dont think she my gf -;( she is mine own little sister -:}
#define mitsuha_wifu ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define kyouka_chan freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define folafol(x) cout << x << gtr ;
#define folafol_1(x,y) cout << x << se2 << y ;
#define she(a,b,i) for (ll i = a; i < b; i++)
#define her(a,b,i) for (ll i = a; i <=b; i++)
#define bjt(a,b,i) for(ll i = a ; i>=b ; i-- )
#define ss second
#define println(x) cout << x << gtr ;
#define folafol_2(x,y) cout << x << " " << y ; cout << gtr ;
#define sayonara return 0
#define lancer_ ll guts ; cin >> guts ; while(guts--)
//---------------------------start---------------------------------
// const int MOD = 1e9 + 7;
// double average = static_cast<double>(sum) / n;
// sort(a(v), greater<ll>()); means reverse(a(v)) ;
ll binarySearch(ll array[], ll x, ll low, ll high) {
while (low <= high) {
int mid = low + (high - low) / 2;
if (array[mid] == x)
return mid;
if (array[mid] < x)
low = mid + 1;
else
high = mid - 1;
}
return -1;
}
bool comp_are (seti a , seti b) {
if(a.first==b.first){
return a.second<b.second ;
}
else
return a.first > b.first;
}
bool comps (seti a , seti b) {
if((a.first == b.first))
return (a.second > b.second);
else
return (a.first<b.first) ;
}
// for 2 pointer l = 0 r= n-1 \
ll tringle(ll a , ll b, ll c ) {
if((a+b)>c && (b+c)>a && (c+a)>b)
{
return 1 ;
}
else return 0 ;
}
ll segment (ll a , ll b, ll c ) {
if((a+b)==c || (b+c)==a || (c+a)==b)
{
return 1 ;
}
else return 0 ;
}
ll N = 500;
int main (){
mitsuha_wifu ;
bool flag = 0 ; // true
#ifndef ONLINE_JUDGE
kyouka_chan ;
#endif
//lancer_
{
ash;
in >> m;
n*=(m+1);
for(i=0;i<m;i++){
cin>>a ;
n-=a;
}
println(n);
return 0;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |