akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int const N = 100 * 1000 + 16;

int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);

  int n;
  cin >> n;
  vector<int> a(n);
  
  int sum = 0;
  int mn = 1000 * 1000;
  for(int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
    if(a[i] % 10)
      mn = min(mn, a[i]);
  }

  if(sum % 10) {
    cout << sum << endl;
  } else if(mn != 1000 * 1000) {
    cout << sum-mn << endl;
  } else {
    cout << 0 << endl;
  }
}

Measured memory_bytes: 256
/*
By Tianyi Chen. All rights reserved.
Date: 2017-01-28
*/
#include<bits/stdc++.h>
using namespace std;
int ans,pcnt,t;
map<int,int>m;
int main() {
 int n;scanf("%d",&n);for(int i=0;i<n;++i) {
  scanf("%d",&t);++m[t];
 }
 for(auto&&x:m) {
  if(x.second>1) {
   if(x.second&1)n-=x.second-1;
   else ++pcnt,n-=x.second-2;
  }
 }
 cout<<n-pcnt-(pcnt&1);
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define int long long
#define INT_MAX INT64_MAX
#define INT_MIN INT64_MIN
#define PI 3.14159265358979323846
#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main
#define MOD 1000000007
/* DEFINE cout */
#define pln cout << "===============================\n"
#define on cout<<"\n"
#define os cout<<" "
#define o2(a,b) cout<<a<<" "<<b
#define o(a) cout << a
#define bitcount __builtin_popcount
/* DEFINE cout */
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);//fastio
using namespace std;
struct hash_pair { // use pair as key in unordered_map<pair<int,int>,int,hash_pair>;
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
bool prime[10000001];
int P=MOD-2;
int factorial[10000001]={0};
int powerFunction(int x,int y){
    int res = 1;
    int p = MOD;
    x = x % p;
    while (y > 0){
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
void sieveFunction(int maxLimit){
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1]=false;
    for(int i=2; maxLimit >= i ; i++){
        if(prime[i]){
            for(int j=2*i ; maxLimit >= j ; j+=i)
                prime[j]=false;
        }
    }
}
void factorialFunction(int maxLimit){
    factorial[0]=1;
    for(int i=1 ; i <= maxLimit ; i++)
        factorial[i]=(factorial[i-1]*i)%MOD;
    return;
}
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int n, m, k;
int arr[7][7];
int ans = 0;
int rows[7];
int col[7];
void fun2(int id){
    
    int cnt = 0;
    for(int i=0; n>i; i++){
        for(int j=0; m>j; j++){
            if(rows[i] == 0 && col[j] == 0){
                if(arr[i][j] == 1){
                    cnt++;
                }
            }
        }
    }
    if(cnt == k){
        ans++;
    }
    
    
    for(int i=id; m>i; i++){
        col[i] = 1;
        fun2(i+1);
        col[i] = 0;
    }
}
void fun(int id){
    
    memset(col, 0, sizeof(col));
    fun2(0);
    
    for(int i=id; n>i; i++){
        rows[i] = 1;
        fun(i+1);
        rows[i] = 0;
    }
}
signed main(){
    cin >> n >> m >> k;
    for(int i=0; n>i; i++){
        string str;
        cin >> str;
        for(int j=0; m>j; j++){
            if(str[j] == '.'){
                arr[i][j] = 0;
            }else{
                arr[i][j] = 1;
            }
        }
    }
    fun(0);
    cout << ans << endl;
}






Measured memory_bytes: 3612
class UnionFindTree
  attr_accessor :rank, :parent

  def initialize(size)
    @rank = Array.new(size, 0)
    # @parent = (0..(size-1)).to_a
    @parent = Array.new(size, &:itself)
  end

  def unite(id_x, id_y)
    x_parent = get_parent(id_x)
    y_parent = get_parent(id_y)
    return false if x_parent == y_parent

    if @rank[x_parent] == @rank[y_parent]
      @parent[y_parent] = x_parent
      @rank[y_parent] += 1
    elsif @rank[x_parent] < @rank[y_parent]
      @parent[x_parent] = y_parent
    else # @rank[x_parent] > @rank[y_parent]
      @parent[y_parent] = x_parent
    end
    return true
  end

  def get_parent(index)
    @parent[index] == index ? index : (@parent[index] = get_parent(@parent[index]))
  end

  def same_parent?(id_x, id_y)
    get_parent(id_x) == get_parent(id_y)
  end
end

# 7 4 4   n k l
# 1 2     p_1 q_1
# 2 3
# 2 5
# 6 7     p_k q_k
# 3 5     r_1 s_1
# 4 5
# 3 4
# 6 7     r_l s_l

n, k, l = gets.split.map(&:to_i)
array_roads = k.times.map{ gets.split.map(&:to_i).map(&:pred) }
array_rails = l.times.map{ gets.split.map(&:to_i).map(&:pred) }

tree_roads = UnionFindTree.new(n)
tree_rails = UnionFindTree.new(n)

array_roads.each do |a, b|
  tree_roads.unite(a, b)
end
array_rails.each do |a, b|
  tree_rails.unite(a, b)
end

array_pair = []
hash_count = Hash.new(0)
array_ans = []

n.times do |i|
  parent_road = tree_roads.get_parent(i)
  parent_rail = tree_rails.get_parent(i)
  array_pair[i] = [parent_road, parent_rail]
  hash_count[ array_pair[i] ] += 1
end

array_pair.each do |pair|
  array_ans << hash_count[pair]
end

puts array_ans.join(" ")


Measured memory_bytes: 53432
def evenEven(d1, d2):
    return d1//2 + d2//2

# tmpInput = "2 6 3\n"
# inDatas = tmpInput.strip('\n').split(' ')
inDatas = input().strip('\n').split(' ')

inDatas = list(map(int, inDatas))
inDatas.sort()
A = inDatas[0]
B = inDatas[1]
C = inDatas[2]

diff1 = C - A
diff2 = C - B

if not diff1%2 and not diff2%2:
    print(evenEven(diff1, diff2))
elif (diff1%2 and not diff2%2) or (not diff1%2 and diff2%2):
    print(2+evenEven(diff1, diff2))
else:
    print(1+evenEven(diff1, diff2))

Measured memory_bytes: 3064
import math

N,M = map(int,input().split())

AC_count = 0
WA_count =  0

check_list = [0 for i in range(N+1)]

for _ in range(M):
  i, res =  map(str,input().split())
  i = int(i)
  if check_list[i] == "AC":
    pass
  else:
    if res == "WA":
      check_list[i] += 1
    else:
      AC_count += 1
      WA_count += check_list[i]
      check_list[i] = "AC"
    
  
print(AC_count,WA_count)

Measured memory_bytes: 54816
///who is the king ??? *** << t.mohammad >> *** ///
/*
                  00                                                                                                            00
                 00                               00                                                                           00
            0000000000                           00                                                                           00
           0000000000   000       000           00                        000       000  000       000                       00
              00       0000     0000           00         000000         0000     0000  0000     0000   000000              00
             00       00 00   00 00    000    00        00000000        00 00   00 00  00 00   00 00  00000000       00000000
            00       00  00 00  00   00000   000000    00    000       00  00 00  00  00  00 00  00  00    000     0000000000
           00       00   000   00  00   00  00000000  00    0000      00   000   00  00   000   00  00    0000    00     0000
          00       00         00  00   00  00    00  00    00 00     00         00  00         00  00    00 00   00     00 00
         00  00   00         00   00000   00    00  00000000  00    00         00  00         00  00000000  00  000000000  00
        00  00   00         00    000    00    00   000000    00   00         00  00         00   000000    00  0000000    00
*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std ;
#define int long long int
typedef long double ld ;
#define ff first
#define ss second
#define setp(t) cout << setprecision(t) << fixed ; 
int const N = 1e5 + 100 ;
int a[N] , b[N] , c[N] , dp[N][3] ;
int32_t main() {
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
	int n ;
	cin >> n ;
	for (int i = 0 ; i < n ; i++) {
		cin >> a[i] >> b[i] >> c[i] ;
	}
	dp[0][0] = a[0] ;
	dp[0][1] = b[0] ;
	dp[0][2] = c[0] ;
	for (int i = 1 ; i < n ; i++) {
		dp[i][0] = max(dp[i - 1][1] + a[i] , dp[i - 1][2] + a[i]) ;
		dp[i][1] = max(dp[i - 1][0] + b[i] , dp[i - 1][2] + b[i]) ;
		dp[i][2] = max(dp[i - 1][0] + c[i] , dp[i - 1][1] + c[i]) ;
	}
	cout << max(dp[n - 1][0] , max(dp[n - 1][1] , dp[n - 1][2])) ;
}


Measured memory_bytes: 4992
import Control.Applicative
import Control.Monad
import Data.List
main = do
  [n,m]<- map (read::String->Int).words <$> getLine
  rows <-  map (map (read::String->Int) .words) <$> (replicateM n getLine)
  b <- map (read::String->Int) <$> (replicateM m getLine)
  putStr $ unlines $ map (\r-> show $ sum (zipWith (*) r b)) rows

Measured memory_bytes: 7492
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll L,N; cin >> L >> N;
    vector<ll> X(N);
    rep(i,N) cin >> X[i];

    ll ans = 0;
    auto solve=[&]() {
        vector<ll> S(N+1);
        rep(i,N) S[i+1] += S[i] + X[i];
        auto get=[&](int l, int r) {return S[r] - S[l];};

        rep(i,N) {
            ll val = L*(N-1-i);
            if ((N-1-i)&1) {
                int mid = (N+i+1)/2;
                val += get(i,mid)*2 - get(mid,N)*2;
                val += X[mid];
                chmax(ans,val);
            } else {
                int mid = (N+i+1)/2;
                val += get(i,mid)*2 - get(mid,N)*2;
                val -= X[mid-1];
                chmax(ans,val);
            }
        }
    };

    solve();
    rep(i,N) X[i] = L-X[i];
    reverse(all(X));
    solve();
    cout << ans << ln;
}


Measured memory_bytes: 6368
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    static void Main()
    {
        var sc = new Scanner();

        var ring = sc.String();
        int n = sc.Int();
        Enumerable.Range(0, n)
            .Select(_ => sc.String())
            .Select(x => x + x)
            .Where(x => x.Contains(ring))
            .Count()
            .Print();

        Console.ReadKey();
    }
}

static class Extensions
{
    public static IEnumerable<T> Output<T>(this IEnumerable<T> source)
    {
        foreach (var item in source)
        {
            Console.WriteLine(item);
        }
        return source;
    }

    public static T Print<T>(this T obj)
    {
        Console.WriteLine(obj);
        return obj;
    }
}

public class Scanner
{
    public Scanner()
    {
        byte[] inputBuffer = new byte[1024];
        System.IO.Stream inputStream = Console.OpenStandardInput(inputBuffer.Length);
        Console.SetIn(new System.IO.StreamReader(inputStream, Console.InputEncoding, false, inputBuffer.Length));
    }
    string[] buffer = new string[0];
    int index = 0;
    public char[] SplitChars { get; set; }
    public string String()
    {
        if (index < buffer.Length) return buffer[index++];
        string line = "";
        while (line == "") line = Console.ReadLine();
        if (line == null) return null;
        buffer = line.Split(SplitChars, StringSplitOptions.RemoveEmptyEntries);
        index = 0;
        return buffer[index++];
    }
    public string[] StringArray(int count) { return NextArray(count, x => x); }
    public void Skip(int count) { for (int i = 0; i < count; i++) String(); }
    public T Next<T>(Func<string, T> parser) { return parser(String()); }
    public T[] NextArray<T>(int count, Func<string, T> parser)
    {
        var arr = new T[count];
        for (int i = 0; i < count; i++) arr[i] = Next(parser);
        return arr;
    }
    public int Int() { return Next(int.Parse); }
    public int[] IntArray(int count) { return NextArray(count, int.Parse); }
    public double Double() { return Next(double.Parse); }
    public double[] DoubleArray(int count) { return NextArray(count, double.Parse); }
}

Measured memory_bytes: 10212
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second > b.second;
    }
}

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) { 
        os << v[i]; 
        if (i != (int)v.size() - 1) 
            os << " "; 
    } 
    return os; 
} 

int main()
{
    ll N, C;
    cin >> N >> C;
    vector<vector<ll>> D(C, vector<ll>(C,0));
    rep(i, C) {
        rep(j, C) {
            cin >> D[i][j];
        }
    }
    vector<vector<ll>> G(3, vector<ll>(C, 0));
    rep(i, N) {
        rep(j, N) {
            ll tmp;
            cin >> tmp;
            G[(i+j)%3][tmp-1]++;
        } 
    }
    ll mi = INF;
    rep(i,C) {
        rep(j, C) {
            if (i == j) continue;
            rep(k, C) {
                if (i == k || j == k) continue;
                ll sum = 0;
                rep(l, C) {
                    sum += D[l][i] * G[0][l];
                    sum += D[l][j] * G[1][l];
                    sum += D[l][k] * G[2][l];
                }
                mi = min(mi, sum);
            }
        }
    }
    print(mi);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
int n, ai[N];
int comp(int a, int b) {return a > b;}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; ++ i) cin >> ai[i];
    sort(ai + 1, ai + n + 1, comp);
    for (int i = 1; i <= n + 1; ++ i) if (i > ai[i])
    {
        int win = 0;
        if (((ai[i - 1] - (i - 1)) & 1)) win = 1;
        int c = 0;
        for (int j = i - 1; ai[j + 1] >= i - 1; ++ j, ++ c);
        if ((c & 1)) win = 1;
        if (win) cout << "First\n"; else cout << "Second\n";
        return 0;
    }

}


Measured memory_bytes: 640
#include <stdio.h>
int main(){
    int S;
    scanf("%d",&S);
    int h=S/3600;
    int m=(S-3600*h)/60;
    int s=(S-3600*h-60*m);
    
    
    
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define rep(i, n)  for (int i = 0; i < (n); ++i )
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(){
    string S, ans;
    cin >> S;

    ans = "No";

    if((S.at(2) == S.at(3)) && (S.at(4) == S.at(5))){
        ans = "Yes";
    } 

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

int quick(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int main(void) {
    int d[3];

    if(scanf("%d %d %d", &d[0], &d[1], &d[2]) == 1);

    qsort(d, 3, sizeof(int), quick);

    printf("%d", d[2]*10+d[1]+d[0]);

    return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <climits>

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int n;
vector<string> vec;

void solve() {
    vec.clear();
    vec.reserve(n);
    rep(i,n) {
        string s;
        cin>>s;
        vec.pb(s);
    }
    rep(i,n) {
        rep(j,vec[i].size()) {
            if(vec[i][j]!='.') continue;
            if(vec[i][j+1]!='.') vec[i][j]='+';
        }
    }
    rep(i,n) {
        rep(j,vec[i].size()) {
            if(vec[i][j]!='+') continue;
            int idx=-1;
            for(int k=i+1;k<n;k++) {
                if(vec[k].size() <= j) break;
                if(vec[k][j]=='+') {
                    idx=k;
                    break;
                }
                if(vec[k][j]!='.') break;
            }
            if(idx!=-1) {
                for(int k=i+1;k<idx;k++) vec[k][j]='|';
            }
        }
    }
    rep(i,n) rep(j,vec[i].size()) if(vec[i][j]=='.') vec[i][j]=' ';
    rep(i,n) cout<<vec[i]<<endl;

}

int main() {
    while(cin>>n) {
        if(n==0) break;
        solve();
    }
    return 0;
}

Measured memory_bytes: 1864
import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto n = readln.chomp.to!size_t;
  auto rci = iota(n).map!(_ => readln.split.to!(size_t[])).array;

  auto memo = new size_t[][](n, n + 1);
  memo.each!(a => a[] = size_t.max);

  size_t dp(size_t s, size_t t)
  {
    if (memo[s][t] < size_t.max)
      return memo[s][t];

    if (t - s <= 1)
      return 0;

    auto minP = size_t.max;
    foreach (i; s+1..t) {
      auto p = dp(s, i) + dp(i, t) + rci[s][0] * rci[t-1][1] * rci[i][0];
      minP = min(minP, p);
    }

    return memo[s][t] = minP;
  }

  writeln(dp(0, n));
}

Measured memory_bytes: 2496
#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define vi vector<int>
#define ii pair< int , int >
#define vii vector<ii>
#define FOR(i, n) for(ll i = 0; i < (ll)n; i++)
int MAX(int a, int b){return (a > b) ? a:b;}
int MIN(int a, int b){return (a < b) ? a:b;}
int ABS(int x){return (x > 0) ? x:-x;}
int left(int x){return (x<<1);}
int right(int x){return (x<<1)+1;}
int lsone(int x){return (x&(-x));}

const int maxn = 405;
const ll INF = 1e18;

int n, a[maxn];
ll sum[maxn];
ll ans[maxn][maxn];
bool found[maxn][maxn];

ll getSum(int l, int r){
	return sum[r] - ((l > 0) ? sum[l-1]:0);
}

ll dp(int l, int r){
	if(l == r) return 0;
	if(found[l][r]) return ans[l][r];
	found[l][r] = true;
	ans[l][r] = INF;
	for(int i = l; i < r; i++){
		ans[l][r] = min(ans[l][r], dp(l, i)+dp(i+1, r)+getSum(l, r));
	}
	return ans[l][r];
}

int main(){
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%d", &a[i]);
		sum[i] = a[i];
		if(i) sum[i] += sum[i-1];
	}
	printf("%lld\n", dp(0, n-1));
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

//実行部
void Main()
{
  ll n, m, x; cin >> n >> m >> x;
  ll ans = 0, s = 0;
  vll a(m); rep(i, m) { cin >> a[i]; if(a[i] > 0&&a[i] < x) ans++; if(a[i] > x&&a[i] < n) s++;}
  fin(min(ans, s))
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int a,x;
	scanf("%d",&a);
	
	if(a>10)
	{
		x=a%10;
	}
	else
	{
		x=a;
	}
	
	
	switch(x)
	{
		case(1):
			printf("pon");
			break;
		case(2):
			printf("hon");
			break;
		case(3):
			printf("bon");
			break;
		case(4):
			printf("hon");
			break;
		case(5):
			printf("hon");
			break;
		case(6):
			printf("pon");
			break;
		case(7):
			printf("hon");
			break;
		case(8):
			printf("pon");
			break;
		case(9):
			printf("hon");
			break;
		case(0):
			printf("pon");
			break;
		default:
			printf("Defualt");
			break;
	}
	
}

Measured memory_bytes: 1708
#include <iostream>
#include<cstring>
#include<bits/stdc++.h>
using namespace std;
long int lcm(long int a,long int b)
{
    return a/__gcd(a,b)*b;
    
}

int main() {
	// your code goes here
	long int n;
	cin>>n;
	long int sol;
	cin>>sol;
	long int a;
	for(int i=1;i<n;i++)
	{
	    cin>>a;
	sol=lcm(sol,a);
	}
	cout<<sol;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

const int N = 100005;

int n, a[N];
bool t;

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < n; ++i) cin >> a[i];
	while (1) {
		bool sum = 0;
		for (int i = 0; i < n; ++i) {
			sum ^= (a[i] - 1) & 1;
		}
		if (sum) {
			if (!t) cout << "First";
			else cout << "Second";
			return 0;
		}
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cnt += a[i] & 1;
		}
		int cnt1 = 0;
		for (int i = 0; i < n; ++i) {
			cnt1 += a[i] == 1;
		}
		if (cnt == 1 && !cnt1) {
			int gcd = 0;
			for (int i = 0; i < n; ++i) {
				if (a[i] & 1) a[i]--;
				gcd = __gcd(gcd, a[i]);
			}
			for (int i = 0; i < n; ++i) {
				a[i] /= gcd;
			}
		}
		else {
			t ^= 1;
			if (!t) cout << "First";
			else cout << "Second";
			return 0;
		}
		t ^= 1;	
	}
}

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string a, b, c;
	cin >> a >> b >> c;

	int sza = a.size();
	int szb = b.size();
	int szc = c.size();

	char turn = 'a';
	int i = 0, j = 0, k = 0;
	while (true) {
		if (turn == 'a') {
			if (i == sza) {
				cout << "A\n";
				return 0;
			}

			turn = a[i++];
 		}
		else if (turn == 'b') {
			if (j == szb) {
				cout << "B\n";
				return 0;
			}

			turn = b[j++];
		} else {
			if (k == szc) {
				cout << "C\n";
				return 0;
			}

			turn = c[k++];
		}
	}

	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>
#include <bitset>

using namespace std;

/* template */

using ll = long long;

void debug_out() { std::cout << std::endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, a, n) for (int i = ((int)(n-1)); i >= (int)(a); i--)
#define Rep(i, a, n) for (long long i = (long long)(a); i< (long long)(n); i++)
#define RRep(i, a, n) for (long long i = ((long long)(n-1ll)); i>=(long long)(a); i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}

struct Edge{
    int to;
    ll weight;
    Edge(int t, ll w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    ll weight;
    edge(int f,int t,ll w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

template <class T>
inline bool chmin(T &a, T b){
    if (a > b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b){
    if (a < b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}

constexpr ll LNF = 1LL<<50;

constexpr int INF = 1e9+7;

const long double PI=3.14159265358979323846;


vector<int> dx = {1,0,-1,1,-1,0};
vector<int> dy = {1,1,1,0,0,-1};

/* template */

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> a(4,0);
    vector<string> s = {"AC","WA","TLE","RE"};
    rep(i,0,n){
        string b; cin >> b;
        rep(j,0,4){
            if(s[j]==b){
                a[j]++;
            }
        }
    }
    rep(i,0,4){
        cout << s[i] << " " << "x " << a[i] << endl;
    }
}

Measured memory_bytes: 3676
#include <iostream>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  
  int zStart, oStart = 0;
  for (int i = 0; i < S.size(); i++) {
    zStart += i % 2 ? (S[i] != '1') : (S[i] != '0');
	oStart += i % 2 ? (S[i] != '0') : (S[i] != '1');
  }
  cout << min(zStart, oStart);
}


Measured memory_bytes: 512
from itertools import accumulate

N, K = map(int, input().split())
As = list(map(int, input().split()))

def getDivisors(x):
    anss = set()
    for d in range(1, int(x**0.5)+1):
        if x%d == 0:
            anss.add(d)
            anss.add(x//d)
    return sorted(anss)

sumA = sum(As)
divs = getDivisors(sumA)

def check(x):
    Bs = [A%x for A in As if A%x]
    if not Bs:
        return True
    Bs.sort()
    accNums = list(accumulate(Bs))
    accNumRevs = list(accumulate([x-B for B in reversed(Bs)]))[::-1]
    for i in range(len(Bs)-1):
        if accNums[i] == accNumRevs[i+1] and accNums[i] <= K:
            return True
    return False

for div in reversed(divs):
    if check(div):
        print(div)
        break


Measured memory_bytes: 42972
#include "bits/stdc++.h"

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<=(b);i++)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef long long ll;

void solve() {
#ifdef _WIN32
	istream &cin = ifstream("input.txt");
#endif

	string s;
	cin >> s;
	cout << (s.find_last_of('Z') - s.find('A') + 1) << endl;
}




int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	solve();
#ifdef _WIN32
	system("PAUSE");
#endif
	return 0;
}

Measured memory_bytes: 720
import java.util.*;

public class Main {
    public static int ABS(int a){
        return (a>0)?a:-a;
    }
    
    public static int shellsort(int[] X,int N){
    int count=0;
    int h;
    for(h=1;h<N/9;h=3*h+1){
      ;
    }
    
    for(;h>0;h/=3){
      for(int i=h;i<N;i++){
        int j;
        int tmp=X[i];
        for(j=i-h;j>=0&&tmp<X[j];j-=h){
          X[j+h]=X[j];
          count++;
        }
        X[j+h]=tmp;
        count++;
      }
    }
    return count;
  }
  
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int[] A=new int[N];
        int MINUS;
        
        for(int i=0;i<N;i++){
            A[i]=sc.nextInt()-i-1;
        }
        
        int S=shellsort(A,N);
        
        if(N%2==1){
            int CENTER=(N+1)/2;
            MINUS=A[CENTER-1];
        }else{
            int CENTER=(N+1)/2;
            MINUS=A[CENTER-1];
        }
        
        Long ANS=0L;
        
        for(int i=0;i<N;i++){
            ANS+=ABS(A[i]-MINUS);
        } 
      
        System.out.println(ANS);
    }
}


Measured memory_bytes: 65444
#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;

const int N = 100010;
const double eps = 1e-6;
const LL p = 1e15;

string s;
ULL k, sum;

bool qp(ULL a)
{
    ULL res = 1;
    ULL b = p;
    while(b)
    {
        if(b & 1) res = res * a;
        if(a > 1e9 || sum + a >= k) return true;
        a = a * a;
        b >>= 1;
    }
    sum += res;
    return false;
}

int main()
{
    cin >> s >> k;
    for(int i = 0; i < s.size(); i++)
    {
        ULL a = s[i] - '0';
        a = a * a;
        if(qp(a))
        {
            cout << s[i] << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(v) v.begin(),v.end()

const int maxn = 101;
const ll inf = 2e18, mod = 1e9 + 7;

int h, w;
short sumrow[maxn][maxn], sumcol[maxn][maxn], ZERO;
short dp[maxn][maxn][maxn][maxn];
char a[maxn][maxn];

inline short MAX(short a, short b)
{
	return (a < b ? b : a);
}

short get(int LEFT, int RIGHT, int UP, int DOWN, int x, int y, int X, int Y)
{
	if (x == X)
	{
		if (DOWN > x || h - UP - 1 < x)
			return 0;
		y = max(y, RIGHT);
		Y = min(Y, w - LEFT - 1);
		if (y > Y)
			return 0;
		return (sumrow[x][Y] - (y ? sumrow[x][y - 1] : ZERO));
	}
	if (y == Y)
	{
		if (RIGHT > y || w - LEFT - 1 < y)
			return 0;
		x = max(x, DOWN);
		X = min(X, h - UP - 1);
		if (x > X)
			return 0;
		return (sumcol[X][y] - (x ? sumcol[x - 1][y] : ZERO));
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	cin >> h >> w;
	for (int i = 0; i < h; i++)
		cin >> a[i];
	pair<int, int> pos = mp(-1, -1);
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
			if (a[i][j] == 'E')
				pos = mp(i, j);
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
		{
			sumrow[i][j] = (a[i][j] == 'o');
			if (j)
				sumrow[i][j] += sumrow[i][j - 1];
		}
	for (int i = 0; i < w; i++)
		for (int j = 0; j < h; j++)
		{
			sumcol[j][i] = (a[j][i] == 'o');
			if (j)
				sumcol[j][i] += sumcol[j - 1][i];
		}
	//cerr << '@' << pos.ff << ' ' << pos.ss << endl;
	for (int LEFT = 0; LEFT <= pos.ss; LEFT++)
		for (int RIGHT = 0; RIGHT < w - pos.ss; RIGHT++)
			for (int UP = 0; UP <= pos.ff; UP++)
				for (int DOWN = 0; DOWN < h - pos.ff; DOWN++)
				{
					if (LEFT < pos.ss)
						dp[LEFT + 1][RIGHT][UP][DOWN] = MAX(dp[LEFT + 1][RIGHT][UP][DOWN], 
								dp[LEFT][RIGHT][UP][DOWN] + get(LEFT, RIGHT, UP, DOWN, pos.ff - UP, pos.ss - LEFT - 1, pos.ff + DOWN, pos.ss - LEFT - 1));
					if (RIGHT < w - pos.ss - 1)
						dp[LEFT][RIGHT + 1][UP][DOWN] = MAX(dp[LEFT][RIGHT + 1][UP][DOWN], 
								dp[LEFT][RIGHT][UP][DOWN] + get(LEFT, RIGHT, UP, DOWN, pos.ff - UP, pos.ss + RIGHT + 1, pos.ff + DOWN, pos.ss + RIGHT + 1));
					if (UP < pos.ff)
						dp[LEFT][RIGHT][UP + 1][DOWN] = MAX(dp[LEFT][RIGHT][UP + 1][DOWN], 
								dp[LEFT][RIGHT][UP][DOWN] + get(LEFT, RIGHT, UP, DOWN, pos.ff - UP - 1, pos.ss - LEFT, pos.ff - UP - 1, pos.ss + RIGHT));
					if (DOWN < h - pos.ff - 1)
						dp[LEFT][RIGHT][UP][DOWN + 1] = MAX(dp[LEFT][RIGHT][UP][DOWN + 1], 
								dp[LEFT][RIGHT][UP][DOWN] + get(LEFT, RIGHT, UP, DOWN, pos.ff + DOWN + 1, pos.ss - LEFT, pos.ff + DOWN + 1, pos.ss + RIGHT));
				}
	/*for (int LEFT = 0; LEFT < 4; LEFT++)
		for (int RIGHT = 0; RIGHT < 4; RIGHT++)
			for (int UP = 0; UP < 4; UP++)
				for (int DOWN = 0; DOWN < 4; DOWN++)
					if (dp[LEFT][RIGHT][UP][DOWN])
						cerr << '#' << LEFT << ' ' << RIGHT << ' ' << UP << ' ' << DOWN << ':' << dp[LEFT][RIGHT][UP][DOWN] << endl;*/
	cout << dp[pos.ss][w - pos.ss - 1][pos.ff][h - pos.ff - 1] << endl;
}



Measured memory_bytes: 199040
#include <cmath>
#include<vector>
#define rep(i, n) for (int i=0;i<n;i++)
#include <map> 
#include<algorithm>
#include <numeric>
#include<iostream>
#include<deque>
#include<queue>
#include<string>
#include <iomanip>
using namespace std;
typedef long long ll;

vector <pair<int, int> > to[100005];
vector <int> ans;
void dfs(int v, int p=-1){
    for(int i=0;i<to[v].size();i++){
        int u=to[v][i].first;
        int w=to[v][i].second;
        
        if(u==p) continue;
        if(w==0) ans[u]=ans[v];
        else ans[u]=~ans[v];
        dfs(u, v);
    }
}

int main(void){
    int n;
    cin>>n;
    rep(i, n-1){
        int a, b;
        ll c;
        cin>>a>>b;
        cin>>c;
        a--;
        b--;
        c%=2;
        to[a].push_back(make_pair(b, c));
        to[b].push_back(make_pair(a, c));
    }
    
    ans.resize(n);
    ans[0]=0;
    dfs(0);
    rep(i, n){
        cout<<(-1)*ans[i]<<endl;
    }
    return 0;

    
}

Measured memory_bytes: 8320
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  int sum = 0;
  for(int i=1;i<N+1;i++)
  {
    sum += 800;
    if(i%15==0)
    {
      sum -= 200;
    }
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main(){
  string str;
  cin >> str;
  int count=0;
  int l;
  l=str.size();
  if(l%2==0){
    for(int i=0;i<l/2;i++){
      if(str[i]!=str[l-1-i]){
        count++;
      }
    }
  }
  else if(l%2!=0){
    for(int i=0;i<l/2;i++){
      if(str[i]!=str[l-1-i]){
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase

#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
#show_flg=True

n,c=LI()
s=[]

for i in range(n):
    x,v=LI()
    s.append((x,v))

show(c,s)
def solve(s):
    show('s',s)
    rt=-inf
    n=len(s)
    av=[0]
    for i in range(n):
        av.append(av[-1]+s[i][1])
    
    rav=[0]
    for i in range(n):
        rav.append(rav[-1]+s[-i-1][1])
    
    f=[-inf]*(n+1)
    for i in range(n):
        f[i+1]=max(av[i+1]-s[i][0],f[i])
    f.append(-inf)
    
    for i in range(1,n+1):
        rt=max(rt,rav[i]-(c-s[-i][0]),rav[i]-(c-s[-i][0])*2+f[n-i])

    return rt

ans=solve(s)
ans=max(ans,solve([(c-x,v) for x,v in s[::-1]]),0)
print(ans)






Measured memory_bytes: 84440
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
using namespace std;

int main(){
	int n;
	cin >> n;
	if(n % 2 == 0) cout << n/2 << endl;
	else cout << n/2+1 << endl;
	
	return 0;
}

Measured memory_bytes: 256
program kadai
implicit none
integer  ::  i(3),num
integer  ::  ans(3)

read(*,*) i
ans(1)=i(1)+i(2)
ans(2)=i(1)+i(3)
ans(3)=i(2)+i(3)
num=minval(ans)


write(*,*) num

end program kadai

Measured memory_bytes: 256
#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <map>
#include <queue>
#include <set>
#include <string.h>
#include <vector>

using namespace std;
typedef long long ll;

int M = 2000;

bool match(char c1, char c2) {
  return (c1 == '?' || c2 == '?' || c1 == c2);
}

bool ab[100000], ac[100000], bc[100000];

int main() {
  memset(ab, false, sizeof(ab));
  memset(ac, false, sizeof(ac));
  memset(bc, false, sizeof(bc));

  string a, b, c;

  cin >> a;
  cin >> b;
  cin >> c;

  int A = a.size();
  int B = b.size();
  int C = c.size();

  int geta = 10000;

  for (int i = 0; i < A; ++i) {
    for (int j = 0; j < B; ++j) {
      if (!match(a[i], b[j])) {
        ab[i - j + geta] = true;
      }
    }
  }

  for (int i = 0; i < A; ++i) {
    for (int j = 0; j < C; ++j) {
      if (!match(a[i], c[j])) {
        ac[i - j + geta] = true;
      }
    }
  }

  for (int i = 0; i < B; ++i) {
    for (int j = 0; j < C; ++j) {
      if (!match(b[i], c[j])) {
        bc[i - j + geta] = true;
      }
    }
  }

  int ans = 3 * M;

  for (int i = -2 * M; i <= 2 * M; ++i) {
    for (int j = - 2 * M; j <= 2 * M; ++j) {
      if (!ab[i + geta] && !ac[j + geta] && !bc[j - i + geta]) {
        int L = min(0, min(i, j));
        int R = max(A, max(B + i, C + j));
        ans = min(ans, R - L);
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 512
n = STDIN.gets.chomp.to_i
x = STDIN.gets.chomp.split(" ")
y = STDIN.gets.chomp.split(" ")

0.upto(n - 1) { |i|
	x[i] = x[i].to_f
	y[i] = y[i].to_f
}

p1_d = 0
p2_d = 0
p3_d = 0
pi_d = 0

0.upto(n - 1) { |i|
	diff = (x[i] - y[i]).abs	
	p1_d += diff
	p2_d += diff ** 2
	p3_d += diff ** 3
	pi_d = diff if pi_d < diff
}

p2_d = p2_d ** (1 / 2.0)
p3_d = p3_d ** (1 / 3.0)
	
p p1_d
p p2_d
p p3_d
p pi_d



Measured memory_bytes: 6956
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int, int> P;

int main() {
  int N; cin >> N;
  vector<int> A(N), B(N);
  for(int i = 0; i < N; ++i) {
    cin >> A[i];
    B[i] = A[i];
  }
  sort(B.begin(), B.end());
  for(int i = 0; i < N; ++i) {
    if(A[i] == B[N-1]) {
      std::cout << B[N-2] << std::endl;
    } else {
      std::cout << B[N-1] << std::endl;
    }
  }
  return 0;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  int sum_alice=0, sum_bob=0;
  
  for(int i=0; i<N; i++)
    cin >> a.at(i);
  
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  for(int i=0; i<N; i++){
    if(i%2 == 0)
      sum_alice += a.at(i);
    else
      sum_bob += a.at(i);
  }
  
  cout << sum_alice - sum_bob << endl;
}

Measured memory_bytes: 256
n = int(input())
s = list(map(int, list(input())))
ans = 0
for i in range(1000):
    c = 0
    for j in s:
        if i % 10 == j:
            if c == 2:
                ans += 1
                break
            c += 1
            i //= 10
print(ans)

Measured memory_bytes: 42860
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    ll n, x, d;
    cin >> n >> x >> d;

    if(d == 0) {
        if(x == 0) cout << 1 << endl;
        else cout << n+1 << endl;
        return 0;
    }

    if(d < 0) x *= -1, d *= -1;

    map<ll,vector<PII>> mp;
    REP(i, n+1) {
        // i個選ぶとき
        // i*x + d(0 + 1 + … + i-1) ～ i*x + d(n-1-i + n-i + … + n-1)
        ll lb = i*x/d + i*(i-1)/2;
        ll ub = i*x/d + n*i - i*(i+1)/2;
        ll mo = ((i*x)%d+d)%d;
        mp[mo].emplace_back(lb, ub);
    }

    ll ret = 0;
    for(auto pv: mp) {
        auto v = pv.second;
        sort(ALL(v));
        dump(v);
        PII last = v[0];
        vector<ll> nv;
        FOR(i, 1, v.size()) {
            if(v[i].first <= last.second) {
                chmax(last.second, v[i].second);
            } else {
                dump(last);
                ret += last.second - last.first + 1;
                last = v[i];
            }
        }
        dump(last);
        ret += last.second - last.first + 1;
    }
    cout << ret << endl;

    return 0;
}

Measured memory_bytes: 22144
#include <bits/stdc++.h>
using namespace std;
int main(void){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	int n,k;
	cin>>n;
	map<int,bool> ma;
	bool f=false;
	for(int i=1;i<=n;i++){
		cin>>k;
		if(!ma[k]) ma[k]=true;
		else{
			f=true;
			break;
		}
	}
	if(f) cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
	return 0;
}


Measured memory_bytes: 9600
package main

import (
        "fmt"
)

func solution(n, t, a int, h []int) int {
        lo := 1 << 31
        out := 0
        for i := range h {
          diff := abs(1000*a - (1000*t - (h[i] * 6)))
                if lo > diff {
                        out = i + 1
                        lo = diff
                }

        }
        return out
}

func abs(x int) int {
        if x < 0 {
                return -x
        }
        return x
}

func main() {
        var n, t, a int
        fmt.Scan(&n, &t, &a)
        h := make([]int, n)
        for i := range h {
                fmt.Scan(&h[i])
        }
        fmt.Println(solution(n, t, a, h))
}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main {
  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] l = br.readLine().split(" ");
    int a = Integer.valueOf(l[0]);
    int b = Integer.valueOf(l[1]);
    
    int add = a + b;
    int sub = a - b;
    int multi = a * b;
    
    int ret = add;
    if (ret < sub) {
      ret = sub;
    }
    if (ret < multi) {
      ret = multi;
    }
    System.out.printf("%d\n", ret);
  }
}

Measured memory_bytes: 23252
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>
using namespace std;


int main() {
	int w, h, x, y;
	cin >> w >> h >> x >> y;
	double ans;
	ans = (double)w * h / 2.0;
	printf("%.9f", ans);
	if (x == (w / 2.0) && y == (h / 2.0)) cout << " 1" << endl;
	else cout << " 0" << endl;
	return 0;
}

Measured memory_bytes: 256
N,C=map(int, input().split())
inarr=[[int(i) for i in input().split()] for _ in range(N)]
maxes=[[(0, 0)]*(N+1),[(0, 0)]*(N+1)]
cums=[0]*(N+1)
cum = 0
for i, [a, v] in enumerate(inarr):
    cum += v
    maxes[0][i+1]=(cum-a,a) if (cum - a) > maxes[0][i][0] else maxes[0][i]
    maxes[1][i+1]=(cum-2*a,a) if (cum - 2*a) > maxes[1][i][0] else maxes[1][i]
    cums[i+1]=cum

resmax = 0
for i, [b, v] in enumerate(inarr):
    oasum1, x = maxes[0][i]
    oasum2, x = maxes[1][i]
    ob = cums[N] - cums[i]
    resmax = max(resmax, ob + oasum1 - 2*(C-b), ob + oasum2 - (C-b))

print(max(resmax, maxes[0][N][0], 0))


Measured memory_bytes: 46456
#include <bits/stdc++.h>
#include <cmath>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
struct Edge {
	ll to;
 	ll cost;
 };
using Graph = vector<vector<Edge>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const ll MAX = 10000000;
/****** define constant end ********/
/****** define variable start ******/
ll n;
vl a;
/******* define variable end *******/
int solve() {
	cin >> n;
	a.resize(n);
	vector<ll> l(n);
	vector<ll> r(n);
	REP(i, n){
		cin >> a[i];
		l[i] = i + 1 - a[i];
		r[i] = a[i] + i + 1;
	}
	ll ans = 0;
	sort(ALL(l));
	sort(ALL(r));
	for(ll i = 1; i <= l[n-1]; i++){
		auto iterl = lower_bound(ALL(l), i);
		auto iterr = lower_bound(ALL(r), i);
		if(!(iterl == l.end()) & !(iterr == r.end())){
			ll countl = 0;
			ll countr = 0;
			for(auto j = iterl;; j++){
				if(l[j - l.begin()] != i){
					break;
				}
				countl++;
			}
			for(auto j = iterr;; j++){
				if(r[j - r.begin()] != i){
					break;
				}
				countr++;
			}
			ans += countl * countr;
		}
	}
	cout << ans << endl;
	return 0;
}

int main() {
	//clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 7916