akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

typedef long long ll;

int main() {
	/*int N;
	cin >> N;
	cout << 180 * (N - 2);*/

	string S;
	cin >> S;
	int n = 0;
	rep(i, S.size()) {
		if (S[i] == 'x') {
			n++;
		}
	}
	if (n <= 7) {
		cout << "YES";
	}
	else {
		cout << "NO";
	}
	return 0;
}

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

int main()
{
    int n, k, q;
    cin >> n >> k >> q;
    vector<int> a(n);

    vector<int> x(q);
    for (int i = 0; i < q; i++)
    {
        cin >> x[i];
        a[x[i] - 1]++;
    }

    for (int p = 0; p < n; p++)
    {
        a[p] = a[p] + k - q;
    }

    for (int j = 0; j < n; j++)
    {
        // cout << a[j] << endl;
        if (a[j] <= 0)
            cout << "No" << endl;
        else
            cout << "Yes" << endl;
    }

    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
 
using namespace std;
using std::cout;
using ll =long long;
bool is_int_lround(double x){
  return std::lround(x)==x;
}
int ketasuu(int x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}
ll gcd11(ll x, ll y){
  long long a= max(x,y), b=min(x,y), c=a%b;
  while( c!=0){
    a =b;
    b =c;
    c = a%b;
  }
  return b;
}

int ab(int x, int y){
  if(x>=y){
    return x-y;
  }
  else if(y>x){
    return y-x;
  }
}
int main(){
  int N,i;
  cin>>N>>i;
  cout<<N-i+1 <<endl; 
}


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


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,temp1,temp2,t,x,y,m,k,a,b,c,temp;
	
	cin>>x>>n;
	
	set<lli> st;
	
	for(int i=0;i<n;i++)
	{
		cin>>a;
		st.insert(a);
	}
	int val=x+1;
	int ans;
	
	
	val=-200;
	temp = 1e9;
	
	for(int i =0;i<1000;i++)
	{
		if(st.find(val)==st.end())
		{
			if( abs(x- val) < temp)
			{
				ans=val;
				temp= abs(x-val);
			}
		}
		val++;
	}
	
	cout<<ans;
}

Measured memory_bytes: 3648
import java.io.PrintWriter
import java.math.BigDecimal
import java.util.*

val pw = PrintWriter(System.out)
val sc = Scanner(System.`in`)

fun main(args: Array<String>) {
    val a = sc.next()
    if(a[2] == a[3] && a[4] == a[5]){
        println("Yes")
    }else{
        println("No")
    }
}

fun abc160b(){}

fun abc160c(){}




fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextListOfString() = next().split(" ")
fun nextListOfInt() = nextListOfString().map { it.toInt() }
fun nextListOfLong() = nextListOfString().map { it.toLong() }
fun nextListOfDouble() = nextListOfString().map { it.toDouble() }



Measured memory_bytes: 31268
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

int dx[] = { -1, 0, 1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};


int main() {

	int n; cin >> n;
	map<int, bool> freq;
	for (int i = 1; i <= n; i++) {
		int a; cin >> a;
		freq[a] = true;
	}

	cout << ((freq.size() == n) ? "YES" : "NO");

	return 0;
}

Measured memory_bytes: 12412
#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif

template <class T>
vector<pair<T, T>> prime_factorization(T n) {
    vector<pair<T, T>> ret;
    for (T i = 2; i * i <= n; i++) {
        T cnt = 0;
        while(n % i == 0) {
            n /= i;
            cnt++;
        }
        if(cnt != 0) ret.emplace_back(i, cnt);
    }
    if (n != 1) ret.emplace_back(n, 1);
    return ret;
}


