akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;

    int ans = 0;
    if(a >= 13)
        ans = b;
    else if(a >= 6)
        ans = b / 2;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    
    vector<int> h(n);
    for(int i = 0; i < n; i++)
    {
        cin >> h[i];
    }

    vector<int> dp(n);
    dp[n-2] = abs(h[n-2]-h[n-1]);
    
    for(int i = n-3; i >= 0; i--)
    {
        dp[i] = min(dp[i+1]+abs(h[i]-h[i+1]),dp[i+2]+abs(h[i]-h[i+2]));
    }
    
    cout << dp[0] << '\n';
    
    return 0;
}


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

long tmp(long a) {
	++a;
	if (a % 4 == 0) return 0;
	if ((a + 1) % 4 == 0) return a;
	if ((a + 2) % 4 == 0) return 1;
	return a - 1;
}

int main() {
	long A, B;
	cin >> A >> B;
	cout << (tmp(A - 1) ^ tmp(B));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <fstream>
#include <cstdio>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(n);
// string p=s.substr(0,len);
// string q=s.insert(0,str);
// sort(arr, arr+n, greater<int>());
// cout<<fixed<<setprecision(9)<<pi<<endl
// const  double pi = acos(-1.0);
// sort(v.rbegin(),v.rend());
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll,ll >
#define mlli map<ll,ll>::iterator
#define size size()
#define endl "\n"
#define ll long long int
#define ld long double
void fast(){ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);}


