akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<string.h>
#include<algorithm>
#include<numeric>
#include<random>
#include <functional>
using namespace std;

int main() {
	string w;
	cin >> w;
	int ans = 0;
	for (char i = 'a'; i <= 'z'; i++) {
		int 	count = 0;
		for (int j = 0; j < w.size(); j++) {
			if (w[j] == i) {
				count++;
			}

		}


		if (count % 2 != 0) {
			cout << "No" << endl;
			break;
		}
		else if (i == 'z' && count % 2 == 0) {
			cout << "Yes" << endl;
		}
	}



	return 0;
}

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

int main() {

  int N; 
  cin >> N;

  int total = 0;
  for (int i = 0; i < N; i++) {
    int L, R;
    cin >> L >> R;
    total += R - L + 1;
  }
  
  cout << total << endl;
}


Measured memory_bytes: 256
_ = input()
a = list(map(int, input().split()))
ans = 'APPROVED'
for num in a:
    if num % 2 == 0:
        if num % 3 == 0:
            continue
        elif num % 5 == 0:
            continue
        else:
            ans = 'DENIED'
            break

print(ans)


Measured memory_bytes: 3060
import sys;input=sys.stdin.readline
MOD = 10**9+7
N, K = map(int, input().split())
X = list(map(int, input().split()))
if N==K:
    R = 1
    mc = 0
    for x in X:
        if x<0:
            mc += 1
        R = R*abs(x)%MOD
    if mc%2:
        print(((-1)*R)%MOD)
    else:
        print(R%MOD)
    sys.exit()
ps,ns=[],[]
for x in X:
    if x>=0:
        ps.append(x)
    else:
        ns.append(x)
ps.sort()
ns.sort()
if K%2 and len(ps)==0:
    R = 1
    ns = ns[::-1]
    for i in range(K):
        R = R*abs(ns[i])%MOD
    print((-1*R)%MOD)
    sys.exit()
if len(ps) == 0:
    R = 1
    for i in range(K):
        R = R*abs(ns[i])%MOD
    print(R)
    sys.exit()
