akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(int argc, char* argv) {
  int n, m, l, r, lx, rx;
  lx = 1; rx = 100000;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &l, &r);
    lx = (lx < l)?l:lx;
    rx = (r < rx)?r:rx;
  }
  printf("%d\n", (lx>rx)?0:(rx-lx+1));
}

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

int main(void)
{
  char str[1001];
  int q;
  int i,j,k;
  char req[10];
  int tar;
  int a,b;
  char p[1001];
  char temp;
  
  scanf("%s",str);
  scanf("%d",&q);

  for(i=0; i<q; i++){
    memset(req,'\0',10);
    memset(p,'\0',1001);
    
    scanf("%s",req);
    
    if(strcmp(req,"print")==0){
      scanf("%d %d",&a,&b);
      for(j=a; j<=b; j++){
	printf("%c",str[j]);
      }
      puts("");
    }
    else if(strcmp(req,"reverse")==0){
      scanf("%d %d",&a,&b);
      for(j=a,k=b; j<=k; j++,k--){
	temp = str[j];
	str[j] = str[k];
	str[k] = temp;
      }
    }
    else if(strcmp(req,"replace")==0){
      scanf("%d %d %s",&a,&b,p);
      for(j=a,k=0; j<=b; j++,k++){
	str[j] = p[k];
      }
    }    
  }
  
  return(0);
}

Measured memory_bytes: 592
#include<iostream>
        using namespace std;
         
        int main(){
          string w;
          cin >> w;
          int l = (int)w.length();
          
          int count[24] = {0};
          string ret = "Yes";
          
          for(int i=0; i<l; i++)
            count[ w[i] - 'a' ]++;
          for(int i=0; i<24; i++)
            if(count[i]%2 == 1)
              ret = "No";
          cout << ret << endl;
        }

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e5 + 10;
const int M = 2e5 + 10;
const int maxn = 1e9 + 1e5;
int las[N], nex[M], to[M], sz, val[N], n, K, fa[N], ans[N];
bool visit[N];
struct node {
    int l, r;
    bool all;
    bool empty;
} rem[N], tmp[N];
void add(int x, int y) {
    to[++sz] = y; nex[sz] = las[x]; las[x] = sz;
}
bool dfs(int now) {
    int cnt = 0, flag = 0;
    for (int i = las[now]; i; i = nex[i])
    if(!visit[to[i]]) {
        visit[to[i]] = true;
        if(!dfs(to[i])) {
            rem[now].empty = true;
            return false;
        } 
    }
    else fa[now] = to[i];
    for (int  i = las[now]; i; i = nex[i])
    if(to[i] != fa[now]) {
        tmp[++cnt] = rem[to[i]];
        tmp[cnt].l -= 1;
        tmp[cnt].r += 1;
    }
    if(!rem[now].all) {
        tmp[++cnt] = rem[now];
    }
    flag = (tmp[1].l & 1);
    for (int i = 1; i <= cnt; i++) {
        if(tmp[i].all) continue;
        else if(tmp[i].l & 1 != flag) flag = -1;
    }
    if(flag == -1) return false; 
    int maxl = -maxn, minr = maxn;
    for (int i = 1; i <= cnt; i++) {
        if(tmp[i].l > maxl) maxl = tmp[i].l;
        if(tmp[i].r < minr) minr = tmp[i].r;
    }
    if(maxl > minr) return false;
    rem[now].l = maxl;
    rem[now].r = minr;
    return true;
}
void calc(int now) {
    visit[now] = true;
    int L = max(ans[fa[now]] - 1, rem[now].l);
    int R = min(ans[fa[now]] + 1, rem[now].r);
    ans[now] = L;
    for (int i = las[now]; i; i = nex[i])
    if(!visit[to[i]]) {
        calc(to[i]);
    }
}
int main()
{
    scanf("%d", &n);
    for (int i = 1, x, y; i < n; i++) {
        scanf("%d%d", &x, &y);
        add(x, y);
        add(y, x);
    }
    memset(val, -1, sizeof(val));
    for (int i = 1; i <= n; i++) {
        rem[i].l = -maxn;
        rem[i].r = maxn;
        rem[i].empty = false;
        rem[i].all = true;
    }
    scanf("%d", &K);
    for (int i = 1, x; i <= K; i++) {
        scanf("%d", &x);
        scanf("%d", &val[x]);
        rem[x].l = rem[x].r = val[x];
        rem[x].all = false;
    }
    visit[2] = true;
    if(dfs(2)) {
        memset(ans, 0, sizeof(ans));
        fa[2] = 0;
        ans[0] = rem[2].l - 1;
        memset(visit, 0, sizeof(visit));
        printf("Yes\n");
        calc(2);
        for (int i = 1; i <= n; i++)
            printf("%d\n", ans[i]);
        return 0;
    }
    else printf("No\n");
}