int main(void)
{
	fast();

	/*
	string s;
	cin>>s;
	int maxi = 0;
	int curr = 0;

	for(int i=0;i<s.size;i++)
	{
		if(s[i]=='R' && curr==0)
		{
			curr=1;
			maxi = max(curr,maxi);
		}
		else if(curr!=0)
		{
			if(s[i]=='R')
			{
				curr++;
				maxi=max(curr,maxi);
			}
			else
			{
				curr=0;
			}
		}
	}	
	cout<<maxi<<endl;
	*/

	string s;
	cin>>s;
	int ans=0;
	int curr=0;

	// Simple code.

	for(int i=0;i<s.size;i++)
	{
		if(s[i]=='R')
		{
			curr++;
			ans=max(curr,ans);
		}
		else
		{
			curr=0;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <algorithm>
#include <bitset>
#include <queue>

using namespace std;
typedef pair<int,int> pii;

struct edge{
  int to;
  int cost;
  int rev;
  bitset<100> flags;
  edge(int t,int c,int r){
    to=t,cost=c,rev=r;
  }
  edge(){}
};

int dijkstra(int s,int t,int N,const vector<vector<edge> > &graph,vector<int> &clusters){
  const int INF=1<<29;
  //int target_cluster=clusters[t];
  priority_queue<pii,vector<pii>,greater<pii> > pq;
  pq.push(pii(0,s));
  vector<int> d(N,INF);
  while(pq.size()){
    pii p=pq.top();pq.pop();
    int ccost=p.first;
    int cnode=p.second;
    if(d[cnode]<ccost)continue;
    for(int i=0;i<(int)graph[cnode].size();i++){
      edge e=graph[cnode][i];
      //if(!e.flags[target_cluster])continue;
      const int ncost=e.cost+ccost;
      const int to=e.to;
      if(d[to]>ncost){
        d[to]=ncost;
        pq.push(pii(ncost,to));
      }
    }
  }
  return d[t];
}

int main(){

  int N,M;
  while(cin>>N>>M&&(N|M)){
    vector<vector<edge> > graph[2];
    for(int i=0;i<2;i++)
      for(int j=0;j<M;j++)
        graph[i].push_back(vector<edge>());
    for(int i=0;i<N;i++){
      int a,b,c,d;
      cin>>a>>b>>c>>d;
      a--;b--;
      //cout<<a<<" "<<b<<endl;
      graph[0][a].push_back(edge(b,c,graph[0][b].size()));
      graph[0][b].push_back(edge(a,c,graph[0][a].size()-1));
      graph[1][a].push_back(edge(b,d,graph[1][b].size()));
      graph[1][b].push_back(edge(a,d,graph[1][a].size()-1));
    }
    vector<int> clusters(N,0);
    int K;
    cin>>K;
    for(int q=0;q<K;q++){
      int p,q,r;
      cin>>p>>q>>r;
      p--;q--;
      if(r==0){
        cout<<dijkstra(p,q,M,graph[0],clusters)<<endl;
      }
      else{
        cout<<dijkstra(p,q,M,graph[1],clusters)<<endl;
      }
    }
  }
  
  return 0;
}

Measured memory_bytes: 1664
import java.util.GregorianCalendar;
import java.util.Scanner;
public class Main
{
	public static void main(String arg[])
	{
		Scanner in = new Scanner(System.in);

		while(in.hasNext())
		{
			//			解1
			//			int m=in.nextInt();
			//			int d=in.nextInt();
			//			GregorianCalendar g= new GregorianCalendar(2004, m-1, d);
			//			if((m|d)==0)
			//				return;
			//			String w[] ={"","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
			//			System.out.println(w[g.get(GregorianCalendar.DAY_OF_WEEK)]);

			//解2
			int m=in.nextInt();
			int d=in.nextInt();
			if((m|d)==0)
				return;
			int  da[] = {31,29,31,30,31,30,31,31,30,31,30,31};
			String we[]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
			int day =2+d;
			for(int i=0; i<m-1; i++)
				day+=da[i];
			System.out.println(we[day%7]);
		}
	}
}

Measured memory_bytes: 12000
import sys
sys.setrecursionlimit(10**6)

import math

a2e = [int(input()) for _ in range(5)]

def get_ceiled_num(num):
    ret = math.ceil(num/10)*10
    return ret

#diff_a2e = [i-get_ceiled_num(i) for i in a2e]
#
#idxs = [i[0] for i in sorted(enumerate(diff_a2e), key=lambda x:-x[1])]
#
#ans = 0
#
#for idx in idxs[:-1]:
#    ans += get_ceiled_num(a2e[idx])
#
#ans += a2e[idxs[-1]]
#    
#print(ans)

ceiled_a2e = [get_ceiled_num(i) for i in a2e]

tot = sum(ceiled_a2e)

ans = tot

for i,j in zip(a2e, ceiled_a2e):
    tmp = tot-(j-i)
    ans = min(ans, tmp)
    
print(ans)

Measured memory_bytes: 9200
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
typedef long long ll;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
mint exp(int a,int n)
{
  mint t=a;
  mint ans;
  ans=(n%2==0)? 1:t;
  n>>=1;
  while(n>0)
  {
    t=t*t;
    if(n%2==1)ans=(ans.x==1)?t:ans*t;
    n>>=1;
  }
  return ans;
}
int main()
{
  int n,a,b;
  cin>>n>>a>>b;
  
  mint ans=exp(2,n)-1;
  //cout<<ans.x<<endl;
  mint A;
  mint B;
  mint d=1;
  mint fa=1;
  mint fb=1;
  for(int i=0;i<max(a,b);i++)
  {
    if(i<a)fa*=(i+1);
    if(i<b)fb*=(i+1);
    
    d*=(n-i);
    //cout<<d.x<<endl;
    if(i==a-1)A=d;
    if(i==b-1)B=d;
  }
  //cout<<A.x<<" "<<B.x<<endl;
  A*=exp(fa.x,mod-2);
  B*=exp(fb.x,mod-2);
  ans-=(A+B);
  
  cout<<ans.x<<endl;
    
  return 0;
}

Measured memory_bytes: 3644
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
#define inf 100000000/*10^8*/



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

#define MAX_N 200005//調節！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
int par[MAX_N],dep[MAX_N];//depはrankのこと
//n要素で初期化//忘れないように！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
void init(int n){
    for(int i=0;i<=n-1;i++){//頂点番号は0~n-1
        par[i]=i;
        dep[i]=0;
    }
}
//木の根を求める
int find(int x){
    return par[x]==x?x:par[x]=find(par[x]);
}
//xとyの属する集合を併合
void unite(int x,int y){
    x=find(x);
    y=find(y);
    if(x==y)return;
    if(dep[x]<dep[y]){
        par[x]=y;
    }else{
        par[y]=x;
        if(dep[x]==dep[y])dep[x]++;
    }
}
//xとyが同じ集合に属するか否か
bool same(int x,int y){
    return find(x)==find(y);
}

//////////////////////////////////////
int parb[MAX_N],depb[MAX_N];//depはrankのこと
//n要素で初期化//忘れないように！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
void initb(int n){
    for(int i=0;i<=n-1;i++){//頂点番号は0~n-1
        parb[i]=i;
        depb[i]=0;
    }
}
//木の根を求める
int findb(int x){
    return parb[x]==x?x:parb[x]=findb(parb[x]);
}
//xとyの属する集合を併合
void uniteb(int x,int y){
    x=findb(x);
    y=findb(y);
    if(x==y)return;
    if(depb[x]<depb[y]){
        parb[x]=y;
    }else{
        parb[y]=x;
        if(depb[x]==depb[y])depb[x]++;
    }
}
//xとyが同じ集合に属するか否か
bool sameb(int x,int y){
    return findb(x)==findb(y);
}

bool asc(const i_i a,const i_i b){
    return a.second<b.second;
}

int main(){
    int n,k,l;cin>>n>>k>>l;
    init(n);initb(n);
    for(int i=1;i<=k;i++){
        int p,q;cin>>p>>q;p--;q--;
        unite(p,q);
    }
    for(int i=1;i<=l;i++){
        int p,q;cin>>p>>q;p--;q--;
        uniteb(p,q);
    }
    int ans[n];memset(ans,0,sizeof(ans));
  
   
    vector<i_i> vv;
    for(int i=0;i<=n-1;i++){
        vv.push_back(make_pair(i, findb(i)));
    }
    sort(vv.begin(),vv.end(),asc);
    
    int pos=0;
    while(pos<=n-1){
        vector<int> v;
        v.push_back(vv[pos].first);
        while(pos+1<=n-1&&vv[pos].second==vv[pos+1].second){
            v.push_back(vv[pos+1].first);
            pos++;
        }
        
        vector<i_i> q;
        for(auto x:v){
            q.push_back(make_pair(x,find(x)));
        }
        sort(q.begin(),q.end(),asc);
        for(int i=0;i<q.size();i++){
            int count=1;int s=i;
            while(i+1<q.size()&&q[i].second==q[i+1].second){
                i++;
                count++;
            }
            for(int j=s;j<=i;j++){
                ans[q[j].first]=count;
            }
        }
        pos++;
    }
    for(int i=0;i<=n-1;i++)cout<<ans[i]<<" ";
    return 0;
}


Measured memory_bytes: 7536
r, c = input().split()
r = int(r) # 行数
c = int(c) # 列数
list = [[0] * (c + 1) for i in range(r + 1)]
for i in range(r):
    l = input().split()
    for j in range(c):
        list[i][j] = int(l[j])
        list[i][c] += list[i][j]
        list[r][j] += list[i][j]
    list[r][c] += list[i][c]

# 結果出力
for i in range(r + 1):
    for j in range(c + 1):
        if j != c:
            print("%d " %list[i][j], end="")
        else:
            print(list[i][j])


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

struct Node {
  Node *l, *r;
};

void test() {
  for (int i = 0; i < 2000000; ++i) new Node();
}

int main() {
  test();
  int a, b, c;
  cin >> a >> b >> c;
  cout << ((a+b+c) == max({a,b,c})*2 ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 62720
#include<bits/stdc++.h>
using namespace std;
int a[2000]={0};
int main(){
	int n,x,y;
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			if(i<=x&&j>=y){
				//cout<<i<<' '<<j<<' '<<min(j-i,x-i+j-y+1)<<'\n';
				a[min(j-i,x-i+j-y+1)]++;
			}
			else if(y<=j&&i>=x){
				//cout<<i<<' '<<j<<' '<<min(j-i,j-y+1+i-x)<<'\n';
				a[min(j-i,j-y+1+i-x)]++;
			}
			else if(x>=i&&j<=y){
				//cout<<i<<' '<<j<<' '<<min(j-i,x-i+1+y-j)<<'\n';
				a[min(j-i,x-i+1+y-j)]++;
			}
			else{
				//cout<<i<<' '<<j<<' '<<min(j-i,i-x+y-j+1)<<'\n';
				a[min(j-i,i-x+y-j+1)]++;
			}
		}
	}
	for(int i=1;i<n;i++)cout<<a[i]<<'\n';
} 

Measured memory_bytes: 256
import itertools

N = 5
ARR = [4, 4, 9, 7, 5]


N = 10
ARR = [9, 4, 6, 1, 9, 6, 10, 6, 6, 8]

N = int(input())
ARR = list(map(int,input().split()))

result = 0
for item in itertools.combinations(ARR, 3):
    x, y, z = item

    if x == y:
        continue
    if x == z:
        continue
    if y == z:
        continue

    if x + y > z:
        if abs(x - y) < z:
            result += 1

print(result)


Measured memory_bytes: 9196
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int dp[105][26];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    int n;
    cin>>n;
    string a, b, c;
    cin>>a>>b>>c;
    int mn = 0;
    f(i, n){
        int nxt = 500000;
        f(j, 26){
           int to = 0;
           if(a[i] != (char)(j + 'a')) to++;
           if(b[i] != (char)(j + 'a')) to++;
           if(c[i] != (char)(j + 'a')) to++;
           dp[i][j] = mn + to;
           nxt = min(nxt, dp[i][j]);
        }
        mn = nxt;
    }
    cout<<mn;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

int main(){
   int n;
   string s;
   int k;
   cin >> n >> s >> k;
   k = k - 1;
   char key = s[k];
   for(int i = 0; i < n; i++){
      if(s[i] != key){
         s[i] = '*';
      }
   }
   cout << s << endl;

   return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int S;
	int h=0,m=0,s=0;
	
	scanf("%d",&S);
	
	h=S/3600;
	m=(S-h*3600)/60;
	s=S-(h*3600+m*60);
	
	printf("%d:%d:%d\n",h,m,s);
	
	return 0;
}


Measured memory_bytes: 2128
#include<cstdlib>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cstring>
#include<cmath>
using namespace std;
const int MAXN = (int) 5e5 + 10;
const int INF = (int) 0x3f3f3f3f;
typedef long long LL;

int E;

void work(){
    while(~scanf("%d",&E)&&E){
        int m=INF;
        for(int z=0;z*z*z<=E;z++){
            for(int y=0;y*y<=E-z*z*z;y++){
                int x=E-y*y-z*z*z;
                m=min(m,x+y+z);
            }
        }
        printf("%d\n",m);
    }
}

int main(){
#ifdef NNever
//    freopen("data.in","r",stdin);
//    freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}



Measured memory_bytes: 3144
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main(){
    int num[3][3];
    bool check[3][3];
    rep(i,3)rep(j,3)check[i][j]=0;
    rep(i,3)rep(j,3)cin>>num[i][j];
    int N;cin>>N;
    bool bingo=0;
    rep(t,N){
        int p;cin>>p;
        rep(i,3)rep(j,3)if(num[i][j]==p)check[i][j]=1;
        rep(i,3){
            int count1=0;
            rep(j,3){
                if(check[i][j]==1)count1++;
            }
            if(count1==3)bingo=1;
        }
        int count2=0;
        rep(i,3)if(check[i][i]==1)count2++;
        if(count2==3)bingo=1;
        int count3=0;
        rep(i,3)if(check[i][2-i]==1)count3++;
        if(count3==3)bingo=1;
        rep(i,3){
            int count4=0;
            rep(j,3){
                if(check[j][i]==1)count4++;
            }
            if(count4==3)bingo=1;
        }
    }
    if(bingo)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

x, y, z, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
a.sort()
b.sort()
c.sort()

x_y_list = []

for i in a:
    for j in b:
        x_y_list.append(i + j)

x_y_list.sort()

import bisect
left = 0
right = 10 ** 18

import numpy as np

x_y_list_np = np.array(x_y_list, np.int64)
c_np = np.array(c, np.int64)

while right - left > 1:
    mid = (left + right) // 2
    cnt = np.searchsorted(x_y_list_np, mid - c_np, side="right").sum()
    if cnt >= x*y*z - k + 1:
        right = mid
    else:
        left = mid

up_k = right # 上からk番目

ans = []
for i in c:
    idx = bisect.bisect_right(x_y_list, up_k - i)
    for j in range(idx, len(x_y_list)):
        ans.append(i + x_y_list[j])

for i in range(k - len(ans)):
    ans.append(up_k)

ans.sort()

for i in ans[::-1]:
    print(i)

Measured memory_bytes: 74880
#include<stdio.h>
#include<string.h>
 
int main(){
    char w[101];
    scanf("%s",w);
    int len=strlen(w);
  
    int alpha[26]={0};
    for(int k=0;k<len;k++){
        alpha[w[k]-'a']++;
    }
    int t=0;
    for(int k=0;k<26;k++){
        if(alpha[k]%2!=0){
            t++;
        }
    }
  
    if(t>0){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
    return 0;
}

Measured memory_bytes: 1608
#include <iostream>
using namespace std;int k,n,s,j,a,m=998244353,d[3001];int main(){cin>>n>>s;while(n--){cin>>a;for(j=s+1;j-->a;)d[j]=(d[j]+d[j-a])%m;d[a]++;d[0]++;k=(k+d[s])%m;}cout<<k;}

Measured memory_bytes: 3624
/*
2
3 1 2
6 1 1
*/
fn main() {
    // let n = 2;
    // let vt = vec![0, 3, 6];
    // let vx = vec![0, 1, 1];
    // let vy = vec![0, 2, 1];
    let n = read();
    let vec = read_lines(n);
    let mut vt = vec![0];
    let mut vx = vec![0];
    let mut vy = vec![0];
    for v in vec {
        vt.push(v[0]);
        vx.push(v[1]);
        vy.push(v[2]);
    }

    let mut can_reach = true;

    for i in 1..(n + 1) as usize {
        let dt : i32 = vt[i] - vt[i - 1];
        let dx = ((vx[i] - vx[i - 1]) as i32).abs();
        let dy = ((vy[i] - vy[i - 1]) as i32).abs();
        let length = dx + dy;
        let div = (length - dt).abs();

        // debug
        // println!("{} {} {} {}", dt, dx, dy, div);

        if length > dt {
            can_reach = false;
        }

        if div % 2 == 1 {
            can_reach = false;
        }

        if !can_reach {
            println!("No");
            return;
        }
    }

    println!("Yes");
}

fn read() -> i32 {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_lines(n: i32) -> Vec<Vec<i32>> {
    let mut v2 = Vec::new();
    for _ in 0..n {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).ok();
        let v = s.trim()
            .split_whitespace()
            .map(|e| e.parse().ok().unwrap())
            .collect();
        v2.push(v);
    }
    v2
}


Measured memory_bytes: 11416
n = gets.chomp.to_i
as = gets.chomp.split(' ').map(&:to_i)
r = as.last

j = -1
0.upto(n - 1) do |i|
  if as[i] <= r
    j += 1
    as[j], as[i] = as[i], as[j]
  end
end
as[j] = "[#{as[j]}]"
puts as.join(' ')


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

# Mの約数を列挙
sup = int(M**0.5) + 1
divs_left = []
divs_right = []
for i in range(1, sup+1):
  if M%i == 0:
    divs_left.append(i)
    divs_right.append(M//i)

divs = divs_right + divs_left[::-1]
for d in divs:
  if M//d >= N:
    print(d)
    quit()

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

long long int N, L, T,p;
long long int X[100010];
long long int W[100010], Y[100010], Z[100010],S[100010], U[100010];
long long int A[100010], B[100010];
long long int a=0, b=0;
long long int pmod(long long int x, long long int a){
	if (x%a<0) return x%a+a;
  	else return x%a;
}
long long int modL(long long int x){
	if(x%L==0) return L;
  	else return pmod(x,L);
}
long long int locate_0(long long int t){
	if (W[0]==1){
		long long int i=0, d=0;
      	while(d<=2*t){
        	if (i%2==0){
            	if (i==0) {
                  d+=modL(B[0]-A[0]);
                }
              	else {
                	d+=modL(B[pmod(i/2,b)]-B[pmod(i/2-1,b)]);
                }
            }
          	else{
            	d+=modL(A[pmod((i-1)/2,a)]-A[pmod((i+1)/2,a)]);
            }
          i++;
          p=i;
        }
      	if (i%2==0) return pmod(B[pmod((i-2)/2,b)]-t,L);
      	else return pmod(A[pmod((i-1)/2,a)]+t,L);
    }
  if (W[0]==2){
		long long int i=0, d=0;
      	while(d<=2*t){
        	if (i%2==0){
            	if (i==0) {
                  d+=modL(B[0]-A[0]);
                }
              	else {
                	d+=modL(A[pmod((i-2)/2,a)]-A[pmod(i/2,a)]);
                }
            }
          	else{
            	d+=modL(B[pmod((i+1)/2,b)]-B[pmod((i-1)/2,b)]);
            	}	
          i++;
          p=i;
        }
      	if (i%2==0) return pmod(A[pmod((i-2)/2,a)]+t,L);
      	else return pmod(B[pmod((i-1)/2,b)]-t,L);
    }
}
long long int f(long long int x){
	for (long long int i=0; i<N; i++){
    	if (x==X[i]) return Y[i];
    }
}
int main() {
  cin >> N >> L >>T;
  for (long long int i=0; i<N; i++){
  	cin >>X[i] >> W[i];
  }
  for (long long int i=0; i<N; i++){
    if(W[i]==2){
      	B[b]=X[i];
        b++;
    }
  }
  for (long long int i=N; i>=1; i--){
    	if (W[i%N]==1){
      	A[a]=X[i%N];
        a++;
        }
    }
    

  int e=0;
  for (int i=0;i<N; i++){
  	if (W[0]!=W[i]) e=1;
  }
  if (e){
  long long int s=0;
  long long int n=locate_0(L);
  	for(int i=0;i<N;i++){
  		if (X[i]==n){
        	s=i;
          break;
        }
    }

  for (long long int i=0; i<N;i++){
  	Y[i]=X[(i+s)%N];
  }
  
  long long int c=1, d=f(X[0]);
  Z[0]=X[0];
  while(d!=X[0]){
    Z[c]=d;
    d=f(d);
    c++;
  }
    
   
  long long int f=(T/L);
  long long int g=c-f%c;
  long long int h=g%c;
  long long int k=s*h;
  long long int u=k%N;

  
  for (long long int i=0; i<N; i++){
  	if (W[i]==1) S[i]=(X[i]+T)%L;
    else S[i]=pmod((X[i]-T),L);
  }
  sort(S, S+N);
  
  long long int v=0;
  long long int m=locate_0(T%L);
  while(S[v]!=m) v++;
  if (S[(v+1)%N]==S[v]&&((W[0]==1&&p%2==1)||(W[0]==2&&p%2==0))) v++;
  for (long long int i=0; i<N; i++){
  	U[i]=S[pmod(v-u+i,N)];
    cout << U[i] <<endl;
  }
  }
  else {
  	if (W[0]==1){
    	for (int i=0;i<N;i++){
          U[i]=(X[i]+T)%L;
              cout << U[i] <<endl;
        }
    }
    else {
    	for (int i=0;i<N;i++){
          U[i]=pmod((X[i]-T),L);
              cout << U[i] <<endl;
        }
    }
  }
}


Measured memory_bytes: 6656
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws IOException{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	String buf;
    	int num;
    	int [] maxNum = new int[100];
    	try{
    		while((buf = br.readLine())!=null)
    		{
    			if(buf.isEmpty()||buf==null)
    				break;
    			num = Integer.parseInt(buf);
    			maxNum[--num]++;
    		}
    	int maxValue =0;
    	for(int i=1;i<=100;i++){
    		if(maxNum[i-1]>maxValue){
    			maxValue=maxNum[i-1];
    		}
    	}
    	for(int i=1;i<=100;i++){
    		if(maxNum[i-1]==maxValue)
    			System.out.println(i);
    	}
    			
    	}catch (Exception e){
    		e.printStackTrace();
    	}
	}
}

Measured memory_bytes: 24096
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

//long long int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

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

	cin >> N >> M;
	if (N >= M) {
		cout << 0 << endl;
		return 0;
	}
	vector<int>v(M);
	for (auto &i : v)cin >> i;
	sort(v.begin(), v.end());
	vector<int>w;
	for (int i = 1; i < M; i++)w.push_back(v[i] - v[i - 1]);
//	for (auto i : w)cout << i << endl;
	long long int ans = 0;
	sort(w.begin(), w.end());
	for (int i = 0; i < M - N; i++) {
		ans += w[i];	
	}
	cout << ans << endl;
}

Measured memory_bytes: 1276
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int h, n;
    cin >> h >> n;
    vector<ll> a(n), b(n);
    rep(i, n) cin >> a[i] >> b[i];
    vector<ll> dp(114514,LINF);
    dp[0] = 0;
    rep(i,114514) {
        rep(j,n) {
            if (i+a[j]<114514) {
                chmin(dp[i+a[j]], dp[i]+b[j]);
            }
        }
    }
    ll ans = dp[h];
    for (int i = h; i < 114514; ++i) if (dp[i]!=LINF) {
        chmin(ans,dp[i]);
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

template<typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T> >;

static const int INTINF = (2147483647 >> 1); // 10^9 + 5000
static const ll LLINF = (9223372036854775807 >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;

namespace Kunitaka{
    template<
        typename TYPE,
        std::size_t SIZE
    >
    std::size_t array_length(const TYPE (&array)[SIZE])
    {
        return SIZE;
    }

    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
}
using namespace Kunitaka;
namespace Printer{
    void br(){
        cout << endl;
    }

    void loop_cnt(int i){
        cout << "i = " << i << endl;
    }

    void loop_cnt(int i, int j){
        cout << "i = " << i << ", " << "j = " << j << endl;
    }

    template<class T>
    void print(T x){
        cout << x << endl;
    }

    template<class T, class S>
    void print(T x, S y){
        cout << x << "," << y << endl;
    }

    template<class T, class S, class U>
    void print(T x, S y, U z){
        cout << x << "," << y << "," << z << endl;
    }

    template<class T, class S>
    void print(pair<T, S> p){
        cout << p.first << ", " << p.second << endl;
    }

    template<
        typename TYPE,
        std::size_t SIZE
    >
    void print(const TYPE (&array)[SIZE]){
        int lim = array_length(array);
        for(int i=0; i<lim; i++){
            if(i) cout << " ";
            cout << array[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<S> v){
        for(int i=0; i<v.size(); i++){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<vector<S> > vv){
        for(int i=0; i<vv.size(); i++){
            for(int j=0; j<vv[i].size(); j++){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }

    void yesno(bool x){
        if(x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
};
using namespace Printer;

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//


    // input
    cout << fixed << setprecision(10);
    ll N, K; cin >> N >> K;

    ll ans = 0;

    rep2(i, 1, N+1){
        int num = i - K;
        if(num <= 0) continue;
        int tmp = (N + 1) / i;
        ans += tmp * num;
        // cout << ans << endl;
        if((N + 1) % i != 0){
            int tmp2 = (N + 1) % i;
            if(tmp2 - K > 0){
                ans += tmp2 - K;
            }
        }
        // cout << ans << endl;
        if(K == 0) --ans;
    }

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


Measured memory_bytes: 256
def main():
    is_big = 0

    n = int(input())
    set_a = [int(a) for a in input().split(" ")]

    n = int(input())
    set_b = [int(a) for a in input().split(" ")]

    for i in range(len(set_b)):
        if i > len(set_a) - 1 or i > len(set_b) - 1:
            if len(set_a) >= len(set_b):
                is_big = 0
                break
            else:
                is_big = 1
                break
        else:
            if set_b[i] > set_a[i]:
                is_big = 1
                break
            elif set_b[i] < set_a[i]:
                is_big = 0
                break

    print(is_big)
main()



Measured memory_bytes: 5716
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>

using namespace std;

int main(){
    long long number;
    string ans = "";
    cin >> number;

    while(number>0){
        number = number - 1;
        ans += (char)('a' + (number % 26));
        number /= 26;
    }
    reverse(ans.begin(), ans.end());
    cout << ans;
}

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

using namespace std;

int main() {
  string t;
  cin >> t;
  rep(i, t.size()){
    if(t[i] == '?'){
      t[i] = 'D';
    }
  }
  cout << t << endl;
      
}
    

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

int main()
{
	int N = 0;
	int L = 0;
	int R = 0;
	int sum = 0;
        cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> L >> R;
		sum += R - L + 1;
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main{
    void run(){
	Scanner sc=new Scanner(System.in);
	int M=sc.nextInt();
	sc.nextLine();
	for(int attend=0;attend<M;attend++){
	    StringBuffer text=new StringBuffer(sc.nextLine());
	    int cur=0;
	    int n=sc.nextInt();
	    String command1;
	    String command2;
	    sc.nextLine();
	    for(int i=0;i<n;i++){
		String command=sc.nextLine();
		//System.out.println(command);
		for(int j=0;;j++){
		    if(command.charAt(j)==' '){
			command1=command.substring(0,j);
			command2=command.substring(j+1);
			break;
		    }
		}
		if("forward".equals(command1)){
		    if("char".equals(command2)){
			cur=cur<text.length()? cur+1:cur;    
		    }
		    else{
			for(;cur<text.length()&&text.charAt(cur)==' ';cur++);
			for(;cur<text.length()&&text.charAt(cur)!=' ';cur++);
		    }
		}
		if("backward".equals(command1)){
		    if("char".equals(command2)){
			cur=cur>0? cur-1:cur;    
		    }
		    else{
			for(;cur>0&&text.charAt(cur-1)==' ';cur--);
			for(;cur>0&&text.charAt(cur-1)!=' ';cur--);
		    }  
		}
		if("insert".equals(command1)){
		    text.insert(cur,command2.substring(1,command2.length()-1));
		    cur+=command2.length()-2;
		}		       
		if("delete".equals(command1)){
		    if("char".equals(command2)){
			if(cur!=text.length()){
			    text.deleteCharAt(cur);
			}
		    }
		    else{
			int temp=cur;
			for(;cur<text.length()&&text.charAt(cur)==' ';cur++);
			if(cur!=text.length()){
			    for(;cur<text.length()&&text.charAt(cur)!=' ';cur++);
			    text.delete(temp,cur);
			}
			cur=temp;
		    }
		}
		//print(text,cur);
	    }
	    print(text,cur);
	}
	
    }
    void print(StringBuffer text,int cur){
	    text.insert(cur,"^");
	    System.out.println(text);
	    text.deleteCharAt(cur);
    }
    public static void main(String[] args){
	new Main().run();
    }
}

Measured memory_bytes: 12000
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
const ll maxn=1e6+10;
const ll inf=0x3f3f3f3f3f3f3f3f;
int N,M;
vector<pii> ve[maxn];
ll dis[maxn];
priority_queue<pii,vector<pii>,greater<pii>> heap;

void init(){
	for(int i=1;i<=N;i++) dis[i]=inf;
	for(int i=1;i<=N;i++) ve[i].push_back({0,i-1});
}
ll Djistra(){
	heap.push({0,1});
	dis[1]=0;

	while(heap.size()){
//		cout<<"%%%"<<endl;
		auto ans=heap.top();
		heap.pop();
		ll d=ans.first,id=ans.second;
		for(auto v:ve[id]){
			ll w=v.first,id2=v.second;
			if(d+w<dis[id2]){
				dis[id2]=d+w;
			heap.push({dis[id2],id2});
			}
			
		}
	}
	if(dis[N]==inf) return -1;
	return dis[N];
}

int main(){
	cin>>N>>M;
	init();
	int a,b,c;
	for(int i=0;i<M;i++){
		cin>>a>>b>>c;
		ve[a].push_back({c,b});
	}
	cout<<Djistra()<<endl;
	return 0;
}

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


vector<ll> fac(300001);
vector<ll> ifac(300001);

ll mod_pow(ll x, ll n,ll mod){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % mod;
        x = x*x % mod;
        n = n >> 1;
    }
    return ans;
}

ll mod_c(ll a, ll b,ll mod){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % mod;
    return tmp * fac[a] % mod;
}


int main(){
    const ll mod=998244353;
    ll n,m,k;
    ll ans=0;
    ll col=m;
    cin>>n>>m>>k;

    fac[0]=1;
    ifac[0]=1;

    for (ll i=0;i<300000;i++){
        fac[i+1]=fac[i]*(i+1)%mod;
        ifac[i+1]=ifac[i]*mod_pow(i+1,mod-2,mod)%mod;//(i+1)!^-1 =(i+1)!^(M-2)=(i+1)^(M-2) * (i!)^(M-2) #(mod M)
    }

    for(ll x=0;x<=k;x++){
        ans+=mod_c(n-1,x,mod)*m%mod*mod_pow(m-1,n-x-1,mod)%mod;
    }
    cout<<ans%mod<<endl;
    return 0;
}




Measured memory_bytes: 7872
n,d=map(int,input().split())
X=[list(map(int,input().split())) for _ in range(n)]
c=0
for i in range(n-1):
    for j in range(i+1,n):
        for k in range(d):
            diff = sum([(s-t)**2 for s,t in zip(X[i],X[j])])
        if (diff**.5).is_integer():c += 1
print(c)


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

#define rep(i,n) for(int i=0;i<(n);i++)
#define dbg(S) { int f=1; for(auto x:S) cerr<<(f?"[":", ")<<x, f=0; cerr<<"]\n"; }

using namespace std;
using lint=long long;

void bfs(const vector<vector<pair<int,lint>>>& G,int s,vector<bool>& vis){
	int n=G.size();
	vis[s]=true;
	queue<int> Q; Q.push(s);
	while(!Q.empty()){
		int u=Q.front(); Q.pop();
		for(auto e:G[u]){
			int v=e.first;
			if(!vis[v]) vis[v]=true, Q.push(v);
		}
	}
}

pair<vector<lint>,bool> Bellman_Ford(const vector<vector<pair<int,lint>>>& G,int s){
	int n=G.size();
	vector<lint> d(n,1LL<<61);
	d[s]=0;
	rep(t,n){
		bool updated=false;
		rep(u,n) for(const auto& e:G[u]) {
			int v=e.first;
			lint cost=e.second;
			if(d[v]>d[u]+cost){
				d[v]=d[u]+cost;
				updated=true;
			}
		}
		if(t==n-1 && updated) return {d,false};
	}
	return {d,true};
}

int main(){
	int n,m; scanf("%d%d",&n,&m);
	vector<vector<pair<int,lint>>> G(n),G_rev(n);
	rep(i,m){
		int u,v;
		lint c; scanf("%d%d%lld",&u,&v,&c); u--; v--;
		G[u].emplace_back(v,-c);
		G_rev[v].emplace_back(u,-c);
	}

	vector<bool> vis(n),vis_rev(n);
	bfs(G,0,vis);
	bfs(G_rev,n-1,vis_rev);

	vector<int> p,f(n,-1);
	rep(u,n) if(vis[u] && vis_rev[u]) p.emplace_back(u);
	rep(i,p.size()) f[p[i]]=i;

	vector<vector<pair<int,lint>>> H(p.size());
	rep(u,n) if(f[u]!=-1) {
		for(auto e:G[u]){
			int v=e.first;
			if(f[v]!=-1) H[f[u]].emplace_back(f[v],e.second);
		}
	}

	vector<lint> dist;
	bool ok;
	tie(dist,ok)=Bellman_Ford(H,0);

	if(ok) cout<<-dist[f[n-1]]<<endl;
	else   cout<<"inf"<<endl;

	return 0;
}


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

struct P
{
    int x,y;

    bool operator<(const P &a)const{

        if(y!=a.y) return y>a.y;
        return x>a.x;
    }

};

vector<int> v;

//bitset<4001000> b;
int i,n,d,m,k,a,b,c;

int o[1];
int l[1];
int j[1];
int e;

//int dx[10]={2,2,-2,-2,1,1,-1,-1},dy[10]={1,-1,1,-1,2,-2,2,-2};

int dx[10]={0,1,0,-1,1,1,-1,-1},dy[10]={1,0,-1,0,1,-1,1,-1},dz[10]={0,0,0,0,1,-1};
long long mod=1000000009,mod2=1000000009,mod3=2017;
long long x,z,y;
double pi=3.14159265;
P u[1];
//stack<int> s;
//set<int> se;
//priority_queue<int> q;
//queue<int> q;
string r,r1;
//char r[1];
//2147483647
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
//map<int,int> p;
/*
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
unordered_map<long long, int, custom_hash> safe_map;
*/
//list<int> l;


//deque<int> de;
//srand((int)time(NULL));




bool as(P a,P b)
{
    return a.x<b.x;
}

int main()
{
    scanf("%d %d",&a,&b);
    if(a>=2*b-1) puts("YES");
    else puts("NO");
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

const ll INF = 1LL << 50;

int main() {
  ll a, b;
  cin >> a >> b;
  ll ans = -1;
  rep(i, 1010) {
    bool conda = i * 8 / 100 == a;
    bool condb = i / 10 == b;
    if(conda && condb){
      ans = i;
      break;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int n, i, j, t;
    int[][] a;

    for(;;){
      n = sc.nextInt();
      if(n == 0)break;
      a = new int[n][n];
      t = 0;
      i = n / 2 + 1; j = n / 2;
      a[i][j] = ++t;
      for(;t < n * n;){
        if(a[++i % n][++j % n] == 0)a[i % n][j % n] = ++t;
        else a[++i % n][--j % n] = ++t;
      }

      for(i = 0;i < n;i++){
        for(j = 0;j < n;j++)out.printf("%4d", a[i][j]);
        out.println();
      }
    }

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}

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

int main()
{
    string str, order, w;
    int q, i, j, a, b;

    cin >> str;
    cin >> q;

    for(i = 0; i < q; i++){
        cin >> order;
        cin >> a >> b;

        if(order == "print"){
            cout << str.substr(a, b - a + 1) << endl;

        }else if(order == "reverse"){
            w = str.substr(a, b - a + 1);
            for(j = 0; j < b - a + 1; j++){
                str[a + j] = w[b - a - j];
            }

        }else{
            cin >> w;
            for(j = 0; str[j]; j++);
            str = str.substr(0, a) + w + str.substr(b + 1, j - b - 1);
        }
    }

    return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
#define LL long long

const int mod = 1e9 + 7;
const int N = 1e6 + 5;
const int M = 2e6 + 5;

int n, k;
int m, fac[M] = {1}, inv[M];
char str[N];

LL tot, mis;

int mul(int ta, int tb) {
	int ret;
	__asm__ __volatile__ ("\tmull %%ebx\n\tdivl %%ecx\n":"=d"(ret):"a"(ta), "b"(tb), "c"(mod));
	return ret;
}

int qpow(int bas, int po) {
	int res = 1;
	while(po) {
		if(po & 1)
			res = mul(res, bas);
		bas = mul(bas, bas);
		po >>= 1;
	}
	return res;
}

int C(int tn, int tm) {
	return mul(fac[tn], mul(inv[tm], inv[tn - tm]));
}

int32_t main() {
	
	scanf("%d %s", &k, str + 1);
	
	n = strlen(str + 1);
	m = n + k;

	tot = qpow(26, m);
	
	for(int i = 1; i <= m; ++i)
		fac[i] = mul(fac[i - 1], i);
	for(int i = 0; i <= m; ++i)
		inv[i] = qpow(fac[i], mod - 2);

	for(int i = 0; i <= n - 1; ++i) {
		mis = (mis + mul(C(m, i), qpow(25, m - i))) % mod;
	}
	
	tot = ((tot - mis) % mod + mod) % mod;
	
	printf("%d", tot);

	return 0;
}

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

long long x,y;

long long extGCD(long long a, long long b, long long *px, long long *py){
    if(b == 0){
        *px = 1;
        *py = 0;
        return a;
    }
    long long d = extGCD(b, a%b, py, px);
    *py -= a/b * (*px);
    return d;
}

vector<long long> min_factor;

set<long long> factor(long long n) {
    set<long long> res;
    while (n > 1) {
        res.insert(min_factor[n]);
        n /= min_factor[n];
    }
    return res;
}

void min_factor_init(long long n){
    min_factor.resize(n);
    iota(min_factor.begin(), min_factor.end(), 0);
    for (long long i = 2; i*i < n; ++i) {
        if (min_factor[i] < i) continue;
        for (long long j = i*i; j < n; j += i)
            if (min_factor[j] == j) min_factor[j] = i;
    }
}

int main(){
    min_factor_init(1000001);
    long long N;
    cin >> N;
    long long A[N+1];
    long long i;
    for(i=1; i<=N; i++){
        cin >> A[i];
    }
    long long g=A[1];
    for(i=2; i<=N; i++){
        g=extGCD(g,A[i],&x,&y);
    }
    if(g>1){
        cout << "not coprime" << endl;
        system("pause");
        return 0;
    }
    set<long long> used_prime;
    long long pre;
    bool dabu=0;
    for(i=1; i<=N; i++){
        set<long long> now_prime=factor(A[i]);
        for(auto t=now_prime.begin(); t!=now_prime.end(); ++t){
            pre=used_prime.size();
            used_prime.insert(*t);
            if(pre==used_prime.size()){
                dabu=1;
                break;
            }
        }
        if(dabu==1) break;
    }
    if(dabu==1){
        cout << "setwise coprime" << endl;
    }else{
        cout << "pairwise coprime" << endl;
    }
    system("pause");
    return 0;
}

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


int main(){
    long long n;
  	cin >> n;
    
  	long long b = 0;
    /*
  	while((1LL<<b) <= n){
    	++b;
    }
    cout <<((1LL<<b) - 1)<<"\n";
    */
    b = 64 - __builtin_clzll(n);
    cout <<((1LL<<b)-1)<<"\n";
	return 0;
}

//1(4) -> 2(4/2) => 4(4/4)

Measured memory_bytes: 256
import math


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


q = int(input())
l = []
r = []
for i in range(q):
    ll, rr = map(int, input().split())
    l.append(ll)
    r.append(rr)

dp = [0 for _ in range(10**5 + 5)]
dpsum = [0 for _ in range(10**5 + 5)]

for i in range(3, 10**5 + 1, 2):
    if is_prime(i) and is_prime((i + 1) // 2):
        # dp[i] = 1
        dpsum[i] = dpsum[i - 2] + 1
    else:
        dpsum[i] = dpsum[i - 2]

for i in range(q):
    print(dpsum[r[i]] - dpsum[l[i] - 2])


Measured memory_bytes: 18844
//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl '\n'
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
bool sortbysec(const pair<ll,ll>&a,const pair<ll,ll>&b)
{
    return (a.second<b.second);
}
int main()
{
    ios;
    int n;
    cin>>n;
    string s;
    cin>>s;
    if(n<3200)
        cout<<"red"<<endl;
    else
        cout<<s<<endl;



}
//Alhamdulillah










Measured memory_bytes: 3612
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long llong;

int n,k;
llong opts[500111];

llong P3(llong a)
{
    return a*a*a;
}

int main()
{
    int i,j,in;
    int P,Q,W;
    llong a,b,c;
    int avg;
    llong ans = 0;

    scanf("%d %d",&n,&k);

    for (i=1;i<=n;i++)
    {
        opts[i%k]++;
    }

    if (k%2 == 0)
    {
        ans = P3(opts[k/2]) + P3(opts[0]);
    }
    else
    {
        ans = P3(opts[0]);
    }

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

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void) {
    string S;
    cin >> S;
    if(S == "RRR") {
        cout << 3 << endl;
    } else if(S == "SSS") {
        cout << 0 << endl;
    } else if(S == "RRS" || S == "SRR") {
        cout << 2 << endl;
    } else {
        cout << 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3624