akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bitset>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<string, int> PSI;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define REP(i,n)  for(int i=0; i<(n); i++)

//constant
//--------------------------------------------
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const LL MOD = 1e9+7; 
//vector <vector<int>> x(20, vector<int> (20)), y(20,vector<int> (20));
/*int counter_1 (int x) {
    if(x == 0) return 0;
    return counter_1(x >> 1) + (x & 1);
}*/

//int Counter(int x)
/*int factorial(int n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}*/
/*bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second > secondElof.second;
}*/
int main(){
    int n, k, ans=0;
    cin >> n >> k;
    while(n>=k){
        n/=k;
        ans++;
    }
    cout << ans+1 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long FINV(int n){
    if (n < 0) return 0;
    return finv[n];
}

ll mod_pow(ll x, ll n, ll mod){
    ll res = 1;
    while(n > 0){
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

/*
    Ball and Boxes 9
    男、女、スルーあり(ストリートナンパ形式)
*/

ll calc_Bell(int n, int k){
    ll res = 0;
    while(0 < k){
        ll tmp = 0;
        rep(i,k){
            ll mul = 1;
            mul *= mod_pow(k-i, n, MOD);
            mul *= COM(k,i);
            mul %= MOD;
            if(i%2==0){
                tmp += mul;
                tmp %= MOD;
            }else{
                tmp -= mul;
                tmp += MOD;
                tmp %= MOD;
            }
        }

        tmp *= FINV(k);
        tmp %= MOD;
        
        res += tmp;
        res %= MOD;

        k--;
    }
    return res;
}

int main() {
    ll n, k;
    cin >> n >> k;
    COMinit();

    ll ans = calc_Bell(n, k);
    
    cout << ans << endl;
    return 0;
}
 
 



Measured memory_bytes: 15056
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var x = parseInt(input[0].split(" ")[1]);
  a = new Array(N);
  tmp = input[1].split(" ");
  var sum =0;
  for(i=0;i<N;i++){
	  a[i]=parseInt(tmp[i]);
	sum+=a[i];
  }
  var num=x;
  a.sort(function(a,b){return a-b});
  var ans =0;
  for(i=0;i<N;i++){
	  if(x>=a[i]){
		ans++;
		x-=a[i];
	  }else{
		  break;
	  }
  }
  if(num>sum){
	  ans=N-1;
  }
  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

    string s;
    string t;
    cin>>s>>t;
    int ans= 0 ;
    for(int i = 0 ;  i < s.length() ; ++i)
        ans += (s[i] == t[i]);
    cout<<ans<<endl;
}
		

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
using namespace std;
 
int main() {
    int K, X; cin >> K >> X;

    int minX = X - (K - 1);
    int maxX = X + (K - 1);

    for(minX; minX <= maxX; minX++){
        cout << minX;
        if(minX != maxX) cout << " ";
    }
    return 0;
}

Measured memory_bytes: 256
from math import sqrt
x1, y1, r1 = map(int, input().split())
x2, y2, r2 = map(int, input().split())

def intersection_cc(C0, r0, C1, r1):
    x0, y0 = C0; x1, y1 = C1
    xd = x1 - x0; yd = y1 - y0
    rr0 = xd**2 + yd**2
    rr1 = r0**2; rr2 = r1**2
    v_cos = (rr0 + rr1 - rr2)
    if 4*rr0*rr1 < v_cos**2:
        # ?§£??????
        return tuple()
    """
    if 4*rr0*rr1 == v_cos**2:
        # ????????????
        return tuple((x0 + v_cos*xd/(2.*rr0), y0 + v_cos*yd/(2.*rr0)))
    """
    # ??????
    v_sin = sqrt(4*rr0*rr1 - v_cos**2)
    return (
        (x0 + (v_cos*xd - v_sin*yd)/(2.*rr0), y0 + (v_cos*yd + v_sin*xd)/(2.*rr0)),
        (x0 + (v_cos*xd + v_sin*yd)/(2.*rr0), y0 + (v_cos*yd - v_sin*xd)/(2.*rr0))
    )

p0, p1 = sorted(intersection_cc((x1, y1), r1, (x2, y2), r2))
print("%.08f %.08f %.08f %.08f" % (p0 + p1))

Measured memory_bytes: 7864
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static final long INF = (long) 1e17;
    static int n, a[], maxskips;
    static Long memo[][];

    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner sc = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        n = sc.nextInt();
        a = sc.nextIntArray(n);
        maxskips = 1 + (n % 2);
        memo = new Long[3][n];
        long ans = dp(0, 0);
        out.println(ans);
        out.flush();
        out.close();
    }

    static long dp(int skip, int i) {
        if (skip > maxskips) return -INF;
        if (i >= n) return (n%2!=0 && skip==0)?-INF:0;
        if (memo[skip][i] != null) return memo[skip][i];
        long max = a[i] + dp(skip, i + 2);
        if (i != n - 1) max = Math.max(max, dp(skip + 1, i + 1));
        return memo[skip][i] = max;
    }


    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        boolean ready() throws IOException {
            return br.ready();
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        Scanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        int nextChar() throws IOException {
            return next().charAt(0);
        }

        int[] nextIntArray(int n) throws IOException {
            int[] ans = new int[n];
            for (int i = 0; i < n; i++)
                ans[i] = nextInt();
            return ans;
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

    }
}


Measured memory_bytes: 67128
N = int(input())
S = input()

l = []
l.append(S)
i = 0
while True:
    if i > 1 and l[i] == l[i-1]:
        break
    l.append(l[i].replace("()",""))
    i += 1

a = l[i]
left = a.count(')')
right = a.count('(')
ans = '('*left + S + ')'*right
print(ans)

Measured memory_bytes: 3064
N = int(input())
if len(str(N)) == 1:
  ans = N
elif len(str(N)) == 2:
  ans = 9
elif len(str(N)) == 3:
  ans = N - 99 +9
elif len(str(N)) == 4:
  ans = 999 -99 + 9
elif len(str(N)) == 5:
  ans = N - 9999 + 999 - 99 +9
else:
  ans = 99999 - 9999 + 999 -99 +9
print(ans)

Measured memory_bytes: 9180
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>

using namespace std;

int main (void)
{
	int a,b,c;
	
	cin >> a >> b >> c;
	
	if (a + b >= c)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main() {
  int N,M;
  cin>>N>>M;
  
  int a[50],b[50];
  for(int i=0;i<M;++i){
    cin>>a[i]>>b[i];
  }
  
  int road[N]={0};
  for(int i=0;i<N;++i){
    for(int j=0;j<M;++j){
      if(i+1==a[j]) ++road[i];
      if(i+1==b[j]) ++road[i];
    }
  }
  
  for(int i=0;i<N;++i){
    cout<<road[i]<<endl;
  }
}


Measured memory_bytes: 256
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7


n = int_input()

a = list_input()

MAX = pow(10, 18)
flag = True
p = 1

for i in a:
    if i == 0:
        p = 0
        break

for i in a:
    p = p*i
    # print(p)
    if (p > MAX):
        flag = False
        break

# print(MAX)
if flag == True:
    print(p)
else:
    print(-1)

Measured memory_bytes: 22840
/*input
1 2
3 3
3

*/

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 4;

int a[2 * N], pos[N];

int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  int a, b, v, w, t;
  cin >> a >> v >> b >> w >> t;

  if (a == b) {
    cout << "YES";
    return 0;
  }

  if (w >= v) {
    cout << "NO";
    return 0;
  }

  int d = abs(a - b), sv = v - w;
  cout << ((d + sv - 1) / sv > t ? "NO" : "YES");

  return 0;
}

Measured memory_bytes: 3652
n = int(input())
a = []

for i in range(n):
    s,p = map(str,input().split())
    a.append([i+1,s,int(p)])

a = sorted(a, key=lambda x:x[2], reverse=1)
a = sorted(a, key=lambda x:x[1], reverse=0)

for i in range(n):
    print(a[i][0])

Measured memory_bytes: 3060
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int[] v = new int[n];
    int[] c = new int[n];

    for(int i = 0; i<n; i++) {
      v[i] = stdIn.nextInt();
    }

    for(int i = 0; i<n; i++) {
      c[i] = stdIn.nextInt();
    }

    int[] d = new int[n];
    for(int i = 0; i<n; i++) {
      d[i] = v[i] - c[i];
    }

    int ans = 0;
    for(int i = 0; i<n; i++) {
      if(d[i] > 0) {
        ans += d[i];
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 

int main() {
	int n;
	cin >> n;
	ll sum = 0;
	for(int i = 1; i <= n; i++) {
		if(i%3!=0&&i%5!=0)
			sum += i;
	}
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 3628
#define _GLIBCXX_DEBUG
typedef long long ll;
#include <bits/stdc++.h>

using namespace std;

ll mod = 1000000007;

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

ll modpow(ll a, ll n, ll mod)
{
	ll res = 1;
	while (0 < n)
	{
		if (n & 1)
		{
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

//int gcd(int x, int y)
//{
//
//}

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

	int n = 1;
	for (int i = 0; i < b; i++)
	{
		if (a * n % b == c)
		{
			cout << "YES" << endl;
			return 0;
		}
		n++;
	}
	cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
	string s;
	cin >> s;
	int flag =1;
	for(int i=0;i<=s.size()-3;i++){
		int j= i+2;
		if(s[i]!=s[j]){
			flag=0;
			break;
		}
	}
	if(flag){
		cout << "Second" << endl;
		return 0;
	}
	if(s[0]!=s[s.size()-1]){
		if(s.size()%2)cout<< "First" <<endl;
		else cout << "Second" << endl;
	}
	else{
		if(s.size()%2)cout<< "Second" <<endl;
		else cout << "First" << endl;
	}
}

Measured memory_bytes: 3728
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <iostream>
#include <fstream>
#include <chrono>

using namespace std;

const int DIV = 998244353;

void dfs(int v, vector<char> &was, vector<vector<int>> &g) {
    was[v] = 1;
    for (int i = 0; i < g[v].size(); i++) {
        int u = g[v][i];
        if (!was[u])
            dfs(u, was, g);
    }
}

void solve(int test, std::istream &in) {
    int n, m;
    in >> n >> m;
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i++) {
        int a, b;
        in >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<char> was(n, 0);
    int result = 0;
    for (int i = 0; i < n; i++) {
        if (!was[i]) {
            result++;
            dfs(i, was, g);
        }
    }
    printf("%d\n", result - 1);
}

int main(int argc, char *argv[]) {
#ifdef VLAD_LOCAL
    ifstream in("in.txt");
    auto start = std::chrono::steady_clock::now();
#else
    istream &in = cin;
#endif
    solve(0, in);
#ifdef VLAD_LOCAL
    auto end = std::chrono::steady_clock::now();
    double seconds = (double)std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() / 1000;
    printf("%.3lf seconds\n", seconds);
#endif
	return 0;
}


Measured memory_bytes: 9892
import numpy as np
def main():
    MOD = 10**9 + 7
    N = int(input())
    A = np.array(list(map(int, input().split())), dtype="i4")

    A = A % MOD
    rsumA = np.cumsum(A[::-1]) % MOD
    count = 0
    for i in range(len(A)-1):
        a = A[i]
        other = rsumA[len(A) - i - 2]
        count += (a * other) % MOD
    count %= MOD
    print(count)





if __name__ == '__main__':
    main()


Measured memory_bytes: 49988
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>


#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int n; cin >> n;
	unordered_multimap<int, int> g;
	FOR_LT(i, 0, n - 1) {
		int a, b; cin >> a >> b;
		g.insert({ a, b });
		g.insert({b, a
	});
	}

	struct P {
		int i;
		bool b;
		bool s;
	};
	vector<P> ps(n + 1);

	ps[1].b = true;
	ps[1].s = true;
	queue<int> search;
	search.push(1);
	int nb = 1;
	int nc = 0;
	while (!search.empty()) {
		int c = search.front();
		search.pop();

		auto it = g.find(c);
		while (it != g.end() && it->first == c) {
			int b = it->second;
			if (ps[b].s) {
			}
			else {
				ps[b].b = !ps[c].b;
				if (ps[b].b) nb++;
				else nc++;
				ps[b].s = true;
				search.push(b);
			}
			it++;
		}
	}
  
	int r1 = 1;
	int r2 = 2;
	int r3 = 3;

	if (nb <= (n / 3)) {
		FOR_LE(i, 1, n) {
			if (ps[i].b) {
				ps[i].i = r3;
				r3 += 3;
			}
			else {
				if (r1 <= n) {
					ps[i].i = r1;
					r1 += 3;
				}
				else if (r2 <= n) {
					ps[i].i = r2;
					r2 += 3;
				}
				else {
					ps[i].i = r3;
					r3 += 3;
				}
			}
		}
	}
	else if (nc <= (n / 3)) {
		FOR_LE(i, 1, n) {
			if (!ps[i].b) {
				ps[i].i = r3;
				r3 += 3;
			}
			else {
				if (r1 <= n) {
					ps[i].i = r1;
					r1 += 3;
				}
				else if (r2 <= n) {
					ps[i].i = r2;
					r2 += 3;
				}
				else {
					ps[i].i = r3;
					r3 += 3;
				}
			}
		}
	}
	else {
		FOR_LE(i, 1, n) {
			if (ps[i].b) {
				if (r1 <= n) {
					ps[i].i = r1;
					r1 += 3;
				}
				else if (r3 <= n) {
					ps[i].i = r3;
					r3 += 3;
				}
				else {
					assert(0);
				}
			}
			else {
				if (r2 <= n) {
					ps[i].i = r2;
					r2 += 3;
				}
				else if (r3 <= n) {
					ps[i].i = r3;
					r3 += 3;
				}
				else {
					assert(0);
				}
			}
		}
	}

	FOR_LE(i, 1, n) {
		cout << ps[i].i << " ";
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 20084
import math as ma

a,b,h,m = map(int,input().split())
degA,degB = h*30 + m*0.5, m*6
rad = ma.radians(abs(degA - degB))

ans = (a**2 + b**2 - 2*a*b*ma.cos(rad)) **0.5
print(ans)




Measured memory_bytes: 9496
#include <vector> 
#include <list> 
 #include <map>
 #include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '('<<'L' << __LINE__ << ')' << ' ' << __FILE__ << endl;

string yes="YES",no="NO";

int main(){
 

    int a;
    cin>>a;
    cout<<(24-a)+24<<endl;




}


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

int main(){
	int A,B,C,X,Y; cin>>A>>B>>C>>X>>Y;
	cout<< min(A*X + B*Y, C*2*min(X,Y) + min(X>Y?A:B, C*2)*abs(X-Y)) <<endl;
}

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

using namespace std;

int N;
int v[128];

vector<int> Solve() {
  vector<int> ans;
  for (int i = 0; i < N; ++i) {
    if (v[i]-1 > ans.size()) {
      return vector<int>();
    }
    ans.insert(ans.begin() + v[i]-1, v[i]);
  }
  return ans;
}

int main() {
  while (cin >> N) {
    for (int i = 0; i < N; ++i) {
      cin >> v[i];
    }
    auto ans = Solve();
    if (ans.empty()) {
      cout << -1 << endl;
    } else {
      for (auto v : ans) {
	cout << v << endl;
      }
    }
  }
}


Measured memory_bytes: 256
import numpy as np	
import sys
stdin = open(0)
K1 = (stdin.readline()).split()
K2 = (stdin.readline()).split()
K3 = (stdin.readline()).split()
KKK = np.array([K1,K2,K3], dtype='int')
N = np.array((stdin.readline()).split(),dtype='int')
K = np.array(stdin.readlines())
for i in range(len(K)):
  K[i] = K[i].replace('\n','')
K = np.array(K, dtype='int')

AAA = np.zeros((3,3),dtype='int')
for i in range(3):
  for j in range(3):
    for k in K:
      if KKK[i,j] == k:
        AAA[i,j] = 1
for i in range(3):
  if np.sum(AAA[i,:]) == 3:
    print('Yes')
    sys.exit()
  if np.sum(AAA[:,i]) == 3:
    print('Yes')
    sys.exit()
if (AAA[0,0]+AAA[1,1]+AAA[2,2])==3:
    print('Yes')
    sys.exit()
if (AAA[0,2]+AAA[1,1]+AAA[2,0])==3:
    print('Yes')
    sys.exit()
print('No')

Measured memory_bytes: 12436
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
#define BIG 2000000007
 
#define MOD 1000000007
typedef unsigned long long ull;
typedef   signed long long sll;
 
typedef struct {
	int a;
	int b;
} hw;
 
#define N_MAX 200000
#define M_MAX 100000
 
ull n, m, k;
ull h, w;
// ull a[N_MAX];
sll a[N_MAX];
// ull b[N_MAX];
// ull dp[N_MAX][M_MAX + 1];
// char s[N_MAX + 1];
// char t[N_MAX + 1];
// hw arr[N_MAX];
 
void swap_adj(ull *a, ull *b){
	ull tmp = *b;
	*b = *a;
	*a = tmp;
	return;
}

ull divide(ull a, ull b){
	ull x = MOD - 2;
	ull ans = 1;
	while (x) {
		if (x & 1) ans = (ans * b) % MOD;
		b = (b * b) % MOD;
		x /= 2;
	}
	return (a * ans) % MOD;
}
 
int digits(ull x){
	int i = 1;
	while (x >= 10) {
		x /= 10;
		i++;
	}
	return i;
}
 
int min(ull x, ull y){
	return (x < y) ? x : y;
}
 
ull gcd(ull x, ull y){
	if (x < y) {
		return gcd(y, x);
	} else if (y == 0) {
		return x;
	} else {
		return gcd(y, x % y);
	}
}
 
ull bitpow(ull a, ull x){
	ull result = 1;
	while (x) {
		if (x & 1) {
			result *= a;
			result %= MOD;
		}
		x /= 2;
		a = (a * a) % MOD;
	}
	return result;
}

int comp(const void *left, const void *right){
	if ((*(int*)left) < (*(int*)right)) {
		return -1;
	} else if ((*(int*)left) > (*(int*)right)) {
		return +1;
	} else {
		return 0;
	}
}

// int nextroute(int arr[]){
// 	int i = n - 1;
// 	int j, x;
// 	while (arr[i - 1] > arr[i]) i--;

// 	x = n;
// 	for (j = i; j < n; j++) {
// 		if (arr[j] < arr[i - 1]) continue;
// 		if (x == n || arr[x] > arr[j]) x = j;
// 	}
// 	arr[i - 1] ^= arr[x];
// 	arr[x] ^= arr[i - 1];
// 	arr[i - 1] ^= arr[x];

// 	qsort(&arr[i], n - i, sizeof(int), comp);
// 	return 0;
// }

ull solve(){
	int i, j;
	sll left = 0, right = 0;
	sll mindiff;

	for (i = 0; i < n; i++) right += a[i];

	for (i = 0; i < n - 1; i++) {
		sll tmpdiff;

		left += a[i];
		right -= a[i];
		tmpdiff = ((left > right) ? left - right : right - left);
		if (i == 0 || tmpdiff < mindiff) mindiff = tmpdiff;
	}

	printf("%lld\n", mindiff);
 
	return 0;
}
 
int main(void){
	int i, j;
	int x = 0;
 
	scanf("%llu", &n);
	for (i = 0; i < n; i++) {
		scanf("%lld", &a[i]); // signed
	}

	solve();
 
	return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define F first
#define S second
#define mod 1000000007
///distance(s.begin(),s.lower_bound(101))
using namespace std;
///dp[i][j]=j lessons skipped in first i days.
///mn[i][j]=min hours needed to spend in ith day to skip skip exactly j lessons.



int main(){
    int n,x,y;cin >>n>>x>>y;
    int mat[n+1][n+1];mat[x][y]=1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)mat[i][j]=100000;
    }
    for(int i=1;i<=n;i++){

            mat[x][i]=abs(i-x);

            mat[i][x]=abs(x-i);


            mat[y][i]=abs(i-y);

            mat[i][y]=abs(y-i);


    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            int d1=mat[i][x]+mat[y][j]+1;
            int d2=mat[j][x]+mat[y][i]+1;
            mat[i][j]=min(j-i,min(d1,d2));
        }
    }
    int vis[n+1]={0};
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            vis[mat[i][j]]+=1;
        }
    }
    for(int i=1;i<=n-1;i++)cout <<vis[i]<<endl;

}


Measured memory_bytes: 15872
#include<iostream>
#include<algorithm>
using namespace std;
#define FOR(i,b,n) for(int i = (b) ; i < (n) ; ++i)
#define rep(i,n) FOR(i,0,n)
int main(){
  int a,b,data[20000];
  while(cin >> a >> b , a || b){
    rep(i,a+b) cin >> data[i];
    sort(data,data+a+b);
    int ans = data[0];
    FOR(i,1,a+b) ans = max(ans,data[i]-data[i-1]);
    cout << ans << endl;
  }
}

Measured memory_bytes: 1252
#[allow(unused_imports)]
use std::cmp;

fn run() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: usize = sc.read();

    let ans = (1..=n)
        .into_iter()
        .map(|x| {
            let q = n / x;
            q * (q + 1) / 2 * x
        })
        .sum::<usize>();
    println!("{}", ans);
}

fn main() {
    std::thread::Builder::new()
        .name("run".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn read_pairs<T: std::str::FromStr>(&mut self, n: usize) -> Vec<(T, T)> {
        (0..n).map(|_| (self.read(), self.read())).collect()
    }
    pub fn read_pairs_1_indexed(&mut self, n: usize) -> Vec<(usize, usize)> {
        (0..n)
            .map(|_| (self.read::<usize>() - 1, self.read::<usize>() - 1))
            .collect()
    }
    pub fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
        (0..n).map(|_| self.read_chars()).collect()
    }
    pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n)
            .map(|_| (0..m).map(|_| self.read()).collect())
            .collect()
    }
}