int main(){
    int64_t n;
    cin >> n;

    if(n < 2) {
        cout << 0 << endl;
        return 0;
    }

    vector<pair<int64_t, int64_t>> p = prime_factorization(n);

    int64_t ans = 0;
    for (auto i = 0; i < (int)p.size(); i++) {
        int64_t cnt = 1;
        while(true) {
            if(p[i].second >= cnt) {
                p[i].second -= cnt;
                ans++;
                cnt++;
            } else break;
        }
        // cout << p[i].first << " " << p[i].second << endl;
    }

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

Measured memory_bytes: 3640
n = int(input())

if n == 1:
  print(1)
elif n >= 2 and n <= 3:
  print(2)
elif n >= 4 and n <= 7:
  print(4)
elif n >= 8 and n <= 15:
  print(8)
elif n >= 16 and n <= 31:
  print(16)
elif n >=32 and n <= 63:
  print(32)
else:
  print(64)

Measured memory_bytes: 3060
using System;
using System.Collections;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
        string alpha = "abcedfghijklmnopqrstuvwxyz";
        int num = rint();
        string[,] list = new string[260,100010];
        int[,] listnum = new int[260,100010];
        long total = 0;
        for(int i=0;i<num;i++){
            string read = rstr();
            char[] chan = new char[10];
            for(int j=0;j<10;j++){
                chan[j] = read[j];
            }
            Array.Sort(chan);
            string change = "";
            int fir = 0;
            for(int j=0;j<10;j++){
                change += chan[j];
                fir += alpha.IndexOf(chan[j]);
            }
            for(int j=0;j<100010;j++){
                if(list[fir,j] == null){
                    list[fir,j] = change;
                    total += listnum[fir,j];
                    listnum[fir,j]++;
                    break;
                }else if(list[fir,j] == change){
                    total += listnum[fir,j];
                    listnum[fir,j]++;
                    break;
                }
            }
        }
        WriteLine(total);
    
    
    
    
    }
    //各種読取
    static string rstr(){
        return ReadLine();
    }
    static int rint(){
        return int.Parse(ReadLine());
    }
    static long rlong(){
        return long.Parse(ReadLine());
    }
    static string[] stra(){
        return ReadLine().Split(' ');
    }
    static int[] inta(){
        string[] read_str_array = ReadLine().Split(' ');
        int[] return_int_array = new int[read_str_array.Length];
        for(int countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_int_array[countup_i] = int.Parse(read_str_array[countup_i]);
        }
        return return_int_array;
    }
    static int[,] inta2(int num_array,int in_array){
        int[,] int_array2 = new int[num_array,in_array];
        for(int i=0;i<num_array;i++){
            int[] temp_array = inta();
            for(int j=0;j<in_array;j++){
                int_array2[i,j] = temp_array[j];
            }
        }
        return int_array2;
    }
    static long[] longa(){
        string[] read_str_array = ReadLine().Split(' ');
        long[] return_long_array = new long[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_long_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_long_array;
    }
    static double[] doublea(){
        string[] read_str_array = ReadLine().Split(' ');
        double[] return_double_array = new double[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_double_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_double_array;
    }
    // A/B小数点以下切上
    static int divideup(int divided,int divid){
        int temp_divide = divided/divid;
        if(divided % divid > 0){
            temp_divide++;
        }
        return temp_divide;
    }
}


Measured memory_bytes: 245244
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	if(a%b==0){
		cout<<"-1";
		return 0;
	} 
	for(int i=1;;i++){
		if((a*i)%b!=0){
			cout<<a*i;
			return 0;
		}
	}
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 205
using namespace std;
int n,l[N],ans;

int main(){
  cin>>n;
  for(int i=0;i<2*n;i++)cin>>l[i];
  sort(l,l+2*n);
  for(int i=0;i<2*n;i+=2)ans+=l[i];
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF=1e6;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    vector<int> cnt(3,0);
    for (char c:S) ++cnt[c-'a'];
    int m=INF,M=0;
    for (int i=0;i<3;++i) m=min(m,cnt[i]),M=max(M,cnt[i]);
    cout << (M-m<2?"YES":"NO") << '\n';
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<numeric>
#include<stack>
#include<map>
#include<queue>
#include<unordered_map>
#include<cmath>
#include<utility>

using ULL = unsigned long long;
using LL = long long;
using String = std::string;
using Ints = std::vector<int>;
using Doubles = std::vector<double>;
using Bools = std::vector<bool>;
using Strings = std::vector<std::string>;
using ULLs = std::vector<ULL>;
using LLs = std::vector<LL>;

// pythonのdictionary相当
template <typename T1, typename T2>
using Dict = std::unordered_map<T1,T2>;




int main(void) {
    int H, W, K;
    std::cin >> H >> W >> K;

    std::vector<Ints> C(H, Ints(W, 0));

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            char c;
            std::cin >> c;
            if(c == '.') C[i][j] = 0;
            else C[i][j] = 1;
        }
    }

    int res = 0;

    for(int i=0;i<pow(2,H);i++){
        for(int j=0;j<pow(2,W);j++){
            int cnt = 0;
            int a=i;
            for(int k=0;k<H;k++){
                int b=j;
                for(int l=0;l<W;l++){
                    if(a%2 == 0 && b%2 == 0 && C[k][l] == 1) cnt++;
                    b/=2;
                }
                a/=2;
            }
            if(cnt == K) res++;
        }
    }

    std::cout << res << std::endl;

    return 0;
}

Measured memory_bytes: 4108
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;
bool hantei(int a){
    for(int i=2;i*i<=a;i++){
        if(a%i==0){
            return false;
        }
    }
    return true;
}

