akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#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;
 
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
 
 
#define F first
#define S second
#define ll long long
#define pb push_back
#define db double
#define ld long double
#define ppb pop_back
#define pii pair<int, int>
#define pll pair<long long, long long>
#define piii pair<int, pii>
#define all(x) (x).begin(),(x).end()
#define __ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define watch(x) cout << (#x) << " is " << (x) << endl
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define TEST int T; cin >> T; while(T--)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//#define int long long
 
const int N = 2e5 + 1, inf = 2e9 + 7, mod = 1e9 + 7;
const ll INF = 2e18 + 7, MOD = 1e15 + 7;

int h[N], a[N];
ll dp[N], t[4 * N];

void upd(int v, int tl, int tr, int id, ll val) {
    if (tl == tr) {
        t[v] = val;
        return;
    }
    int tm = (tl + tr) / 2;
    if (id <= tm) upd(v * 2, tl, tm, id, val);
    else upd(v * 2 + 1, tm + 1, tr, id, val);
    t[v] = max(t[v * 2 + 1], t[v * 2]);
}

ll get(int v, int tl, int tr, int l, int r) {
    if (l <= tl && tr <= r) {
        return t[v];
    }
    if (l > tr || r < tl) {
        return 0;
    }
    int tm = (tl + tr) / 2;
    return max(get(v * 2, tl, tm, l, r), get(v * 2 + 1, tm + 1, tr, l, r));
}

signed main() { __
//    freopen("lcm.in", "r", stdin);
//    freopen("lcm.out", "w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> h[i];
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) {
        dp[i] = 0;
        dp[i] = get(1, 1, n, 1, h[i] - 1) + a[i];
//        for (int j = 1; j < i; j++) {
//            if(h[i] > h[j])
//                dp[i] = max(dp[i], dp[j]);
//        }
        upd(1, 1, n, h[i], dp[i]);
    }
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ans = max(ans, dp[i]);
    }
    cout << ans;
    return 0;
}



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

int main() {
	int x1,x2,y1,y2,X,Y;
	cin>>x1>>y1>>x2>>y2;
	
	X=x2-x1;
	Y=y2-y1;
	cout<<x2-Y<<" "<<y2+X<<" "<<x1-Y<<" "<<y1+X<<endl;
	return 0;
}

Measured memory_bytes: 256
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let s = { use std :: io :: Read ; let mut s = String :: new ( ) ; std :: io :: stdin ( ) . read_to_string ( & mut s ) . unwrap ( ) ; s } ; let mut iter = s . split_whitespace ( ) ; input_inner ! { iter , $ ( $ r ) * } } ; }
macro_rules ! input_inner { ( $ iter : expr ) => { } ; ( $ iter : expr , ) => { } ; ( $ iter : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , mut $ var : ident $ ( $ r : tt ) * ) => { let mut $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ iter , $ t ) ; input_inner ! { $ iter $ ( $ r ) * } } ; ( $ iter : expr , $ var : ident $ ( $ r : tt ) * ) => { let $ var = $ iter . next ( ) . unwrap ( ) . parse ::< usize > ( ) . unwrap ( ) ; input_inner ! { $ iter $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ iter : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ iter , $ t ) ) ,* ) } ; ( $ iter : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ iter , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ iter : expr , chars ) => { read_value ! ( $ iter , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ iter : expr , usize1 ) => { read_value ! ( $ iter , usize ) - 1 } ; ( $ iter : expr , $ t : ty ) => { $ iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) } ; }
use std::collections::{HashMap, HashSet};
fn main() {
    input! { n, a: [[usize1; n-1]; n] };
    let mut day = 0;
    let mut od = HashMap::new();
    for i in 0..n {
        od.insert(i, 0);
    }
    let mut next = HashSet::new();
    let mut old = HashSet::new();
    for i in 0..n {
        let j = a[i][0];
        if a[j][0] == i {
            next.insert(i);
        }
    }
    while !od.is_empty() {
        if next.is_empty() {
            day = -1;
            break;
        }
        std::mem::swap(&mut next, &mut old);
        next = HashSet::new();
        for &x in &old {
            let d = *od.get(&x).unwrap_or(&0) + 1;
            if d >= n - 1 {
                od.remove(&x);
            } else {
                od.insert(x, d);
            }
        }
        for &i in &old {
            if let Some(&x) = od.get(&i) {
                let j = a[i][x];
                if let Some(&y) = od.get(&j) {
                    if a[j][y] == i {
                        next.insert(i);
                        next.insert(j);
                    }
                }
            }
        }
        day += 1;
    }
    println!("{}", day);
}


