akhauriyash/Code-Regression huggingface dataset:
package main

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

func main() {
	p := problem{
		in:  bufio.NewReader(os.Stdin),
		out: bufio.NewWriter(os.Stdout),
	}
	m := []string{"M", "A", "R", "C", "H"}
	N := p.NextInt()
	ns := make([]int, 5)
	for i := 0; i < N; i++ {
		s := string([]rune(p.Next())[0])
		for k, v := range m {
			if s == v {
				ns[k]++
			}
		}
	}

	res := 0
	for i := 0; i < 3; i++ {
		for j := i + 1; j < 4; j++ {
			for k := j + 1; k < 5; k++ {
				res += ns[i] * ns[k] * ns[j]
			}
		}
	}
	fmt.Println(res)

}

type problem struct {
	in  *bufio.Reader
	out *bufio.Writer
}

func (p *problem) PrintInt(d int) {
	p.Printf("%d", d)
}

func (p *problem) Printf(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, format, a...); err != nil {
		panic(err)
	}
}

func (p *problem) NextInt() int {
	return stoi(p.Next())
}

func (p *problem) NextInts() []int {
	line := p.NextSSLine()
	ds := make([]int, len(line))
	for i, s := range line {
		ds[i] = stoi(s)
	}
	return ds
}

func (p *problem) NextSSLine() []string {
	return strings.Split(p.Next(), " ")
}

// Next reads line and return string.
func (p *problem) Next() string {
	var b []byte
	for {
		l, pre, err := p.in.ReadLine()
		if err != nil {
			panic(err)
		}
		b = append(b, l...)
		if !pre {
			break
		}
	}
	return string(b)
}

func stoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		fmt.Println(i)
		fmt.Println(err)
	}
	return i
}

Measured memory_bytes: 2688
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define INF 99999999
using namespace std;