Measured memory_bytes: 8320
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 100000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N,K;
int A[595];
bool check(int t){
	vector<int> vec;
	for(int i=0;i<N;i++){
		if(A[i]%t!=0)vec.pb(A[i]%t);
	}
	sort(all(vec));
	int M = vec.size();
	if(M==0)return true;
	vector<ll> a(M);
	vector<ll> b(M);
	for(int i=0;i<M;i++){
		a[i] = vec[i];
		b[i] = t-vec[i];
	}
	for(int i=1;i<M;i++){
		a[i] += a[i-1];
		b[M-1-i] += b[M-i];
	}
	ll m = min(a[M-1],b[0]); 
	for(int i=0;i<M-1;i++){
		m = min(m,max(a[i],b[i+1]));
	}
	return m<=(ll)K;
}
int main(){
	cin >> N;
	cin >> K;
	int s=0;	
	for(int i=0;i<N;i++){
		cin >> A[i];
		s += A[i];
	}
	vector<int> vec;
	for(int i=1;i*i<=s;i++){
		if(s%i==0){
			vec.pb(i);
			if(i!=s/i)vec.pb(s/i);
		}
	}
	sort(all(vec));
	for(int i=vec.size()-1;i>=0;i--){
		if(check(vec[i])){
			cout << vec[i] << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#define N 1000006

using namespace std;

int n, ans;
char s[N], t[N];

int main(){
	scanf("%d%s%s", &n, s + 1, t + 1);
	if(strcmp(s + 1, t + 1) == 0){
		puts("0");
		return 0;
	}
	int pos = n;
	queue < int > Q;
	for(int i = n; i; --i){
		if(t[i] == t[i - 1]) continue;
		pos = min(pos, i);
		while(s[pos] != t[i] && pos) pos--;
		if(!pos){
			puts("-1");
			return 0;
		}
		while(!Q.empty()){
			int u = Q.front(), sz = Q.size();
			if(u - sz + 1 > i) Q.pop();
			else break;
		}
		Q.push(pos);
		int sz = Q.size();
		if(i != pos) ans = max(ans, sz);
	}
	cout << ans + 1 << endl;
	return 0;
}


Measured memory_bytes: 6272
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll n,a[200000];
int main(){
    cin >> n;
    REP(i,n)
        cin >> a[i];

    sort(a,a + n);

    vector<ll> b,d;
    RREP(i,n - 1){
        if(a[i] == a[i + 1])
            b.pb(a[i]);
        while(0 <= i && a[i] == a[i + 1])i--;
    }
    RREP(i,n - 3){
        if(a[i] == a[i + 1] && a[i] == a[i + 2] && a[i] == a[i + 3]){
            d.pb(a[i]);
            break;
        }
    }
    ll ans = 0;
    if(b.size() >= 2)
        ans = b[0] * b[1];
    if(d.size() > 0)
        ans = max(ans,d[0] * d[0]);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

const int MAX_N = 1000;

int par[MAX_N];
int Rank[MAX_N];
int size;

void init(int n) {
    for (int i = 0; i < n; i++) {
        par[i] = i;
        Rank[i] = 0;
    }
    size = n;
}

int find(int x) {
    if (par[x] == x) {
        return x;
    } else {
        return par[x] = find(par[x]);
    }
}

void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    size--;
    if (Rank[x] < Rank[y]) {
        par[x] = y;
    } else {
        par[y] = x;
        if (Rank[x] == Rank[y]) {
            Rank[x]++;
        }
    }
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int V, M;
    cin >> V >> M;
    int a[M], b[M];
    int ans = 0;
    rep(i, M) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
    }
    rep(i, M) {
        init(V);
        rep(j, M) {
            if(i != j) unite(a[j], b[j]);
        }
        //dump(size);
        if (size != 1) ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
loop do
  str = gets.chomp
  break if str == "-"
  count = gets.chomp.to_i
  ARGF.each.with_index(1) do |s, i|
    a = str[0, s.to_i]
    str.slice!(0, s.to_i)
    str = str + a
    break if (i == count)
  end
  puts str
end

Measured memory_bytes: 6112
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int>vec1(n);
  vector<int>vec2(n);
  bool a=false;
  for (int i=0;i<n;i++){
    cin>>vec1.at(i)>>vec2.at(i);
  }
  for (int i=0;i<=n-3;i++){
    if(vec1.at(i)==vec2.at(i)&&vec1.at(i+1)==vec2.at(i+1)&&vec1.at(i+2)==vec2.at(i+2)){
      a=true;
      break;
    }
  }
  if(a){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}


Measured memory_bytes: 3600
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let mut a: Vec<usize> = (0..n)
        .map(|_| iterator.next().unwrap().parse().unwrap())
        .collect();
    a.sort();
    let mut b = a.clone();
    b.reverse();

    let mut ng: isize = -1;
    let mut ok: isize = n as isize;
    while (ok - ng).abs() > 1 {
        let mid = (ok + ng) / 2;
        let ai = a[mid as usize];
        let mut c = b.clone();
        c.remove(n - 1 - mid as usize);
        if can_survive(ai, &mut c) {
            ok = mid;
        } else {
            ng = mid;
        }
    }

    return format!("{}", n - ok as usize);
}

fn can_survive(mut size: usize, a: &mut Vec<usize>) -> bool {
    while !a.is_empty() {
        let size2: usize = a.pop().unwrap();
        if size2 <= 2 * size {
            size += size2;
        } else {
            return false;
        }
    }
    return true;
}


Measured memory_bytes: 10492
#include <algorithm>
#include <iostream>
#include <string>
#define INF (1e9)
using namespace std;

int main(){
  int d[10]={0,0,1,2,0,-1,2,0,1,2},cnt,ans;
  string s;
  char lr;
  while(1){
    cin>>s;
    if(s=="#") break;
    ans=INF;
    for(int i=0;i<2;i++){
      if(!i) lr='l';
      else lr='r';
      cnt=0;
      for(int j=1;j<s.size();j++){
	if(lr=='l'&&d[s[j-1]-'0']>d[s[j]-'0']) lr='l',cnt++;
	else if(lr=='l') lr='r';
	else if(d[s[j-1]-'0']<d[s[j]-'0']) lr='r',cnt++;
	else lr='l';
      }
      ans=min(ans,cnt);
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1316
#include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
  map<string,int> m;
  map<string,int>::iterator p;
  int ans=0,count=0; 
  string ans1 ,ans2;
  string s;
  while(cin >> s){
    ++m[s];
    if(ans<s.size()){
      ans = s.size();
      ans2 = s;
    }
  }
  p = m.begin();
  for(p=m.begin();p!=m.end();p++){
    if(count<p->second){
      count = p->second;
      ans1 = p->first;
    }
  }
  cout << ans1 << ' ' << ans2 << endl;
  return 0;
}

Measured memory_bytes: 1192
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;

class Program
{
    static void Main(string[] args)
    {
        var num = ToInt32(ReadLine());
        var dic = new Dictionary<int, int>();
        for(var i = 0; i < num; i++)
        {
            var a = ToInt32(ReadLine());
            if (dic.ContainsKey(a)) dic[a]++;
            else dic[a] = 1;
        }
        var result = 0;
        foreach (var key in dic.Keys)
            result += dic[key] % 2 == 0 ? 0 : 1;
        WriteLine(result);
    }
}


Measured memory_bytes: 21216
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007



int main(int argc, char const *argv[]) {
  int a,b;
  string s;
  std::cin >> a >> b >> s;
  bool ans=true;
  if(s[a]!='-') ans=false;

  for(int i=0; i<a; i++){
    if(s[i]>'9' || s[i]<'0') ans=false;
  }

  for(int i=a+1; i<a+b+1; i++){
    if(s[i]>'9' ||  s[i]<'0') ans=false;
  }

  if(ans) printf("Yes\n");
  else printf("No\n");
  return 0;
}


Measured memory_bytes: 256
A, V = list(map(int,input().split(" ")))
B, W = list(map(int,input().split(" ")))
T = int(input())

if A == B:
  print("YES")
elif A < B:
  if A + V*T >= B + W*T:
    print("YES")
  else:
    print("NO")
else:
  if A - V*T <= B - W*T:
    print("YES")
  else:
    print("NO")

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

int main() {
    long long N;
    cin >> N;
    vector <long long> t(N+1, 0);
    vector <long long> x(N+1, 0);
    vector <long long> y(N+1, 0);
    for (long long i=1; i<=N; i++) {
        cin >> t.at(i) >> x.at(i) >> y.at(i);
    }
    bool ok=true;
    for (long long i=1; i<=N; i++) {
        long long dt, dx, dy;
        dt = t.at(i) - t.at(i-1);
        dx=abs(x.at(i)-x.at(i-1));
        dy=abs(y.at(i)-y.at(i-1));
        if(dt < dx+dy) ok=false;
        if((dt-dx-dy)%2 == 1) ok=false;
    }
    if (ok) cout << "Yes";
    else cout << "No";
}

Measured memory_bytes: 5540
use proconio::input;

fn main() {
    input! {
        n: String,
    }

    let mut sum: i64 = 0;
    for d in n.chars() {
        let d = d.to_digit(10).unwrap();
        sum += d as i64;
    }

    println!("{}", if sum % 9 == 0 {"Yes"} else {"No"})
}


Measured memory_bytes: 2316
A = input()
B = input()

dica = {}
dicb = {}
for i, a in enumerate(list(A)):
    b = B[i]
    ai = dica.get(a, -1)
    bi = dicb.get(b, -1)
    if ai != bi:
        print('No')
        exit()
    dica[a] = i
    dicb[b] = i
print('Yes')


Measured memory_bytes: 5168
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;



int main()
{
	int N;
	cin >> N;
	string S, T;
	cin >> S >> T;
	for (int i = 0; i < N; i++) {
		cout << S[i] << T[i];
	}
	cout << endl;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
C = [1] * N
R = [1] + [0] * (N-1)
for _ in range(M):
    x, y = map(int, input().split())
    x, y = x-1, y-1
    C[x] -= 1
    C[y] += 1
    if R[x]: R[y] = 1
    if C[x] == 0: R[x] = 0
print(sum(R))

Measured memory_bytes: 5364
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;
int main(){
   string s;
   cin>>s;
   bool flag=true;
   rep(i,s.size()){
       if(i%2==0){
           if(s[i]!='h') flag=false;
       }
       else{
           if(s[i]!='i') flag=false;
       }

   } 
   if(s.size()%2==1) flag=false;
   flag? cout<<"Yes":cout<<"No";
return 0;
}


Measured memory_bytes: 256
/*
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mint; //*/
#include <bits/stdc++.h>
#define  re(i,j,n) for(li i=(j);i<(n);i++)
#define  rep(i,n) re(i,0,(n))
#define  red(i,n) for(li i=n-1;i>=0;i--)
#define  all(a) begin(a),end(a)
#define  pb(a) push_back(a)
using namespace std;
typedef long int li;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<li> vli;
typedef vector<string> vs;
 
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    a=c-a,b=d-b;
    cout<<"LU";
    rep(i,b) cout<<"U";
    rep(i,a) cout<<"R";
    cout<<"RD";
    rep(i,a) cout<<"L";
    rep(i,b) cout<<"D";
    cout<<"DR";
    rep(i,a) cout<<"R";
    rep(i,b) cout<<"U";
    cout<<"UL";
    rep(i,b) cout<<"D";
    rep(i,a) cout<<"L";
    cout<<endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n; cin >> n;
    vector<bool> zoro(n, 0);
    for(int i = 0; i < n; i++) {
        int a, b; cin >> a >> b;
        if(a == b) {
            zoro[i] = 1;
        }
    }
    bool k = 0;
    for(int i = 0; i < n -2; i++) {
        if(zoro.at(i) && zoro.at(i+1) && zoro.at(i+2)) {
            k = 1;
        }
    }
    if(k) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3628
using System;
using System.Collections.Generic;
using System.Linq;

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] lrd = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            int count = 0;
            for(int i = lrd[0];i<=lrd[1];i++){
                if(i%lrd[2]==0){
                    count++;
                }
            }
            Console.WriteLine(count);
        }
            // long[] NK = Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // long N = NK[0];
            // long K = NK[1];
            // long K = long.Parse(Console.ReadLine());
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int x = int.Parse(Console.ReadLine());
            // int b = int.Parse(Console.ReadLine());
            // int N = int.Parse(Console.ReadLine());
            // float N = float.Parse(Console.ReadLine());
            // string c = Console.ReadLine();
            // string B = Console.ReadLine();
            // string[] s = Console.ReadLine().Split();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(float.Parse);
            // float[] a = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // var X = Console.ReadLine();
            // int[,] abcd = new int[NMQ[2],4];
            // int[] A = new int[NMQ[0]];
            // int[] A_num = new int[NMQ[0]];
            // long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            // var hs=new Dictionary<long,long>();
            // for(int i=0;i<s[0];i++){
            //     long[] q=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
            //     if(hs.ContainsKey(q[0])){hs[q[0]]+=q[1];}
            //     else{hs.Add(q[0],q[1]);}
            // }
        
        // //最小公倍数
        // static long Lcm(long a, long b)
        // {
        //     return a/Gcd(a,b)*b;
        // }

        // //最大公約数
        // static long Gcd(long m, long n)
        // {
        //     if(n==0)return m;
        //     return Gcd(n,m%n);
        // }
    }
}


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

using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    int arr[n];
    int aa = 0;
    int bb = 0;
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    sort(arr, arr + n, greater<int>());
    for (int i = 0; i < n; i = i + 2) {
        aa += arr[i];
    }
    for (int i = 1; i < n; i = i + 2) {
        bb += arr[i];
    }
    cout << aa - bb << "\n";
}












Measured memory_bytes: 3612
import java.util.*;
import java.io.*;

public class Main{

static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;}
static int int_v (String s1){
    StringBuilder sb=new StringBuilder();
    for(int i=0;i<s1.length();i++){sb.append(s1.charAt(i));}
    return Integer.parseInt(sb.toString());
}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split("\\s+");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split("\\s+");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}
//......................................@uthor_Alx..............................................