Measured memory_bytes: 16632
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
	sc = bufio.NewScanner(strings.NewReader(`

				`))
	//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	//fmt.Fprintln(out, "[DEBUG]", time.Now())

	k := nextInt()
	a := nextInt()
	b := nextInt()

	ans := maxInt(a+(b-a)*((k-(a-1))/2)+(k-(a-1))%2, k+1)

	//	fmt.Fprintln(out, "[DEBUG]]", a)
	fmt.Fprintln(out, ans)
}

//------------------------------------------------------------------------------

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func absInt(x int) int {
	return int(math.Abs(float64(x)))
}
func minInt(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func maxInt(x, y int) int {
	if x > y {
		return x
	}
	return y
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;

typedef vector<lint> vl;
typedef pair<lint,lint> pll;

#define mpr make_pair



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

    lint n, k; cin>>n>>k;

    lint mod = 1e9 + 7;
    lint res = 0;
    for (lint cnt = k; cnt <= n+1; ++cnt){
        lint min = 0;
        //for (int i=0; i<cnt; ++i) min = (min + i)%mod;
        min = cnt*(cnt-1)/2;

        lint max = 0;
        max = (n+n-cnt+1)*cnt/2;
        //for (int i = n; i>=n-cnt+1; --i) max= (max+i)%mod;

        res = (res + max - min + 1)%mod;
    }
    cout<<res;

}


Measured memory_bytes: 3644
S = int(input())
i = 1
a_i = S
a_ls = [S]
while True:
    if a_i % 2 == 0:
        next_a_i = a_i // 2
    else:
        next_a_i = 3 * a_i + 1
    if next_a_i in a_ls:
        print(i + 1)
        break
    i += 1
    a_i = next_a_i
    a_ls.append(a_i)

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

int main() {
  int n;
  while (cin >> n) {
    if (n == 0) break;
    vector<ll> dp(n + 1);
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
      dp[i] += dp[i - 1];
      if (i >= 2) dp[i] += dp[i - 2];
      if (i >= 3) dp[i] += dp[i - 3];
    }
    cout << (dp[n] + 3649) / 3650 << endl;
  }
  return 0;
}



Measured memory_bytes: 3080
import java.util.Scanner;

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
         
        double r = sc.nextDouble(); 
        System.out.printf("%.6f %.6f\n ",r*r*Math.PI,2*r*Math.PI);
        
        sc.close();
    }
}


Measured memory_bytes: 28192
# サラスの公式
# X1,Y1 は原点。絶対値記号も外せる。
# S=X2Y3-Y2X3

import math
S=int(input())

X1=Y1=0
X2=Y3=math.ceil(math.sqrt(S))
Y2=1
X3=X2*Y3-S
print(X1,Y1,X2,Y2,X3,Y3)

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

vector<ll>p(60,1),a(60,1);

ll f(ll n,ll x){
    if(n==0){
        return (x<=0?0:1);
    }
    if(x==1){
        return 0;
    }
    else if(x<=a[n-1]+1){
        return f(n-1,x-1);
    }
    else if(x==a[n-1]+2)return p[n-1]+1;
    else if(x<=2*a[n-1]+2){
        return p[n-1]+1+f(n-1,x-2-a[n-1]);
    }
    else if(x==2*a[n-1]+3){
        return 2*p[n-1]+1;
    }
}

int main(){
    for (int i = 0; i < 60; ++i) {
        p[i+1]=2*p[i]+1;
        a[i+1]=2*a[i]+3;
    }
    ll n,x;cin >>n>>x;
    cout <<f(n,x)<<endl;
    return 0;
}

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