Measured memory_bytes: 2276
#include <stdio.h>
#include <string.h>

#define NIL (-1)
#define M 1046527
#define L 14

char H[M][L];

int getChar(char ch)
{
	if (ch == 'A') return 1;
	else if (ch == 'C') return 2;
	else if (ch == 'G') return 3;
	else if (ch == 'T') return 4;
	else return 0;
}

long long getKey(char str[])
{
	long long sum = 0, p = 1, i;
	for (i = 0; i < strlen(str); i++) {
		sum += p*(getChar(str[i]));
		p *= 5;
	}
	return sum;
}

int h1(int key) { return key % M; }
int h2(int key) { return 1 + (key % (M - 1)); }

int find(char str[])
{
	long long key, i, h;
	key = getKey(str);
	for (i = 0; ; i++) {
		h = (h1(key) + i*h2(key)) % M;
		if (strcmp(H[h], str) == 0) return 1;
		else if (strlen(H[h]) == 0) return 0;
	}
	return 0;
}

int insert(char str[])
{
	long long key, i, h;
	key = getKey(str);
	for (i = 0; ; i++) {
		h = (h1(key) + i*h2(key)) % M;
		if (strcmp(H[h], str) == 0) return 1;
		else if (strlen(H[h]) == 0) {
			strcpy(H[h], str);
			return 0;
		}
	}
	return 0;
}

