akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

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

signed main(){
    ll m,n;
    cin >> m >> n;
    cout << mod_pow(m, n) << endl;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define Rep(i,a,b) for(register int i=(a);i<=int(b);++i)
#define Dep(i,a,b) for(register int i=(a);i>=int(b);--i)
#define rep(i,a,b) for(register int i=(a);i<int(b);++i)
#define mem(x,v) memset(x,v,sizeof(x))
#define fi first
#define se second
#define gc getchar
#define pc putchar
inline ll read(){
    ll x=0,f=1;char c=gc();
    for(;!isdigit(c);c=gc())if(c=='-')f=-1;
    for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
    return x*f;
}
inline void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);putchar(x%10+'0');}
inline void wri(ll x){write(x);pc(' ');}
inline void writeln(ll x){write(x);pc('\n');}
const int maxn = 5005;
struct Edge{
	int to,nxt;
	Edge(){}
	Edge(int to,int nxt):to(to),nxt(nxt){}
}edge[maxn*2];int first[maxn],nume;
void Addedge(int a,int b){
	edge[nume] = Edge(b,first[a]);
	first[a] = nume++;
}
vector<int> ed[maxn],st[maxn];
bool vis[maxn];int num[maxn],val[maxn];
int u[maxn],v[maxn],n,m;
bool dfs(int u,int id,int fa,int t){
	if(u==t) return true;
	for(int e=first[u];~e;e=edge[e].nxt){
		int v=edge[e].to;
		if(v!=fa && dfs(v,id,u,t)){
			ed[id].push_back(e);
			st[e>>1].push_back(id);
			return true;
		}
	}return 0;
}
int main(){
	n = read(),m = read();nume = 2;
	memset(first,-1,sizeof(first));
	rep(i,1,n){
		int a = read(),b = read();
		Addedge(a,b);
		Addedge(b,a);
	}
	Rep(i,1,m){
		u[i] = read(),v[i] = read();
		dfs(u[i],i,0,v[i]);
	}int ans = 0;
	rep(i,1,n) num[i] = st[i].size(),ans += min(2,num[i]);
	writeln(ans);
	for(;;){
		int x;
		for(x=1;x<n;++x) if(num[x]==1 && vis[x<<1]!=vis[x<<1|1]) break; 
		if(x==n){
			for(x=1;x<n && !num[x];++x);
			if(x==n) break;
		}
		while(val[st[x].back()]) st[x].pop_back();
		int p = st[x].back(),rev = 0;
		val[p] = true;
		auto it=ed[p].begin();
		for(it=ed[p].begin();it!=ed[p].end();++it){
			if((*it)/2==x){
				if(vis[*it]) rev=1,swap(u[p],v[p]);
				break;
			}
		}
		for(it=ed[p].begin();it!=ed[p].end();++it)
			vis[*it^rev]=1,--num[*it>>1];
	}
	Rep(i,1,m) wri(u[i]),writeln(v[i]);
	return 0;
}

Measured memory_bytes: 13952
#include<bits/stdc++.h>
#define il inline
#define vd void
typedef unsigned long long ll;
il ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
ll x[200010],s[200010];
int main(){
#ifdef XZZSB
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n=gi();ll X=gi();
	for(int i=1;i<=n;++i)x[i]=gi(),s[i]=s[i-1]+x[i];
	ll ans=9e18,res;
	for(int i=1;i<=n;++i){
		res=1ll*i*X+5*(s[n]-s[n-i]);
		int l=n-i-i,r=n-i;
		for(int j=5;r>0;j+=2,l-=i,r-=i)res+=1ll*j*(s[r]-s[std::max(0,l)]);
		ans=std::min(ans,res);
	}
	printf("%lld\n",ans+1ll*n*X);
	return 0;
}


Measured memory_bytes: 3328
#include<stdio.h>
int main()
{
    int a,b,x;
    scanf("%d %d",&a,&b);
    while(1)
    {
        if(a>b)
        {
            x=a-b;
            a=x;
        }
        if(a<b)
        {
            x=b-a;
            b=x;
        }
        if(a==b)
        {
            printf("%d\n",a);
            break;
        }
    }
}



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

using namespace std;

#define rep(i, a, b) for (int i = (a); i <= (b); i++)

int h, w, a, b;