int main(){

int X,Y,l=-100,k=100,a[100],b[100],A,B;

cin >> A >> B >> X >> Y;

for(int i=0;i<A;i++){
cin >> a[i];
if(l<a[i])l=a[i];
}
for(int i=0;i<B;i++){
cin >> b[i];
if(k>b[i])k=b[i];
}
if(l>=k)cout << "War" << endl;
else if(X>=k)cout << "War" << endl;
else if(k>Y)cout << "War" << endl;
else cout << "No War" << endl;

return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2,147,483,647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define cint(n) int n;cin>>n;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int main() {
    int n,x;cin>>n>>x;
    vector<int> a(n);
    rep(i,n){
        cin>>a[i];
    }
    sort(ALL(a));
    int j=0;
    ll sum=0;
    while(sum<x && j<n){
        sum+=a[j];
        j++;
    }
    if(sum==x){
        cout<<j;
    }else{
        cout<<j-1;
    }
    
    return 0;
}


Measured memory_bytes: 3564
n=int(input())
nlist=list(map(int,input().split()))
flag=1
ans=1
if 0 in nlist:
    ans=0
else:
    for i in nlist:
        ans*=i
        if ans>10**18:
            flag=0
            break
        #print("OK")
if flag:
    print(ans)
else:
    print(-1)

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

int main(){
	long double n, m, sum;
	cin >> n >> m >> sum;
	
	if(n+m+2.0*sqrt(n*m)<sum){
		cout << "Yes";
	}
	else{
		cout << "No";
	}
	
	return 0;
}

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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

template<typename T, size_t size> void fill(T (&ary)[size], const T& val){
    fill_n((T*)ary, size, val);
}

void solve() {
    //const i64 mod = 1'000'000'007;
    i64 L,R;
    cin >> L >> R;
    
    if((R-L+1)>=2019){
        cout << 0 << endl;
        return;
    }
    
    i64 ans=inf64;
    rep(i,L,R+1){
        rep(j,i+1,R+1){
            chmin(ans,i*j%2019);
        }
    }
    
    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;

ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

ll LCM(ll a,ll b){
    return a / GCD(a,b) * b;
}

const int MOD = 1000000007;


//void warshall_floyd(int n){
//    for(int k=0;k<n;k++){
//        for(int i=0;i<n;i++){
//            for(int j=0;j<n;j++){
//                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
//            }
//        }
//    }
//}
//ll calc_digit(ll N) {
//    ll res = 0;
//    while (N) {
//        ++res;
//        N /= 10;
//    }
//    return res;
//}
//ll sum_digit(ll N) {
//    ll res = 0;
//    while (N) {
//        res += N % 10;
//        N /= 10;
//    }
//    return res;
//}

int main() {
    int n;cin >> n;
    vector<ll>v;multimap<ll,ll>m;
    for(int i = 0;i < n;i++){
        ll x; cin >> x;
        v.push_back(x);
        auto z = m.find(x);
        if(z == m.end()){
            m.insert(make_pair(x,1));
        }else{
            z->second++;
        }
    }
    ll sum  = 0;
    
    for(auto f: m){
        ll g = (f.second*(f.second-1))/2;
        sum += g;
    }
    
    for(int i = 0;i < n;i++){
        ll plus = (m.find(v[i])->second-1)*(m.find(v[i])->second-2);
        plus/=2;
        ll minus = (m.find(v[i])->second)*(m.find(v[i])->second-1);
        minus/=2;
        cout << sum - minus + plus << endl;
    }
    
}




Measured memory_bytes: 12704
h, w, m = map(int, input().split())
HW = [[*map(lambda x: int(x)-1, input().split())] for _ in range(m)]

sum_h = [[0,0] for _ in range(h)] # [sum, index]
sum_w = [[0,0] for _ in range(w)]
for i in range(m):
    h,w = HW[i]
    sum_h[h][0] += 1
    sum_w[w][0] += 1
    sum_h[h][1] = h
    sum_w[w][1] = w

h_num_ix = {}
for num,ix in sum_h:
    if not num in h_num_ix:
        h_num_ix[num] = set()
    h_num_ix[num].add(ix)

w_num_ix = {}
for num,ix in sum_w:
    if not num in w_num_ix:
        w_num_ix[num] = set()
    w_num_ix[num].add(ix)

max_h_num = max(h_num_ix)
max_w_num = max(w_num_ix)

# print(sorted(HW))
# print('---')
# print(h_num_ix)
# print(w_num_ix)
# print(max_h_num)
# print(max_w_num)
# print('====')

SHW = set()
for h,w in HW:
    SHW.add((h,w))
# print(SHW)

max_num = max_h_num + max_w_num - 1
for h_ix in h_num_ix[max_h_num]:
    for w_ix in w_num_ix[max_w_num]:
        num = max_h_num + max_w_num
        # if [h_ix, w_ix] in HW: continue
        if (h_ix, w_ix) in SHW: continue
        max_num += 1
        print(max_num)
        exit()
print(max_num)


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

if N==1 and M==1:
  print(0)
elif N==2 and M==0:
  print(1)
elif N==0 and M==2:
  print(1)
else:
  print(int(N*(N-1)/2)+int(M*(M-1)/2))
 

Measured memory_bytes: 2940
s=set()
l = [0] * ( 10 ** 5 + 1 )
sum=0
N = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
    l[A[i]] += 1
    s.add(A[i])
    sum += A[i]
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    if l[B] > 0:
        s.add(C)
        sum = sum + l[B] * ( C - B )
        l[C] += l[B]
        l[B] = 0
        s.discard(B)
    print(sum)


Measured memory_bytes: 84184
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		new Main();	
	}

	public Main() {
		new aoj0056().doIt();
	}
	class aoj0056 {
		ArrayList<Integer> array = new ArrayList<Integer>();
		void eratos(){ 
			int MAX = 50000;
			boolean [] isprime = new boolean[MAX + 1];
			Arrays.fill(isprime, true);
			isprime[0] = false;
			isprime[1] = false;
			for(int i = 0; i * i <= MAX; i++){
				if(isprime[i]){
					for(int j = i * 2; j <= MAX; j+= i){
    					isprime[j] = false;
    				}
    			}
			}
			for(int i = 0; i <= MAX; i++){
				if(isprime[i])array.add(i);
			}
		}
		int ans[] = new int [50001];
		int ans2[] = new int [50001];
		void DP(){
			for(int i = 0;i < array.size();i++){
				ans2[array.get(i)]++;
			}
			for(int i = 0;i <= array.size();i++){
				for(int j = i;j < array.size();j++){
					if(array.get(i) + array.get(j) <= 50000){
						ans[array.get(i)+array.get(j)] = ans[array.get(i)+array.get(j)] + ans2[array.get(i)];  
					}else break;
				}
			}
		}
		void doIt() {
			eratos();
			DP();
			while(true){
				int n = sc.nextInt();
				if(n == 0)break;
				System.out.println(ans[n]);
			}
		}
	}
}

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