int main() {
    int n;
    string a, b, c;
    cin >> n >> a >> b >> c;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        if(a[i] == b[i] and b[i] == c[i]){

        } else if (a[i] == b[i] or b[i] == c[i] or c[i] == a[i]){
            ans += 1;
        } else {
            ans += 2;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  int a[3];
  for(int i = 0; i < 3; i++){
    a[i] = N % 10;
    N /= 10;
  }
  int ans;
  if(a[2] >= a[0] && a[2] >= a[1]){
    ans = a[2]*100 + a[2]*10 + a[2];
  } else {
    ans = (a[2]+1)*100 + (a[2]+1)*10 + a[2]+1;
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int N,X,T;
  cin >> N>>X>>T;
  int a=N/X;
  if((N%X)==0){
    cout << (N/X)*T << endl;
  }
  else{
    cout << ((N/X)+1)*T <<endl;
  }
}


Measured memory_bytes: 3580
#include <stdio.h>
int main(void)
{
  int n;
  scanf("%d",&n);
  for (int a = 1; a <= 9; a++)
  {
    if (n % a == 0 && n / a <= 9)
    {
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << a << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair
 
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
mt19937_64 rng;

const int 
    M = 1e7 + 10,
    MOD = 1e9 + 7;

int inv[M], fact[M], ifact[M];

int comb(int m, int n) {
    if (m < 0 || n < 0 || n > m) return 0;
    return (ll) fact[m] * ifact[n] % MOD * ifact[m-n] % MOD;
}

int f(int a, int b, int c) {
    return (ll) fact[a+b+c] * inv[a+b] % MOD * a % MOD;
}

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

    inv[1] = 1;
    forsn(n,2,M) {
        inv[n] = ll(MOD - MOD/n) * inv[MOD%n] % MOD;
        assert((ll) inv[n] * n % MOD == 1);
    }
    fact[0] = ifact[0] = 1;
    forsn(n,1,M) {
        fact[n] = ll(n) * fact[n-1] % MOD;
        ifact[n] = ll(inv[n]) * ifact[n-1] % MOD;
        assert((ll) fact[n] * ifact[n] % MOD == 1);
    }

    ll ans = 0;
    int n,a; cin >> n >> a;
    for (int i = 1; i <= a; i++) {
        for (int k = 0; k <= i; k++) {
            ll sign = k%2 ? MOD - 1 : 1;
            ans += sign * comb(i,k) % MOD * f(i-k, n-a, max(0, a-1-i)) % MOD;
        }
    }
    cout << ans%MOD << endl;

    return 0;
}


Measured memory_bytes: 120848
import java.util.Scanner;
 
class Main {
        public static void main(String args[]) {
                Scanner sc = new Scanner(System.in);
                int N = sc.nextInt();
                while (true) {
                        sc.nextLine();
                        String c = sc.nextLine();
                        if (c.equals("=")) {
                                System.out.println(N);
                                break;
                        } else if (c.equals("+")) {
                                N += sc.nextInt();
                        } else if (c.equals("-")) {
                                N -= sc.nextInt();
                        } else if (c.equals("*")) {
                                N *= sc.nextInt();
                        } else if (c.equals("/")) {
                                N /= sc.nextInt();
                        }
                }
        }
}


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

using namespace std;

using ll = long long;


int main(){
    ll n;
    ll flag = 0;
    cin >> n;
    for(ll i = 0; i < n; ++i){
        ll tmp;
        cin >> tmp;
        if(tmp % 2 == 1){
            flag = 1;
            break;
        }
    }
    if(flag)cout << "first";
    else cout << "second";
    return 0;

}


Measured memory_bytes: 3508
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ; //何もしない文
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define pb push_back
#define eb emplace_back

//#define int long long

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<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string X; cin >> X;
    int len = X.length();
    //VI cntt(len), cnts(len);
    //REP(i,len){
    //    if(X[i] == 'T'){
    //        cntt[i+1] = cntt[i]+1;
    //        cnts[i+1] = cnts[i];
    //    }
    //    else{
    //        cntt[i+1] = cntt[i];
    //        cnts[i+1] = cnts[i]+1;
    //
    //    }
    //}

    int ans = len;
    int cnts = 0;
    REP(i,len){
        if(X[i] == 'T'){
            if(cnts != 0){
                ans -= 2;
                cnts--;
            }
        }
        else{
            cnts++;
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 720
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
S = '1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51'.replace(',', '').split()
K = int(input())
print(S[K-1])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
double PI=acos(-1);
string s1,s2,s3;
int n,m,dp[3010][3010];
string table[3010][3010];
int c1;
string solve(int r,int c){
    /*cout<<c1<<'\n';
    c1++;*/
    if(r>=n || c>=m) return "";
    if(table[r][c]!="") return table[r][c];
    if(dp[r][c]>dp[r+1][c] && dp[r][c]>dp[r][c+1]) return table[r][c]=solve(r+1,c+1)+s1[r];
    if(dp[r+1][c]>=dp[r][c+1]) return table[r][c]=solve(r+1,c);
    else return table[r][c+1]=solve(r,c+1);
}


int main(){
    IO
    cin>>s1>>s2;

    n=s1.length(),m=s2.length();
    for(int i=n-1;i>=0;i--){
        for(int j=m-1;j>=0;j--){
            if(s1[i]!=s2[j]) dp[i][j]=max(dp[i][j+1],dp[i+1][j]);
            else dp[i][j]=dp[i+1][j+1]+1;
        }
    }
    s3=solve(0,0);
    reverse(s3.begin(),s3.end());
    cout<<s3;
    return 0;
}


Measured memory_bytes: 331336
def judge(a, b, c)
  (a == b) && (b == c) && a != 's'
end

while gets do
  a = $_.chomp.chars

  res = nil
  3.times do |i|
    if judge(a[3*i], a[3*i+1], a[3*i+2])
      res = a[3*i]
      break
    elsif judge(a[i], a[i+3], a[i+6])
      res = a[i]
      break
    end
  end

  if res
    puts res
  elsif judge(a[0], a[4], a[8]) or judge(a[2], a[4], a[6])
    puts a[4]
  else
    puts 'd'
  end
end

Measured memory_bytes: 6096
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3100000;
const int UF_SIZE = 210000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ

int main(){
	int a;scanf("%d",&a);
	printf("%d\n",a*a);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll a,b,c;
	cin>>a>>b>>c;
	ll now=a-b;
	cout << max(ll(0),c-now);
	// your code goes here
	return 0;
}

Measured memory_bytes: 3640
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)


class BipartiteMatching:
    def __init__(self, N, M):
        self.N = N
        self.M = M
        self.pairA = [-1] * N
        self.pairB = [-1] * M
        self.edge = [[] for _ in range(N)]
        self.was = [0] * N
        self.iter = 0

    def add(self, s, t):
        self.edge[s].append(t)

    def _DFS(self, s):
        self.was[s] = self.iter
        for t in self.edge[s]:
            if self.pairB[t] == -1:
                self.pairA[s] = t
                self.pairB[t] = s
                return True
        for t in self.edge[s]:
            if self.was[self.pairB[t]] != self.iter and self._DFS(self.pairB[t]):
                self.pairA[s] = t
                self.pairB[t] = s
                return True
        return False

    def solve(self):
        res = 0
        while True:
            self.iter += 1
            found = 0
            for i in range(self.N):
                if self.pairA[i] == -1 and self._DFS(i):
                    found += 1
            if not found:
                break
            res += found
        return res


if __name__ == "__main__":
    X, Y, E = map(int, input().split())
    match = BipartiteMatching(X, Y)
    for _ in range(E):
        x, y = map(int, input().split())
        match.add(x, y)
    ans = match.solve()
    print(ans)



Measured memory_bytes: 5688
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main(){
    int N;
    cin >> N;
    string s;
    vector<int> count(4);
    for(int i = 0; i < N; i++){
        cin >> s;
        if(s == "AC") count[0]++;
        else if(s == "WA") count[1]++;
        else if(s == "TLE") count[2]++;
        else if(s == "RE") count[3]++;
        else break;
    }

    cout << "AC x " << count[0] << endl;
    cout << "WA x " << count[1] << endl;
    cout << "TLE x " << count[2] << endl;
    cout << "RE x " << count[3] << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(int i = (N) - 1; i >= 0; i--)
#define rep1(i,N) for(int i = 1; i <= (N) ; i++)
#define repr1(i,N) for(int i = (N) ; i > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; using vl = vector<ll>;
using vi = vector<int>; using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif
using P = pair<int,int>; using vp = vector<P>;
constexpr int MOD = /**/ 1000000007; //*/ 998244353;
//////////

void solve(){
  inl(t1,t2,a1,a2,b1,b2);

  ll ca = t1 * a1 + t2 * a2;
  ll cb = t1 * b1 + t2 * b2;
  if(ca == cb) die("infinity");

  if(ca < cb){swap(a1 , b1); swap(a2 , b2); swap(ca , cb);}
  if(a1 > b1) die(0);

  ll nya = t1 * (b1 - a1);
  trc(nya);
  if(nya % (ca - cb) == 0) out( ( nya / (ca - cb) ) * 2 );
  else out( 1 + ( nya  / (ca - cb) ) * 2 );

}

Measured memory_bytes: 256
use scanner::Scanner;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.read();
    let a: Vec<i32> = (0..n).map(|_| sc.read()).collect();

    println!("{:?}",(-100..101).map(|x| a.iter().map(|y| (y - x).pow(2)).sum::<i32>()).min().unwrap());
}

mod scanner {
    pub struct Scanner<'a> {
        s: String,
        words: ::std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new() -> Scanner<'a> {
            let s = String::new();
            let words = unsafe { ::std::mem::transmute(s.split_whitespace()) };
            Scanner { s: s, words: words }
        }

        pub fn read<T: ::std::str::FromStr>(&mut self) -> T {
            match self.words.next() {
                Some(x) => x.parse().ok().unwrap(),
                None => {
                    self.load();
                    self.read()
                }
            }
        }

        fn load(&mut self) {
            self.s.clear();
            ::std::io::stdin().read_line(&mut self.s).unwrap();
            self.words = unsafe { ::std::mem::transmute(self.s.split_whitespace()) };
        }
    }
}

Measured memory_bytes: 4352
from itertools import combinations
def d(x1,x2):
    return ((x1[0]-x2[0])**2+(x1[1]-x2[1])**2)**0.5
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
tot = 0
for x in combinations(range(N),2):
    tot += d(A[x[0]],A[x[1]])
print(2*tot/N)

Measured memory_bytes: 38384
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 100011

ll R, C, n, i;
ll x, y, xx, yy;
vector< pair<ll, ll> > ord;
set<ll> S;

bool on_edge(ll x, ll y) {
    if (x == 0 || y == 0) return true;
    if (x == R || y == C) return true;
    return false;
}

ll get_pos(ll x, ll y) {
    if (y == 0) return x;
    if (x == R) return R + y;
    if (y == C) return R + C + (R - x);
    if (x == 0) return R + C + R + (C - y);
}

int main()
{
  //  freopen("test.in","r",stdin);

    cin >> R >> C >> n;
    for (i = 1; i <= n; i++) {
        cin >> x >> y >> xx >> yy;
        if (!on_edge(x, y)) continue;
        if (!on_edge(xx, yy)) continue;

        ll p1 = get_pos(x, y);
        ll p2 = get_pos(xx, yy);
        if (p2 < p1) swap(p1, p2);
        if (p2 - p1 > 2LL * (R + C) - (p2 - p1)) {
            swap(p1, p2);
            p2 += 2LL * (R + C);
        }

        ord.pb(mp(p1, p2));
        ord.pb(mp(p1 + 2LL * (R + C), p2 + 2LL * (R + C)));
        ord.pb(mp(p1 + 4LL * (R + C), p2 + 4LL * (R + C)));
    }


    sort(ord.begin(), ord.end());
    for (auto e : ord) {
        auto it = S.lower_bound(e.first + 1);
        if (it != S.end()) {
            if (*it < e.second) {
                printf("NO");
                return 0;
            }
        }
        S.insert(e.second);
    }

    printf("YES");



    return 0;
}


Measured memory_bytes: 20584
#include<bits/stdc++.h>
using namespace std;
long long x[1000010],y[1000010];
#define int long long
signed main(){
  
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n,k,x,y;
  cin>>n>>k>>x>>y;
  
  int z;
  z=n-k;
  if(n<=k) cout<<n*x<<'\n';
  else  cout<<k*x+z*y<<'\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
          

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a[3] = {};
    cin >> a[0] >> a[1] >> a[2];
    sort( a , a + 3 );
    if ( a[2]  ==  a[0] + a[1] ) cout << "Yes\n";
    else cout << "No\n";
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
typedef long long ll;
const int maxn=(1e5)+10;
int n,ans;
ll m,v,p,a[maxn],x,s[maxn];
ll tmp;
int main() {
	//freopen("1.txt","r",stdin);
	read(n); read(m); read(v); read(p);
	p--;
	for (int i=1;i<=n;i++) read(a[i]);
	sort(a+1,a+n+1);
	for (int i=1;i<=n;i++) s[i]=s[i-1]+a[i];
	int l,r,t,delta,k;
	for (int i=1;i<=n;i++) {
		x=a[i]+m;
		l=upper_bound(a+1,a+n+1,a[i])-a;
		if (l>n) { ans++; continue; }
		r=upper_bound(a+1,a+n+1,x)-a-1;
		tmp=m*(v-1);
		tmp-=m*(n-r);
		tmp-=m*(l-2);
		t=r-l+1;
		delta=n-r;
		if (p-delta<0) continue;
		if (p-delta>=t) { ans++; continue; }
		tmp-=m*(p-delta);
		if (tmp<=0) { ans++; continue; }
		k=r-(p-delta);
		tmp-=x*(k-l+1)-(s[k]-s[l-1]);
		if (tmp<=0) ans++;
	}
	printf("%d\n",ans);
	return 0;
}
/*
  REMEMBER:
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Array size? Integer overflow? Time complexity? Memory usage? Precision error?
*/

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  std::string S;
  std::cin >> S;

  bool is_good = true;
  if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) {
    is_good = false;
  }

  if (is_good) print("Good");
  else print("Bad");

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 100005
#define NIL -1

struct Node {int p, l, r;};

Node T[MAX];
int n, D[MAX];

void print(int u){
    int i, c;
    cout << "node " << u << ": ";
    cout << "parent = " << T[u].p << ", ";
    cout << "depth = " << D[u] << ", ";

    if (T[u].p == NIL) cout << "root, ";
    else if (T[u].l == NIL) cout << "leaf, ";
    else cout << "internal node, ";

    cout << "[";

    for (i = 0, c = T[u].l; c != NIL; i++, c=T[c].r) {
        if (i) cout << ", ";
        cout << c;
    }
    cout << "]" << endl;
}

// 再帰的に深さを求める
int rec(int u, int p){
    D[u] = p;
    if (T[u].r != NIL) rec(T[u].r, p); // 右の兄弟に同じ深さを設定
    if (T[u].l != NIL) rec(T[u].l, p + 1); // 最も左の子に自分の深さ+1を設定
}

int main() {
    int i, j, d, v, c, l, r;
    cin >> n;
    for (i = 0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;

    for (i = 0; i < n; i++){
        cin >> v >> d; 
        for ( j = 0; j < d; j++){
            cin >> c;
            if (j == 0) T[v].l = c;
            else T[l].r = c;
            l = c;
            T[c].p = v;
        }
    }
    for (i = 0; i < n; i++){
        if (T[i].p == NIL) r = i;
    }

    rec(r, 0);

    for(i = 0; i < n; i++) print(i);

    return 0;
}


Measured memory_bytes: 7768
#include <iostream>
typedef long long ll;
using namespace std;
int main() {
    ll n, y;
    cin >> n >> y;
    y /= 1000;

    for(int i=n; i>=0; i--) {
        for(int j=n-i; j>=0; j--) {
            int k = y - 10*i - 5*j;
            if(k>=0 && i+j+k==n) {
                cout << i << ' ' << j << ' ' << k << endl;
                return 0;
            }
        }
    }

    cout << "-1" << ' ' << "-1" << ' ' << "-1" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

const int bound = 100100;

vector<int> graph[bound];
vector<ll> cost;
vector<ll> mini(bound);
bool besucht[bound];

void dfs( int gesehen, int elternteil ){
	besucht[gesehen] = true;
	mini[elternteil] = min( cost[gesehen], mini[elternteil]	);
	for( auto nachbar : graph[gesehen] ){
		if( !besucht[nachbar] ) dfs(nachbar, elternteil);
	}
}

int main(){
	fill_n( mini.begin(), bound, INF );
	int n, m; cin >> n >> m;
	for( int i = 0; i < n; ++i ){
		ll temp; cin >> temp;
		cost.push_back(temp);
	}
	for( int i = 0; i < m; ++i ){
		int x, y; cin >> x >> y;
		graph[x].push_back(y);
		graph[y].push_back(x);
	}
	int cnt = 0;
	for( int i = 0; i < n; ++i ){
		if( !besucht[i] ){
			++cnt;
			dfs(i, i);
		}
	}
	if( cnt == 1 ){
		cout << 0 << endl;
		return 0;
	}
	if( !( n >= (cnt-1)*2 ) ){
		cout << "Impossible" << endl;
		return 0;
	}
	ll ans = 0;
	for( int i = 0; i < n; ++i ){
		if( mini[i] != INF ) ans += mini[i];
	}
	sort( cost.begin(), cost.end() );
	map<ll, ll> mp;
	for( int i = 0; i < n; ++i ) mp[cost[i]] += 1;
	for( int i = 0; i < n; ++i ){
		if( mini[i] != INF ) mp[mini[i]] -= 1;
	}
	int fois = 1;
	for( int i = 0; i < n; ++i ){
		if( fois >= cnt-1 ){
			break;
		}
		if( mp[cost[i]] > 0 ){
			ans += cost[i];
			mp[cost[i]] -= 1;
			++fois;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 13684
#include <cstdio>
#include <iostream>
#include <algorithm>
//#define _0219nice 
using namespace std;
int main() {
#ifdef _0219nice
    freopen("1.in", "r", stdin);
#endif
    long long n, k;
    while (cin >> n >> k) {
        n %= k;
        cout << min(k - n, n) << endl;
    }
    return 0;
}

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

int main(){
    
    int a, b;
    
    a = 0;
    
    b = 0;
    
    
    while(1){
        cin >> a >> b;
        
        if(a == 0 && b == 0)break;
        
        for ( int i = 0; i < a; i++ ){
            for ( int j = 0; j < b; j++ ){
                cout << "#";
            }
            cout << endl;
            
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define F first
#define S second
#define INF ll(1e18)
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define MAXN 100005

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	ll n,k; cin>>n>>k;
	cout<<min(n%k, k-(n%k))<<'\n';
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int h,w;
int main()
{
    scanf("%d%d",&h,&w);
    if(h>w)swap(h,w);
    if(h%3==0||w%3==0)printf("0\n");
    else
    {
        long long ans=1e10+7,s1,s2,s3;
        for(int i=1;i<=w/2+1;i++)
        {
            s1=(long long)h*(long long)i;s2=(long long)h*(long long)((w-i)/2);s3=(long long)h*(long long)((w-i)-(w-i)/2);
            ans=min(ans,max(s1,max(s2,s3))-min(s1,min(s2,s3)));
        }
        for(int i=1;i<=h/2+1;i++)
        {
            s1=(long long)w*(long long)i;s2=(long long)(h-i)*(long long)(w/2);s3=(long long)(h-i)*(long long)(ceil((double)w/2));
            ans=min(ans,max(s1,max(s2,s3))-min(s1,min(s2,s3)));
        }
        for(int i=1;i<=w/2+1;i++)
        {
            s1=(long long)h*(long long)i;s2=(long long)(h/2)*(long long)(w-i);s3=(long long)(ceil((double)h/2))*(long long)(w-i);
            ans=min(ans,max(s1,max(s2,s3))-min(s1,min(s2,s3)));
        }
        printf("%lld\n",ans);
    }
    return 0;
}


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

int main() {
    string t;
    cin >> t;
    int n = t.size();
    for (int i = 0; i < n; i++){
        if(t[i] == '?'){
            cout << 'D';
        } else {
            cout << t[i];
        }
    }
    cout << endl;
}

Measured memory_bytes: 3756
N = int(input())
C = list(map(int,input().split()))

C.sort(reverse=True)
ans = 0
mod = 10**9 + 7
if N>=2:
    t = 1
    for i in range(2*N-2):
        t*=2
        t%=mod
    for i in range(N):
        ans+=(i+2)*C[i]
        ans%=mod
    #print(ans)
    ans*=t
    ans%=mod
    print(ans)
else:
    print((2*C[0])%mod)

Measured memory_bytes: 87500
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------
class Combination:
    def __init__(self, n, mod):
        self.mod = mod
        self.fact = [1]*n
        self.finv = [1]*n
        self.inv  = [1]*n
        for i in range(2,n):
            self.fact[i] = (self.fact[i-1]*i) % self.mod
            self.inv[i]  = self.mod - self.inv[self.mod%i] * (self.mod//i)%self.mod
            self.finv[i] = self.finv[i-1] * self.inv[i] % self.mod
 
    def nCr(self, n, r):
        if n<r:
            return 0
        else:
            return self.fact[n] * (self.finv[r] * self.finv[n-r] % self.mod) % self.mod

mod = 10**9+7
Combination = Combination(2010, mod)

# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,K = map(int,input().split())

# 青の連続部分の数で全探索
for i in range(1,K+1):
    ans = 1
    # 青を複数の連続部分に分割する場合の数
    ans *= Combination.nCr(K-1,i-1)
    # 赤を一列に並べた時の, 両端を含めた"青の連続部分の挿入可能箇所"
    x = N-K+1
    # x箇所から
    ans *= Combination.nCr(x,i)
    print(ans%mod)


Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
#define reg register
#define ll long long
inline ll read()
{
	ll x=0,w=0;char ch=getchar();
	while(!isdigit(ch))w|=ch=='-',ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}
int main()
{
    int n=read(),d=read(),c;
    d=d+d+1;c=n/d;if(n%d)c++;
    cout<<c<<"\n";
    	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var inputStr string
	fmt.Scan(&inputStr)

	input, _ := strconv.Atoi(inputStr)

	a := input / 1000
	input = input % 1000
	b := input / 100
	input = input % 100
	c := input / 10
	input = input % 10
	d := input

	oj, ok, ol := 1, 1, 1
	for i := 0; i < 2; i++ {
		for j := 0; j < 2; j++ {
			oj = oj * -1
			for k := 0; k < 2; k++ {
				ok = ok * -1
				for l := 0; l < 2; l++ {
					ol = ol * -1
					ans := a + b*oj + c*ok + d*ol
					if ans == 7 {
						fmt.Printf("%d%s%d%s%d%s%d=7\n", a, f(oj), b, f(ok), c, f(ol), d)
						return
					}
				}
			}
		}
	}
}

func f(v int) string {
	if v >= 0 {
		return "+"
	} else {
		return "-"
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>

using namespace std;
typedef long long int lli;

int main() {
	lli A, B, K;
	cin >> A >> B >> K;

	for(lli i=0; i<K; i++) {
		if(i % 2 == 0) {
			B += A / 2;
			A /= 2;
		} else {
			A += B / 2;
			B /= 2;
		}
	}
	cout << A << " " << B << endl;
}


Measured memory_bytes: 888
#include<stdio.h>

int A[500001];
int H;

void maxHeapify(int i)
{
  int l, r, largest, max;
  l = i*2;
  r = i*2+1;

  if(l<=H && A[l]>A[i])
    largest = l;
  else
    largest = i;
  if(r<=H && A[r]>A[largest])
    largest = r;

  if(largest!=i){
    max = A[largest];
    A[largest] = A[i];
    A[i] = max;
    maxHeapify(largest);
  }
}

void buildMaxHeap(void)
{
  int i;
  for( i = H/2 ; i>0 ; i-- )
    maxHeapify(i);
}


int main()
{
  int i;
  scanf("%d",&H);
  for( i=1 ; i<=H ; i++ )
    scanf("%d",&A[i]);

  buildMaxHeap();

  for( i=1 ; i<=H ; i++ )
    printf(" %d",A[i]);
  printf("\n");

  return 0;
}

Measured memory_bytes: 2552
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <climits>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>

#define DIV 1000000007

using namespace std;

string S, T;

int main(){
	S = "CODEFESTIVAL2016";
	cin >> T;
	long long ans = 0;
	for(int i = 0; i < T.size(); i++){
		if(T[i] != S[i]){
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
n, m, q = map(int, input().split())
req = []
for _ in range(q):
    a, b, c, d = map(int, input().split())
    req.append((a - 1, b - 1, c, d))


def list_A(i=0, a=1):
    if i == n - 1:
        return [[i] for i in range(a, m + 1)]
    lA = []
    for b in range(a, m + 1):
        for A in list_A(i + 1, b):
            lA.append([b] + A)
    return lA


def score(A):
    s = 0
    for a, b, c, d in req:
        if A[b] - A[a] == c:
            s += d
    return s


answer = max(score(A) for A in list_A())
print(answer)


Measured memory_bytes: 23948
import sys
import math
import bisect

def main():
    s = list(input())
    for i in range(len(s)):
        if s[i] == '1':
            s[i] = '9'
        elif s[i] == '9':
            s[i] = '1'
    print(''.join(s))

if __name__ == "__main__":
    main()


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

#ifndef LOCAL
#define cerr dolor_sit_amet
#endif

#define mp make_pair
#define sz(x) ((int)((x).size()))
#define X first
#define Y second

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair < int , int > ipair;
typedef pair < ll , ll > lpair;
const int IINF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const double DINF = numeric_limits<double>::infinity();
const int MOD = 1000000007;
const double EPS = 1e-9;
const int DX[] = { 1,  0, -1,  0,  1, -1,  1, -1};
const int DY[] = { 0,  1,  0, -1,  1, -1, -1,  1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll sqr(ll x) { return x*x; } ll sqr(int x) { return (ll)x*x; }
double sqr(double x) { return x*x; } ld sqr(ld x) { return x*x; }
mt19937 mmtw(960172);
ll rnd(ll x, ll y) { static uniform_int_distribution<ll> d; return d(mmtw) % (y - x + 1) + x; }

// ========================================================================= //

const int N = 2017;

int n;
bool a[N], b[N];
int bnext[N], bprev[N];

int solve(int sh) {
    vector < ipair > need;
    int ans = sh;
    for (int i = 0; i < n; ++i) {
        if (a[i] != b[(i+sh) % n]) {
            ++ans;
            if (bnext[i] > sh) {
                need.push_back({bprev[i], bnext[i]-sh});
            }
        }
    }
    sort(need.begin(), need.end());
    vector<int> ymax(sz(need) + 1);
    ymax[sz(need)] = 0;
    for (int i = sz(need) - 1; i >= 0; --i)
        ymax[i] = max(ymax[i+1], need[i].Y);

    int nans = IINF;
    for (int i = 0; i <= sz(need); ++i)
        nans = min(nans, ymax[i] + (i==0?0:need[i-1].X));
    nans *= 2;
    nans = min(nans, n);
    return ans + nans;
}

int main()
{
    ios::sync_with_stdio(false);

    string ss;
    cin >> ss;
    n = sz(ss);
    bool wa = false;
    for (int i = 0; i < n; ++i)
        wa |= (a[i] = ss[i] - '0');
    cin >> ss;
    bool w = false;
    for (int i = 0; i < n; ++i)
        w |= (b[i] = ss[i] - '0');

    if (!w) {
        if (wa)
            cout << "-1\n";
        else
            cout << 0 << "\n";
        return 0;
    }

    int ans = IINF;

    for (int i = 0; i < n; ++i) {
        for (bnext[i] = 0; !b[(i+bnext[i])%n];   ++bnext[i]);
        for (bprev[i] = 0; !b[(i+n-bprev[i])%n]; ++bprev[i]);
    }
    for (int i = 0; i < n; ++i)
        ans = min(ans, solve(i));
    reverse(a, a + n);
    reverse(b, b + n);
    for (int i = 0; i < n; ++i) {
        for (bnext[i] = 0; !b[(i+bnext[i])%n];   ++bnext[i]);
        for (bprev[i] = 0; !b[(i+n-bprev[i])%n]; ++bprev[i]);
    }
    for (int i = 0; i < n; ++i)
        ans = min(ans, solve(i));

    cout << ans << "\n";

    return 0;
}


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

#define FOR(i,x,y) for(int i = (x);i < (y);i++)
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) (int) (x).size()
typedef long long ll;

ll H,W,A,B;
const int H_MAX = 1e5,W_MAX = 1e5;
ll fact [H_MAX + W_MAX];
const long long MOD = 1e9 + 7;

void init()
{
	fact [0] = 1;
	FOR(i,1,H_MAX + W_MAX){
		fact [i] = fact [i - 1] * i % MOD;
	}
}

long long pow_mod(long long x,long long y,long long i = MOD - 2)
{
	while(i){
		if(i & 1){
			(x *= y) %= MOD;
		}
		(y *= y) %= MOD;
		i >>= 1;
	}

	return x;
}

long long nCr(long long n,long long r)
{
	long long res = fact [n];
	res = pow_mod(res,fact [n - r]);
	res = pow_mod(res,fact [r]);

	return res;
}

int main()
{
	cin >> H >> W >> A >> B;
	H--,W--;
	init();

	ll ans = 0;
	for(int i = B;i <= W;i++){
		ll tmp = nCr(H - A + i,i);
		(tmp *= nCr((A - 1) + (W - i),W - i)) %= MOD;
		(ans += tmp) %= MOD;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1792
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int a[] = new int[M];
		int b[] = new int[M];
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt() - 1;
			b[i] = sc.nextInt() - 1;
		}
		
		LinkedList list[] = new LinkedList[N];
		for(int i = 0; i < N; i++) {
			list[i] = new LinkedList();
		}
		for(int i = 0; i < M; i++) {
			list[a[i]].add(b[i]);
			list[b[i]].add(a[i]);
		}
		
		Boolean flag[] = new Boolean[list.length];
		for(int i = 0; i < list.length; i++) {
			flag[i] = false;
		}
		int ans = 0;
		ans = GraphDFS(list, 0 , flag, ans);
		System.out.println(ans);
	}
	
	public static int GraphDFS(LinkedList list[], int now, Boolean flag[], int ans) {
		flag[now] = true;	
		for(int i = 0; i < list[now].size(); i++) {
			if(!flag[list[now].get(i)]) {
				ans = GraphDFS(list, list[now].get(i), flag, ans);
			}
		}
		
		if(!Arrays.asList(flag).contains(false)) {
			ans++;
		}
		
		flag[now] = false;
		return ans;
	}
}

class LinkedList {
	ArrayList<Integer> link = new ArrayList<Integer>();
	public void add(int vertex) {
		link.add(vertex);
	}

	public int get(int i){
		return link.get(i);
	}
	
	public void remove(int vertex) {
	}
	
	public void view() {
		for(int i = 0; i < link.size(); i++) {
			System.out.println(link.get(i));
		}
	}
	
	public boolean linked(int vertex) {
		if(link.contains(vertex)){
			return true;
		} else {
			return false;
		}
	}

	public int size() {
		return link.size();
	}
}

Measured memory_bytes: 22228
#include<stdio.h>
int main()
{
   	unsigned long int x;
  	int i = 1;
  	unsigned long int money = 100;
	scanf("%ld", &x);
  	
  	while(1){
    	money += money * 0.01;
      	if(x <= money){
        	break;	
       	}
      	i++;
    }
	
  	printf("%d\n", i);
 
    return 0;
}


Measured memory_bytes: 1724
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int ans = 0;

            StringBuilder sb = new StringBuilder();
            for (int i = a; i <= b; i++) {
                sb.append(i);
                String t = sb.toString();
                sb.reverse();
                String rev = sb.toString();
                sb.delete(0, sb.length());
                if (t.equals(rev)) ans++;
            }

            // 出力
            out.println(ans);

        }

    }
}



Measured memory_bytes: 31396
#include<bits/stdc++.h>
#define MP make_pair
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<LL,LL> pii;
template<typename T>
inline bool inrange(const T& x,const T& L,const T& R) {return x >= L && x<R;}
set<pii> S;
const LL dx[]={-1,-1,-1,0,0,1,1,1,0};
const LL dy[]={-1,0,1,-1,1,-1,0,1,0};
LL ans[11];
int main()
{
    LL H,W,N;
    scanf("%lld%lld%lld",&H,&W,&N);
    for(LL i=0,x,y;i<N;i++)
    {
        scanf("%lld%lld",&x,&y);x--,y--;
        S.insert(MP(x,y));
    }
    for(auto&& it:S)
    {
            for(LL d=0;d<9;d++)
            {
                LL nx=it.F+dx[d],ny=it.S+dy[d];

                LL cnt=0;
                bool flag=1;
                for(LL dir=0;dir<9;dir++)
                {
                    if(!inrange(nx+dx[dir],0LL,H) || !inrange(ny+dy[dir],0LL,W)) {flag=0;break;}
                    if(S.find(MP(nx+dx[dir],ny+dy[dir]))!=S.end()) cnt++;
                }
                if(!flag) continue;
                ans[cnt]++;
            }
    }
    LL sum=0;
    for(LL i=1;i<=9;i++) sum+=ans[i]/i;
    printf("%lld\n",(H-2)*(W-2)-sum);
    for(LL i=1;i<=9;i++) printf("%lld\n",ans[i]/i);
}


Measured memory_bytes: 6528
#include <stdio.h>

int main(void) {
	int a, b;
	scanf("%d %d", &a, &b);
	if(a < b){
		printf("a < b\n");
	}
	else if(a > b){
		printf("a > b\n");
	}
	else{
		printf("a == b\n");
	}
	return 0;
}


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

#define int long long
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define COUT(x) cout << x << endl;
#define PB(x) push_back(x)
#define MP make_pair
int gcd(int a,int b){return b?gcd(b,a%b):a;}
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int INF = 1e9;
const int MOD = 1e9+7;

signed main(){
    int n,k; cin >> n >> k;
    vector<int> a(n);
    rep(i,n){cin>>a[i]; a[i]--;}
    vector<int> dist(n,-1);
    dist[0]=0;
    int pos=0;
    int t=0;
    int start=0;

    //距離を計算し，ループを見つけたら終了
    rep(i,n){
        if(dist[a[pos]]!=-1){
            t=dist[pos]-dist[a[pos]]+1;
            start=a[pos];
            break;
        }
        dist[a[pos]]=dist[pos]+1;
        pos=a[pos];
    }
    
    
    if(k<n){
        pos=0;
        rep(i,k){
            pos=a[pos];
        }
        cout<<pos+1<<endl;
    }else{
        //k-=dist[start];
        //k%=t;
        pos=start;
        k=(k-dist[start])%t;
        rep(i,k){
            pos=a[pos];
        }
        cout<<pos+1<<endl;
    }
    //cout<<"k="<<k<<endl;
    //cout<<"dist[1]="<<dist[1]<<endl;
    //cout<<"t="<<t<<endl;
    //cout<<"start="<<start<<endl;
}

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

int main(){
  long long L,R,ans,a;
  double an;
  cin>>L>>R;
  ans=2019;
if(R-L>2019){
  cout<<0<<endl;
  return 0;
}
  else{
    a=R-L;
    L%=2019;
    R=L+a;
  for(int i=L;i<R;i++){
    for(int j=i+1;j<R+1;j++){
      a=i*j;
      ans=min(a%2019,ans);
    }
  }
    cout<<ans<<endl;
    return 0;
}
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
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;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe
    
int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    
  int n;
  cin >> n;
  cout<<"ABC" << n << endl;
  
  
  
  
    
  
  
    


//////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  long long kotae=0;
  for(int i=0;i<n;i++){
    long long a;
    cin>>a;
    kotae+=a-1;
  }
  cout<<kotae<<endl;
  return 0;
}

  


Measured memory_bytes: 3504
#include<iostream>
#include<set>
#include<cstdlib>

using namespace std;

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

set<int> used;
int n, k;

void solve2(string str) {
  int cnt = 0;
  rep (i, n) if (str[i] == '1') ++cnt;
  if (cnt == 1) {
    rep (i, n) if (str[i] == '1') {
      used.insert(i);
      return;
    }
  }
  string s;
  rep (i, n) {
    if (str[i] == '1' && rand() % 2) s += "1";
    else s += "0";
  }
  cout << "?" + s << endl;
  cout.flush();
  int t;
  cin >> t;
  if (t == 1) {
    solve2(s);
  } else {
    rep (i, n) if (str[i] == '1') s[i] ^= '0' ^ '1';
    solve2(s);
  }
}

void solve() {
  while (true) {
    string str;
    rep (i, n) {
      str += rand() % 2 ? "1" : "0";
      if (used.count(i)) str[str.size() - 1] = '0';
    }
    cout << "?" + str << endl;
    cout.flush();
    int t;
    cin >> t;
    if (t == 1) {
      solve2(str);
      return;
    }
  }
}

int main() {
  cin >> n >> k;
  rep (i, k) solve();
  for (set<int>::iterator itr = used.begin(); itr != used.end(); ++itr) {
    if (itr == used.begin()) cout << "!";
    else cout << " ";
    cout << *itr + 1;
  }
  cout << endl;
}

Measured memory_bytes: 1772
#include <iostream>
using namespace std;
 
int main() {
    int r, g, b, n;
    cin >> r >> g >> b >> n;
    int ans = 0;
 
    for (int i = 0; i < n + 1; i++) {
        if (r*i > n) 
            continue;
 
        for (int j = 0; j < n + 1; j++) {
            if (r*i + g*j > n) 
                continue;
            if ((n - r*i - g*j) % b == 0) 
                ans++;
        }
    }
 
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 888