int main(){
    int q;
    cin>>q;
    vector<int> sosuu(100010,0);
    sosuu[3]=1;
    vector<int> ans(q);
    for(int i=3;i<100010;i++){
        if(i%2==0){
            sosuu[i]=sosuu[i-1];
        }else{
            sosuu[i]=sosuu[i-1];
            if(hantei(i) && hantei((i+1)/2)){
                sosuu[i]++;
            }
        }
    }
    for(int i=0;i<q;i++){
        int l,r;
        cin>>l>>r;
        ans[i]=sosuu[r]-sosuu[l-1];
    }
    for(int i=0;i<q;i++){
        cout<<ans[i]<<endl;
    }
}

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

int main()
{
    int n, tmp = 0, ans = 0;
    cin >> n;
    int h[n];
    for (int i = 0; i < n; i++)
        cin >> h[i];

    for (int i = 0; i < n - 1; i++)
    {
        if (h[i] >= h[i + 1])
        {
            tmp++;
        }
        else
        {
            ans = max(tmp, ans);
            tmp = 0;
        }
    }
    ans = max(tmp, ans);
    cout << ans << endl;
}


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

int main() {
    int a, b;
    cin >> a >> b;

    if (a < b) {
        cout << "a < b" << endl;
    }
    else if(a > b) {
        cout << "a > b" << endl;
    }
    else {
        cout << "a == b" << endl;

    }
}


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

int main(){
	while(1){
		int n, ans=0;
		
		scanf(" %d", &n);
		if(n==0) break;
		
		for(int i=2; i<n; ++i){ //連続する正の数の個数(n未満は明らか)
			if(i%2==0){ //偶数個
				int q=n/i;
				int w=i/2;
				if(q-w+1>=1 && n%i==w) ++ans;
			}
			else{ //奇数個
				if(n%i != 0) continue;
				else{
					int q=n/i;
					int w=i/2;
					if(q-w>=1) ++ans;
				}
			}
		}	
	
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1188
r={"*":2,"/":2,"+":1,"-":1,"(":0,")":0}
for _ in[0]*int(input()):
 L=[];t=''
 for e in input()[:-1]:
  if e.isdigit():t+=e
  else:
   if t:L+=[t];t=''
   L+=e
 if t:L+=[t]
 P,S=[],[]
 for i in L:
  if"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  elif i in r:
   while S and r[S[-1]]>=r[i]:P+=S.pop()
   S+=i
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:
  if x in'+-*/':t=S.pop();S+=[str(int(eval(S.pop()+x+t)))]
  else:S+=[x]
 print(*S)


Measured memory_bytes: 5604
use std::cmp::min;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let m:usize = read();
    let mut v:Vec<i64> = (0..m).map(|_| read()).collect();
    v.sort();
    let mut diffs = Vec::new();
    for i in 1..m {
        diffs.push((v[i] - v[i-1]).abs());
    }
    diffs.sort_by(|a, b| b.cmp(a));
    let mut ans = v[m-1] - v[0];
    for i in 0..min(diffs.len(), n-1) {
        ans -= diffs[i];
    }
    println!("{}", ans);
}

Measured memory_bytes: 3912
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = Integer.parseInt(sc.next());
		int w = Integer.parseInt(sc.next());
		if (h == 1 && w == 1) {
			System.out.println("Yes");
			return;
		}
		String[][] s = new String[h][w];
		for (int i = 0; i < h; i++)
			s[i] = sc.next().split("");
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (s[i][j].equals(".")) continue;
				boolean able = false;
				if (i - 1 >= 0 && s[i - 1][j].equals("#"))
					able = true;
				if (j - 1 >= 0 && s[i][j - 1].equals("#"))
					able = true;
				if (i + 1 < h && s[i + 1][j].equals("#"))
					able = true;
				if (j + 1 < w && s[i][j + 1].equals("#"))
					able = true;
				if (!able) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}