#define s(n)                        scanf("%d",&n)
#define ss(n)                       scanf("%s",n)
#define forall(i,a,b)               for(int i=a;i<b;i++)
#define fill(a,v)                   memset(a, v, sizeof a)
#define fi              freopen("input.txt", "rt", stdin)
#define fo              freopen("output.txt", "wt", stdout)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;

void solve(){
//	fi; fo;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string w;
    cin>>w;

    int n=w.length();
    int a[26];
    fill(a,0);
    forall(i,0,n){
        if(islower(w[i]))
            a[w[i]-'a']++;
    }
    int f=1;
    forall(i,0,26)
        if(a[i]%2!=0){
            f=0;
            break;
        }

    if(f)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}


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



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

using namespace std;

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

void Main()
{
	int n;
	cin >> n;
	vector<string> s(n);
	int a = 0, w = 0, t = 0, r = 0;
	rep(i, n){
		cin >> s[i];
	}
	rep(i, n){
		if(s[i] == "AC"){
			a++;
		}else if(s[i] == "WA"){
			w++;
		}else if(s[i] == "TLE"){
			t++;
		}else if(s[i] == "RE"){
			r++;
		}else{}
	}
	cout << "AC" << " " << 'x' << " " << a << endl;
	cout << "WA" << " " << 'x' << " " << w << endl;
	cout << "TLE" << " " << 'x' << " " << t << endl;
	cout << "RE" << " " << 'x' << " " << r << endl;
}
int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


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

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

 
/*CODE START HERE*/
int main() {
  int n ;
  cin >> n ;
  int a = dsum(n) ;
  cout << (n%a == 0 ? "Yes" : "No" ) << endl;
}

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

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