nns = []
for i in range(len(ns)//2):
    nns.append(ns[2*i]*ns[2*i+1])
if K%2:
    R = ps.pop()
    K -= 1
else:
    R = 1
nns = nns[::-1]
K = K//2
#print(ps)
ps = ps[::-1]
pps  = []
for i in range(len(ps)//2):
    pps.append(ps[2*i]*ps[2*i+1])
pps =pps[::-1]
#print(pps, nns)
while K:
    x = 0
    f = 0
    if pps:
        x = pps.pop()
        f = 1
    if nns:
        if nns[-1] > x:
            if f:
                pps.append(x)
            x = nns.pop()
    R = R*x%MOD
    K-=1
print(R)


Measured memory_bytes: 109764
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include <tuple>
#include <cassert>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;

#define read_int(X) \
    ll X;           \
    scanf("%lld\n", &X);

#define read_two_int(X, Y) \
    ll X, Y;               \
    scanf("%lld %lld\n", &X, &Y);

#define read_three_int(X, Y, Z) \
    ll X, Y, Z;                 \
    scanf("%lld %lld %lld\n", &X, &Y, &Z);

#define read_four_int(X, Y, Z, W) \
    ll X, Y, Z, W;                \
    scanf("%lld %lld %lld %lld\n", &X, &Y, &Z, &W);

int main()
{
    ll N;
    scanf("%lld", &N);

    ll ans = 0;
    for (ll i = 1; i < N; i++)
    {
        ans += N / i;
    }
    for (ll j = 1; j * j <= N; j++)
    {
        if (N % j == 0)
        {
            ans--;
            if (N / j != j)
                ans--;
        }
    }
    ans++;

    printf("%lld\n", ans);
}


Measured memory_bytes: 3780
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
int getDigit(long long n);      // 数字の桁数を取得する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

typedef long long ll;
typedef unsigned long long ull;

// code
// ------------------------------------------------
int main() {

  ll n;
  cin >> n;

  ll bef = LLONG_MAX;
  ll ans = 0;

  rep(i,n)
  {
    ll a;
    cin >> a;
    if(bef > a)
    {
      ans++;
      bef = a;
    }
  }

  cout << ans << endl;


  return 0;
}
// funcの実体
// ------------------------------------------------
int getDigit(ll n)
{
  int i = 1;
  while(1)
  {
    n = n / 10;
    if(n == 0)
      break;
    i++;
  }
  return i;
}
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


Measured memory_bytes: 256
local n, m = io.read("*n", "*n")
local edge = {}
for i = 1, n do
  edge[i] = {}
end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  edge[a][b], edge[b][a] = true, true
end

local len = {}
local ret = {}
local inf = 1000000007
for i = 1, n do
  len[i] = inf
  ret[i] = 0
end
len[1] = 0

local tasks = {1}
for i = 1, n do
  local src = tasks[i]
  -- print(src)
  -- print(len[src])
  for dst, _u in pairs(edge[src]) do
    -- print(src .. " to " .. dst)
    if len[dst] + 1 == len[src] then
      ret[src] = dst
    elseif len[dst] == inf then
      len[dst] = len[src] + 1
      -- print("INS", dst)
      table.insert(tasks, dst)
    end
  end
end
print("Yes")
for i = 2, n do
  print(ret[i])
end


Measured memory_bytes: 24956
//#include<bits/stdc++.h>
#include<cstdio>
#include<cmath>
#include<algorithm>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

void pakuri_sort(int N, int A[]) {
	const int b = 8;
	int tmp[30000];
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

int N, K;
int A[500];
inline bool keisan(int k) {
	int a[500];
	int ouchaku = 0;
	rep(j, N) {
		a[j] = A[j] % k;
		ouchaku = max(ouchaku, min(a[j], (k - a[j]) % k));
		if (ouchaku > K) return false;
	}
	pakuri_sort(N, a);
	int x = 0, y = N - 1;
	int tmp = a[0] + a[N - 1] - k;
	int kazu = a[0] + k - a[N - 1];
	while (x + 1 < y) {
		if (tmp <= 0) {
			tmp += a[++x];
			kazu += a[x];
		}
		else {
			tmp += a[--y] - k;
			kazu += k - a[y];
		}
	}
	if (kazu / 2 <= K) {
		printf("%d", k);
		return true;
	}
	return false;
}

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	N = getint();
	K = getint();
	int goukei = 0;
	rep(i, N) {
		A[i] = getint();
		goukei += A[i];
	}

	int yakusuu[15000];
	int M = 0;
	int sq = sqrt(goukei);
	rep1(i, sq) {
		if (goukei % i == 0) {
			yakusuu[M++] = i;
			if (i * i != goukei) {
				if (keisan(goukei / i)) return 0;
			}
		}
	}

	for (int i = M - 1; i >= 0; i--) {
		if (keisan(yakusuu[i])) return 0;
	}

	Would you please return 0;
}

Measured memory_bytes: 128
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def S_():
    return input()
def LS():
    return [i for i in input().split()]
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 NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
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 GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
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
ts=time.time()
sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

a,b,c,d=LI()

print(YN[1-(abs(a-c)<=d or (abs(a-b)<=d and abs(c-b)<=d))])


Measured memory_bytes: 39404
import numpy
import sys
X = int(input())

while 'true':
    tmp = int(numpy.sqrt(X)) + 1
    for i in range(2, tmp + 1):
        if X % i == 0 and X != 2:
            break
        elif i == tmp:
            print(X)
            sys.exit(0)
    X += 1    
        
        

Measured memory_bytes: 21164
#include <iostream>
using namespace std;
long fib[45];
int main(){
	fib[0] = fib[1] = 1;
	int n; cin >> n;
	for (int i = 2; i <= n; ++i){
		fib[i] = fib[i - 1] + fib[i - 2];
	}
	cout << fib[n] << '\n';
}

Measured memory_bytes: 1164
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <math.h>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

typedef long long ll;

const int MAX_N = 200005;

int A[MAX_N];

int main() {

   int N;
   scanf("%d", &N);
   for (int i = 0; i < N; i++) {
      scanf("%d", &A[i]);
   }
   sort(A, A + N);
   ll ans = 0;
   for (int i = 1; i < N; i++) {
      ans += A[N - 1 - i / 2];
   }
   printf("%lld\n", ans);

   return 0;
}

Measured memory_bytes: 2484
#include <stdio.h>
#include <algorithm>
using namespace std;
int a[200001];
int main()
{
	int n;
	scanf("%d",&n);
	long long sm=0;
	for (int i=1;i<=n;++i)
	{
		scanf("%d",a+i);
		sm+=a[i];
	}
	long long cursm=0,ans=1000000000000000000;
	for (int i=1;i<n;++i)
	{
		cursm+=a[i];
		if (abs(cursm-(sm-cursm))<ans)
			ans=abs(cursm-(sm-cursm));
	}
	printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
#define pb push_back
#define ll long long        
using namespace std;
 
void scan()
{
    #ifdef NURS
        freopen("main.in", "r", stdin);
        freopen("main.out", "w", stdout);
    #endif
 
}
const int N = 1e6 + 500;
const int mod = 1e9 + 7;

int main() 
{
    scan();     
    int a, b;
    cin >> a >> b;
    cout << (a * 3 + b) / 2;
}     
//JUDGE_ID: 295965SY
//Tis I

Measured memory_bytes: 3628
using System;
class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string P = Console.ReadLine();
        string Q = Console.ReadLine();
        int i = N;
        while ((Q.Substring(0, i) != P.Substring(N - i, i)) && i != 0) i--;
        Console.WriteLine(2 * N - i);
    }
}

Measured memory_bytes: 2648
#include <cstdio>
#include <vector>
int N, f1[100001], f2[100001], root1, root2, f[100001], w[100001];
std::vector < int > e1[100001], e2[100001];
int F(int x)
{
	return f[x] == x ? x : (F(f[x]), w[x] *= w[f[x]], f[x] = f[f[x]]);
}
void add(int u, int v)
{
	int fu = F(u), fv = F(v);
	w[fu] = w[u] * w[v] * -1;
	f[fu] = fv;
}
void BFS(int start, std::vector < int > *E)
{
	static int q[100001], g[100001];
	int H = 0, T = 1;
	q[1] = start;
	while (H < T)
	{
		int u = q[++H];
		for (int v : E[u])
			q[++T] = v;
	}
	for (int i = N; i; i--)
	{
		int u = q[i];
		for (size_t i = 1; i < E[u].size(); i += 2)
			add(g[E[u][i - 1]], g[E[u][i]]);
		g[u] = E[u].size() & 1 ? g[E[u].back()] : u;
	}
}
int main()
{
	scanf("%d", &N);
	for (int i = 1; i <= N; i++)
	{
		scanf("%d", f1 + i);
		if (f1[i] == -1)
		{
			f1[i] = 0;
			root1 = i;
		}
		else
			e1[f1[i]].push_back(i);
	}
	for (int i = 1; i <= N; i++)
	{
		scanf("%d", f2 + i);
		if (f2[i] == -1)
		{
			f2[i] = 0;
			root2 = i;
		}
		else
			e2[f2[i]].push_back(i);
	}
	for (int i = 1; i <= N; i++)
		if ((e1[i].size() ^ e2[i].size()) & 1)
		{
			puts("IMPOSSIBLE");
			return 0;
		}
	puts("POSSIBLE");
	for (int i = 1; i <= N; i++)
	{
		f[i] = i;
		w[i] = 1;
	}
	BFS(root1, e1);
	BFS(root2, e2);
	for (int i = 1; i <= N; i++)
	{
		F(i);
		printf("%d%c", e1[i].size() & 1 ? 0 : w[i], " \n"[i == N]);
	}
	return 0;
}


Measured memory_bytes: 12800
s = input()
judg = [False]*3
if s[0] == "A":
  judg[0] = True
  if s[2:-1].count("C") == 1:
    judg[1] = True
    if (s[1] + s[-1]) == (s[1] + s[-1]).lower():
      judg[2] = True
print("AC" if all(judg) else "WA")   
  


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;

int main(){
    int n,i;
    cin >> n >> i;
    cout << n-i +1<< endl;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IC ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll ;
#define pb push_back

using namespace std;
//-------------------------------
const int N = 2000 + 10 ;
int n , x , k ;
//------------------
int main()
{
    cin >> n >> x >> k ;
    cout << (n+x-1) / x * k ;
}


Measured memory_bytes: 3616
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a,h,m,s;;
		a=Integer.parseInt(br.readLine());
		h=a/3600;
		m=(a-h*3600)/60;
		s=a-(h*3600+m*60);

		System.out.println(h + ":" + m + ":"+s);




	}
}