Measured memory_bytes: 21972
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int N = reader.nextInt();
        double[] X = new double[N];
        double[] Y = new double[N];
        for (int i=0; i<N; i++) {
            X[i] = (double)reader.nextInt();
            Y[i] = (double)reader.nextInt();
        }
        double sum = 0.0;
        for (int i=0; i<N; i++) {
            for (int j=i+1; j<N; j++) {
                sum += Math.sqrt(Math.pow(X[i]-X[j],2)+Math.pow(Y[i]-Y[j],2));
            }
        }
        System.out.println(sum*2.0/(double)N);
    }

    // Read Class
    static class FS {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
    
        private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public int nextInt() {
            return (int)nextLong();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if(b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
    }
}



Measured memory_bytes: 22484
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;
using ll = long long;

int main(){
    int H,W;
    cin >> H >> W;
    int CH,CW,DH,DW;
    cin >> CH >> CW >> DH >> DW;
    vector<vector<char>> S(H,vector<char>(W));
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            cin >> S.at(i).at(j);
        }
    }
    typedef pair<int,int> P;
    int INF = 100000000;
    vector<vector<int>> d(H,vector<int>(W));
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            d.at(i).at(j)=INF;
        }
    }
    queue<P> que;
    queue<P> que2;
    que.push(P(CH-1,CW-1));
    d.at(CH-1).at(CW-1)=0;

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

    vector<int> dx2(24);
  	dx2 = {-2,-1,0,1,2,-2,-1,0,1,2,-2,-1,1,2,-2,-1,0,1,2,-2,-1,0,1,2,-2,-1,0,1,2};
    vector<int> dy2(24);
  	dy2 = {-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,1,1,1,1,1,2,2,2,2,2};

    while(que.size()+que2.size()){
        while(que.size()){
            P p=que.front();
            que2.push(p);
            que.pop();
            if(p.first==DH-1 && p.second==DW-1) break;

            for(int i=0; i<4; i++){
                int nx=p.first+dx.at(i);
                int ny=p.second+dy.at(i);
                if(0<=nx && nx<H && 0<=ny && ny<W && S.at(nx).at(ny)!='#' && d.at(nx).at(ny)==INF){
                    que.push(P(nx,ny));
                    d.at(nx).at(ny)=d.at(p.first).at(p.second);
                }
            }
        }
        while(que2.size()){
            P p=que2.front();
            que2.pop();

            for(int i=0; i<24; i++){
                int nx=p.first+dx2.at(i);
                int ny=p.second+dy2.at(i);
                if(0<=nx && nx<H && 0<=ny && ny<W && S.at(nx).at(ny)!='#' && d.at(nx).at(ny)==INF){
                    que.push(P(nx,ny));
                    d.at(nx).at(ny)=d.at(p.first).at(p.second)+1;
                }
            }
        }
    }
    if(d.at(DH-1).at(DW-1)==INF) cout << -1;
    else cout << d.at(DH-1).at(DW-1);
}

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

int main() {
    int n;
    string s;
    cin >> n >> s;
    int a[26], b[26];
    int max=0;

    for(int i=1; i<n-1; i++) {
        for(int j=0; j<26; j++) {
            a[j]=0; b[j]=0;
        }

        for(int j=0; j<i; j++) a[s[j]-'a']++;
        for(int j=i; j<n; j++) b[s[j]-'a']++;
        int cnt=0;
        for(int j=0; j<26; j++) if(a[j]*b[j]) cnt++;
        if(cnt>max) max=cnt;
    }
    cout << max << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
using ll = long long;
const int INF=1001001001;
const double PI=3.14159265358979323846; 
 
int main(){
  	int n, m;
  cin >> n >> m;
  int h = 0;
  rep(i, m){
    int a;
    cin >> a;
    h += a;
  }
  
  int ans = n - h;
  if(ans < 0) ans = -1;
  cout << ans << endl;
  
  return 0;
}


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

int main(void) {
	int a,b,c,d;
	cin >> a >> b >> c >> d;
		
	if (a+b > c+d) {
		cout << "Left" << "\n";
	} else if (a+b < c+d) {
		cout << "Right" << "\n";
	} else {
		cout << "Balanced" << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
#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;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

string s1;
string s2;

void query1(char a, char b)
{
	cout << s1 << a << endl;
	cout << s2 << b << endl;
	fflush(stdout);
}

void query2(char a, char b)
{
	cout << a << s1 << endl;
	cout << b << s2 << endl;
	fflush(stdout);
}

bool read()
{
	char c; cin >> c;
	if(c == 'T') return true;
	else return false;
}

char dx[4] = {'.', '.', '#', '#'};
char dy[4] = {'.', '#', '.', '#'};

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin >> n;
	bool bac = true;
	while(s1.length() < n && s2.length() < n && bac)
	{
		bac = false;
		for(int i = 0; i < 4; i++)
		{
			query1(dx[i], dy[i]);
			if(read())
			{
				bac = true;
				s1 += dx[i];
				s2 += dy[i];
				break;
			}
		}
	}
	while(s1.length() < n && s2.length() < n)
	{
		for(int i = 0; i < 4; i++)
		{
			query2(dx[i], dy[i]);
			if(read())
			{
				bac = true;
				s1 = dx[i] + s1;
				s2 = dy[i] + s2;
				break;
			}
		}
	}
	cout << s1 << endl << s2 << endl; fflush(stdout);
	string s; cin >> s;
}


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

    using namespace std;

    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int n;
        int m;
        cin>>n>>m;
        int total=0;
        vector<int>a(n);
        for(int i=0;i<n;i++){
            cin>>a[i];
            total+=a[i];
        }
        int z=m;
        if(total%(4*m)==0)
            m=total/(4*m);
        else
            m=(total/(4*m))+1;
        int val=0;
        for(int i=0;i<n;i++){
            if(a[i]>=m)
                val++;
        }
        if(val>=z)
            cout<<"Yes";
        else
            cout<<"No";
        return 0;
    }


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <limits>

template<class T> std::ostream& operator<<(std::ostream& o, const std::vector<T>& v)
{
	o << v[0];
	for (unsigned int i = 1; i < v.size(); i++) { o << " " << v[i]; }
	return o;
}

int main()
{
	unsigned int N = 0;
	std::cin >> N;

	std::vector<int> A(N);
	for (unsigned int i = 0; i < N; i++) { std::cin >> A[i]; }

	std::cout << A << std::endl;

	for (unsigned int i = 1; i < N; i++)
	{
		int val = A[i];
		unsigned int cand = i;
		while (cand > 0)
		{
			if (A[cand - 1] < val) { break; }
			A[cand] = A[cand - 1];
			cand--;
		}
		A[cand] = val;

		std::cout << A << std::endl;
	}

	return 0;
}


Measured memory_bytes: 3096
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;
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;
}

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

    int N;
    cin >> N;
    vector<int> s(N);
    REP(i, N) cin >> s[i];

    int sum = 0;
    REP(i, N) sum += s[i];
    SORT(s);
    REP(i, N) {
        if (sum % 10 != 0)
            break;
        if (s[i] % 10 != 0)
            sum -= s[i];
    }
    REP(i, N) {
        if (s[i] % 10 != 0)
            break;
        if (i == N - 1)
            sum = 0;
    }

    std::cout << sum << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define M 100010