int main(){
    int N;
    cin >> N;
    rep(i, N){
        int a;
        cin >> a;
        if(a % 2 == 0){
            if((a % 3 != 0) && (a % 5 != 0)){
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }
    cout << "APPROVED" << endl;
    return 0;
}

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

int main() {
    ll T1,T2;
    cin >> T1 >> T2;
    vector<ll> A(2),B(2);
    cin >> A[0] >> A[1];
    cin >> B[0] >> B[1];
    if(A[0]<B[0]){
        swap(A,B);
    }
    // cerr <<"A0=" << A[0] <<", A1=" <<A[1] << endl;
    ll firstHalf = (A[0]-B[0]) * T1;
    ll lastHalf = (A[1] -B[1]) *T2;
    ll diff =firstHalf +lastHalf;
    // cerr <<"diff=" << diff << endl;
    if(diff==0){
        cout << "infinity" << endl;
        return 0;
    }
    if(diff>0){
        cout << 0 << endl;
        return 0;
    }
    // cerr <<"target =" << (A[0]-B[0])*T1 << endl;
    ll ans = firstHalf/(-diff) +1;
    ans *=2;
    //最初の一回分は引く。
    --ans;
    //最後ちょうど一回出会う場合は回数が通常より少なくなる。
    if(firstHalf %(-diff) ==0){
        --ans;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

int main()
{
  int n;
  scanf("%d", &n);
  if(n%10 == 3){
    printf("bon\n");
  }else if(n%10 == 0 || n%10 == 1 || n%10 == 6 || n%10 == 8){
    printf("pon\n");
  }else{
    printf("hon\n");
  }

  // printf("Hello World!\n");
  return 0;
}

Measured memory_bytes: 1648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main()
{
    //入力
    int N, M, C;
    cin >> N >> M >> C;

    vector<int> B(M);
    rep(i, M) cin >> B[i];

    vector<vector<int>> A(N, vector<int>(M));
    rep(i, N) rep(j, M) cin >> A[i][j];

    //計算
    int ans = 0;
    rep(i, N)
    {
        int sum = 0;
        for (int j = 0; j < M; ++j)
        {
            sum += A[i][j] * B[j];
        }
        if (sum + C > 0)
        {
            ++ans;
        }
    }
    
    //出力
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string num;
  while(cin>>num){
    if(num=="0")break;
    else{
      int sum=0;
      for(int i=0;i<num.length();i++){
        sum+=(num[i]-'0');
      }
      cout<<sum<<endl;
    }
  }
}


Measured memory_bytes: 3224
X = int(input())
expoList = []

def addList(i):
    for p in range(2,10):
        if i**p <= X:
            expoList.append(i**p)
        else:
            break

for q in range(1,32):
    addList(q)

expoList.sort()
print(expoList[-1])



Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;

ll d[1111][2222],e[1111],u[1111];
vector<P> v[1111];
vector<int> g[1111];

void Main() {
  ll n,m;
  cin >> n >> m;
  rep(i,1111)rep(j,2222)d[i][j]=-MAXL;
  fill(e,e+1111,-MAXL);
  rep(i,m) {
    ll x,y,z;
    cin >> x >> y >> z;
    x--,y--;
    v[x].pb(P(y,z));
    g[y].pb(x);
  }
  queue<int> q;
  q.push(n-1);
  u[n-1]=1;
  while(!q.empty()) {
    int x=q.front();q.pop();
    rep(i,g[x].size()) {
      int y=g[x][i];
      if(u[y]) continue;
      u[y]=1;
      q.push(y);
    }
  }
  d[0][0]=0;
  priority_queue<PP> que;
  que.push(PP(0,P(0,0)));
  while(!que.empty()) {
    PP p=que.top();que.pop();
    ll x=p.S.S,k=-p.S.F,c=p.F;
    if(d[x][k]>c) continue;
    rep(i,v[x].size()) {
      ll y=v[x][i].F,z=v[x][i].S;
      if(k>=n) {
        if(u[y]&&e[y]<d[x][k]+z) {
          pr("inf");
          return;
        }
      }
      if(k+1>=2*n) continue;
      if(d[y][k+1]<d[x][k]+z) {
        d[y][k+1]=d[x][k]+z;
        e[y]=max(e[y],d[y][k+1]);
        que.push(PP(d[y][k+1],P(-k-1,y)));
      }
    }
  }
  ll ans=-MAXL;
  rep(i,n) ans=max(ans,d[n-1][i]);
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


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

#define N_MAX 5002
#define M_MAX 202
#define ll long long

using namespace std;

int n, m;

ll a[N_MAX], sp[N_MAX];

ll ma[N_MAX][M_MAX];

ll mars[N_MAX];

ll v[N_MAX];

stack <int> st[M_MAX];

int main()
{
    cin >> n >> m;
    for(int i = 2; i <= n; i++)
    {
        cin >> a[i];
        sp[i] = sp[i - 1] + a[i];
    }
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++)
            cin >> ma[i][j];
    ll ans = 0;
    for(int j = 1; j <= m; j++)
    {
        st[j].push(0);
        ma[0][j] = 1e9+1;
    }
    for(int i = 1; i <= n; i++)
    {
        memset(mars, 0, sizeof(mars));
        for(int j = 1; j <= m; j++)
        {
            int last = i - 1;
            while(!st[j].empty() && ma[st[j].top()][j] < ma[i][j])
            {
                last = st[j].top();
                st[j].pop();
                mars[st[j].top() + 1] += ma[i][j] - ma[last][j];
                mars[last + 1] -= ma[i][j] - ma[last][j];
                last = st[j].top();
            }
            st[j].push(i);
            v[i] += ma[i][j];
        }
        for(int j = 1; j <= i; j++)
        {
            mars[j] += mars[j - 1];
            v[j] += mars[j];
        }
        for(int i1 = 1; i1 <= i; i1++)
            ans = max(ans, v[i1] - (sp[i] - sp[i1]));
    }
    cout << ans << "\n";
    return 0;
}


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

int N;
vector<vector<int>> A;
ll ans;

void warshall_floyd() {
  vector<vector<int>> B(A);
  for (int k = 0; k < N; k++) {
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        B[i][j] = min(B[i][j], B[i][k] + B[k][j]);
      }
    }
  }

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (ans == -1) break;
      if (A[i][j] > B[i][j]) {
        ans = -1;
      } else {
        bool ok = false;
        for (int k = 0; k < N; k++) {
          if (k != i && k != j && B[i][j] == B[i][k] + B[k][j]) ok = true;
        }
        if (!ok) ans += B[i][j];
      }
    }
  }
}

main() {
  cin >> N;
  A.resize(N, vector<int>(N));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      cin >> A[i][j];
    }
  }

  warshall_floyd();
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>

int l[51] = { 0 };

int sort(const void *a, const void *b) {
	return *(int*)b - *(int*)a;
}

int main(void) {
	int n, k;
	int ans = 0;

	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &l[i]);
	}
	qsort((void*)l, n, sizeof(l[0]), sort);
	
	for (int i = 0; i < k; i++) ans += l[i];

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

	return 0;
}

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