public static void main(String[] args) throws  IOException{
                assign();
                int t=1;//read().charAt(0)-'0',cn=1;
                while(t--!=0){
                    String s=read();
                    int res=0,max=0;
                    for(int i=0;i<3;i++){
                    	if(s.charAt(i)=='R'){
                    		res++;
                    	}
                    	else{max=Math.max(max,res);res=0;}
                    }
                    max=Math.max(max,res);
                    out.write(max+"\n");            
                }                
                out.flush();

    }
}

Measured memory_bytes: 36176
main = interact $ unlines . solve . read' . lines
  where
    solve = map solveRow
    solveRow [a, b, c]
      | a == -1 || b == -1 = "F"
      | a + b >= 80 = "A"
      | a + b >= 65 = "B"
      | a + b >= 50 = "C"
      | a + b >= 30 && c >= 50 = "C"
      | a + b >= 30 = "D"
      | otherwise = "F"
    read' = map (map read . words) . init :: [String] -> [[Int]]



Measured memory_bytes: 4080
w0=0
h0=0
 
w,h,n=gets.chomp.split(" ").map(&:to_i)

n.times{
  w1,h1,a=gets.chomp.split(" ").map(&:to_i)
  case a
    when 1
    	w0=w1 if w0 < w1
    when 2
    	w=w1 if w > w1
    when 3
    	h0=h1 if h0 < h1
    when 4
    	h=h1 if h > h1
  end
  }
 
