akhauriyash/Code-Regression huggingface dataset:
//  main.cpp
//  CppTest

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

int main(int argc, const char * argv[]) {
    
    // cinを高速にするためのおまじない
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    /////////////////////
    // Write code below /
    /////////////////////
    int N, K, n=0;
    cin>>N>>K;
    for(int i=0;i<N;i++){
        int x;
        cin>>x;
        if(x<K-x){
            n+=(x*2);
        }
        else{
            n+=((K-x)*2);
        }
    }
    cout<<n<<endl;
    
    
    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

		public static void main(String[] args){

			Scanner sc = new Scanner(System.in);
			// 整数の入力
			int N = sc.nextInt();
			int res = N;
			
			for(int i = 0;i <= N;i++){
				
				int cc = 0;
				int t = i;
				while(t>0){
					cc+=t%6;
//					System.out.println("cc="+cc);
					t/=6;
				}
//				System.out.println("i6="+i);
				t=N-i;
				while(t>0){
					cc+=t%9;
					t/=9;
				}
//				System.out.println("i9="+i);
				if(res>cc){
					res = cc;
				}
//				System.out.println("cc="+cc);
			}
       		// 出力
			System.out.println(res);

			return ;
		}

}


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

for i in range(N):
    a[i].append(a[i][0] + a[i][1])
    a[i].append(a[i][0] - a[i][1])

a = sorted(a, key = lambda x: x[2])
candidate1 = abs(a[0][0] - a[-1][0]) + abs(a[0][1] - a[-1][1])

a = sorted(a, key = lambda x: x[3])
candidate2 = abs(a[0][0] - a[-1][0]) + abs(a[0][1] - a[-1][1])

print(max([candidate1, candidate2]))

Measured memory_bytes: 62948
#define _USE_MATH_DEFINES // M_PIなどの定義を使用するのに必要
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <climits>
#include <iomanip>
#include <deque>
#include <limits>
#include <map>

using namespace std;