Measured memory_bytes: 24196
#include <stdio.h>

int main(){
    int W, H, x, y, r;

    int x_lim_max, x_lim_min;
    int y_lim_max, y_lim_min;

    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);

    x_lim_max = W - r;
    x_lim_min = r;
    y_lim_max = H - r;
    y_lim_min = r;

    if ((x >= x_lim_min) &&
        (x <= x_lim_max) &&
        (y >= y_lim_min) &&
        (y <= y_lim_max)
    ) {
        printf("Yes\n");
    }
    else {
        printf("No\n");
    }

}


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

using namespace std;

typedef long long ll;

const int INF = 1000000009;

void solve() {
    int n;
    cin >> n;
    vector<vector<ll>> r(n);
    for (int i = 0; i < n - 1; ++i) {
        int u, v;
        cin >> u >> v;
        r[max(u, v) - 1].push_back(min(u, v));
    }
    
    ll ans = 0;
    ll curc = 0;
    for (int i = 0; i < n; ++i) {
        curc += (i + 1);
        sort(r[i].begin(), r[i].end());
        for (int j = 0; j < r[i].size(); ++j) {
            curc -= r[i][j];
        }
        ans += curc;
        //cout << curc << "\n";
    }
    
    cout << ans << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    int t = 1;
    //cin >> t;
    for (int qq = 0; qq < t; ++qq) {
       solve();
    }
   
    return 0;
}

Measured memory_bytes: 14224
#include<iostream>
#include<cstdio>
#include<math.h>
#define N 37
using namespace std;
struct Card
{
	char suit;
	int value;
};

Card Swap(Card a, Card b)
{
	Card c;
	c.suit = a.suit;
	c.value = a.value;
	a.suit = b.suit;
	a.value = b.value;
	b.suit = c.suit;
	b.value = c.value;
	return a, b;
}

void Print(Card A[], int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << A[i].suit << A[i].value;
		if (i < n - 1)
			cout << ' ';
	}
	cout << endl;
}

void Bubblesort(Card A[], int n)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = n - 1; j > i; j--)
		{
			if (A[j].value < A[j - 1].value)
				swap(A[j], A[j - 1]);
		}
	}
}

void Selectionsort(Card A[], int n)
{
	for (int i = 0; i < n; i++)
	{
		int mini = A[i].value;
		int mininum = i;
		for (int j = i + 1; j < n; j++)
		{
			if (A[j].value < mini)
			{
				mini = A[j].value;
				mininum = j;
			}
		}
		if (i != mininum)
		{
			swap(A[i], A[mininum]);
		}

	}
}

int main()
{
	int n;
	Card A[N], B[N], C[N];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> A[i].suit >> A[i].value;
		B[i].suit = A[i].suit;
		C[i].suit = A[i].suit;
		B[i].value = A[i].value;
		C[i].value = A[i].value;
	}
	Bubblesort(A, n);
	Selectionsort(B, n);
	Print(A, n);
	cout << "Stable" << endl;
	Print(B, n);
	int flag = 0;
	for (int i = 0; i < n; i++)
	{
		if (A[i].suit != B[i].suit)
			flag = 1;
	}
	if (flag == 0)
		cout << "Stable" << endl;
	else
		cout << "Not stable" << endl;

	return 0;

}


Measured memory_bytes: 3116
#include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<stack>
#include<queue>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug" << x << endl;
using namespace std;

struct P{
    char name[11];
    int time;
};