#define fi first
#define sc second
#define pb push_back
#define LL long long
#define MOD 998244353
#define pii pair<int, int>
#define For(i,x,y) for(int i=(x);i<(y);i++)
#define rep(i,x,y) for(int i=(x);i<=(y);i++)
#define drep(i,x,y) for(int i=(x);i>=(y);i--)
inline int read(){char ch=getchar();int x=0,f=1;while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while('0'<=ch&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
inline LL llread(){char ch=getchar();LL x=0,f=1;while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while('0'<=ch&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
inline int Power(int x,int y,int mod){int r=1;while(y){if(y&1)r=1ll*r*x% mod;x=1ll*x*x%mod;y>>=1;}return r;}
map<LL,int> cnt;
int main(){
	int n=read();LL ans=0;
	while(n--){
		LL x=llread(); LL A=1,B=1;
	//	printf("x:%lld\n",x);
		for(int i=2;1ll*i*i*i<=x;i++){
			int c=0;while(x%i==0)c++,x/=i;
		//	cout << "c " << c << endl;
			c%=3;
			if(c==1)A*=i,B*=1ll*i*i;
			if(c==2)A*=1ll*i*i,B*=i;
		} A*=x;
		if((LL)sqrt(x)*(LL)sqrt(x)==x)B*=(LL)sqrt(x);
		else B*=x*x;
		if(A==1)ans+=(++cnt[A]==1);
		else ans+=(++cnt[A]>cnt[B]);
	//	printf("%lld %lld\n", A, B);
	} cout<<ans;
	return 0;
}

Measured memory_bytes: 12800
# ABC090B - Palindromic Numbers
a, b = list(map(int, input().rstrip().split()))
count = 0
for i in range(a, b + 1):
    lst = list(map(int, list(str(i))))
    if lst[0] == lst[4] and lst[1] == lst[3]:
        count += 1
print(count)

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

//C++14 (GCC 5.4.1)

#define LLINF (1LL<<60)
typedef long long ll;
#define mod 1000000007

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define rrepd(i,a,b) for(int i=(a);i>=(b);i--)

template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

#define dbg_v1(i,V) do{cout<<"-v1----\n";rep(i,V.size())cout<<" "<<i<<"\t:"<<V[i]<<endl;cout<<endl;}while(0)
#define dbg_v2(i,k,V) do{cout<<"-v2----\n";rep(i,V.size()){rep(k,V[0].size())cout<<" "<<V[i][k];cout<<endl;}}while(0)
#define lower_bound_idx(V,c) distance(V.begin(),lower_bound(V.begin(),V.end(),c))

int p[8],N;
double ans=0;
bool isK[8]={0};
double dis[8][8];

void dic(int pos,int k){
    //cout<<"-"<<pos<<"  "<<k<<endl;
    p[pos]=k;
    if(pos == N-1){
        //show
        double addk=0;
        repd(i,1,N){
            addk+=dis[p[i-1]][p[i]];
        }
        ans+=addk;
    }else{
        isK[k]=false;
        rep(i,N){
            if(isK[i])dic(pos+1,i);
        }
        isK[k]=true;
    }
}


int main() {
    
    cin >>N;

    vector<double> x(N),y(N);
    rep(i,N) cin >> x[i]>>y[i];
    rep(i,N)rep(k,N){
        dis[i][k] = sqrt( (x[i]-x[k])*(x[i]-x[k]) + (y[i]-y[k])*(y[i]-y[k]));
    }
    rep(i,N) isK[i]=true;
    rep(i,N) dic(0,i);
    int as=1;
    for(int t=N;t>0;t--)as*=t;
    //printf("%0.10f %d\n",ans,as);
    printf("%0.10f\n",ans/as);

    return (0);
}

Measured memory_bytes: 256
var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var Q = Number(lines[0]); lines.shift();
    var lr = lines.map(i => i.split(" ").map(i => Number(i)));

    var x = lr.concat().sort((a, b) => b[1] - a[1])
    var max = x[0][1];

    var sum = Array(max + 1).fill(0);

    sum[0] = 0; sum[1] = 0; sum[2] = 0; sum[3] = 1; sum[4] = 1;
    
    // 累積和
    for (var i = 5; i <= max; i++) {
        for (var j = 2; j <= Math.sqrt(i); j++) {
            // 素数でなければ，break
            if (i % j === 0) { break; }
            
            // (i + 1) / 2が整数でない場合，素数でないのでbreak
            if ((i + 1) / 2 !== Math.floor((i + 1) / 2)) { break; }
            
            // (i + 1) / 2が素数でなければ，break
            if (((i + 1) / 2) % j === 0) { break; }
            
            // 素数なら，sum++
            if (j === Math.floor(Math.sqrt(i))) { sum[i]++; }
        }
        // 累積和
        sum[i] += sum[i - 1];
    }



    for (var i = 0; i < Q; i++) {
        console.log(sum[lr[i][1]] - sum[lr[i][0] - 1]);
    }

});

Measured memory_bytes: 56684
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 2e+9 + 10;
typedef pair<ll, ll> P;

int main() {
    cin>>N;
    vec num(2e+5, 0);
    rep(i,N){
        cin>>A;
        ++num[A];
    }
    ll ans = 0;
    rep(i, ll(2e+5)) ans += max(0LL, num[i] - 1);
    cout<<N - ((ans + 1) / 2) * 2<<endl;
}

Measured memory_bytes: 1792
#include<stdio.h>

int main()
{
	long long h,w, ans;
	long long line, line_num;
	scanf("%lld %lld", &h, &w);

	if (h==1 || w==1){
		ans = 1;
	}else{
			line = w / 2 + w % 2;
			line_num = h / 2 + h % 2;
			ans = line * line_num;

			line = w / 2;
			line_num = h / 2;
			ans += line * line_num;
	}

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

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


using namespace std;


#ifdef zxc

#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-8;
const ll MOD = 1e9 + 7;
const ld PI = 3.141592653589793;
const int maxn = 10001;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

signed main() {
#ifdef zxc
    mt19937 mt(228);
//    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
//            freopen("", "r", stdin);
//        freopen("hack.out", "w", stdout);
#endif
    fast_io();
    cout.precision(10);
    cout << fixed;
    auto start = chrono::steady_clock::now();

    int x;
    cin >> x;
    cout << (x / 500 * 1000 + x % 500/5*5);
    auto end = chrono::steady_clock::now();
    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}



Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main() {
    long int n, k, r, s, p;
    string t;

    scanf("%ld", &n);
    scanf("%ld", &k);
    scanf("%ld", &r);
    scanf("%ld", &s);
    scanf("%ld", &p);

    cin >> t;

    vector<int> win(n, 0);
    long int ans = 0;

    for (int i=0; i<n; i++) {
        if (i-k < 0) {
            win[i] = 1;
            if (t[i] == 'r') {
                ans += p;
            } else if (t[i] == 's') {
                ans += r;
            } else {
                ans += s;
            }
        } else {
            if (t[i-k] == t[i]) {
                if (win[i-k] == 1) {
                    continue;
                } else {
                    win[i] = 1;
                    if (t[i] == 'r') {
                        ans += p;
                    } else if (t[i] == 's') {
                        ans += r;
                    } else {
                        ans += s;
                    }
                }
            } else {
                win[i] = 1;
                if (t[i] == 'r') {
                    ans += p;
                } else if (t[i] == 's') {
                    ans += r;
                } else {
                    ans += s;
                }
            }
        }
    }

    printf("%ld", ans);




}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

LL n, m, a[100000], s[100001];
map<LL, LL> mp;

int main() {
	cin >> n >> m;
	inc(i, n) { cin >> a[i]; }
	
	inc(i, n) { s[i + 1] = (s[i] + a[i]) % m; }
	
	incII(i, 0, n) { mp[s[i]]++; }
	
	LL ans = 0;
	for(auto && e: mp) { ans += e.SE * (e.SE - 1) / 2; }
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 5760
import java.util.*;
public class Main
{
    public static void main (String args[]) throws Exception
    {
        Scanner cin = new Scanner(System.in);
        int a = cin.nextInt();
        int b = cin.nextInt();
        if((a * b) % 2 == 0) {
            System.out.print("Even");
        } else {
            System.out.print("Odd");
        }
    }
}

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

using namespace std;

int G[51][51];

int main(void){
	int H, W;
	scanf("%d %d", &H, &W);



	for(int j = 0;j < H;++j){
		for(int k = 0;k < W;++k){
			char c;
			cin >> c;
			if(c == '#'){
				G[j][k] = 1;
			}else{
				G[j][k] = 0;
			}
		}
	}

	int flag = 0;
	for(int j = 0;j < H;++j){
		for(int k = 0;k < W;++k){
			int t = G[j][k];
			if(t == 1){
				int hoge = 0;
				if(j >= 1 && G[j-1][k] == 1){
					hoge = 1;
				}
				if(j < H - 1 && G[j+1][k] == 1){
					hoge = 1;
				}
				if(k >= 1 && G[j][k-1] == 1){
					hoge = 1;
				}
				if(k < W - 1 && G[j][k+1] == 1){
					hoge = 1;
				}
				if(hoge != 1){
					flag = 1;
				}
			}
		}
	}

	if(flag == 0){
		printf("Yes\n");
	}else{
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, k, n) for(int i = (k); i < (n); i++)
#define FORr(i, k, n) for(int i = (k); i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORr(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;

int main(void){
  int n;
  cin >> n;
  vector<int> h(n);
  REP(i, n) cin >> h[i];

  int maxval = h[0];
  FOR(i, 1, n){
    if(h[i] < maxval-1){
      cout << "No" << endl;
      return 0;
    }
    chmax(maxval, h[i]);
  }
  cout << "Yes" << endl;

  return 0;
}

Measured memory_bytes: 640
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
#define int long long
#define float double
const int INF = 100000000000000000;


signed main(void){
  int a,b,h;
  cin >> a >> b >> h;
  cout << (a+b)*h/2 << "\r\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define ordered_set tree < ll ,  null_type ,  less<ll> ,  rb_tree_tag ,  tree_order_statistics_node_update >
//added two more functions to set
//(1)*(set.find_by_order(k))[kth element in the sorted set] 
//(2)set.order_of_key(k)[count of elements strictly less than k]

typedef vector< int > vi;
typedef vector<long long> lvi;
typedef vector< vector<int> > vvi;
typedef vector< vector<long long> > lvvi;
typedef pair< int,int > ii;
typedef pair< long long,long long > lii;
typedef vector<pair<int,int>> vii;
typedef vector<pair<long long,long long>> lvii;
typedef vector<vector<pair<int,int>>> vvii;
typedef vector<vector<pair<long long,long long>>> lvvii;
typedef vector<bool> vb;

// #ifdef ONLINE_JUDGE 
// #define endl '\n'
// #endif
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)//remember i is an iterator
#define tc(t) int (t); cin>>(t);while((t)--)
#define ff first
#define ss second
#ifdef ONLINE_JUDGE
	#define error(args...) 0
#else
	#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#endif
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr <<"[ "<< *it << " = " << a << " ]"<< endl;
	err(++it, args...);
}

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
const long long mod = 1e9 + 7;
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

long long mos() { return 0LL; }
template<typename T, typename... Args>
T mos(T a, Args... args) { return ((a + mos(args...))%mod + mod)%mod; }

long long mop() { return 1LL; }
template<typename T, typename... Args>
T mop(T a, Args... args) { return (a*mop(args...))%mod; }
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------



signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);	
	string s;
	cin>>s;
	for (int i = 0; i < s.length() && i<3; ++i)
	{
		cout<<s[i];
	}
	cout<<endl;
	return 0;
}	


// WA
// 1. overflow
// 2. re-initialize global variables for every test case.
// 3. edge cases like n=1

// Run time error
// 1. division by zero.
// 2. array bounds.

// TLE
// 1. uncomment that #define endl '\n' line

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

int main(){
  int a,b,c,sum;
  cin >> a >> b >> c;
  priority_queue<int> que;
  que.push(a);
  que.push(b);
  que.push(c);
  sum=0;
  que.pop();
  sum=que.top();
  que.pop();
  sum=sum+que.top();
  que.pop();
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<algorithm>

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

using namespace std;

const double EPS=1e-9;

int n;
double d[21][21];

bool dfs(double t,int i,bool *vis){
	if(d[i][n]<t+EPS) return false;
	if(count(vis,vis+n,true)==n) return true;

	rep(j,n) if(!vis[j] && d[i][j]+EPS>d[j][n]-t) return false;

	rep(j,n) if(!vis[j]) {
		vis[j]=true;
		if(dfs(t+d[i][j],j,vis)) return true;
		vis[j]=false;
	}
	return false;
}

int main(){
	for(int hx,hy,mx,my;scanf("%d%d%d%d%d",&n,&hx,&hy,&mx,&my),n;){
		int cx[20],cy[20];
		rep(i,n) scanf("%d%d",cx+i,cy+i);
		rep(i,n){
			rep(j,n) d[i][j]=hypot(cx[i]-cx[j],cy[i]-cy[j]);
			d[i][n]=hypot(cx[i]-mx,cy[i]-my);
		}

		bool ok=false,vis[20]={};
		rep(i,n){
			vis[i]=true;
			if(dfs(hypot(hx-cx[i],hy-cy[i]),i,vis)) { ok=true; break; }
			vis[i]=false;
		}
		puts(ok?"YES":"NO");
	}

	return 0;
}

Measured memory_bytes: 744
n = int(input())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
m = 0
cnt = 0
for i, a in enumerate(a_list):
    b = 0 if i == n else b_list[i]
    cnt += min(m+b, a)
    m = max(0, b - max(0, a-m))
print(cnt)


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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  int A=0,B=0;
  for (int i = 0; i < N; i+=2) {
    A+=a.at(i);
  }
  for (int i = 1; i < N; i+=2) {
    B+=a.at(i);
  }
  cout << A-B << endl;
}


Measured memory_bytes: 256
N, M= map(int, input().split())

L,R = 0,100100
ans = [0]*(N+1)
for i in range(M):
    a,b = map(int,input().split())
    L = max(L,a)
    R = min(R,b)
if R - L >= 0:
    print(R-L+1)
else:
    print(0)



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

using namespace std;
using ll = long long;

ll gcd(ll a,ll b){while(a&&b){if(a>b) a = a%b;else b = b%a;}return a+b;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

template<class T>
map<T,T> fact(T n){
    map<T,T> Map;
    for(T i = 2; i * i <= n; i++){
        while(n % i == 0){
            Map[i]++;
            n /= i;
        }
    }
    if(n == 1)return Map;
    Map[n]++;
    return Map;
}

int main()
{
    ll a, b;
    cin >> a >> b;
    ll gc = gcd(a,b);
    map<ll,ll> fac = fact(gc);

    int cnt = 0;

    for(auto i : fac){
        //cerr << i.first << " " << i.second << endl;
        cnt++;
    }
    cout << cnt + 1<< endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define ff first
#define ss second
#define INF 1000000000
int main() {
    int h,n;
    cin>>h>>n;
    vector<int> ans(h+1,INF);
    int a[n], b[n];
    for(int i=0;i<n;i++) {
        cin>>a[i]>>b[i];
    }
    ans[0] = 0;
    for(int i=0;i<=h;i++) {
        for(int j=0;j<n;j++) {
            ans[i] = min(ans[max(0,i-a[j])]+b[j],ans[i]);
        }
    }
    cout<<ans[h];
}

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

int main()
{
    int n, z, w;
    cin >> n >> z >> w;
    int a[n];
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }

    
    int dp1[n+1];
    int dp2[n+1];
    
    dp1[1] = abs(a[n-1] - a[n-2]);
    dp2[1] = abs(a[n-1] - a[n-2]);

    
    for(int i = 2; i < n; i++)
    {
        int s = 0;
        for(int j = 1; j < i; j++)
        {
            s = max(s, dp2[j]);
        }
        dp1[i] = max(s, abs(a[n-1]-a[n-i-1]));

        int p = 2000000000;
        for(int j = 1; j < i; j++)
        {
            p = min(p, dp1[j]);
        }
        dp2[i] = min(p, abs(a[n-1]-a[n-i-1]));

    }
    
    int t = 0;
    for(int i = 1; i < n; i++)
    {
        t = max(t, dp2[i]);
    }
    
    dp1[n] = max(t, abs(w - a[n-1]));
    
    cout << dp1[n] << endl;
    
}

Measured memory_bytes: 256