int main()
{
  string S, T;

  cin >> S >> T;

  for (int i = 0; i < S.size(); i++) {
    if (S[i] != T[i]) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 3596
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class A
{
	public static void Main()
	{
		long x = GetLong();
		long y = GetLong();
		Console.WriteLine((x % y != 0) ? x : -1);
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}

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

void solve(){
  int n, m; cin >> n >> m;
  string sn[n], sm[m];
  for(int i = 0; i < n; ++i) cin >> sn[i];
  for(int i = 0; i < m; ++i) cin >> sm[i];
  for(int i = 0; i < n-m+1; i++){
    for(int j = 0; j < n-m+1; j++){
      int flag = 1;
      int cnt = 0;
		for(int k = 0; k < m && flag; k++){
          if(sn[i+k].substr(j, m) != sm[k]) flag = 0;
          else cnt++;
        }
      if(cnt == m) {
        cout << "Yes" << endl;
        return;
      }
    }
  }
  cout << "No" << endl;
}

int main(){
  solve();
  return 0; 
}

Measured memory_bytes: 3628
from collections import Counter
N, K, Q = map(int, input().split())
A = [int(input())-1 for _ in range(Q)]
A = Counter(A)
for i in range(N):
    if i in A.keys():
        tmp = A[i]
    else:
        tmp = 0
    if K - (Q - tmp) > 0:
        print('Yes')
    else:
        print('No')


Measured memory_bytes: 11904
ll = int(input())
l = ll-1
bb = format(l,'b')
x = len(bb)-1

ans=[]

for i in range(x):
    ans.append((i+1,i+2,0))
    ans.append((i+1,i+2,2**(x-i-1)))

a = l - 2**x+1
acum=2**x

n=x+1

while a != 0:
    bb = format(a,'b')
    y = len(bb)-1
    if x+1-y == 1:
        ans.append((x+1,x+2,0))
        ans.append((x+1,x+2,2**x))
        n+=1
        a=0
    else:
        ans.append((1,x+1-y,acum))
        a = a-2**y
        acum += 2**y

m = len(ans)
print(n,m)

for a,b,c in ans:
    print(a,b,c)




Measured memory_bytes: 3064
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;

using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e9;
const ll MOD = 1e9 + 7;

int main()
{
  long long N;
  scanf("%lld", &N);
  std::vector<double> x(N);
  std::vector<double> y(N);
  for (int i = 0; i < N; i++)
  {
    scanf("%lf", &x[i]);
    scanf("%lf", &y[i]);
  }
  vector<int> arr(N);
  for (int i = 0; i < N; ++i)
    arr[i] = i;
  double ans = 0;
  do
  {
    for (int i = 0; i < N - 1; ++i)
    {
      ans += sqrt(pow(x[arr[i + 1]] - x[arr[i]], 2.0) + pow(y[arr[i + 1]] - y[arr[i]], 2.0));
    }
  } while (next_permutation(arr.begin(), arr.end()));
  double t = 1;
  for (int i = 1; i <= N; ++i)
    t *= i;
  ans /= t * 1.0;
  printf("%.9lf\n", ans);

  return 0;
}


Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {
    h:usize,
    w:usize,
    k:usize,
    c : [Chars;h],
     }
    // all!
    // let mut rowc = vec![0; h];
    // let colc = vec![0; w];
    // for i in 0..h {
    //     for j in 0..w {
    //         rowc[i] += if c[i][j] == '#' { 1 } else { 0 };
    //     }
    // }
    // for i in 0..w {
    //     for j in 0..h {
    //         colc[i] += if c[j][i] == '#' { 1 } else { 0 };
    //     }
    // }
    let mut ans = 0;

    for hh in 0..1 << h {
        for ww in 0..1 << w {
            let mut blackc = 0;
            for i in 0..h {
                for j in 0..w {
                    if hh >> i & 1 == 1 && ww >> j & 1 == 1 {
                        if c[i][j] == '#' {
                            blackc += 1;
                        }
                    }
                }
            }
            if blackc == k {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2204
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
result = 0
for n in range(N):
    result+= min(B[n], A[n]+A[n+1])
    if B[n]>A[n]:
        A[n+1]-=min(B[n]-A[n], A[n+1])
print(result)

Measured memory_bytes: 19244
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
using namespace std; using ll = long long; using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
int ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.second < secondElof.second;
}
ll nod(ll F) { return log10(F) + 1; }
//**定義場所**//
//gcd, isPrime, eratos, modinv, bitSearch, dfs, bfs, dijkstra, UnionFind//
ll i, j, k, l, m, n; ll N, M, K, H, W, L; string S;
ll MOD = 1000000007; ll ans = 1; ll INF = 9999999999999;
vl flag, color; vll path;
//***********//
//main内でCOMinit(N)を忘れずに！
vl fac, finv, inv;
ll modinv(ll a, ll m) {
	ll b = m, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
void COMinit(ll N) {
	fac.resize(N);
	finv.resize(N);
	inv.resize(N);
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < N; 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;
	}
}
ll COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
	ll A, B;
	cin >> N >> A >> B;
	ll C = N;
	ll D = 1;
	for (i = 0; i < 100; i++) {
		D = (D * 2) % MOD;
	}
	while (C >= 100) {
		ans = (ans * D) % MOD;
		C -= 100;
	}
	while (C > 0) {
		ans = (ans * 2) % MOD;
		C -= 1;
	}
	ans--;
	ll pre = 1;
	ll P = A;
	for (i = N; i >= N-P+1; i--) {
		pre = (pre * i) % MOD;
	}
	for (i = 2; i <= P; i++) {
		pre = (pre * (modinv(i,MOD)%MOD)) % MOD;
	}
	//cout << pre;
	ans = (ans - pre + MOD) % MOD;
	pre = 1;
	P = B;
	for (i = N; i >= N - P + 1; i--) {
		pre = (pre * i) % MOD;
	}
	for (i = 2; i <= P; i++) {
		pre = (pre * (modinv(i, MOD)%MOD)) % MOD;
	}
	//cout << pre;
	ans = (ans - pre + MOD) % MOD;
	cout << ans;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<string.h>
int main(){
    char S[10];
    scanf("%s",S);
    int num = strlen(S);
    long long sum = 0;    
    for(int bit=0;bit<(1<<num-1);bit++){
       int order = 1;
        sum += S[num-1]-'0';
        for(int i=1;i<num;i++){
            if(bit & (1<<(i-1))){
                order = 0;
                sum += (S[num-1-i]-'0')*pow(10,order);
                order = 1;
            }
            else{
                sum += (S[num -1- i]-'0')*pow(10,order);
                order++;
            }
        }
    }
    printf("%lld",sum);
}


Measured memory_bytes: 128
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

const ll nmax = 1e9 + 7;
const ll Mod = 998244353;
const double PI = 2 * asin(1);

ll Pow(ll A, ll B, ll mod){
  if (B == 0) return 1;
  else{
    if (B % 2 == 0){
      return Pow(A * A % mod, B / 2, mod) % mod;
    }else{
      return A * Pow(A * A % mod, B / 2, mod) % mod;
    }
  }
}

ll nCr(ll N, ll C, ll mod){
  ll ans = 1; C = min(C, N - C);
  for (ll i = 1; i <= C; i++){
    ans *= N - i + 1; ans %= mod;
    ans *= Pow(i, mod - 2, mod); ans %= mod;
  }
  return ans;
}


int main(){
  ll H; cin >> H;
  ll now = 1;

  ll ans = 0;
  while (H > 1){
    H /= 2;
    ans += now;
    now *= 2;
  }
  ans += now;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
class Sushi(object):
    def __init__(self, sushi_type, delicious):
        self.t = sushi_type
        self.d = delicious


def main() -> None:
    n, k = map(int, input().split())
    menu = [[int(x) for x in input().split()] for _ in range(n)]
    selected = []
    unselected = []
    cnt = 0
    p_satisfied = 0
    selected_type = set()

    menu.sort(key=lambda x: x[1], reverse=True)

    for i in range(n):
        sushi = Sushi(menu[i][0], menu[i][1])
        if sushi.t not in selected_type and cnt < k:
            selected_type.add(sushi.t)
            cnt += 1
            selected += [menu[i]]
        else:
            unselected += [menu[i]]

    unselected.sort(key=lambda x: x[1])

    while cnt < k and len(unselected) > 0:
        p_satisfied += unselected[-1][1]
        unselected.pop()
        cnt += 1

    while True:
        t_cnt = len(selected)
        if len(selected) == 0 or len(unselected) == 0:
            break
        if t_cnt ** 2 + selected[-1][1] > (t_cnt - 1) ** 2 + unselected[-1][1]:
            break
        p_satisfied += unselected[-1][1]
        unselected.pop()
        selected.pop()

    for v in selected:
        p_satisfied += v[1]

    print(p_satisfied + len(selected) ** 2)


if __name__ == "__main__":
    main()


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

int main() {
    string s;
    cin >> s;

    bool hi=false;

    if (s.size()%2 == 0) {
        for (int i=0; i<s.size(); i += 2) {
            if (s.at(i) == 'h') {
                if (s.at(i+1) == 'i') hi = true;
            }
        }
    } 

    if (hi) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

int N;
Pi data[300000];

bool calc(int value){ //閉じこめられる微生物value

  priority_queue < Pi, vector< Pi >, greater< Pi > > que; //許容量が小さい順に取り出す(?)
  int64 sum = 0; //放出量の和
  for(int i = 0; i < N; i++){ //人数分入れる
    sum += data[i].first;
    que.push( Pi( data[i].second, data[i].first));
    while(!que.empty() && (int64)que.top().first * value < sum){
      sum -= que.top().second;
      que.pop();
    }
    if(que.size() >= value) return true;
  }
  return value == 0;
}
int main(){
  scanf("%d", &N);
  for(int i = 0; i < N; i++){
    scanf("%d %d", &data[i].first, &data[i].second);
  }
  sort( data, data + N);

  //これわかんないな
  int row = 0, high = N;
  while(high != row){
    int mid = (row + high + 1) >> 1;
    if(calc(mid)) row = mid;
    else high = mid - 1;
  }
  printf("%d\n", high);
}

Measured memory_bytes: 10920
#include<bits/stdc++.h>
using namespace std;
#define sz(x) int(x.size())
#define pb push_back
#define ff first
#define ss second
typedef long long ll;

int main(){
	int n,k;cin>>n>>k;
	vector<int>vec(n);
	bool is0=false;
	for(int i=0;i<n;i++){
		cin>>vec[i];
		if(vec[i]==0)is0=true;
	}
	if(!is0){
		vec.pb(0);
		sort(vec.begin(),vec.end());
		k++;
	}
	int mn=INT_MAX;
	for(int i=0;i+k<=sz(vec);i++){
		//eval in range [i,i+k-1]
		if(vec[i]>0||vec[i+k-1]<0)continue;
		mn=min(mn,min(-2*vec[i]+vec[i+k-1],-vec[i]+2*vec[i+k-1]));
	}
	cout<<mn<<endl;
	
	return 0;
}


Measured memory_bytes: 4032
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    for i in range(3):
        if S[i] == S[i + 1]:
            print('Bad')
            exit()
    print('Good')

if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <deque>
#include <queue>
#include <string>
#include <tuple>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>

#define pb push_back
#define pbk pop_back
#define sz(a) ((int) (a).size())
#define all(a) (a).begin(), (a).end()
#define mp make_pair
#define mt make_tuple
#define fs first
#define sc second
#define next hunext
#define prev huprev
#define rank hurank
#define hash huhash

#ifdef LOCAL42
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;

const int inf = int(1e9);
const ll linf = ll(1e18);
const double eps = 1e-9;
const double pi = 4 * atan(1.0);

struct hasher {
    
    inline int operator () (const pii& p) const {
        return p.fs * 239017 + p.sc + 42;
    }
    
};

unordered_set<pii, hasher> points;
unordered_set<pii, hasher> used;
ll ans[10];

int main() {
#ifdef LOCAL42
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m, k;
    cin >> n >> m >> k;
    for (int i = 0; i < k; ++i) {
        int x, y;
        scanf("%d %d", &x, &y);
        points.insert(mp(x, y));
    }
    for (pii p : points) {
        for (int x = max(p.fs - 2, 1); x <= min(p.fs, n - 2); ++x) {
            for (int y = max(p.sc - 2, 1); y <= min(p.sc, m - 2); ++y) {
                if (used.find(mp(x, y)) == used.end()) {
                    used.insert(mp(x, y));
                    int cnt = 0;
                    for (int i = 0; i < 3; ++i) {
                        for (int j = 0; j < 3; ++j) {
                            if (points.find(mp(x + i, y + j)) != points.end()) {
                                ++cnt;
                            }
                        }
                    }
                    assert(cnt > 0);
                    ++ans[cnt];
                }
            }
        }
    }
    ans[0] = 1LL * (n - 2) * (m - 2);
    for (int i = 1; i < 10; ++i) {
        ans[0] -= ans[i];
    }
    for (int i = 0; i < 10; ++i) {
        cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 40720
#include<cstdio>
#include<cstdlib>
#include<cstring>

struct Node
{
	int key;
	Node *next,*prev;
};

Node *nil;

Node* listSearch(int key)
{
	Node *cur = nil->next;
	while(cur != nil && cur ->key != key)
	{
		cur = cur->next;
	}
	return cur;
}

void init(){
	nil = (Node *)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}

void printList()
{
	Node *cur = nil->next;
	int isf = 0;
	while(1)
	{
		if(cur == nil) break;
		if(isf++ > 0) printf(" ");
		printf("%d",cur->key);
		cur = cur->next;
	}
		printf("\n");
}

void deleteNode(Node *t)
{
	if(t == nil) return;
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst()
{
	deleteNode(nil->next);
}

void deleteLast()
{
	deleteNode(nil->prev);
}

void deleteKey(int key)
{
	deleteNode(listSearch(key));
}

void insert(int key)
{
	Node *x = (Node *)malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next =x;
	x->prev=nil;
}

int main()
{
	int key,n,i;
	int size = 0;
	char com[20];
	int np = 0,nd = 0;
	scanf("%d",&n);
	init();
	for(i=0;i<n;i++)
	{
		scanf("%s%d",com,&key);
		if(com[0] == 'i')
		{
			insert(key);
			np++;
			size++;
		}
		else if(com[0] == 'd')
		{
			if(strlen(com) > 6)
			{
				if(com[6] == 'F') deleteFirst();
				else if(com[6] == 'L') deleteLast();
			}
			else
			{
				deleteKey(key);
				nd++;
			}
			size--;
		}
	}
	printList();
	
	return 0;
}

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

typedef long long LL;

// Find the biggest m that m(m+1)/2 <= n. (1+2+...+(m-1)+m <= n)
LL calc(LL n)
{
	n <<= 1LL;
	LL x = __builtin_sqrt(n);
	if(x * (x + 1LL) > n) return x - 1LL;
	if((x + 1LL) * (x + 2LL) <= n) return x + 1LL;
	return x;
}

int main(int argc, char** argv)
{
	LL n, ans = 0LL;
	scanf("%lld", &n);
	bool isprime = true;
	int t = __builtin_sqrt(n);
	for(LL i=2LL; i<=t; i++)
	{
		LL cnt = 0LL;
		while(n % i == 0LL)
			n /= i, cnt ++;
		if(cnt > 0LL)
			ans += calc(cnt), isprime = false;
	}
	if(n > 1LL)
		if(isprime) puts("1");
		else printf("%lld\n", ans += 1);
	else printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 2140
X,N=map(int, input().split())
p=list(map(int, input().split()))

if len(p)==0:
    print(X)
    exit()

for i in range(N+1):
    if p.count(X-i)==0:
        print(X-i)
        exit()
    if p.count(X+i)==0:
        print(X+i)
        exit()


Measured memory_bytes: 9120
mod = 1000000007
n,k = map(int, input().split())
d = [0]*(k+1)
for i in range(1,k+1):
    d[i] = pow(k//i, n, mod)
for i in range(k,0,-1):
    for j in range(2*i, k+1, i):
        d[i] -= d[j]
        d[i] %= mod
ans = 0
for i in range(1,k+1):
    ans += d[i]*i
    ans %= mod
print(ans)

Measured memory_bytes: 11184
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
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);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int[] n = in.nextIntArray(3);
            Arrays.sort(n);
            out.println(n[0] + n[1] == n[2] ? "Yes" : "No");
        }

    }

    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;
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

    }
}



Measured memory_bytes: 23508
import bisect

N = int(input())
L = sorted(map(int, input().split()))

ans = 0
for m in range(N):
    for s in range(m):
        #このfor文の時点で、時点でs<mを満たす。
        # L[m] <= L[l] < L[s] + L[m]
        # 使用している辺は使えず、sortしてあるので、m<lという条件が加わる。
        # m<lの時点で、L[m] <= L[l]は満たすので、m<l とL[l] < L[s] + L[m]で考える。
        ans += bisect.bisect_left(L,L[s]+L[m]) - (m+1)
        
print(ans)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int n, q, k; cin >> n >> k >> q;
	vi a(n); rep(i, n) cin >> a[i];
	vi v = a;
	sort(all(v));
	int ans = inf;
	for(int mn : v){
		vi cur, res;
		vector<vi> vs;
		rep(i, n) if(a[i] < mn){
			if(cur.size()){
				vs.pb(cur);
				cur.clear();
			}
		}
		else cur.pb(a[i]);
		if(cur.size()) vs.pb(cur);
		
		//dbg(mn, vs);
		
		for(vi & i : vs) if(i.size() >= k){
			sort(all(i));
			for(int j = 0; j + k <= i.size(); j++) res.pb(i[j]);
		}
		sort(all(res));
		if(res.size() >= q) ans = min(ans, res[q - 1] - mn);
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
LL A[2001];
LL K;
LL MOD=1e9+7;
LL B[2001];
int main(){
	cin>>N>>K;
	REP(i,N){
		cin>>A[i];
		B[i]=0;
	}
	LL c=0;
	REP(i,N){
		for(int j=i+1;j<N;j++){
			if(A[i]>A[j]){
				c+=K;
				c%=MOD;
			}
		}
	}
	LL ans=c;
	//cout<<ans<<endl;
	REP(i,N){
		REP(j,N){
			if(A[i]>A[j]){
				B[i]++;
			}
		}
	}
	REP(i,N){
		//cout<<B[i]<<endl;
		LL t=B[i]*((K*(K-1)/2)%MOD);
		t%=MOD;
		ans+=t;
		ans%=MOD;
	}
	cout<<ans<<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 = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

vector<string> results;

int n;

void rec(string s){
  map<char, int>m;
  rep(i, s.size()) m[s[i]]++;
  rep(i, m.size()+1){
    char c = (char)('a'+i);
    string t(s);
    t.push_back(c);
    if(t.size()==n)results.push_back(t);
    else rec(t);
  }
}

int main(){
  cin>>n;
  if(n==1){cout<<'a';return 0;}

  rec("a");

  rep(i, results.size())cout<<results[i]<<endl;

  return 0;
}


Measured memory_bytes: 9588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
#define ALL(a)  (a).begin(),(a).end()
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;



int main(){
    string S;
    cin>>S;
    cout<<'A';
    if(S.at(1)=='B'){
        cout<<'R';
    }
    else{
        cout<<'B';
    }
    cout<<'C'<<endl;
    return 0;
}

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

struct Card {char suit,value; };

void bub(struct Card A[],int N)
{
  for(int i=0;i<N;i++)
    {
      for(int j=N-1;j>=i+1;j--)
	{
	  if(A[j].value<A[j-1].value)
	    {
	      Card t=A[j];A[j]=A[j-1];A[j-1]=t;
	    }
	}
    }
}

void sel(struct Card A[],int N)
{
  for(int i=0;i<N;i++)
    {
      int minj=i;
      for (int j=i;j<N;j++)
	{
	  if(A[j].value<A[minj].value)
	    minj=j;
	}
      Card t=A[i];A[i]=A[minj];A[minj]=t;
    }
}

void print(struct Card A[], int N)
{
  for(int i=0;i<N;i++)
    {
      if(i>0)
	cout << " ";
      cout << A[i].suit << A[i].value;
    }
  cout << endl;
}

bool isStable(struct Card C1[],struct Card C2[],int N)
{
  for(int i=0;i<N;i++)
    {
      if(C1[i].suit != C2[i].suit)
	return false;
    }
  return true;
}

int main()
{
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i=0;i<N;i++)
    {
      cin >> C1[i].suit >> C1[i].value;
    }
  for(int i=0;i<N;i++)
    {
      C2[i]=C1[i];
    }
  bub(C1,N);
  sel(C2,N);

  print(C1,N);
  cout << "Stable" << endl;
  print(C2,N);
  if(isStable(C1,C2,N))
    {
      cout << "Stable" << endl;
    }
    else
      {
	cout << "Not stable" << endl;
      }

    return 0;
}



Measured memory_bytes: 3104
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            solve(in);
        }
    }

    private static void solve(Scanner in) {
        int N = in.nextInt(), C = in.nextInt(), K = in.nextInt();
        int[] T = new int[N];
        for (int i = 0; i < N; i++) {
            T[i] = in.nextInt();
        }
        Arrays.sort(T);
        long ans = 0;
        for (int i = 0; i < N;) {
            int j = i + 1;
            int c = 1;
            while (j < N
                    && T[j] <= T[i] + K
                    && c + 1 <= C) {
                c++;
                j++;
            }
            i = j;
            ans++;
        }
        System.out.println(ans);
    }
}

final class Scanner implements Closeable {
    private final InputStream stream;
    private final byte[] buf = new byte[1024];
    private int cur;
    private int num;

    Scanner(InputStream stream) {
        this.stream = stream;
    }

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

    int nextInt() {
        return (int) nextLong();
    }

    long nextLong() {
        int c = read();
        while (isdel(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long l = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            l *= 10;
            l += c - '0';
            c = read();
        } while (!isdel(c));
        return l * sgn;
    }

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

    String next() {
        int c = read();
        while (isdel(c))
            c = read();
        StringBuilder s = new StringBuilder();
        do {
            s.appendCodePoint(c);
            c = read();
        } while (!isdel(c));
        return s.toString();
    }

    private int read() {
        if (num == -1)
            throw new InputMismatchException();
        if (cur >= num) {
            cur = 0;
            try {
                num = stream.read(buf);
            } catch (Exception e) {
                throw new InputMismatchException();
            }
            if (num <= 0)
                return -1;
        }
        return buf[cur++];
    }

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

    @Override
    public void close() {
        try {
            stream.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

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

def s(a):
    ret = 0
    for i in range(len(str(a))):
        ret += int(str(a)[i])
    return ret

ans = 10**10
for i in range(1,n):
    a = i
    b = n - a
    ans = min(ans , s(a)+s(b))
print(ans)


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

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)///

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	while (cin >> n, n) {
		vector<double> x(n), y(n);
		int ans = 1;
		REP(i, n)cin >> x[i] >> y[i];
		REP(i, n) {
			REP(j, n) {
				if (i == j)continue;
				double ax = x[j] - x[i], ay = y[j] - y[i];
				if (ax*ax + ay*ay+EPS > 4)continue;
				double px = x[i] + ax / 2 + sqrt((4 - (ax*ax + ay*ay)) / (4 * (ax*ax + ay*ay)))*ay,
				py = y[i] + ay / 2 - sqrt((4 - (ax*ax + ay*ay)) / (4 * (ax*ax + ay*ay)))*ax;
				int cnt = 0;
				REP(k, n) {
					if ((x[k] - px)*(x[k] - px) + (y[k] - py)*(y[k] - py) < 1+EPS)cnt++;
				}
				ans = max(ans, cnt);
			}
		}
		REP(i, n) {
			REP(j, n) {
				if (i == j)continue;
				double ax = x[j] - x[i], ay = y[j] - y[i];
				if (ax*ax + ay*ay+EPS > 4)continue;
				double px = x[i] + ax / 2 - sqrt((4 - (ax*ax + ay*ay)) / (4 * (ax*ax + ay*ay)))*ay,
					py = y[i] + ay / 2 + sqrt((4 - (ax*ax + ay*ay)) / (4 * (ax*ax + ay*ay)))*ax;
				int cnt = 0;
				REP(k, n) {
					if ((x[k] - px)*(x[k] - px) + (y[k] - py)*(y[k] - py) < 1+EPS)cnt++;
				}
			
				ans = max(ans, cnt);
			}
		}
		cout <<ans << endl;
	}
}

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

int n,m,a,b,c;
int e[100][100];

int main(){
	while(cin>>n>>m>>a>>b>>c,n||m||a||b||c){
		a--;b--;c--;
		rep(i,100)rep(j,100)e[i][j]=INF;
		rep(i,100)e[i][i]=0;
		rep(i,m){
			int p,q,t;
			cin>>p>>q>>t;
			p--;q--;
			e[p][q]=t;
		}
		rep(i,n)rep(j,n)rep(k,n)e[j][k]=min(e[j][k],e[j][i]+e[i][k]);
		int ans=INF;
		rep(i,n) ans=min(ans,e[a][i]+e[i][b]+e[i][c]);
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1200
#include <iostream>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
using namespace std;

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

    cout<<(1+N)*N/2<<endl;
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
const int p=1000000007;
int inv2,n,a[200010],cnt[200010],c[200010],c1[200010],o[200010],g[200010],ans;
int D[200010],invd[200010];
int read()
{
	int x=0;
	char ch=getchar();
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') {
		x=(x<<3)+(x<<1)+ch-'0';
		ch=getchar();
	}
	return x;
}
void add(int x,int y) {for(;x<=n;x+=x&-x) (c[x]+=y)%=p;}
int ask(int x) {int y=0;for(;x;x-=x&-x) (y+=c[x])%=p; return y;}
void add1(int x) {for(;x<=n;x+=x&-x) ++c1[x];}
int ask1(int x) {int y=0;for(;x;x-=x&-x) y+=c1[x]; return y;}
int poww(int a,int k)
{
	int ans=1;
	for(;k;k>>=1)
	{
		if(k&1) ans=1ll*ans*a%p;
		a=1ll*a*a%p;
	}
	return ans;
}
int main()
{
	n=read(); inv2=(p+1)/2;
	for(int i=1;i<=n;++i) cnt[a[i]=read()]++;
	for(int i=n-1;i>=1;--i) cnt[i]+=cnt[i+1];
	bool flag=1; int s=1;
	for(int i=1;i<=n&&flag;++i) {
		if(cnt[i]-(n-i)<=0) flag=0;
		else s=1ll*s*(cnt[i]-(n-i))%p;
	}
	if(flag==0) {printf("0"); return 0;}
	D[0]=1;
	for(int i=1;i<=n;++i)
	{
		o[i]=o[i-1]; D[i]=D[i-1];
		if(cnt[i]-(n-i)==1) {o[i]++; g[o[i]]=i;}
		else{
			D[i]=1ll*D[i]*(cnt[i]-(n-i)-1)%p*poww(cnt[i]-(n-i),p-2)%p;
		}
		invd[i]=poww(D[i],p-2);
	}
	for(int i=1;i<=n;++i)
	{
		ans=(ans+1ll*(ask(a[i])-ask(g[o[a[i]]]-1)+p)*D[a[i]]%p*s%p*inv2)%p;
		add(a[i],invd[a[i]]);
	}
	for(int i=1;i<=n;++i) c[i]=0;
	for(int i=n;i>=1;--i)
	{
		ans=(ans-1ll*(ask(a[i]-1)-ask(g[o[a[i]]]-1)+p)*D[a[i]]%p*s%p*inv2%p+p)%p;
		ans=(ans+1ll*ask1(a[i]-1)*s)%p;
		add(a[i],invd[a[i]]);
		add1(a[i]);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include<unordered_map>
#include<string>
#include<algorithm>

using namespace std;

int main(void){
    int n;
    long int count = 0;
    string s;
    unordered_map<string, int> um;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> s;
        sort(s.begin(), s.end());
        um[s]++;
    }
    for(auto &a : um){
        int x = a.second;
        count += (long int)x * (x - 1) / 2;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 10660
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// N:
var N int
var node [][]int
var dist1 []int
var dist2 []int
var u, v int

func dfs1(x, p, cnt int) {
	if len(node[x]) == 1 {
		dist1[x] = cnt
	}
	for _, e := range node[x] {
		if e == p {
			continue
		}
		dfs1(e, x, cnt+1)
	}
}

func dfs2(x, p, cnt int) {
	if len(node[x]) == 1 {
		dist2[x] = cnt
	}
	for _, e := range node[x] {
		if e == p {
			continue
		}
		dfs2(e, x, cnt+1)
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	N, u, v = getInt(), getInt()-1, getInt()-1
	node = make([][]int, N)
	for i := 0; i < N-1; i++ {
		f, t := getInt()-1, getInt()-1
		node[f] = append(node[f], t)
		node[t] = append(node[t], f)
	}

	dist1 = make([]int, N)
	dist2 = make([]int, N)
	dfs1(v, -1, 0)
	dfs2(u, -1, 0)
	// out(dist1)
	// out(dist2)

	ans := 0
	for i := 0; i < N; i++ {
		if dist1[i] > dist2[i] {
			diff := dist1[i] - dist2[i]
			// out(dist1[i], dist2[i], diff)
			ans = max(ans, dist2[i]+diff-1)

		}
	}
	out(ans)
}


Measured memory_bytes: 22696
import java.util.Scanner;

public class Main{
        public static void main(final String[] args){
            final Scanner sc = new Scanner(System.in);
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if(a < b){
                if(c < a){
                    System.out.println(c + " " + a + " " + b);
                }else if(b < c){
                    System.out.println(a + " " + b + " " + c);
                }else {
                    System.out.println(a + " " + c + " " + b);
                }
            }else{
                if(c < b){
                    System.out.println(c + " " + b + " " + a);
                }else if(a < c){
                    System.out.println(b + " " + a + " " + c);
                }else {
                    System.out.println(b + " " + c + " " + a);
                }
            }
            sc.close();
        }


}


Measured memory_bytes: 26344
package main

import "fmt"

func getGroup(a int) (b int){
  switch a{
  case 1,3,5,7,8,10,12: b = 0
  case 4,6,9,11: b = 1
  case 2: b = 2
  }
  return
}

func main(){
  var x, y int
  fmt.Scan(&x, &y)
  if getGroup(x) == getGroup(y){
    fmt.Println("Yes")
  }else{
    fmt.Println("No")
  }
}


Measured memory_bytes: 512
def pushback(A,t,x):
    A[t].append(x)
    return A

def dump(A,t):
    count=len(A[t])
    if count==0:
        print()
    else:
        print(str(A[t][0]),end="")
        if count>1:
            for i in range(1,count):
                print(" "+str(A[t][i]),end="")
        print()

def clear(A,t):
    A[t].clear()
    return A

n,q=(int(x) for x in input().split())
A=[[] for i in range(n)]
for i in range(q):
    query=list(map(int,input().split()))
    if query[0]==0:
        A=pushback(A,query[1],query[2])
    elif query[0]==1:
        dump(A,query[1])
    else:
        A=clear(A,query[1])



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

int main() {
  int d, n;
  cin >> d >> n;
  
  if (n == 100) n++;
  
  if (d == 0) {
    cout << n << endl;
    return 0;
  }
  
  int ans = 1;
  for (int i = 0; i < d; i++) {
    ans *= 100;
  }
  
  ans *= n;
  
  cout << ans << endl;
}

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


public class Main {
	
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		stdIn.useDelimiter("\\.");
		Stack<Character> stack;
		while(true) {
			String tmp = stdIn.nextLine();
			if(tmp.length() == 1) break;
			stack = new Stack<Character>();
			boolean isYes = true;
			for(int i = 0; i < tmp.length(); i++) {
				if(tmp.charAt(i) == '(') {
					stack.push('(');
				}
				if(tmp.charAt(i) == '[') {
					stack.push('[');
				}
				if(tmp.charAt(i) == ')') {
					if(stack.isEmpty() || stack.pop() != '(') {
						isYes = false;
					}
				}
				if(tmp.charAt(i) == ']') {
					if(stack.isEmpty() || stack.pop() != '[') {
						isYes = false;
					}
				}
				if(!isYes) {
					break;
				}
			}
			if(!stack.isEmpty()) {
				isYes = false;
			}
			System.out.println((isYes)?"yes":"no");
		}
		
	}
	
}

Measured memory_bytes: 34380
#include<stdio.h>
int main() {
  int a[5], n, i;
  scanf("%d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &a[4]);
  for (i = 1; i < 5; i ++) {
    if (a[i - 1] < a[i]) {
      n = a[i]; a[i] = a[i - 1]; a[i - 1] = n; i -= 2;
      if (i < 0) i ++;
    }
  }
  printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]);
  return 0;
}

Measured memory_bytes: 596
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<list>
#include<math.h>
using namespace std;

#define ll long long
#define vecint vector<int>
#define listint list<int>

#define REP(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define print(a) cout << a << endl

#define INF 1000000007;

int main(){
  int N,M;
  ll T[100000];
  int P[100];
  ll X[100];

  cin >> N;
  rep(i,N){
    cin>>T[i];
  }
  cin>>M;
  rep(i,M){
    cin>>P[i]>>X[i];
    P[i]--;
  }
  ll sum=0;
  rep(i,N){
    sum+=T[i];
  }
  rep(i,M){
    print(sum-T[P[i]]+X[i]);
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		ArrayList<String> s = nextCharArray();
      String output = s.get(0) + (s.size() - 2) + s.get(s.size() - 1);
      myout(output);
	}
	//Method addition frame start



	//Method addition frame end
}


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

int main()
{
  int n;
  scanf("%d",&n);
  static long long A[100000];
  for(int i=0;i<n;i++){
    scanf("%lld",A+i);
  }
  sort(A,A+n);
  long long S=A[0];
  int x=0;
  for(int i=1;i<n;i++){
    if(2*S<A[i]){
      x=i;
    }
    S+=A[i];
  }
  printf("%d\n",n-x);
  return 0;
}


Measured memory_bytes: 1024
n=int(input())
v=list(map(int,input().split()))

#奇数個目
dl={}
for i in range(n//2):
    j=2*i
    if v[j] in dl:
        dl[v[j]]+=1
    else:
        dl[v[j]]=1

#偶数個目
dr={}
for i in range(n//2):
    j=2*i+1
    if v[j] in dr:
        dr[v[j]]+=1
    else:
        dr[v[j]]=1

maxli=max(dl,key=dl.get)
maxri=max(dr,key=dr.get)
if maxli!=maxri:
    print(n-dl[maxli]-dr[maxri])
else:
    lr=sorted(dr.values())
    ll=sorted(dl.values())
    
    s=max(lr[-2]+ll[-1] if len(lr)>1 else ll[-1],lr[-1]+ll[-2]if len(ll)>1 else lr[-1])
    print(n-s)



Measured memory_bytes: 18016
A = [[int(i) for i in input().split()] for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]
f = [[False]*3 for _ in range(3)]
for b in B:
    for i in range(3):
        for j in range(3):
            if A[i][j] == b:
                f[i][j] = True
for i in range(3):
    if all(f[i]):
        break
    if f[0][i] and f[1][i] and f[2][i]:
        break
    if f[0][0] and f[1][1] and f[2][2]:
        break
    if f[0][2] and f[1][1] and f[2][0]:
        break
else:
    print('No')
    exit()
print("Yes")


Measured memory_bytes: 38384