int main(){
    queue<struct P> qu;;
    int n, ms;
    while(cin >> n >> ms){
        int ans = 0;
        rep(i, n){
            struct P inp;
            cin >> inp.name >> inp.time;
            qu.push(inp);
        }
        while(!qu.empty()){
            qu.front().time-= ms;
            ans+= ms;
            if(qu.front().time > 0){
                qu.push( qu.front() );
            }else{
                ans+= qu.front().time;
                cout << qu.front().name << ' ' << ans << endl;
            }
            qu.pop();
        }
    }
}

Measured memory_bytes: 1936
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
int main ()
{
    ll x,y;
    cin>>x>>y;
    ll z=x-y;
    if (z>=-1 && z<=1) cout<<"Brown"<<endl;
    else cout<<"Alice"<<endl;

    return 0;
}


Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if X == a*500 + b*100 + c*50:
                cnt += 1
                
print(cnt)

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

int main(){
	int k;
	cin >> k;
	long long ans[100000];
	int count = 0,first,last,index;
	for(int j = 1;j<10;j++){
		ans[count] = j;
		count++;
	}
	first = 0;
	last = 8;
	while(count < k){
		index = first;
		while(index <= last && count < k){
			int rest = ans[index] % 10;
			if(rest == 0){
				ans[count] = ans[index]*10;
				count++;
				ans[count] = ans[index]*10+1;
				count++;
			}else if(rest == 9){
				ans[count] = ans[index]*10+8;
				count++;
				ans[count] = ans[index]*10+9;
				count++;
			}else{
				ans[count] = ans[index]*10+rest-1;
				count++;
				ans[count] = ans[index]*10+rest;
				count++;
				ans[count] = ans[index]*10+rest+1;
				count++;
			}
			index++;
		}
		first = last+1;
		last = count-1;
	}
	cout << ans[k-1] << endl;
}

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

using namespace std;

uint64_t dfs(uint64_t H)
{
  if (H == 0) { return 0; }
  if (H == 1) { return 1; }
  return 1 + (dfs(H >> 1) << 1);
}

int main()
{
  uint64_t H;
  cin >> H;

  cout << dfs(H) << endl;

  return 0;
}

Measured memory_bytes: 256
#import sys
#input = sys.stdin.buffer.readline

def main():
    N,K = map(int,input().split())
    D = list(map(int,input().split()))
    
    use = []
    for i in range(10):
        if i not in D:
            use.append(i)

    nl = []
    for i in range(N,10*N+1):
        num = i
        ans = True
        while num != 0:
            re = num%10
            num //= 10
            if re not in use:
                ans = False
        if ans:
            print(i)
            exit()
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
N = gets.to_i
As = gets.split.map(&:to_i)

m = {}
As.each {|n| m[n] ? m[n] += 1 : m[n] = 1}

m = m.select do |k, v|
  v >= 2
end

a = 0
b = 0
m.keys.sort.reverse.each do |n|
  if m[n] >= 4
    if a == 0
      a = n
      b = n
      break
    else
      b = n
      break
    end
  elsif m[n] >= 2
    if a == 0
      a = n
    else
      b = n
      break
    end
  end
end

ans = a > 0 && b > 0 ? a * b : 0
puts ans


Measured memory_bytes: 14988
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr LL MOD = 1'000'000'007LL;
int N, K;
LL fac[4'000'001], fac_inv[4'000'001];
LL mpow(LL a, LL n) {
    LL r = 1;
    while (n) {
        if (n % 2) r = r * a % MOD;
        n /= 2, a = a * a % MOD;
    }
    return r;
}
LL C(int n, int m) {
    if (m > n) return 0;
    return fac[n] * fac_inv[m] % MOD * fac_inv[n - m] % MOD;
}
LL dp[2001][2001];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    fac[0] = fac_inv[0] = 1;
    for (int i = 1; i <= 4000000; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        fac_inv[i] = mpow(fac[i], MOD - 2);
    }
    cin >> N >> K;
    if (N == 1 || K == 1) {
        cout << "1\n";
    } else {
        dp[0][0] = 1;
        for (int j = 1; j <= N; j++) {
            dp[0][j] = dp[0][j - 1] * C((K - 1) * j - 1, K - 2) % MOD;
        }
        for (int i = 1; i <= N; i++) {
            dp[i][i] = dp[i - 1][i];
            for (int j = i + 1; j <= N; j++) {
                dp[i][j] = (dp[i - 1][j] + dp[i][j - 1] * C(K * i + (K - 1) * (j - i) - 1, K - 2)) % MOD;
            }
        }
        cout << dp[N][N] * fac[N] % MOD << '\n';
    }
    return 0;
}


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

using namespace std;

#define rep(i, n) for(i = 0; i < n; ++i)
#define repr(i, n) for(i = 0; i > n; --i)
#define REP(i,k,n) for (i = k; i <= n; ++i) 
#define REPR(i,k,n) for (i = k; i >= n; --i)

int main()
{
	int n;
	cin >> n;
	if(n >= 30) cout << "Yes" << endl;
	else cout << "No" << endl;
}


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