int main()
{
	int i, n;
	char str[L], com[9];
	for (i = 0; i < M; i++) {
		H[i][0] = '\0';
	}
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%s %s", com, str);

		if (com[0] == 'i') {
			insert(str);
		}
		else {
			if (find(str)) {
				printf("yes\n");
			}
			else {
				printf("no\n");
			}
		}
	}
    return 0;
}



Measured memory_bytes: 16024
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<ll> enum_div(ll n) {
    std::vector<ll> ret;
    for (ll i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

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

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

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<int> A(N);
    cin >> A;

    int k = count_if(ALL(A), [](int a) { return a < 0; });
    ll ans = 0;
    REP(i, N) {
        if (A[i] < 0) { A[i] = -A[i]; }
        ans += A[i];
    }

    if (k % 2 == 1) { ans -= 2 * *min_element(ALL(A)); }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v) {
    for (auto &e : t) fill(e, v);
}
// auto v = make_vec<int>(h, w);
// fill(v, 0);
const int INF = 1LL << 60;

struct edge{ 
  int to, cost, time;
  bool operator<(const edge& a) const {
    return time > a.time;
  }
 };

signed main(){

  int n, m, s; cin >> n >> m >> s;
  vector<vector<edge>> g(n);
  vector<int> a(m), b(m), c(n), d(n);
  for(int i = 0; i < m; i++){
    int u, v; cin >> u >> v;
    u--, v--;
    cin >> a[i] >> b[i];
    g[u].push_back({v, a[i], b[i]});
    g[v].push_back({u, a[i] ,b[i]});
  }
  for(int i = 0; i < n; i++){
    cin >> c[i] >> d[i];
  }

  auto dp = make_vec<int>(n, n * 55);
  fill(dp, INF);
  priority_queue<edge> q; //最小値
  s = min(s, n*50);
  q.push({0, s, 0});
  dp[0][s] = 0;
  while(!q.empty()){
    edge p = q.top(); q.pop();
    int u = p.to, cost = p.cost, t = p.time;
    if(dp[u][cost] < t) continue;
    if(cost + c[u] < n*50 && dp[u][cost + c[u]] > dp[u][cost] + d[u]){
      dp[u][cost + c[u]] = dp[u][cost] + d[u];
      q.push({u, cost + c[u], dp[u][cost + c[u]]});
    }
    for(auto e : g[u]){
      if(cost - e.cost >= 0 && dp[e.to][cost - e.cost] > dp[u][cost] + e.time){
        dp[e.to][cost - e.cost] = dp[u][cost] + e.time;
        q.push({e.to, cost - e.cost, dp[e.to][cost - e.cost]});
      }
    }
  }

  for(int i = 1; i < n; i++){
    //cout << dp[i] << endl;
    cout << *min_element(dp[i].begin(), dp[i].end()) << endl;
  }

  return 0;
}

Measured memory_bytes: 7448
#include <iostream>
#include <cstdio>
using namespace std;
#define MAX 21
#define INF 9999999

int main(){
    int mm[MAX][MAX],n,m,a,b,c,d,x1,x2,y1,y2;
    
    cin >> n >> m;
    for(int i = 1 ; i <= n ; i++)
        for(int j = 1 ; j <= n ; j++)
            mm[i][j] = INF;
    
    while(m--){
        scanf("%d,%d,%d,%d" ,&a ,&b , &c ,&d);
        mm[a][b] = c;
        mm[b][a] = d;
    }
    
    for(int k = 1 ; k <= n ; k++)
        for(int i = 1 ; i <= n ; i++)
            for(int j = 1 ; j <= n ; j++)
                mm[i][j] = min(mm[i][j],mm[i][k]+mm[k][j]);
    
    scanf("%d,%d,%d,%d" ,&x1 ,&x2 ,&y1 ,&y2);
    cout << y1 - y2 - mm[x1][x2] - mm[x2][x1] << endl;
    
    return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
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;

  return 0;
}


Measured memory_bytes: 3096
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    C = [0] * (N - 1)
    S = [0] * (N - 1)
    F = [0] * (N - 1)
    for i in range(N - 1):
        C[i], S[i], F[i] = map(int, input().split())

    ans = [0] * N
    for i in range(N - 1):
        time = 0
        for c, s, f in zip(C[i:], S[i:], F[i:]):
            if time < s:
                time = s
            r = (time - s) % f
            time += f - r if r > 0 else 0
            time += c
        ans[i] = time

    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()


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

int main() {
    int n,k;
    cin >> n >> k;
    vector<int> l(n);
    rep(i, n) cin >> l[i];
    sort(l.begin(),l.end());
    reverse(l.begin(),l.end());
    int ans = 0;
    rep(i,k) ans += l[i];
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct state{
  int y,x,f,bit;
};
int dy[4]={-1,0,1,0};
int dx[4]={0,1,0,-1};
int H,W,N;
char t[50][50];
int T[50][50];
int u[50][50];
int sy,sx,gy,gx;
int d[50][50][2][(1<<10)];

int solve(){
  memset(d,-1,sizeof(d));
  d[sy][sx][0][0]=0;
  queue< state > Q;
  Q.push((state){sy,sx,0,0});
  while(!Q.empty()){
    state s=Q.front();Q.pop();
    int y=s.y,x=s.x,f=s.f,bit=s.bit;
    int cost=d[y][x][f][bit];
    if(y==gy&&x==gx)return cost;
    for(int i=0;i<4;i++){
      int ny=y+dy[i],nx=x+dx[i];
      int key=__builtin_popcount(u[ny][nx]&bit);
      if(t[ny][nx]=='#')continue;
      key=(key+T[ny][nx])%2;
      if(t[ny][nx]!='|'&&f!=key)continue;
      if(d[ny][nx][f][bit]!=-1)continue;
      d[ny][nx][f][bit]=cost+1;
      Q.push((state){ny,nx,f,bit});
    }
    
    if('a'<=t[y][x]&&t[y][x]<='z'){
      int c=t[y][x]-'a';
      int nbit=bit^(1<<c);
      int nf=f;
      if(u[y][x]>>c&1)nf=1-nf;
      if(d[y][x][nf][nbit]==-1){
        d[y][x][nf][nbit]=cost+1;
        Q.push((state){y,x,nf,nbit});
      }
    }
    
    if('A'<=t[y][x]&&t[y][x]<='Z'){
      int c=t[y][x]-'A';
      int nbit=bit^(1<<c);
      int nf=f;
      if(u[y][x]>>c&1)nf=1-nf;
      if(d[y][x][nf][nbit]==-1){
        d[y][x][nf][nbit]=cost+1;
        Q.push((state){y,x,nf,nbit});
      }
    }

    if(t[y][x]=='|'&&d[y][x][1-f][bit]==-1){
      d[y][x][1-f][bit]=cost+1;
      Q.push((state){y,x,1-f,bit});
    }
  }
  return -1;
}

int main(){
  cin>>W>>H;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin>>t[i][j];
      if(t[i][j]=='%'){
        sy=i,sx=j;
      }
      if(t[i][j]=='&'){
        gy=i,gx=j;
      }
      T[i][j]=0;
      if('A'<=t[i][j]&&t[i][j]<='Z')T[i][j]=1;
      if(t[i][j]=='^')T[i][j]=1;
    }
  }
  
  char ch;
  cin>>N;
  for(int i=0;i<N;i++){
    for(int j=0;j<H;j++){
      for(int k=0;k<W;k++){
        cin>>ch;
        if(ch=='*')u[j][k]|=(1<<i);
      }
    }
  }

  cout<<solve()<<endl;
  return 0;
}