int main(){
    int H,W; cin >> H >> W;
    int sx,sy;
    int gx,gy;
    cin >> sy >> sx;
    cin >> gy >> gx;
    sy--; sx--; gy--; gx--;
    string S;
    int iii=10101010;
    vector<vector<int> > c(H,vector<int>(W,iii));
    bool f=false;
    for(int i=0;i<H;i++){
        cin >> S;
        for(int j=0;j<W;j++){
            if(S[j]=='#') c[i][j]=-1;
        }
    }
    queue<pair<int,int>> q;
    q.push(make_pair(sy,sx));
    c[sy][sx]=0;
    while(!q.empty()){
        pair<int,int> now = q.front(); q.pop();
        int n=c[now.first][now.second];
        for(int i=-2;i<=2;i++){
            for(int j=-2;j<=2;j++){
                int dy = now.first+i;
                int dx = now.second+j;
                int ttt=0;
                if(dy<0 || dy>=H) continue;
                if(dx<0 || dx>=W) continue;
                int nn=n;
                int dd=c[dy][dx];
                if(abs(i)>1 || abs(j)>1){
                    nn++;
                }else if(abs(i)==1 && abs(j)==1){
                    nn++;
                }
                if(dd==-1){
                    continue;
                }else if(dd>nn){
                    c[dy][dx] = nn;
                    q.push(make_pair(dy,dx));
                }else{
                    continue;
                }   
            }
        }
        
    }
    if(c[gy][gx]!=iii){
        cout << c[gy][gx] << endl;
    }else{
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 7764
# import sys
# input = sys.stdin.readline

a, b = map(int,input().split())
eps = 10**-10

c0 = -((-a * 12.5) // 1)
c1 = (a+1) * 12.5
if c1 - int(c1) != 0:
    c1 = int(c1+1)
d0 = -((-b * 10) // 1)
d1 = (b+1) * 10
if d1 - int(d1) != 0:
    d1 = int(d1+1)
# print(c0,c1,d0,d1)
if c1 <= d0 or d1 <= c0:
    print(-1)
else:
    print(int(max(c0,d0)))

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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const int INF = 0x3f3f3f3f;
const int maxn = 1100000;
void run_case()
{
    int x;
    cin >> x;
    if (x >= 30)
        cout << "Yes\n";
    else
        cout << "No\n";
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    run_case();
    cout.flush();
    return 0;
}

Measured memory_bytes: 3648
n, a, b = map(int, input().split())
mod = pow(10, 9) + 7
      
def cmb(n, r, mod):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) % mod * pow(i+1, mod-2, mod) % mod
    return res

ans = pow(2, n, mod) -1 - cmb(n, a, mod) - cmb(n, b, mod)
print(ans % mod)

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

int main(){
    string s;
    while(getline(cin, s)){
        for(int i=0;i<26;++i){
            string ans;
            for(int j=0;j<s.size();++j){
                if(s[j] >= 'a' && s[j] <= 'z'){
                    char c = (s[j] - 'a' + i) % 26 + 'a';
                    ans.push_back(c);
                }else{
                    ans.push_back(s[j]);
                }
            }
            if(ans.find("the") != -1 || ans.find("this") != -1 || ans.find("that") != -1){
                cout << ans << endl;
                break;
            }
        }
    }

    return 0;
}


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

int main() {

  int N, K, Xi = 0;
  int i;
  int sum = 0;
  cin >> N;
  cin >> K;
  for (i=0; i < N; i++) {
    cin >> Xi;
    if (Xi < (K-Xi)) {
      sum = sum + 2*(Xi);
    }
    else{
      sum = sum +2*(K-Xi);
    }
    
  }
  cout << sum << endl;
  //cout << N << endl;
  //cout << K << endl;
  //cout << Xi <<endl;

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		int[] town = new int[n];

		for(int i=0;i<n;i++)town[i] = Integer.parseInt(sc.next());
		sc.close();
		long cnt = 0;
		for(int i=0;i<n-1;i++) {
			cnt+=Math.min((town[i+1]-town[i])*a, b);
		}
		System.out.println(cnt);
	}

}


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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

tuple<int64, int64> BinarySearch(const function<bool(int64)>& is_upper_fn, int64 l, int64 u) {
  while (u - l >= 2) {
    int64 m = (u + l) / 2;
    if (is_upper_fn(m)) {
      u = m;
    } else {
      l = m;
    }
  }
  return make_tuple(l, u);
}

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

  int n;
  int64 a, b;
  cin >> n >> a >> b;
  vector<int64> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }

  auto fn = [&](int64 k) -> bool {
    int64 c = 0;
    for(int64 x : xs) {
      if (x > b * k) {
        c += (x - b * k + (a - b - 1)) / (a - b);
      }
    }
    return c <= k;
  };
  int64 u;
  tie(ignore, u) = BinarySearch(fn, 0, 1E9);
  cout << u << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <limits>
#include <iterator>
#include <cmath>
#include <numeric>
#include <stack>
#include <queue>
#include <cassert>
#include <forward_list>
#include <chrono>
#include <deque>
#include <list>
#include <random>
#include <cstdio>
#include <sstream>

using namespace std;

//最大公約数
template<class T>
inline T GCD(T m, T n)
{
	T temp;
	while (m % n != 0)
	{
		temp = n;
		n = m % n;
		m = temp;
	}
	return n;
}

//最小公倍数
template<class T>
inline T LCM(T m, T n)
{
	return m * n / GCD(m, n);
}



int main()
{
	int n, k; cin >> n >> k;
	
	double ans = 0;
	double p = 1.0 / n;
	for (int i = 1; i < n + 1; i++)
	{
		int count = i;
		int num = 0;
		while (true)
		{
			if (count >= k) { break; }
			count *= 2;
			num++;
		}
		ans += p * pow(1.0/2.0, num);
	}

	cout << fixed << setprecision(12) << ans << endl;
	return 0;
}

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

using namespace std;

int main(){
    int n, k;
    cin>>n>>k;
    int arr[n];
    for(int i=0; i<n; i++){
        cin>>arr[i];
    }
    sort(arr, arr+n);
    int l=n-1;
    while(k--){
        arr[l--]=0;
    }
    long long int sum=0;
    for(int i=0; i<n; i++){
        sum+=arr[i];
    }
    cout<<sum;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <limits.h>

int n;
int a[32];

int split(int s1, int s2, int t)
{
    int sp1, sp2;

    if (t == n) return s1 > s2 ? s1 - s2 : s2 - s1;
    sp1 = split(s1 + a[t], s2, t + 1);
    sp2 = split(s1, s2 + a[t], t + 1);

    return sp1 < sp2 ? sp1 : sp2;
}

int main(void)
{
    while (scanf("%d", &n), n != 0){
        int i;

        for (i = 0; i < n; i++){
            scanf("%d", a + i);
        }
        printf("%d\n", split(0, 0, 0));
    }

    return 0;
}

Measured memory_bytes: 600
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			double x1 = sc.nextDouble();		//P1とP2の座標を入力
			double y1 = sc.nextDouble();
			double x2 = sc.nextDouble();
			double y2 = sc.nextDouble();
			double distance = GetDistance (x1,y1,x2,y2);
			System.out.println(distance);
		}
	}

	public static double GetDistance (double x1, double y1, double x2, double y2) {		//二点間の距離を求めるメソッド
		double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));				//Math.sprtで平方根を求める
		return d;
	}

}