int main(){
    string s; cin >> s;
    string t; cin >> t;
    int s_len = s.length();
    int t_len = t.length();
    int ans = t_len;
    for(int i=0; i<=s_len-t_len; i++){
        string tmp = s.substr(i, t_len);
        int cnt =0;
        for(int j=0; j<t_len; j++){
            if(tmp.at(j)!=t.at(j)){
                cnt++;
            }
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

import math

dist_sum = 0
for i in range(N):
    xi, yi = xy[i]
    for j in range(N):
        xj, yj = xy[j]
        dist_sum += math.sqrt((xi - xj) ** 2 + (yi - yj) ** 2)

print(dist_sum / N)

Measured memory_bytes: 3060
#!/usr/bin/env python3.4

# abc128_d

def get_right(l, r):
    return l[-r:] if r!=0 else []

def main():
    # Input
    n, k = [int(s) for s in input().split()]
    vs = [int(s) for s in input().split()]
    # Get ans
    R = min(n, k)
    def gene_lr():
        for i in range(1, R+1):
            for j in range(i+1):
                yield(i-j, j)
    def gene_tv():
        for l, r in gene_lr():
            tv = 0
            pps = []
            for v in vs[:l] + vs[n-r:]:
                tv += v
                if v<0:
                    pps.append(v)
            s = k-(l+r)
            pps.sort()
            yield tv-sum(pps[:s])
    ans = max(gene_tv())
    # Output
    print(ans)

if __name__ == '__main__':
    main()



Measured memory_bytes: 3064
// 反射　反射ベクトル
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<vector>

#include<queue>

using namespace std;

// 浮動小数点のゼロ判定
#define EPS (1e-10)
#define equals(a, b) ( fabs((a) - (b)) < EPS )

// 点を表すクラス
class Point
{
    public:
        double x, y;
        // コンストラクタ
        Point(double x = 0.0, double y = 0.0) : x(x), y(y){ }

        // -----▼▼▼ 演算子のオーバーロード ▼▼▼-----

        Point operator + (Point &p)
        {
            return Point(x + p.x, y + p.y);
        }

        Point operator - (Point &p)
        {
            return Point(x - p.x, y - p.y);
        }

        Point operator * (double a)
        {
            return Point(a * x, a * y);
        }

        Point operator / (double a)
        {
            return Point(x / a, y / a);
        }

        bool operator < ( const Point &p) const
        {
            return x != p.x ? x < p.x : y < p.y;
        }

        bool operator == ( const Point &p) const
        {
            return fabs(x - p.x) < EPS && fabs(y -p.y) < EPS;
        }

        // -----▲▲▲ 演算子のオーバーロード ▲▲▲-----

        // 2点間の距離
        double distance()
        {
            return sqrt( norm() );
        }

        double norm()
        {
            return ( x * x ) + ( y * y );
        }
};

// 線分を表すクラス
class Segment
{
    public:
        Point p1, p2;
        // コンストラクタ
        Segment(Point p1, Point p2) : p1(p1), p2(p2){ }
};

// 点とベクトルの表現は同じ
typedef Point Vector;
// 線分と直線の表現は同じ
typedef Segment Line;

double dot(Vector a, Vector b);
double cross(Vector a, Vector b);
Vector projection(Vector a, Vector b, Vector p);

int main(void)
{
    int q;
    Vector p1, p2, p;
    Vector vertical, base, OH, reflection;

    // ベクトル要素の格納
    cin >> p1.x >> p1.y >> p2.x >> p2.y;

    cin >> q;

    for(int i = 0; i < q; i++)
    {

        // ベクトル要素の格納
        cin >> p.x >> p.y;

        base = p2 - p1;
        vertical = p - p1;

        // 正射影ベクトルを求める
        OH = projection(base, vertical, p1);
        // 反射ベクトルを求める
        // [p → OH]のベクトルを2倍して, pを足す
        reflection = ( ( OH - p ) * 2.0 ) + p;

         printf("%.10lf %.10lf\n", reflection.x, reflection.y);
    }

    return 0;
}

// 内積の計算をする関数
double dot(Vector a, Vector b)
{
    return ( ( a.x * b.x ) + ( a.y * b.y ) );
}

// 外積の計算をする関数
double cross(Vector a, Vector b)
{
    return ( ( a.x * b.y ) - ( a.y * b.x ) );
}

// 正射影ベクトルを求める関数
Vector projection(Vector a, Vector b, Vector p)
{
    // 正射影ベクトルの考え方より
    // 正射影ベクトル = ( ( a, bベクトルの内積 ) / aベクトルの大きさの2乗 ) * aベクトル
    return ( ( a * ( dot(a, b) / pow( a.distance(), 2.0 ) ) ) + p );
}



Measured memory_bytes: 3220
#include<stdio.h>

int main(){
    int N,M;

    scanf("%d %d", &N, &M);
    int A[M];
    for (int i = 0; i <= M-1;i++){
        scanf("%d", &A[i]);
        N = N - A[i];
        // printf("%d", A[i]);
    }
    if(N<0){
        printf("-1");
    }else{
        printf("%d", N);
    }
    
    return 0;
}

Measured memory_bytes: 1764
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <array>
#include <initializer_list>
#include <random>
#include <regex>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
using namespace std;

char s[111111];

int main()
{
    scanf("%s", s);
    int len = strlen(s);

    int L = 0, R = len - 1, ans = 0;
    while (L < R)
    {
        if (s[L] == s[R]) ++L, --R;
        else if (s[L] == 'x') ++ans, ++L;
        else if (s[R] == 'x') ++ans, --R;
        else
        {
            printf("-1\n");
            return 0;
        }
    }

    printf("%d\n", ans);
}



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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int N, M;
  cin >> N >> M;
  cout << (N == M ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

fn main() {
    input! {
        a: usize,
        b: usize
    };

    let res = a * b;
    println!("{}", res);
}


Measured memory_bytes: 2136
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

int main() {

	int64_t a = 100;
	int64_t X;
	int i =0;
	cin >> X;

	while(true){
		i++;
		//a*=1.01;
		a+=a/100;
		if(a>=X)break;
	}
	cout << i;

	return 0;
}

Measured memory_bytes: 3552
#include<stdio.h>
int list[10];
int c=0;
int solve(int n,int a,int b){

	if(n==10){
		return 1;
	}
	else{
		if(a<list[n]){
			if(solve(n+1,list[n],b)){
				return 1;
			}
		}
		if(b<list[n]){
			if(solve(n+1,a,list[n])){
				return 1;
			}
		}
		return 0;
	}
}
int main(){
	int i,j;
	int n;
	int a,b;
	scanf("%d",&n);
	a=0,b=0;
	for(i=0;i<n;i++){
		for(j=0;j<10;j++){
			scanf("%d",&list[j]);
		}
		printf(solve(0,0,0)?"YES\n":"NO\n");
	}
	return 0;
}

Measured memory_bytes: 580
S=int(input())
a=int(S/1000)
b=int((S-a*1000)/100)
c=int((S-a*1000-b*100)/10)
d=int(S-a*1000-b*100-c*10)
if a==b or b==c or c==d:
    print('Bad')
else:
    print('Good')

Measured memory_bytes: 3060
n = int(input())
a = sorted(map(int, input().split()))
b = [0] * (10 ** 6 + 1)
c = [False] * (10 ** 6 + 1)
for i in a:
    b[i] += 1
ans = 0
for i in range(1, 10 ** 6 + 1):
    if not b[i]:
        continue
    if b[i] == 1 and not c[i]:
        ans += 1
    for j in range(1, 10 ** 6 + 1):
        if i * j > 10 ** 6:
            break
        c[i * j] = True
print(ans)

Measured memory_bytes: 114156
#include <sstream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cassert>
#include <ctime>
#include <map>
#include <math.h>
#include <cstdio>
#include <set>
#include <deque>
#include <memory.h>
#include <queue>

#pragma comment(linker, "/STACK:64000000")
typedef long long ll;

using namespace std;

const int MAXK = 17;
const int MAXN = 1 << 17;
const int MOD = 1; // 1000 * 1000 * 1000 + 7;
const int INF = 2e9;
const double PI = acos(-1.0);

int main() {
#ifdef _MSC_VER
	freopen("input.txt", "r", stdin);
#endif

	int n;
	scanf("%d", &n);
	vector<int> x(n);
	for (int i = 0; i < n; i++) scanf("%d", &x[i]);
	int m;
	scanf("%d", &m);

	vector<vector<int> > e(n, vector<int>(MAXK));

	int r = -1;
	for (int l = 0; l < n; l++) {
		r = max(r, l);
		while (r + 1 < n && x[r + 1] - x[l] <= m) r++;
		e[l][0] = r;
	}
	for (int i = 1; i < MAXK; i++) {
		for (int j = 0; j < n; j++) {
			e[j][i] = e[e[j][i - 1]][i - 1];
		}
	}

	int q;
	scanf("%d", &q);
	for (int i = 0; i < q; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a; --b;
		if (a > b) swap(a, b);

		int ans = 0;
		for (int j = MAXK - 1; j >= 0; j--) {
			if (e[a][j] < b) {
				ans += 1 << j;
				a = e[a][j];
			}
		}
		printf("%d\n", ans + 1);
	}

	return 0;
}

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

typedef long long int ll;

int main () {

	ll n;
	cin >> n;

	ll a[n];
	for (ll i=0 ; i<n ; i++) {
		cin >> a[i];
	}

	int curNum = 1;
	int curCount = 0;

	for (ll i=0 ; i<n ; i++) {

		if (a[i]==curNum) {
			curNum++;
		}
		else {
			curCount++;
		}
	}

	if (curCount==n) cout << -1 << endl;
	else cout << curCount << endl;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
 
  
  for(int i=0;i<N; i++){
    cin >> vec.at(i);
  }
  int count = 0, next = 1;
  
 for(int j=0; j<N; j++){
   count++;
   next = vec.at(next-1);
   if(next == 2)break; 
 }
  if(next != 2){count = -1;}
  
  cout << count << endl;
}

Measured memory_bytes: 3784
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll n,weight;
    cin>>n>>weight;
    ll w[n],v[n];
    for(ll i=0;i<n;i++)
    {
        cin>>w[i]>>v[i];
    }
    ll dp[n+1][weight+1];
    for(ll i=0;i<=n;i++)
    {
        for(ll j=0;j<=weight;j++)
        {
            dp[i][j]=INT_MIN;
        }
    }
    dp[0][0]=0;
    for(ll i=0;i<=n;i++)
        dp[i][0]=0;
    for(ll i=0;i<=weight;i++)
        dp[0][i]=0;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=0;j<=weight;j++)
        {
            if(w[i-1]>j)
                dp[i][j]=dp[i-1][j];
            else
                dp[i][j]=max(dp[i-1][j-w[i-1]]+v[i-1],dp[i-1][j]);
        }
    }
    cout<<dp[n][weight]<<endl;
}


Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ;
  cin >> N;

  vector<int> C(N);
  for (int i = 0; i < N; i++) {
    cin >> C.at(i);
  }

  sort(C.begin(), C.end(),greater<int>());

  int A = 0, B = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) A += C.at(i);
    if (i % 2 == 1) B += C.at(i);
  }

  cout << A - B << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