if (w-w0 >= 0 ) && (h-h0 >= 0)
  puts (w-w0)*(h-h0)
else
  puts 0
end

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using bl = bool;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  rep(i, 1, n + 1) {
    ll dig = 0, ch = 1;
    while(ch <= i){
      dig++;
      ch *= 10;
    }
    if(dig % 2 == 1) ans++; 
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.PrintWriter
import java.util.*
import java.math.*
import java.lang.*

val pw = PrintWriter(System.out)
val MOD: Long = (1e+9 + 7).toLong()

fun main(args: Array<String>) {
    val (x, a) = readListOfInt() 
    println(if(x < a) 0 else 10)
    pw.flush()
}

/****** Decrared Functions and Data Structures ******/
// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }

fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun Float.format(digits: Int) = String.format("%.${digits}f", this)

fun print(value: Any) { pw.print(value) }
fun println(value : Any) { pw.println(value) }

fun<T> permutations(src: List<T>): List<List<T>> {
    if(src.size == 1) return listOf(src)
    val perms = mutableListOf<List<T>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for(i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}

// return nCr, if you want nCr, please access v[n][r]
fun combinations(n: Long): List<List<Long>> {
    val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList()
    for(i in 0 until v.size) {
        v[i][0] = 1L
        v[i][i] = 1L
    }
    for(i in 0 until v.size) {
        for(j in 1 until i) {
            v[i][j] = (v[i-1][j-1] + v[i-1][j] % MOD)
        }
    }
    return v.map { it.toList() }.toList()
}

// should be a >= b
fun gcd(a: Long, b: Long): Long = 
    if(b == 0L) a else gcd(b, a % b)

// shoud be a >= b
fun lcm(a: Long, b: Long): Long = 
    a / gcd(a, b) * b

fun sumDigits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

fun isDecimal(v: Double): Boolean = ((v - Math.floor(v)) != 0.0)

// Data Structures
class Stack<T>(private var st: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = st.isEmpty()
    fun top(): T = st.last()
    fun push(e: T) { st.add(e) }
    fun pop() { st = st.dropLast(1).toMutableList() }
}

class Queue<T>(private var que: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = que.isEmpty()
    fun top(): T = que.first()
    fun push(e: T) { que.add(e) }
    fun pop() { que = que.drop(1).toMutableList() }
}


Measured memory_bytes: 37676
x, n = map(int,input().split())

p = list(map(int,input().split()))

d =100
num = 0

if n == 0:
    num = x
else:
    for i in range(102):
        if i not in p:
            d_temp = abs(x-i)
            if d_temp < d:
                d = d_temp
                num = i
print(num)

Measured memory_bytes: 9192
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    vi v;
    int num = 1,cnt = 0;
    rep(i,n){
        if(s[i] == char('0'+num))cnt++;
        else{
            v.push_back(cnt);
            num = 1 - num;
            cnt = 1;
        }
    }
    if(cnt)v.push_back(cnt);
    if(!v.size())v.push_back(0);
    int ans = 0;
    rep(i,v.size()){
        int sum = 0;
        loop(j,i,min(i+2*k+1,(int)v.size())){
            sum += v[j];
        }
        ans = max(ans, sum);
        i++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 1528
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		String[] str = s.split("");

		//配列をリストに変換
		List<String> listA=Arrays.asList(str);
		//重複した値を削除
		List<String> listB = new ArrayList<String>(new HashSet<>(listA));

		if(listA.size() == listB.size()) {
			System.out.println("yes");
		}else {
			System.out.println("no");
		}
	}
}


Measured memory_bytes: 23124
#include <stdio.h>

int main(void)
{
	char x,y,A,B,C,D,E,F;
	char s[]={A,B,C,D,E,F};
	
	scanf("%c %c",&x,&y);
	
	for(int i=0;i<6;i++){
		s[i]=i;
	}
	
	if(x>y){
		printf(">\n");
	}else if(x==y){
		printf("=\n");
	}else{
		printf("<\n");
	}
		
	
	return 0;
}

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

int main() {
  int A, B;
  cin >> A >> B;
  int C, D, E;
  C = A+B;
  D = A-B;
  E = A*B;
  if (C >= D){
  if (C >= E){
  cout << C;
  }else
  cout << E;
  }else{
  if (D >= E){
  cout << D;
  }else
  cout << E;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long INF = 123456789;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i, r, n) for (ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i, r, n) for (ll i = (ll)(n - 1); i >= r; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl

/*--------------------template--------------------*/

map<char, ll> mp;

int main(){
    cin>>s;
    REP(i,s.size()) {
        mp[s[i]]++;
    }
    ll a = mp['a'];
    ll b = mp['b'];
    ll c = mp['c'];
    if(max(max(a,b),c) - min(min(a,b),c)<=1){
        cout << "YES" << endl;
        
    }else{
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <vector>
#include <array>
#include <tuple>
#include <utility>
#include <numeric>
#include <iomanip>
#include <cctype>
#include <cmath>
#include <assert.h>
#include <cstdlib>
#include <list>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;

template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {
    return s << "(" << p.first << ", " << p.second << ")";
}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    s << "[";
    for (int i = 0; i < v.size(); i++) s << (i == 0 ? "" : ", ") << v[i];
    s << "]";
    return s;
}

#define ALL(a) (a).begin(), (a).end()

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    cout << max(0, min(B, D) - max(A, C)) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
#define inf 1000000007

int main(void){
    int n;
    cin >> n;
    long long int count = 1;
    long long int ans = 0;
    string s[n];
    for(int i = 0; i < n; i++){
        cin >> s[i];
        sort(s[i].begin(), s[i].end());
    }
    sort(&s[0], &s[n]);
    for(int i = 0; i < n; i++){
        if(s[i] != s[i+1] && count >= 2){
            ans += count*(count-1)/2;
            count = 1;
        }
        else if(s[i] == s[i+1])
            count++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int a[4][4];
    Rep(i,3){
        Scd3( a[i][0], a[i][1], a[i][2] );
    }

    int N;
    Scd(N);

    int open[4][4] = {};
    int b;
    Rep(i,N){
        Scd(b);
        Rep(x,3) Rep(y,3){
            if( a[x][y] == b ) open[x][y] = 1;
        }
    }

    bool ans = false;
    Rep(i,3){
        if( open[i][0] + open[i][1] + open[i][2] == 3 ) ans = true;
        if( open[0][i] + open[1][i] + open[2][i] == 3 ) ans = true;
    }
    if( open[0][0] + open[1][1] + open[2][2] == 3 ) ans = true;
    if( open[0][2] + open[1][1] + open[0][2] == 3 ) ans = true;

    YesNo(ans);

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int maxn=1e5+10;
int a[maxn];
int m,n;
int main()
{
   int x,k;
   cin>>k>>x;
   for(int i=x-k+1;i<=x;i++)
    cout<<i<<' ';
   for(int i=x+1;i<x+k;i++)
    cout<<i<<' ';

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Yes() std::cout << "Yes" << std::endl
#define No() std::cout << "No" << std::endl
#define Say(s) std::cout << s << std::endl
const ll MOD = 1000000007;
const ll INF = 1061109567;

int main()
{
    ll n;
    std::vector<ll> x, y;
    std::cin >> n;
    for (ll i = 0; i < n; ++i) {
        ll temp;
        std::cin >> temp;

        ll temp_1;
        std::cin >> temp_1;
        x.push_back(temp + temp_1);
        y.push_back(temp - temp_1);
    }
    std::sort(x.begin(), x.end());
    std::sort(y.begin(), y.end());
    Say(std::max(x[n - 1] - x[0], y[n - 1] - y[0]));
    return 0;
}

Measured memory_bytes: 6536
import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
INF=-10**20
dp=[[INF]*5 for i in range(n)]
dp[0]=[a[0],INF,INF,0,INF]
for i in range(0,n-1):
    if i%2==1:
        dp[i+1][1]=max(dp[i+1][1],dp[i][0])
        dp[i+1][3]=max(dp[i+1][3],dp[i][2])
        dp[i+1][2]=max(dp[i+1][2],dp[i][4]+a[i+1])
        dp[i+1][0]=max(dp[i+1][0],dp[i][3]+a[i+1])
        dp[i+1][3]=max(dp[i+1][3],dp[i][3])
        dp[i+1][1]=max(dp[i+1][1],dp[i][1])
    else:
        dp[i+1][3]=max(dp[i+1][3],dp[i][0])
        dp[i+1][4]=max(dp[i+1][4],dp[i][3])
        dp[i+1][2]=max(dp[i+1][2],dp[i][3]+a[i+1])
        dp[i + 1][4] = max(dp[i + 1][4], dp[i][2])
        dp[i + 1][3] = max(dp[i + 1][3], dp[i][1])
        dp[i+1][0]=max(dp[i+1][0],dp[i][1]+a[i+1])
ans=max(dp[n-1][2],dp[n-1][3])
print(int(ans))












Measured memory_bytes: 122692
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

bool error = false;
int addr = 1, idx, M;
string line;
int var[26];
int size[100000];

int parse(){
	int res = 0;
	if(line[idx] == '('){
		idx++;
		res = parse();
		idx++;
	}
	else if(line[idx] == 'm'){
		idx += 7;
		int t = 0;
		while(isdigit(line[idx]))
			t = 10*t + line[idx++]-'0';
		if(t <= M){
			size[addr] = t;
			M -= t;
			res = addr++;
		} else {
			res = 0;
		}
		idx++;
	}
	else if(line[idx] == 'c'){
		idx += 6;
		res = parse();
		if(res == -1 || (res > 0 && size[res] == 0)) error = true;
		else if(res > 0 && size[res] <= M){
			size[addr] = size[res];
			M -= size[res];
			res = addr++;
		} else {
			res = 0;
		}
		idx++;
	}
	else if(line[idx] == 'f'){
		idx += 5;
		res = parse();
		if(res == -1 || (res > 0 && size[res] == 0)) error = true;
		else {
			M += size[res];
			size[res] = 0;
		}
	}
	else if(idx+1<line.size() && line[idx+1] == '='){
		int v = line[idx]-'A';
		idx += 2;
		res = var[v] = parse();
	}
	else if(idx+1<line.size() && line[idx+1] == 'U'){
		idx += 4;
		res = 0;
	}
	else {
		res = var[line[idx++]-'A'];
	}
	return res;
}

int main(){
	int heap; cin >> heap;
	M = heap;
	memset(var, -1, sizeof(var));
	memset(size, 0, sizeof(size));
	while(cin >> line){
		idx = 0;
		parse();
	}
	for(int i=0;i<26;i++)
		if(var[i]!=-1){
			M += size[var[i]];
			size[var[i]] = 0;
		}
	if(error) cout << "Error" << endl;
	else      cout << heap-M << endl;
}

Measured memory_bytes: 0
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			var cin = new Scanner2();
			long n = cin.Long();
			long a = cin.Long();
			long b = cin.Long();

			long dif = b - a;
			if (dif % 2 == 0) {
				Console.WriteLine(dif / 2);
			} else {
				if (a - 1 < n - b) {
					long ans = a - 1;
					b -= a;
					ans += 1;
					a = 1;
					ans += (b - a) / 2;
					Console.WriteLine(ans);
				} else {
					long ans = n - b;
					a += (n - b) + 1;
					ans += 1;
					b = n;
					ans += (b - a) / 2;
					Console.WriteLine(ans);
				}
			}
		}
	}

	public class Scanner2
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private readonly string filePath_;
		private string[] buf_;
		private int index_;
		Func<string> reader_;

		public Scanner2(string file = "")
		{
			if (string.IsNullOrWhiteSpace(file)) {
				reader_ = Console.ReadLine;
			} else {
				filePath_ = file;
				var fs = new StreamReader(file);
				reader_ = fs.ReadLine;
			}
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = reader_();
			while (st == "") {
				st = reader_();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}

		public void Save(string text)
		{
			if (string.IsNullOrWhiteSpace(filePath_)) {
				return;
			}

			File.WriteAllText(filePath_ + "_output.txt", text);
		}
	}
}

Measured memory_bytes: 13140
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	string s;
	cin>>s;
	sort(ALL(s));
	if(s.size() & 1){
		cout<<"No"<<endl;
		return;
	}
	rep(i,s.size()){
		if(s[i] != s[i+1]){
			cout<<"No"<<endl;
			return;
		}
		i++;
	}		
	cout<<"Yes"<<endl;
	
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
    char d[10];
    scanf("%s",d);
    if(strlen(d)==3){
        for(int t=2;t>=0;t--){
            printf("%c",d[t]);
        }
    }
    else{
        printf("%s",d);
    }
    return 0;
    
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E9;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////


 
int main(){
    ll n;cin>>n;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    sort(a,a+n);
    vector<ll>b;
    ll pos=0;
    while(pos<=n-1){
        ll c=1;
        while(pos<=n-2&&a[pos]==a[pos+1]){
            pos++;c++;
        }
        pos++;
        b.pb(c);
    }
    sort(b.begin(),b.end());
    ll m=b.size();
    ll sb[m];sb[0]=b[0];
    rep(i,1,m-1)sb[i]=sb[i-1]+b[i];
    rep(k,1,n){
        ll ok=0,ng=inf;
        while(abs(ok-ng)>1){
            ll mid=(ok+ng)/2;
            ll pos=lower_bound(b.begin(),b.end(),mid)-b.begin();
            ll sum=0;
            if(pos-1>=0)sum=sb[pos-1];
            sum+=(m-pos)*mid;
            if(sum>=k*mid){
                ok=mid;
            }else{
                ng=mid;
            }
        }
        cout<<ok<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 9580
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
typedef pair<int, char> P;
int N, M;
vector<P> a;

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

  cin >> N >> M;
  int s;
  char c;
  rep(i, M) {
    cin >> s >> c;
    s--;
    a.push_back(P(s, c));
  }
  string ans="";
  rep(i, N) ans+='-';
  
  rep(i,M) {
    int d = a[i].first;
    char v = a[i].second;
    if (ans[d]!='-' && ans[d]!=v) {
      cout << -1 << "\n";
      return 0;
    }
    if (d==0 && v=='0') {
      if (N!=1) {
        cout << -1 << "\n";
        return 0;
      }
    }
    ans[d] = v;
  }
  rep(i, N) {
    if (ans[i]=='-') {
      ans[i]=i==0&&N>1?'1':'0';
    }
  }

  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 256
/***
  knapsack with high capacity
*/
#include <bits/stdc++.h>
using namespace std;
#define maxN 100
#define maxV 1000
#define INF 1e17
#define ll long long 
#define endl "\n"

ll dp[maxN*maxV+5];

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

    int i,j,n,ans=0;
    for(i=1; i<=maxN*maxV; i++) dp[i] = INF;
    ll cap,sum=0,v,w;
    cin>>n>>cap;
    for(i=0; i<n; i++)
    {
        cin>>w>>v;
        sum+=v;
        for(j=sum; j>=v; j--)
        {
            dp[j] = min(dp[j], w+dp[j-v]);
            if(dp[j]<=cap) ans=max(ans, j);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<queue>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  while(1){
    string s;
    int m,a,i;
    cin >> s;
    if(s=="-"){
      return 0;
    }
    scanf("%d\n",&m);
    for(i=0;i<m;i++){
      scanf("%d\n",&a);
      string t=s.substr(0,a);
      s.erase(0,a);
      s+=t;
    }
    cout << s << endl;
  }
  return 0;
}


Measured memory_bytes: 3200
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int DP[410][410] = {};

int main(){
	
	int N;
	cin >> N;
	
	long long int a[410] = {};
	for(int i = 1; i <= N; i++){
		cin >> a[i];
	}
	
	for(int i = 0; i < 410; i++){
		for(int j = 0; j < 410; j++){
			DP[i][j] = INF;
		}
		DP[i][i] = 0;
	}
	
	for(int i = 1; i <= N; i++){
		a[i] += a[i - 1];
	}
	
	for(int i = 1; i < N; i++){
		for(int j = 0; j + i < N; j++){
			for(int k = 0; j + k + 1 <= j + i; k++){
				DP[j][j + i] = min(DP[j][j + i], DP[j][j + k] + DP[j + k + 1][j + i] + a[j + i + 1] - a[j]);
			}
		}
	}
	
	cout << DP[0][N - 1] << endl;
	
	return 0;
}


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

using namespace std;

int main(){
    int n, t;
    cin >> n >> t;
    vector<int> A(n), B(n);
    vector<array<int, 2>> C(n);
    int ma = 0;
    int maxi = 0;
    int t_maxi = 0;
    for (int i = 0; i < n; i++){
        cin >> A[i] >> B[i];
        C[i][0] = A[i];
        C[i][1] = B[i];
        if (B[i] > ma or (B[i] == ma and A[i] > A[maxi])){
            ma = B[i];
            maxi = i;
        }
        if (A[i] > A[t_maxi])
            t_maxi = i;
    }

    if (accumulate(A.begin(), A.end(), 0) - A[t_maxi] < t){
        cout << accumulate(B.begin(), B.end(), 0) << endl;
        return 0;    
    }

    sort(C.begin(), C.end(), [](auto l, auto r){return l[0] < r[0] or (l[0] == r[0] and l[1] > r[1]);});

    vector<vector<int>> DP(n + 1, vector<int>(t));

    for (int i = 0; i < n; i++){
        for (int j = 0; j < t; j++){
            DP[i + 1][j] = max(DP[i + 1][j], DP[i][j]);
            if (j + C[i][0] < t)
                DP[i + 1][j + C[i][0]] = max(DP[i + 1][j + C[i][0]], DP[i][j] + C[i][1]);
        }
    }

    int ans = 0;

    for (int i = 0; i < n; i++){
        for (int j = 0; j < t; j++)
            ans = max(ans, DP[i][j] + C[i][1]);
    }

    cout << ans << endl; 


}

Measured memory_bytes: 35584
#include <iostream>
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll c , d;

ll Get(ll x){
    return (x - (x/c + x/d - x/((c * d)/__gcd(c , d))));
}

int main()
{
    ll a,b;  cin >> a >> b >> c >> d;
    cout << Get(b) - Get(a - 1);
    return 0;
}


Measured memory_bytes: 256