Measured memory_bytes: 28024
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<cstdlib>

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

using namespace std;

string s;
ll ans;         
int cur = 0;

int main() {

	cin >> s;  

	for (int i = 0; i < s.size(); i++) {		
		if (s[i] == 'W') {
			ans += (i - cur);
			cur++;
		}
	}

	cout << ans;

	return 0;
}

Measured memory_bytes: 640
#include<cstdio>
#include<cstring>
const int MAXN = 400;
const int MAXM = 400 * 400;
struct edge{
	int to;
	edge *nxt;
}edges[MAXM + 5], *adj[MAXN + 5];
edge *ecnt = &edges[0];
int match[MAXN + 5], vis[MAXN + 5];
bool find(int x) {
	for(edge *p=adj[x];p!=NULL;p=p->nxt) {
		if( vis[p->to] == false ) {
			vis[p->to] = true;
			if( match[p->to] == 0 || find(match[p->to]) ) {
				match[p->to] = x;
				match[x] = p->to;
				return true;
			}
		}
	}
	return false;
}
void addedge(int u, int v) {
	edge *p = (++ecnt);
	p->to = v, p->nxt = adj[u], adj[u] = p;
}
int a[MAXN + 5], b[MAXN + 5];
int main() {
	int N, c, d;
	scanf("%d", &N);
	for(int i=1;i<=N;i++)
		scanf("%d%d", &a[i], &b[i]);
	for(int i=1;i<=N;i++) {
		scanf("%d%d", &c, &d);
		for(int j=1;j<=N;j++) {
			if( c > a[j] && d > b[j] )
				addedge(i+N, j);
		}
	}
	int ans = 0;
	for(int i=N;i<=2*N;i++) {
		memset(vis, 0, sizeof vis);
		if( find(i) ) ans++;
	}
	printf("%d\n",ans);
}

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

int main(){
    string s;
    cin >> s;
    int max=0;
    int t;
    
    for(int i=0;i<(s.size());i++){
        t=0;
        if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
            t++;
            for(int j=i+1;j<s.size();j++){
                if(s[j]=='A'||s[j]=='C'||s[j]=='G'||s[j]=='T'){
                    t++;
                } else {
                    break;
                }
            }
        }
        if(max<t){
            max=t;
        }
    }
    
    cout << max << endl;
    return 0;
}

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