using namespace std;

#define L 4194304
bool HA[L];
int T[256] = {0};

inline int get( unsigned char c ) {
    return T[c];
}

int main() {
    int n, sum, t, c;
    T['A'] = 1, T['C'] = 2, T['G'] = 3, T['T'] = 4;
    while ( scanf("%d", &n) != EOF ) {
        memset(HA,false,L);
        while ( getchar() != '\n' );
        for ( register int i = 0; i < n; ++ i ) {
            sum = 0;
            t = 1;
            bool flag = ( c = getchar() ) == 'i';
            while ( ( c = getchar() ) != ' ' );
            while ( ( c = T[getchar()] ) != 0 ) {
                sum += c * t;
                t *= 4;
            }
            if ( flag ) {
                HA[sum] = true;
            } else {
                puts( HA[sum] ? "yes" : "no" );
            }
        }
    }
    return 0;
}

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

int main(){
  
  long long n, a, i;
  cin>>n;
  deque<long long> data;
  for(i=0;i<n;i++){
    cin>>a;
    if((i+n%2)%2==1){
      data.push_front(a);
    }else{
      data.push_back(a);
    }
  }
  
  for(i=0;i<n;i++){
    cout << data[i] << " ";
  }
  return 0;
}

Measured memory_bytes: 5272
#include<bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pll = pair<ll, ll>;
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define sz(x) ((x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
const double PI = acos(-1);
const int mod = 1e9+7;
const long long INF = (1LL << 60);
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
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;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(const ll a, const ll b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmax(T &a, const T &b){ if(a < b){ a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b){ if(a > b){ a=b; return 1; } return 0; }

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

  ll n;
  cin >> n;
  ll a[2][n];
  rep(i, 0, 2) rep(j, 0, n) cin >> a[i][j];

  ll ans = 0;
  for(ll i = 0; i < n; i++){
    ll sum = 0;
    for(ll j = 0; j <= i; j++){
      sum += a[0][j];
    }

    for(ll j = i; j < n; j++){
      sum += a[1][j];
    }
    chmax(ans, sum);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
def main():
    import sys
    from collections import deque
    from operator import itemgetter
    b=sys.stdin.buffer
    n,d,a=map(int,b.readline().split())
    m=map(int,b.read().split())
    q=deque()
    popleft,append=q.popleft,q.append
    s=b=0
    for x,h in sorted(zip(m,m),key=itemgetter(0)):
        while q and q[0][0]<x:b-=popleft()[1]
        h-=b
        t=-(-h//a)
        if t>0:
            s+=t
            t*=a
            b+=t
            append((x+d+d,t))
    print(s)
main()

Measured memory_bytes: 55768
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Scanner;

// https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_c
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		sc.close();

		BigDecimal A = sqrt(new BigDecimal(a), 50);
		BigDecimal B = sqrt(new BigDecimal(b), 50);
		BigDecimal C = sqrt(new BigDecimal(c), 50);

		if(A.add(B).compareTo(C)==-1) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}

	}
    public static BigDecimal sqrt(BigDecimal a, int scale){
        //とりあえずdoubleのsqrtを求める
        BigDecimal x = new BigDecimal(
                Math.sqrt(a.doubleValue()), MathContext.DECIMAL64);
        if(scale < 17) return x;

        BigDecimal b2 = new BigDecimal(2);
        for(int tempScale = 16; tempScale < scale; tempScale *= 2){
            //x = x - (x * x - a) / (2 * x);
            x = x.subtract(
                    x.multiply(x).subtract(a).divide(
                    x.multiply(b2), scale, BigDecimal.ROUND_HALF_EVEN));
        }
        return x;
    }
}

Measured memory_bytes: 23892
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        var list = new List<long>();
        var n = long.Parse(Console.ReadLine());
        
        for(var i = 0;i < n;i++){
            list.Add(long.Parse(Console.ReadLine()));
            }
        
        var ans = list.Sum() - list.Max() / 2;
        Console.WriteLine(ans);
        
    }
}


Measured memory_bytes: 13268
#ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = a; i >= (b); --i)
#define repdl(i, a, b) for(ll i = a; i >= (b); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
#endif
#ifndef _TEMPLATE_IO
#define _TEMPLATE_IO

template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void writef(T ...tail) { write(tail...); cout << flush; }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  if (v.size()) {
    rep(i, 0, sz(v) - 1)
      out << v[i] << " ";
    out << v.back();
  }
  return out;
}
#endif
using namespace std;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

  ll x, k, d; read(x, k, d);
  x = abs(x);
  ll w = min(x / d, k);
  x -= w * d; k -= w;
  if (k % 2 == 1) {
    k--;
    x = d - x;
  }
  write(x);
}



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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N, M;
    cin >> N >> M;
    vector<P> items(N);
    rep(i, N) cin >> items[i].first >> items[i].second;
    sort(items.begin(), items.end());
    ll ans = 0;
    ll cnt = 0;
    rep(i, N) {
        if (cnt < M) {
            if (items[i].second + cnt > M) {
                ans += items[i].first * (M - cnt);
                cnt = M;
            } else {
                cnt += items[i].second;
                ans += items[i].first * items[i].second;
            }
        }
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

int main(){
    string S;
    cin>>S;
    for(int i=0;i<S.size();i++){
        if(S[i]=='A')S[i]='T';
        else if(S[i]=='T')S[i]='A';
        else if(S[i]=='C')S[i]='G';
        else S[i]='C';
    }
    cout<<S<<endl;
}


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

int main()
{
    int N, K;
    cin >> N >> K;

    vector<int> A(N);

    for (int i = 0; i < N; i++)
    {
        cin >> A.at(i);
    }

    for (int i = K; i < N; i++)
    {
        if (A.at(i - K) < A.at(i))
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }

    return 0;
}

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

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

  int n, x;
  cin >> n;
  multiset<int> slimes;
  for (int i = 0; i < 1 << n; i++)
  {
    cin >> x;
    slimes.insert(-x);
  }

  multiset<int> has;
  has.insert(*slimes.begin());
  slimes.erase(slimes.begin());
  for (int i = 0; i < n; i++)
  {
    vector<int> tmp;
    for (auto x : has)
    {
      auto u = slimes.upper_bound(x);
      if (u == slimes.end())
      {
        cout << "No" << endl;
        return 0;
      }
      tmp.push_back(*u);
      slimes.erase(u);
    }

    for (auto x : tmp)
      has.insert(x);
  }

  cout << "Yes" << endl;
}