int main() {
  cin >> h >> w >> a >> b;
  rep(i, 1, h) {
    rep(j, 1, w) {
      if (i <= b) {
        if (j <= a) putchar('0');
        if (j > a) putchar('1');
      }
      if (i > b) {
        if (j <= a) putchar('1');
        if (j > a) putchar('0');
      }
    }
    puts("");
  }
  return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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 H, W; cin >> H >> W;
    string s[H];
    for(int i=0; i<H; i++) cin >> s[i];
    for(int i=0; i<H; i++){
        cout << s[i] << endl << s[i] << endl;
    }
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]"):
    play = N - sum(A)
    print(play if play >= 0 else -1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(M)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 10096
//

#include <stdio.h>

int main(void){
    char w[101];
    int a[26]={0};
    int i,ans=0;
    scanf("%s",w);
    for(i=0;w[i]!='\0';i++){
        a[w[i]-'a']++;
    }
    for(i=0;i<26;i++){
        if(a[i]%2==1)ans=1;
    }
    if(ans==0)printf("Yes\n");
    else printf("No\n");
    return 0;
}

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

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

typedef long long ll;

int main() {
    ll INF = 1e18;
    int a, b, q; cin >> a >> b >> q;
    vector<ll> s(a), t(b);
    rep(i, a) cin >> s[i];
    rep(i, b) cin >> t[i];

    s.insert(s.begin(), -INF);
    s.push_back(INF);

    t.insert(t.begin(), -INF);
    t.push_back(INF);

    ll x;
    rep(i, q){
        ll d, min_d=INF;
        cin >> x;
        int idx_sxr = lower_bound(s.begin(), s.end(), x) - s.begin();
        int idx_txr = lower_bound(t.begin(), t.end(), x) - t.begin();
        for(int j=idx_sxr-1; j<idx_sxr+1; j++){
            for(int k=idx_txr-1; k<idx_txr+1; k++){
                // s -> t
                d = abs(x-s[j]) + abs(s[j]-t[k]);
                min_d = min(min_d, d);
                // t -> s
                d = abs(x-t[k]) + abs(t[k]-s[j]);
                min_d = min(min_d, d);
            }
        }
        cout << min_d << endl;
    }
    return 0;
}


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

int main(){
  int i,s,t;
  vector<int> a(1000),b(1000);
  for(i=0;i>=0;i++){
    cin >> a[i] >> b[i];
    if(a[i]==0 && b[i]== 0){
      break;
    }
  }
  for(i=0;i>=0;i++){
  if(a[i]==0 && b[i]== 0){
    break;
  }
  for(t=0;t<a[i];t++){
       if(t%2==0){
    for(s=0;s<b[i];s++){
      cout << "#";
      if (s!=b[i]-1){
        cout << ".";
        s++;
      }

   }
 }else {
     for(s=0;s<b[i];s++){
       cout << ".";
       if (s!=b[i]-1){
         cout << "#";
         s++;
       }

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



Measured memory_bytes: 3112
while(1):
    [n,k]=[int(x) for x in raw_input().split()]
    if n==0:
        break
    else:
        hand=[]
        for i in range(k):
            hand.append(int(raw_input()))
        hand.sort()
        havewhite=0
        if hand[0]==0:
            del hand[0]
            k=k-1
            havewhite=1
        groupedhand=[]
        #grouping
        groupedhand=[]
        group=[hand.pop(0)]
        while len(hand)>0:
            card=hand.pop(0)
            if card-group[-1]==1:
                group.append(card)
            else:
                groupedhand.append(group)
                group=[card]
        groupedhand.append(group)
        if havewhite:
            for i in range(len(groupedhand)-1):
                if groupedhand[i+1][0]-groupedhand[i][-1]==2:
                    groupedhand[i]=groupedhand[i]+groupedhand[i+1]
        maxlength=max([len(group) for group in groupedhand])
        if havewhite:
            maxlength=maxlength+1
        print maxlength

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

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

  //文字分繰り返す
  rep(i,s.size()) {
    //文字コードからAを引くことで文字コード値の調整
    s[i] = (s[i] - 'A' + n) % 26 + 'A';
  }

  cout << s << endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a;
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    if (x == i + 1) a.push_back(i);
  }
  int ret = 0, k = a.size();
  for (int i = 0; i < k; ) {
    if (i + 1 < k && a[i] + 1 == a[i + 1]) {
      ++ret;
      i += 2;
    } else {
      ++i;
      ++ret;
    }
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 892
// Atcoder
  // Practice Problems
  // D - Flipping Signs
  #include <bits/stdc++.h>
  #include <iostream>
  #include <map>
  #include <queue>
  #include <set>
  #include <string>   
  #include <vector>
  #include <numeric>
  using namespace std;
  typedef long long int ll;
  typedef pair<ll, int> PLI;
  typedef pair<int, int> PII;
  const ll mxsize = 1e5 + 5;
  #define fastIO                                                                 \
    ios_base::sync_with_stdio(false);                                            \
    cin.tie(NULL);                                                               \
    cout.tie(NULL);
  
  /******************************************* IMPORTANT CODE SNIPPETS ************************************************/ 
  
  ll pow(ll x, ll n) {
    if (n == 0)
      return 1ll;
    ll temp;
    temp = pow(x, n / 2);
    if (n % 2 == 0)
      return temp * temp;
    else
      return x * temp * temp;
  }

  ll gcd(ll a, ll b) {
    if (b == 0)
      return a;
    return gcd(b, a % b);
  }

  int sum_digit(int val) {
    if (val < 0)
      return -1;
    if (val == 0)
      return 0;
    int ans = 0;
    while (val > 0) {
      ans = ans + val % 10;
      val = val / 10;
    }
    return ans;
  }

  ll count_div(ll l, ll r, ll val) {
    if (l % val == 0)
      return (((r / val) - (l / val)) + 1);
    else
      return ((r / val) - (l / val));
  }

  int powmod(int x, int y, int m) {
    int res = 1;
    // x = x % mod;
    while (y > 0) {
      if (y & 1)
        res = (res * x) % m;
      cout << res << endl;
      y = y / 2;
      cout << x << endl;
      x = (x * x) % m;
    }
    // cout << res << endl;
    return res;
  }
  /******************************************** CODE STARTS FROM HERE *************************************************/ 
  
  int main()
  {
    fastIO;
    ll n;
    cin >> n;
    ll arr[n];
    for(ll i = 0 ; i < n ; i++)
    cin >> arr[i];
    ll countneg = 0 , minval = INT_MAX , sum = 0;
    for(ll i = 0 ; i < n ; i++)
    {
      if(arr[i] < 0) countneg++;
      minval = min(minval , abs(arr[i]));
      sum = sum + abs(arr[i]);
    }
    if(countneg % 2 == 0)
    {
      cout << sum;
      return 0;
    }
    else
    {
      sum = sum - 2 * abs(minval);
      cout << sum;
      return 0;
    }
  }

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define inf (ll)1e9
#define de(x) cerr<<#x<<"="<<x<<endl;

vector<int> vec;
vector<pair<int, int>> vp;
//vector<int> cut;
int n,m,tmp,cut,l;

int main(void){
    cin>>n>>m;
    if(n>=m){cout<<0<<endl; return 0;}
    rep(i,m){
        cin>>tmp;
        vec.push_back(tmp);
    }
    sort(vec.begin(),vec.end());
    //rep(i,m)cout<<vec[i]<<endl;
    //cout<<vec.size()<<endl;
    l=vec[vec.size()-1]-vec[0];
    //cout<<l<<endl;
    rep(i,m-1){
        vp.push_back(make_pair(vec[i+1]-vec[i],i));
    }
    sort(vp.begin(),vp.end(),greater<pair<int,int>>());
    //rep(i,m-1){
    //    cout<<vp[i].first<<","<<vp[i].second<<endl;
    //}
    rep(i,n-1)cut+=vp[i].first;
    cout<<l-cut<<endl;
    return 0;
}


Measured memory_bytes: 1784
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <map>

typedef long long ll;
#define fi first
#define se second

using namespace std;

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

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

int n;
string s[100];
int num[30];
int jdg[30];


int abc = 26;

char ans;

int main(){
  
  int i;
  int j;
  int idx;
  
  cin>>n;
  
  for( i = 0; i < n; i++ ){
    cin>>s[i];
  }
  
  fill( num, num+abc, 0 );
  
  for( i = 0; i < n; i++ ){
    fill( jdg, jdg+abc, 0 );
    if( i ){
      for( j = 0; j < s[i].size(); j++ ){
        idx = s[i][j] - 'a';
        jdg[idx]++;
      }
      for( j = 0; j < abc; j++ ){
        num[j] = min( num[j], jdg[j] );
      }
    }
    else{
      for( j = 0; j < s[i].size(); j++ ){
        idx = s[i][j] - 'a';
        num[idx]++;
      }
    }
  }
  
  for( i = 0; i < abc; i++ ){
    ans = 'a' + i;
    for( j = 0; j < num[i]; j++ ){
      printf("%c", ans);
    }
  }
  
  puts("");
  
  return 0;
}

Measured memory_bytes: 256
readInput :: Read a => IO [a]
readInput = map read . words <$> getLine

main = do
    [a, b] <- readInput
    -- x * 0.08 = a
    -- x * 0.1 = b
    let p = fromIntegral (a :: Int) / 0.08
    let q = fromIntegral (b :: Int) / 0.1
    case [ i | i <- [floor (min p q)..ceiling (max p q)], floor (fromIntegral i * 0.08) == a, floor (fromIntegral i * 0.1) == b] of
        i : _ -> print i
        _ -> print (-1)


Measured memory_bytes: 508
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String[] str = sc.nextLine().split(" ");
            String m, d;
            m = str[1].length() == 1 ? "0" + str[1] : str[1];
            d = str[2].length() == 1 ? "0" + str[2] : str[2];
            int date = Integer.parseInt(str[0] + m + d);
            int year = Integer.parseInt(str[0]);
            if (date >= 19890108) {
                System.out.println("heisei" + " " + (year - 1988) + " " + str[1] + " " + str[2]);
            } else if (date >= 19261225) {
                System.out.println("showa" + " " + (year - 1925) + " " + str[1] + " " + str[2]);
            } else if (date >= 19120730) {
                System.out.println("taisho" + " " + (year - 1911) + " " + str[1] + " " + str[2]);
            } else if (date >= 18680908) {
                System.out.println("meiji" + " " + (year - 1867) + " " + str[1] + " " + str[2]);
            } else {
                System.out.println("pre-meiji");
            }
        }
    }
}

Measured memory_bytes: 17164
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
    public static void main(String[] args){
        FastScanner sc = new FastScanner();
        double a = sc.nextInt();
        double b = sc.nextInt();
        int h = sc.nextInt();
        int m = sc.nextInt();
        double angleH = h * 30 + ( m *0.5);
        double angleM = m * 6;
        double angle = Math.abs(angleH - angleM);
        if(angle > 180) angle = 360 - angle;
        double cosC = Math.cos(Math.toRadians(angle));
        double sqrtR = a*a + b*b - 2*a*b*cosC;
        System.out.println(Math.sqrt(sqrtR));

    }

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


Measured memory_bytes: 33332
package main

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

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	q := getNextInt(scanner)
	aa := make([]int, 0)
	for i := 0; i < q; i++ {
		t := getNextInt(scanner)
		switch t {
		case 0:
			aa = append(aa, getNextInt(scanner))
		case 1:
			fmt.Fprintln(writer, aa[getNextInt(scanner)])
		case 2:
			aa = aa[:len(aa)-1]
		}
	}
}



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

int n, x;

vector <int> v;

int main() {
#ifdef LOCAL
    freopen("xxx.in", "r", stdin);
    freopen("xxx.out", "w", stdout);    
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> x;
    if (x == 1 || x == 2 * n - 1) {
        cout << "No";
        return 0;
    }
    x--;
    cout << "Yes\n";
    for (int i = 0; i < x - 1; ++i)
        v.push_back(i + 1);
    for (int i = x + 2; i < 2 * n - 1; ++i)
        v.push_back(i + 1);
    int id = 0;
    for (int i = 0; i < n - 2; ++i) {
        cout << v[id++] << "\n";
    }
    cout << x << "\n" << x + 1 << "\n" << x + 2 << "\n";
    for (int i = n + 1; i < 2 * n - 1; ++i) {
        cout << v[id++] << "\n";
    }
    return 0;
}

Measured memory_bytes: 2420
NK = list(map(int,input().split()))
A = list(map(int,input().split()))
N = NK[0]
K = NK[1]

answer = (N - 1) // (K - 1)
remain = (N - 1) % (K - 1)
if remain > 0:
    answer = answer + 1
print(answer)

Measured memory_bytes: 20356
package main

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

var rdr = bufio.NewReaderSize(os.Stdin, 10000)

func readLine() string {
	buf := make([]byte, 0, 10000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	input := strings.Split(readLine(), " ")
	var a, b, ans int

	a, _ = strconv.Atoi(input[0])
	b, _ = strconv.Atoi(input[1])

	if a > b {
		ans += a
		a--
	} else {
		ans += b
		b--
	}

	if a > b {
		ans += a
		a--
	} else {
		ans += b
		b--
	}

	fmt.Println(ans)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N >> S;

  for (int i = 0; i < S.size(); i++) {
    S[i] += N;
    if (S[i] > 'Z'){
      S[i] -= 26;
    }
  }
  cout << S << endl;
}



Measured memory_bytes: 3656
n = int(input())
ans = [0] * 3

for i in range(n):
    t1 = list(map(int, input().split()))
    t2 = [0] * 3
    for i in range(3):
        for j in range(3):
            if i != j:
                t2[j] = max(t2[j], ans[i] + t1[j])
    ans = t2
print(max(ans))

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

int main(){
	long long h,w;

	cin >> h >> w;
		if (h==1 || w == 1){
		cout << 1;
		return 0;}
	h = (h*w) %2 ==0 ? h*w/2 : h*w/2+1;
	cout << h;
}


Measured memory_bytes: 256
from itertools import accumulate
from operator import add

N, K = map(int, input().split())
K2 = 2 * K

# Gss[i][j]: 「市松模様の黒い部分の右上のマス」が(i,j)のとき、満たせる要望の個数
Gss = [[0] * K2 for i in range(K2)]

for i in range(N):
    x, y, c = input().split()
    x, y = int(x), int(y)

    # 要望を「0<=x<2K, 0<=y<K, 'B'」に変換する
    if c == 'W':
        x -= K
    x, y = x % K2, y % K2

    if y >= K:
        x, y = (x - K) % K2, y - K

    # 要望を満たす「市松模様の黒い部分の右上のマス」に対して、+1する
    # （後で累積和を取る）
    Gss[x][y] += 1
    Gss[x][y - K] += -1
    if x != K:
        Gss[x - K][y - K] += 1
        Gss[x - K][y] += -1
    if x > K:
        Gss[0][y] += 1
        Gss[0][y - K] += -1

# 累積和を取る
Gss = [accumulate(Gs) for Gs in Gss]
Gss = [accumulate(Gs) for Gs in zip(*Gss)]
Gss = list(map(list, zip(*Gss))) # 転置

# 「K<=y<2K」の部分を、「0<=y<K」に重ね合わせる
Gss = [map(add, Gss[i][:K], Gss[i - K][K:]) for i in range(K2)]

# Gssの最大値が答え
print(max(map(max, Gss)))


Measured memory_bytes: 220532
#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;

struct Node
{
    string str;
    int p, idx;
    bool operator<(const Node& rhs) const
    {
        return str == rhs.str ? p > rhs.p : str < rhs.str;
    }
} A[maxn];
int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> A[i].str >> A[i].p, A[i].idx = i + 1;
    sort(A, A + n);
    for (int i = 0; i < n; i++)
        cout << A[i].idx << endl;
    cin >> ws;
    return 0;
}


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

int main() {
	int N;											
	int X;											
	int T;						
	int ans;

	cin >> N;
	cin >> X;
	cin >> T;

	ans =( (N + (X - 1)) / X)*T;

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

Measured memory_bytes: 3636
// ※※※ 解答不能 ※※※
// tourist氏.
// https://atcoder.jp/contests/cf16-relay-open/submissions/8980099
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using P = pair<int, int>;
#define repx(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define a first
#define b second
#define pb push_back

int main(){
    int n;
    scanf("%d", &n);
    vector<vi> g(n);
    rep(i, n - 1){
        int x, y;
        scanf("%d %d", &x, &y);
        --x; --y;
        g[x].pb(y);
        g[y].pb(x);
    }
    int ans = 0;
    vector<P> down(n);
    function<P(int, int)> Dfs = [&](int v, int pr){
        int one = 1;
        int two = 0;
        int profit = 0;
        for(int u : g[v]){
            if(u == pr) continue;
            auto res = Dfs(u, v);
            one = max(one, 1 + res.a);
            two += res.b;
            profit = max(profit, res.a - res.b);
        }
        one = max(one, two + profit);
        two = max(two, 1);
        ans = max(ans, one);
        return down[v] = {one, two};
    };
    Dfs(0, -1);
    function<void(int, int, P)> Solve = [&](int v, int pr, P up){
        vector<P> children;
        for(int u : g[v]){
            if(u == pr) continue;
            children.pb(down[u]);
        }
        int sz = (int) children.size();
        vi pref_one(sz + 1);
        vi pref_two(sz + 1);
        vi pref_profit(sz + 1);
        vi suf_one(sz + 1);
        vi suf_two(sz + 1);
        vi suf_profit(sz + 1);
        pref_one[0] = 1;
        rep(i, sz){
            pref_one[i + 1] = max(pref_one[i], 1 + children[i].a);
            pref_two[i + 1] = pref_two[i] + children[i].b;
            pref_profit[i + 1] = max(pref_profit[i], children[i].a - children[i].b);
        }
        suf_one[sz] = 1;
        repr(i, sz - 1, 0){
            suf_one[i] = max(suf_one[i + 1], 1 + children[i].a);
            suf_two[i] = suf_two[i + 1] + children[i].b;
            suf_profit[i] = max(suf_profit[i + 1], children[i].a - children[i].b);
        }
        ans = max(ans, max(max(pref_one.back(), 1 + up.a), pref_two.back() + up.b + max(pref_profit.back(), up.a - up.b)));
        int ptr = 0;
        for(int u : g[v]){
            if(u == pr) continue;
            int one = 1 + up.a;
            int two = up.b;
            int profit = up.a - up.b;
            one = max(one, max(pref_one[ptr], suf_one[ptr + 1]));
            two += pref_two[ptr] + suf_two[ptr + 1];
            profit = max(profit, max(pref_profit[ptr], suf_profit[ptr + 1]));
            one = max(one, two + profit);
            two = max(two, 1);
            Solve(u, v, {one, two});
            ptr += 1;
        }
    };
    Solve(0, -1, {0, 0});
    printf("%d\n", ans);
    return 0;
}

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

int main(){
    while(1){
        int n;
        scanf("%d",&n);
        if(n == 0)return 0;
        string s;
        cin >> s;
        bool used[1<<10][1<<10];
        for(int i = 0 ; i < (1<<10) ; i ++){
            for(int j = 0 ; j < (1<<10) ; j ++){
                used[i][j] = false;
            }
        }
        int a = 0;
        for(int i = 0 ; i < s.size() ; i ++){
            if(s[i] == 'u'){
                a = 0;
                continue;
            }
            if(((1<<(s[i]-'0'))&a) != 0){
                a = -1;
                break;
            }
            used[1<<(s[i]-'0')][a] = true;
            a += 1<<(s[i]-'0');
        }
        if(a == -1){
            puts("UNSAFE");
            continue;
        }
        
        /*for(int i = 0 ; i < 4 ; i ++){
            for(int j = 0 ; j < 4 ; j ++){
                if(used[i][j])printf("1");
                else printf("0");
            }
            cout << endl;
        }*/
        
        bool ret = false;
        for(int i = 0 ; i < (1<<10) ; i ++){
            for(int j = 0 ; j < (1<<10) ; j ++){
                if(!used[i][j])continue;
                if((i&j) == i)ret = true;
                for(int k = 0 ; k < 10 ; k ++){
                    if(((1<<k)&j) == 0)continue;
                    int sub = ((1<<10)-1)^j;
                    for(int t = (1<<10)-1 ; t >= 0 ; t --){
                        t &= sub;
                        if(!used[(1<<k)][t])continue;
                        used[i|(1<<k)][j|t] = true;
                    }
                }
            }
        }
        
        /*for(int i = 0 ; i < 4 ; i ++){
            for(int j = 0 ; j < 4 ; j ++){
                if(used[i][j])printf("1");
                else printf("0");
            }
            cout << endl;
        }*/
        
        if(ret)puts("UNSAFE");
        else puts("SAFE");
    }
}

Measured memory_bytes: 4296
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		//int i = sc.nextInt();
		if(S.charAt(2)==S.charAt(3)&&S.charAt(4)==S.charAt(5)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		
		
	}

}

Measured memory_bytes: 20948
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            total = 500 * i + 100 * j + 50 * k
            if total == x:
                ans += 1

print(ans)

Measured memory_bytes: 3060
#include <stdio.h>

int main(void)
{
	int b, f, r, v;
	int house[5][4][11];
	int i, n;

	for (b = 1; b <= 4; b++) {
		for (f = 1; f <= 3; f++) {
			for (r = 1; r <= 10; r++) house[b][f][r] = 0;
		}
	}
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %d %d %d", &b, &f, &r, &v);
		house[b][f][r] += v;
	}

	for (b = 1; b <= 4; b++) {
		for (f = 1; f <= 3; f++) {
			for (r = 1; r <= 10; r++) printf(" %d", house[b][f][r]);
			putchar('\n');
		}
		if (b < 4) puts("####################");
	}
	return (0);
}



Measured memory_bytes: 2760
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<pii,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
struct UnionFind{
    vector<int> data;
    UnionFind(int size) : data(size, -1) {}
    bool unionSet(int x,int y){
        x=root(x);y=root(y);
        if(x==y)return 0;
        if(data[y]<data[x])swap(x,y);
        data[x]+=data[y],data[y]=x;
        return 1;
    }
    bool findSet(int x,int y){
        return root(x)==root(y);
    }
    int root(int x){
        return data[x]<0 ? x : data[x]=root(data[x]);
    }
    int size(int x){
        return -data[root(x)];
    }
};
int main(){
	int n,m;
	cin>>n>>m;
	UnionFind uf(n);
	rep(i,m){
		int a,b;cin>>a>>b;
		uf.unionSet(a-1,b-1);
	}
	ll a=uf.size(0);
	ll b=uf.size(1);
	ll t=n-min(a,b);
	ll tt=min(a,b);
	cout<<t*(t-1)/2+tt*(tt-1)/2-m<<endl;
}




















Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<string>
#include <algorithm>
#include <queue>
#include <climits>
#include<cmath>
#include <sstream>
#include <iomanip>

bool sort_pair( std::pair< int64_t, std::string > origin, std::pair< int64_t, std::string > another )
{
    return origin.first < another.first;
}


int main()
{

    int64_t a;
    
    std::cin>> a;
    int64_t max = pow( 10, 9 );
    std::vector< int64_t > point( 6, 0 );
    //int64_t x1,x2,x3,y1,y2,y3;

    point[2] = pow( 10, 9 );
    point[3] = 1;
    
    point[5] = a / max + 1;
    point[4] = point[5] * max - a;

    if( a == max * max )
    {
        point[5] = max;
        point[4] = 0;
    }
    
    for( int i = 0; i < 6; i++ )
    {
        std::cout<< point[i] <<" ";
    }
}


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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = k + 1; i <= n; i++) {
        if (a[i - k] < a[i]) {
            cout << "Yes" << '\n';
        } else {
            cout << "No" << '\n';
        }
    }
    return 0;
}