Measured memory_bytes: 21844
#include<cstdio>
#include<algorithm>
using namespace std;

const int N = 1000000;
int dp[2][N+1];

int main(){
  for(int i=0;i<=N;i++)dp[0][i] = dp[1][i] = N;
  dp[0][0] = dp[1][0] = 0;

  int val = 1;
  for(int i=1;val<=N;i++){
    for(int j=0;j+val<=N;j++){
      int nxt = j+val;
      dp[0][nxt] = min(dp[0][nxt],dp[0][j] + 1);
      if(val&1)dp[1][nxt] = min(dp[1][nxt],dp[1][j] + 1);
    }
    val = i*(i+1)*(i+2)/6;
  }

  int n;
  while(scanf("%d",&n),n)printf("%d %d\n",dp[0][n],dp[1][n]);
}

Measured memory_bytes: 8840
n=int(input())
w=list(map(int,input().split()))
ans=10000

for i in range(n):
  s1=0
  s2=0
  for j in range(i):
    s1=s1+w[j]
  for k in range(i, n):
    s2=s2+w[k]
  ans=min(ans, max(s1, s2)- min(s1, s2))
  
print(ans)

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

int main() {
  int n,i,j,k,count=0,max=0,error=0;
  string s;
  cin >>n>>s;
  string front="",back="";
  
  for(i=1;i<n;i++){
    front="";
    back="";
    count=0;
    for(j=0;j<i;j++)
      front=front+s[j];
    for(j=i;j<n;j++)
      back=back+s[j];
    
    for(j=0;j<i;j++){
      error=0;
      for(k=0;k<j;k++)
        if(front[j]==front[k])
          error--;
      if(error==0){
        for(k=i;k<n;k++){
          if(s[j]==s[k]){
            count++;
            break;
          }
        }
      }
    }
      if(max<count)
        max=count;
  }
  cout<<max;
}


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

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

    if ((a == b + c) or (b == c + a) or (c == a + b)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
G = [list(input()) for i in range(H)]

# あるマスから（右・下・左・上）にいくつ障害物ないマスが続くか
right_space = [[-1] * (W + 2) for i in range(H + 2)]
down_space = [[-1] * (W + 2) for i in range(H + 2)]
left_space = [[-1] * (W + 2) for i in range(H + 2)]
up_space = [[-1] * (W + 2) for i in range(H + 2)]

# 左上から更新（上・左に対応）
for h in range(1, H + 1):
    for w in range(1, W + 1):
        if G[h - 1][w - 1] == '.':
            up_space[h][w] = up_space[h - 1][w] + 1
            left_space[h][w] = left_space[h][w - 1] + 1

# 右下から更新（下・右に対応）
for h in reversed(range(1, H + 1)):
    for w in reversed(range(1, W + 1)):
        if G[h - 1][w - 1] == '.':
            down_space[h][w] = down_space[h + 1][w] + 1
            right_space[h][w] = right_space[h][w + 1] + 1

ans = 0
for h in range(1, H + 1):
    for w in range(1, W + 1):
        if G[h - 1][w - 1] == '.':
            tmp_ans = right_space[h][w] + down_space[h][w] + left_space[h][w] + up_space[h][w] + 1
            ans = max(ans, tmp_ans)

print(ans)


Measured memory_bytes: 307848
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            long mod = 1000000007;
            int[] count = new int[n];

            for (int i = 0; i < n; i++) {
                int cn = in.nextInt();
                if (++count[cn] > 2 || (count[0] > 1 && (n & 1) == 1)) {
                    out.println(0);
                    return;
                }
            }

            long ans = 1;
            for (int i = 0; i < n / 2; i++) {
                ans = ans << 1;
                ans %= mod;
            }

            out.println(ans);
        }

    }

    static class FastScanner {
        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int bufPointer;
        private int bufLength;

        public FastScanner(InputStream in) {
            this.in = in;
        }

        private int readByte() {
            if (bufPointer >= bufLength) {
                if (bufLength == -1)
                    throw new InputMismatchException();

                bufPointer = 0;
                try {
                    bufLength = in.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (bufLength <= 0)
                    return -1;
            }
            return buffer[bufPointer++];
        }

        private static boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public long nextLong() {
            long n = 0;

            int b = readByte();
            while (isSpaceChar(b))
                b = readByte();

            boolean minus = (b == '-');
            if (minus)
                b = readByte();

            while (b >= '0' && b <= '9') {
                n *= 10;
                n += b - '0';
                b = readByte();
            }

            if (!isSpaceChar(b))
                throw new NumberFormatException();

            return minus ? -n : n;
        }

        public int nextInt() {
            long n = nextLong();

            if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
                throw new NumberFormatException();

            return (int) n;
        }

    }
}