Measured memory_bytes: 13304
#include <iostream>
using namespace std;
#define MAX 100000

int parent(int i) { return i / 2; }
int left(int i) { return 2 * i; }
int right(int i) { return 2 * i + 1; }

int main() {
	int H, i, A[MAX + 1];

	cin >> H;
	for (i = 1; i <= H; ++i) cin >> A[i];

	for (i = 1; i <= H; ++i) {
		cout << "node " << i << ": key = " << A[i] << ", ";
		if (parent(i) >= 1) cout << "parent key = " << A[parent(i)] << ", ";
		if (left(i) <= H) cout << "left key = " << A[left(i)] << ", ";
		if (right(i) <= H) cout << "right key = " << A[right(i)] << ", ";
		cout << endl;
	}
}


Measured memory_bytes: 3084
import scala.io.StdIn._
import scala.math._

object Main extends App with StdInHelper {
  val Array(a, b, c, d) = readLongs

  var ans: Option[Long] = None
  for (i <- Array(a * c, a * d, b * c, b * d)) {
    if (ans.isEmpty || ans.get < i) {
      ans = Some(i)
    }
  }

  println(ans.get)
}

trait StdInHelper {
  def readStrings = readLine.split(" ")
  def readInts = readStrings.map(_.toInt)
  def readLongs = readStrings.map(_.toLong)
  def readDoubles = readStrings.map(_.toDouble)
  def readBigInts = readStrings.map(BigInt.apply(_))
  def readBigDecimals = readStrings.map(BigDecimal.apply(_))
}