Measured memory_bytes: 4000
x, y, z, k = map(int,input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
Z = list(map(int, input().split()))
mul_x_y = []
for i in X:
    for j in Y:
        mul_x_y.append(i+j)
mul_x_y.sort()
mul_x_y.reverse()
Z.sort()
Z.reverse()
mul_x_y = mul_x_y[:k]
Z = Z[:k]
ans = []
for i in mul_x_y:
    for j in Z:
        ans.append(i + j)
ans.sort()
ans.reverse()
for i in range(k):
    print(ans[i])

Measured memory_bytes: 151644
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

template<class U, class V>
ostream& operator <<(ostream& out, pair<U, V>& p) {
    return out << p.first << " " << p.second;
}

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    VEC(int) V(3);
    READVEC(V);
    swap(V[0], V[1]);
    swap(V[0], V[2]);
    cout << V;
    return 0;
};

Measured memory_bytes: 3656
#pragma region includes, macros
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;

typedef int64_t i64;
typedef pair<i64, i64> P;

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
    i64 from, to, cost;
    edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
    edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

// 多重vectorを可変引数テンプレートで http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e : t) fill_v(e, v);
}
//

#pragma endregion

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

int main() {
    i64 n, m;
    cin >> n >> m;
    vector<P> v(n);
    for(int i = 0; i < n; ++i){
        i64 a, b;
        cin >> a >> b;
        v[i] = P(a, b);
    }
    sort(v.begin(), v.end());
    i64 sum = 0, cnt = 0;
    for(i64 i = 0; i < n; ++i){
        if(cnt + v[i].second >= m){
            sum += v[i].first * (m - cnt);
            break;
        }else{
            sum += v[i].first * v[i].second;
            cnt += v[i].second;
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 1792
#include <iostream>

int main()
{
  int ARRAY_SIZE = 100;
  int A;
  int B;
  int K;
  int a[ARRAY_SIZE];
  int b[ARRAY_SIZE];
  int k[ARRAY_SIZE];

  std::cin >> A;
  std::cin >> B;
  std::cin >> K;
  int acount = 0;
  int bcount = 0;
  int kcount = 0;

  for(int i = A; i > 0; --i)
  {
    if(A % i == 0)
    {
      a[acount] = i;
      acount++;
    }
  }

  for(int i = B; i > 0; --i)
  {
    if(B % i == 0)
    {
      b[bcount] = i;
      bcount++;
    }
  }

  for(int i = 0; i < acount; i++)
  {
    for(int j = 0; j < bcount; j++)
    {
      if(a[i] == b[j])
      {
        k[kcount] = a[i];
        kcount++;
        if(kcount == K - 1)break;
      }
    }
  }

  std::cout<< k[K - 1] << std::endl;



  return 0;
}


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

typedef struct vertex{
  int color;
  int count;
  vector<pair<vertex*,long long int> >v;
}Vertex;

void dfs(vertex* vt){
  if (vt->count==0){
    vt->count=1;
    for(vector<pair<vertex*,long long int> >::iterator e=vt->v.begin();e!=vt->v.end();e++){
      if (e->second%2 == 0){
        e->first->color = vt->color;
        dfs(e->first);
      } else {
        e->first->color = (vt->color+1)%2;
        dfs(e->first);
      }
    }
  } else {
    return;
  }
}

int main(){
  int N;
  cin >> N;
  struct vertex X[N];
  for(int i=0;i<N;i++){
    X[i].color=0;
    X[i].count=0;
  }

  for (int i=0;i<N-1;i++){
    int u,v;
    long long int w;
    cin >> u >> v >> w;
    pair<vertex*,long long int> V1;
    pair<vertex*,long long int> V2;
    V1.first=&X[u-1];
    V1.second=w;
    V2.first=&X[v-1];
    V2.second=w;
    X[u-1].v.push_back(V2);
    X[v-1].v.push_back(V1);
  }
  X[0].color=0;
  dfs(&X[0]);
  for(int i=0;i<N;i++){
    cout << X[i].color%2 << endl;
  }
}


Measured memory_bytes: 9216
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int32_t, int32_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int32_t N;
  cin >> N;
  vector<int32_t> v(N);
  for (int32_t i = 0; i < N; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());

  double value = static_cast<double>(v[0]);
  for (int32_t i = 1; i < N; ++i) {
    value = (value + static_cast<double>(v[i])) / 2.0;
  }
  cout << setprecision(20) << value << endl;

  return 0;
}


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


void solve(long long N, long long M){
  long long acc = 0;
  long long cc = M/2;

  acc += min(N, M/2);

  long long leftN = N-acc;
  long long leftM = M-(acc*2);

  acc += leftM/4;

  cout << acc << endl;

}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStreamReader

class A

fun main( args: Array<String> ) {
    val br = BufferedReader( InputStreamReader( System.`in` ) )
    val s = br.readLine()
    var w = 0L
    var r = 0L
    for ( i in s.lastIndex downTo 0 ) {
        if ( s[i] == 'W' ) {
            w ++
        } else {
            r += w
        }
    }
    println( r )
}

Measured memory_bytes: 32604
#include <stdio.h>

int main(){
int n=10;
int a[n],i,j;
for(i=0;i<n;i++){
   scanf("%d",&a[i]);
}
int ubah=0;
for(i=0;i<n-1;i++){
    ubah=0;
    for(j=0;j<n-1;j++){
        if(a[j]<a[j+1]){
            ubah=1;
            int temp=a[j];
            a[j]=a[j+1];
            a[j+1]=temp;
        }
    }
    if(ubah==0){
        break;
    }
}
for(i=0;i<3;i++){
    printf("%d\n", a[i]);
}
return 0;
}



Measured memory_bytes: 2028
/*

 Remember, Hope is a good thing... May be the best of things... and No Good thing ever Dies !!!

*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS ios::sync_with_stdio(0); cout.tie(0);
#define endl "\n"
#define MOD 1000000007
#define MOD1 1e18
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
typedef long double ld;
const ll inf=(1LL<<60)-1;
const ll mxn=1e5;
int dx[]= {-1,1,0,0};
int dy[]= {0,0,-1,1};
long long ans,a[100005];
ll mod(ll x)
{
    ll res=x%MOD;
    while(res<0)
        res+=MOD;
    return res;
}
ll bigmod(ll x,ll n)
{
    ll res=1;
    while(n>0)
    {
        if(n&1)
            res=(res*x)%MOD;
        x=(x*x)%MOD;
        n>>=1;
    }
    return res;
}
/*
sort(v.begin(),v.end(),[&](const pair<ll,ll>&a,const pair<ll,ll>&b)
   {
       if(a.first==b.first)
           return a.second<b.second;
       else
           return a.first>b.first;
   });
   */
void solve()
{
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

    string s;
    cin>>s;
    map<char,ll>mp;
    for(ll i=0; i<s.size(); i++)
    {
        mp[s[i]]++;
    }
    bool flag=0;
    for(auto i:mp)
    {
        if(!(i.second&1))
            flag=1;
        else
        {
            flag=0;
            break;
        }
    }
    if(flag)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}
int main()
{
    IOS;
    //ll t;
    //cin>>t;
    //while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3652
#include <iostream>

int gcd(int a,int b){
	if (a%b==0){
		return(b);
    }
	else{
		return(gcd(b,a%b));
    }
}

int multi_gcd(int a, int b, int c) {
    return gcd(gcd(a, b), c);
}

int sum_gcd(int k) {
    int ans = 0;
    for(int a=1; a<k+1; a++) {
        for(int b=1; b<k+1; b++) {
            for(int c=1; c<k+1; c++) {
                ans += multi_gcd(a,b,c);
            }
        }
    }
    return ans;
}

int main() {
    // int a,b,c;
    // std::cin >> a >> b >> c;
    // std::cout << multi_gcd(a,b,c) << std::endl;
    int k;
    std::cin >> k;
    std::cout << sum_gcd(k) << std::endl;
}


Measured memory_bytes: 3644
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double x = n / 1.08;
        if (x == (int) x) {
            System.out.println((int) x);
        } else if (Math.floor(Math.floor(x) * 1.08) == n) {
            System.out.println((int) Math.floor(x));
        } else if (Math.floor(Math.ceil(x) * 1.08) == n) {
            System.out.println((int) Math.ceil(x));
        } else {
            System.out.println(":(");
        }

    }
}

Measured memory_bytes: 22868
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

bool sieve[35005];
LL datas[3005];
vector<int> prime;
void fill(int N)
{
	for(int a=2;a*a<=N;a++)
	{
		if(!sieve[a])
		{	
			for(int b=a;b*a<=N;b++)
			{
				sieve[b*a]=1;
			}
		}
	}
	for(int a=2;a<=N;a++)
	{
		if(!sieve[a]) prime.pb(a);
	}
}

vector<LL> S;

void factorize(int N)
{
	int ix=0;
	while(N>1 && ix<prime.size())
	{
		while(N%prime[ix]==0)
		{
			S.pb(prime[ix]);
			N/=prime[ix];
		}
		ix++;
	}
	if(N > 1) S.pb(prime[ix]);
}

int main()
{
	fill(35000);
	int n;
	scanf("%d", &n);
	LL tr=1;
	for(int a=0;a<n;a++)
	{
		scanf("%lld", &datas[a]);
		factorize(datas[a]);
	}
	LL hasil=0;
	for(int a=0;a<n;a++)
	{
		LL tmp=1;
		for(int z=0;z<S.size();z++)
		{
			tmp=(tmp*S[z])%datas[a];
		}
		tmp=(tmp-1+datas[a])%datas[a];
		hasil+=tmp;
	}
	printf("%lld\n", hasil);
	return 0;
}


Measured memory_bytes: 656
#include<bits/stdc++.h>
using namespace std;
char s[1000];
string st;
int main()
{
	int x=0,C,m=0;;;
	cin>>C>>st;

	for(int i=0 ; i<st.size() ;i++)
	{

			if( st[i] == 'D' )
            {
				x--;

            }
         else
         {
				x++;


         }
			m= max ( x , m ) ;
	}
 cout<<m;
 	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int main(void){
int n;
  scanf("%d",&n);
  int w[n],sum=0;
  for(int i=0;i<n;i++){
		scanf("%d",&w[i]);
    sum+=w[i];
  }
  int min=10000,submax=0;
  for(int i=0;i<n-1;i++){
	submax+=w[i];
    if(abs(submax-(sum-submax))<abs(min))
      min=abs(submax-(sum-submax));
  }
  printf("%d",min);
  return 0;
}    

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
template < class R > inline void Readin( R &K ) {
	K = 0 ; bool F = false ; char C = getchar() ; while( C < '0' or C > '9' ) { if( C == '-' ) F = true ; C = getchar() ; }
	while( C <= '9' and C >= '0' ) K = ( K << 1 ) + ( K << 3 ) + C - '0' , C = getchar() ; if( F ) K = -K ;
}
template < class R > inline void Checkmax( R &A , R B ) {
	if( A < B ) A = B ;
}
template < class R > inline void Checkmin( R &A , R B ) {
	if( A > B ) A = B ;
}
const int MaxN = 2000 + 10 ;
const int MaxM = 4000 + 10 ;
int N , M , Ans = 1 << 30 ;
int Cnt , Head[MaxN] , To[MaxM] , Next[MaxM] , U[MaxN] , V[MaxN] ;
inline void Add( int U , int V ) {
	To[++Cnt] = V ;
	Next[Cnt] = Head[U] ;
	Head[U] = Cnt ;
}
int Dfs( int Nod , int Fa , int Lim ) {
	if( Lim < 0 ) return 0 ;
	int Siz = 1 ;
	for(register int i = Head[Nod] ; i ; i = Next[i] )
		if( To[i] != Fa )
			Siz += Dfs( To[i] , Nod , Lim - 1 ) ;
	return Siz ;
}
int main() {
	Readin( N ) ;
	Readin( M ) ;
	for(register int i = 0 ; ++i < N ; ) {
		Readin( U[i] ) ;
		Readin( V[i] ) ;
		Add( U[i] , V[i] ) ;
		Add( V[i] , U[i] ) ;
	}
	if( M & 1 ) {
		for(register int i = 0 ; ++i < N ; )
			Checkmin( Ans , N - Dfs( U[i] , V[i] , M >> 1 ) - Dfs( V[i] , U[i] , M >> 1 ) ) ;
	}
	else {
		for(register int i = 0 ; ++i <= N ; )
			Checkmin( Ans , N - Dfs( i , 0 , M >> 1 ) ) ;
	}
	return not printf( "%d\n" , Ans ) ;
}

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

int main(void){
  int i, n, judge, taro = 0, hanako = 0;
  char taroC[101], hanakoC[101];

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf(" %s %s", taroC, hanakoC);
    judge = strcmp(taroC, hanakoC);
    if(judge > 0){
      taro += 3;
    }else if(judge < 0){
      hanako += 3;
    }else{
      taro++;
      hanako++;
    }
  }
  printf("%d %d\n", taro, hanako);
  return 0;
}

Measured memory_bytes: 604