Measured memory_bytes: 23252
#include <iostream>
#include <ostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>

using namespace std;

int main()
{
    int n;
    int ans = 0;

    cin >> n;

    for (int i = 1; i <= n; i++) {
        if (n-i > 0 && i != n-i) {
            ans++;
        }
    }

    cout << ans / 2 << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int main()
{
    long long a,b,c,k;
	cin>>a>>b>>c>>k;
	if(k%2==0)
	cout<<(a-b)<<endl;
	else
	cout<<(b-a)<<endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
Sum = [A[0]]
Sum_card =sum(A)
Min= float('inf')
for i in range(1,N-1):
    Sum.append(Sum[-1]+A[i])
    Min = min(Min,abs(Sum[-1]-(Sum_card-Sum[-1])))
Min = min(Min,abs(Sum[-1]-(Sum_card-Sum[-1])))
print(Min)



Measured memory_bytes: 23800
from math import atan, atan2, degrees

a, b, x = list(map(int, input().split()))

th = atan2(a, b)

if a**2*b == x:
    print(0)
else:
    tmp1 = atan(a**3 / (2 * (a**2 * b - x)))
    tmp2 = atan(2 * x / (a * b**2))

    if tmp1 <= th:
        print(90 - degrees(tmp2))
    else:
        print(90 - degrees(tmp1))


Measured memory_bytes: 38640
#include <iostream>

using namespace std;

int main(){
	int n, m;
	cin >> n >> m;
	if((m - 1) % (n - 1) == 0){
		cout << (m - 1) / (n - 1);
	}else{
		cout << (m - 1) / (n - 1) + 1;
	}
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	static int H;
	static int W;
	static char[][] grid;
	static long[][] memo;

	static long dp(int x, int y) {
		for (int i = 0; i < W; i++) {
			if (grid[0][i] == '#')
				break;
			memo[0][i] = 1;
		}
		for (int i = 0; i < H; i++) {
			if (grid[i][0] == '#')
				break;
			memo[i][0] = 1;
		}

		for (int i = 1; i < H; i++) {
			for (int k = 1; k < W; k++) {
				if (grid[i][k] == '#')
					continue;
				memo[i][k] = (memo[i - 1][k] + memo[i][k - 1])% ((long) 1e9 + 7);
			}
		}
		return (memo[H - 1][W - 1] % ((long) 1e9 + 7));

	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		grid = new char[H][W];
		memo = new long[H][W];
		for (int i = 0; i < H; i++)
			grid[i] = sc.next().toCharArray();
		for (long[] i : memo)
			Arrays.fill(i, 0);
		System.out.println(dp(0, 0));

	}

}


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

AB = [tuple(map(int,input().split())) for i in range(M)]

es = [[] for _ in range(N)]
for a, b in AB:
    es[a-1].append(b-1)
    es[b-1].append(a-1)

ans = [-1] * N
ans[0] = 0

from collections import deque
que = deque([])
que.append(0)

while que:
    s = que.popleft()
    for v in es[s]:
        if ans[v] == -1:
            ans[v] = s+1
            que.append(v)

print("Yes")
print(*ans[1:], sep="\n")

Measured memory_bytes: 65008
import java.util.Scanner;

public class Main{
	
	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		
		int A=sc.nextInt();
		int B=sc.nextInt();
		int T=sc.nextInt();
		
		int i=T/A;
		int sum=0;
		
		for(int j=0;j<i;j++) {
			sum+=B;
		}
		System.out.println(sum);
	}
}

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

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
void print_line(vector<ll> &line) {
    for (int i = 0; i < line.size(); i++) {
        cout << line[i];
        if (i == line.size() - 1) cout << endl;
        else cout << ' ';
    }
}

typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;
const int mod = 1000000007;

int main() {

    while (true) {
        string s;
        cin >> s;
        if (s == "0") return 0;

        int sum = 0;
        for (int i = 0; i < s.size(); i++) {
            int j = s[i] - '0';
            sum+= j;
        }
        cout << sum << endl;
    }
}


Measured memory_bytes: 3208