Measured memory_bytes: 54820
h,w = (int(i) for i in input().split())
s = ['.' * (w+2)] + ['.' + input() + '.' for i in range(h)] + ['.' * (w+2)]
for i in range(1,h-1):
  for j in range(1,w-1):
    if s[i][j] == '#':
      tonari = [s[i][j+1], s[i][j-1], s[i+1][j], s[i-1][j]]
      if not(any(i == '#' for i in tonari)):
        print('No')
        exit()
print('Yes')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=210003;
const ll INF=1LL<<60;

ll dp[MAX][3];

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;cin>>N;
    vector<ll> A(13+N);
    for(int i=0;i<N;i++) cin>>A[11+i];
    
    if(N%2==0){
        for(int i=11;i<=10+N;i++){
            dp[i][0]=dp[i][1]=-INF;
        }
        
        for(int i=11;i<=10+N;i++){
            if(i%2){
                dp[i][0]=max(dp[i][0],dp[i-2][0]+A[i]);
            }else{
                dp[i][1]=max(dp[i][1],dp[i-3][0]+A[i]);
                dp[i][1]=max(dp[i][1],dp[i-2][1]+A[i]);
            }
        }
        
        cout<<max(dp[10+N-1][0],dp[10+N][1])<<endl;
    }else{
        for(int i=10;i<=10+N;i++){
            dp[i][0]=dp[i][1]=dp[i][2]=-INF;
        }
        
        for(int i=11;i<=10+N;i++){
            dp[i][0]=max(dp[i][0],dp[i-2][0]+A[i]);
            
            dp[i][1]=max(dp[i][1],dp[i-2][1]+A[i]);
            dp[i][1]=max(dp[i][1],dp[i-3][0]+A[i]);
            
            dp[i][2]=max(dp[i][2],dp[i-2][2]+A[i]);
            dp[i][2]=max(dp[i][2],dp[i-3][1]+A[i]);
            dp[i][2]=max(dp[i][2],dp[i-4][0]+A[i]);
        }
        
        cout<<max({dp[10+N-2][0],dp[10+N-1][1],dp[10+N][2]})<<endl;
    }
}


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

using namespace std;

int main() {
  char buf[256];
  stack<int> stk;
  while(scanf("%s", buf) != EOF) {
    if(isdigit(buf[0])) {
      stk.push(atoi(buf));
    } else {
      int b = stk.top(); stk.pop();
      int a = stk.top(); stk.pop();
      switch(buf[0]) {
      case '+': stk.push(a+b); break;
      case '-': stk.push(a-b); break;
      case '*': stk.push(a*b); break;
      }
    }
  }
  printf("%d\n", stk.top());
  return 0;
}



Measured memory_bytes: 3216