int main()
{
	int n, l;
	cin >> n >> l;

	vector<string> s(n);
	for (int i = 0; i < n; i++)
	{
		cin >> s.at(i);
	}

	sort(s.begin(), s.end());
	for (int i = 0; i < n; i++)
	{
		cout << s.at(i);
	}
	cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

void solve(){
  double a, b, x, y, z, ans; cin >> a >> b >> x;
  y = b - x / (a * a);
  if(x / (a * a) >= y){
    ans = atan(y / (a / 2)) * 180 / M_PI;
  }
  else{
    z = x / b / a * 2;
    ans = atan(b / z) * 180 / M_PI;
  }
  cout << fixed << setprecision(6) << ans << endl;
  return;
}

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


Measured memory_bytes: 512
r=0
a,b,c,x=$<.map &:to_i
(0..x/500).each{|i|(0..(x-500*i)/100).each{|j|
	k0=x-500*i-100*j
	r+=1 if k0%50==0&&c>=k0/50&&a>=i&&b>=j
}}
p r

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

public class Main {
    int n, m;
    int[] ns;

    public static void main(String[] args) {
        Main m = new Main();
        m.read();
        m.solve();
    }

    void read() {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        ns = new int[m];
        for (int i = 0; i < m; i++)
            ns[i] = sc.nextInt();
    }

    void solve() {
        int[][] dp = new int[m+1][n+1];
        for (int i = 0; i < m+1; i++)
            Arrays.fill(dp[i], 10000001);
        dp[0][0] = 0;
        for (int i = 1; i < m + 1; i++) {
            int trg = ns[i-1];
            for (int j = 0; j < n + 1; j++) {
                if (j - trg >= 0)
                dp[i][j] = Math.min(dp[i-1][j-trg]+1,
                        Math.min(dp[i-1][j], dp[i][j-trg]+1));
                else
                    dp[i][j] = dp[i-1][j];
            }
        }
        System.out.println(dp[m][n]);
    }
}

Measured memory_bytes: 30936
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  input()
  heights = map(int, input().split())
  thres = 0
  count = 0

  for h in heights:
    if h >= thres:
      count += 1
      thres = h

  print(count)


if __name__ == '__main__':
  main()



Measured memory_bytes: 2940
import sys
A, B = map(int, input().split())
S = list(input())
for i in range(A):
    if not S[i].isdecimal():
        print('No')
        sys.exit()
if S[A] != '-':
    print('No')
    sys.exit()
for i in range(B):
    if not S[A + 1 + i].isdecimal():
        print('No')
        sys.exit()
print('Yes')

Measured memory_bytes: 9080
#include <iostream>
#include <queue>
#include <vector>

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

int n, m;
int a[200001], b[200001];

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
    }

    vector<vector<int> > v(n + 1, vector<int>());
    for (int i = 0; i < m; i++) {
        v.push_back(vector<int>());
    }
    for (int i = 0; i < m; i++) {
        v[a[i]].push_back(b[i]);
        v[b[i]].push_back(a[i]);
    }

    queue<P> q;
    for (int i = 0; i < v[1].size(); i++) {
        q.push(make_pair(1, v[1][i]));
    }

    int ans[n + 1];
    for (int i = 1; i <= n; i++) {
        ans[i] = 0;
    }
    while (!q.empty()) {
        P pos = q.front();
        q.pop();
        if (ans[pos.second] == 0) {
            ans[pos.second] = pos.first;
            for (int i = 0; i < v[pos.second].size(); i++) {
                q.push(make_pair(pos.second, v[pos.second][i]));
            }
            v[pos.second].clear();
            pos.first = pos.second;
        }
    }
    for (int i = 2; i <= n; i++) {
        if (ans[i] == 0) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    for (int i = 2; i <= n; i++) {
        cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 18516
#include<cstdio>
#include<cstring>
char s[500000];
int a[26];
int len;
long long ans;
int main()
{
	scanf("%s",s);
	len=strlen(s);
	ans=1ll*len*(1ll*len-1ll)/2;
	for(int i=0;i<len;i++)
	  ans-=a[s[i]-'a'],a[s[i]-'a']++;
	printf("%lld",ans+1);
	return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() /4;
const ll linf = numeric_limits<ll>::max() /4;
const ull ulinf = numeric_limits<ull>::max()/4;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.end(), v.begin());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////

ll n;
vector<ll> v(100);

int main(){

    cin >> n;
    v[0] = 2;
    v[1] = 1;
    rep(i,2,n+2){
        v[i] = v[i-1] + v[i-2];
    }

    P(v[n]);
    
	return  0;
}

Measured memory_bytes: 256