akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  3 21:22:26 2019

@author: Yamazaki Kenichi
"""

N,K = map(int,input().split())
A = list(map(int,input().split()))
A = [bin(i) for i in A]

B = [0 for i in range(44)]

for i in range(N):
    for j in range(len(A[i])):
        if A[i][-1-j] == '1':
            B[j] += 1
Ans = []
c = 0
for i in range(44):
    if i <= len(bin(K))-3:
        Ans.append(1) if B[i]<=N//2 else Ans.append(0)
    else:
        Ans.append(0)

for i in range(0,len(bin(K))-2):
    if int(bin(K)[i+2]) - Ans[len(bin(K))-3-i] == -1:
        Ans[len(bin(K))-3-i] = 0
    elif int(bin(K)[i+2]) - Ans[len(bin(K))-3-i] == 1:
        break

ans = 0
for i in range(44):
    ans += pow(2,i)*(B[i]) if Ans[i] == 0 else pow(2,i)*(N-B[i])
print(ans)


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define collect(arr, size) rep(i,size) cin >> arr[i];
#define int long long

signed main(){
    string s; cin >> s;
    bool is_hitachi =
    s=="hi" || s=="hihi" || s=="hihihi" || s=="hihihihi" || s=="hihihihihi";
    cout << (is_hitachi ? "Yes" : "No") << endl;
    return 0;
}

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


int main(){
  int n, a;
  cin >> n;
  priority_queue<pair<int, int>> rank_que;

  for(int i=1; i<=n; i++){
    // i番目の生徒が登校した時点でa人いた
    cin >> a;
    int tmp = n - a;
    pair<int, int> p = make_pair(tmp, i);
    rank_que.push(p);
  }
  while(!rank_que.empty()){
    pair<int, int> p = rank_que.top();
    rank_que.pop();
  	if(rank_que.size())printf("%d ",p.second);
  	else printf("%d\n", p.second); 
  }
  return 0;
}

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

using namespace std;

int next(int n)
{
    ostringstream oss;
    oss << n;
    string str = oss.str();
    int mmax = 0;
    int lim = str.size();
    for(int i=1; i<lim; i++)
    {
        stringstream ss1(str.substr(0, i)), ss2(str.substr(i));
        int x, y;
        ss1 >> x;
        ss2 >> y;
        mmax = max(mmax, x*y);
    }
    return mmax;
}

int main()
{
    int n;
    cin >> n;
    while(n--)
    {
        int r;
        cin >> r;
        set<int> already;
        for(int t=0; ; t++)
        {
            if(r<10)
            {
                cout << t << endl;
                break;
            }
            if(already.find(r)!=already.end())
            {
                cout << -1 << endl;
                break;
            }
            already.insert(r);
            r = next(r);
        }
    }
}

Measured memory_bytes: 3184
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
int inf = 1000000000;
vector<int> a;
int cnt = 0;
void merge(int left, int mid, int right){
  int n1 = mid-left;
  int n2 = right - mid;
  vector<int> l(n1+1);
  vector<int> r(n2+1);

  for(int i=0; i<n1; i++) l[i] = a[left + i];
  for(int i=0; i<n2; i++) r[i] = a[mid + i];

  l[n1] = inf;
  r[n2] = inf;
  int i = 0, j = 0;
  for(int k=left; k<right; k++){
    if( l[i] <= r[j] ){
      a[k] = l[i];
      i++;
    }else{
      a[k] = r[j];
      j++;
    }
    cnt++;
  }

}
void mergeSort(int left, int right){
  if( left + 1 < right ){
    int mid = (left + right) / 2;
    mergeSort(left, mid);
    mergeSort(mid, right);
    merge(left, mid, right);
  }
}

int main(void) {

  int n;
  cin >> n;
  a.resize(n);
  for(int i=0; i<n; i++) cin >> a[i];

  mergeSort(0, n);
  for(int i=0; i<n; i++){
    if( i == n-1 ) cout << a[i] << endl;
    else cout << a[i] << " ";
  }
  cout << cnt << endl;
  return 0;
}

// EOF

Measured memory_bytes: 6856
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(long long int i = 0; i < (n); i++)


int Len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}


int Sint(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int Svec(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}


int GCD(int a,int b){
  int r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


int LCM(int a,int b){
  int c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


int Factorial(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}


/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  int n,m;
  cin>>n>>m;
  string s;
  cin>>s;
  vector<int> v(n-1);
  rep(i,n-1){
    if(s[i]=='A' && s[i+1]=='C'){
      v[i]=1;
    }else{
      v[i]=0;
    }
  }
  vector<int> a(m),b(m),c(n-1);
  rep(i,m) cin>>a[i]>>b[i];
  rep(i,n-1) c[i]=0;
  c[0]=v[0];
  for(int i=1;i<n-1;i++){
    c[i]+=c[i-1]+v[i];
  }
  rep(i,m){
    cout<<c[b[i]-2]-c[a[i]-2]<<endl;
  }
  
  
}

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

struct tmp_t {
    int S;
    int C;
};

int N;
int M;
struct tmp_t T[10];

int cmpfunc( const void *a, const void *b )
{
    return( ((struct tmp_t *)a)->S, ((struct tmp_t *)b)->S );
}

long long powten( int n )
{
    int i;
    long long ret = 1;

    for( i=0; i<n; i++ ) ret *= 10;

    return( ret );
}

/***************************************
    main
***************************************/
int main( int argc, char *argv[] )
{
    int i;
    long long ret = 0;
    int digit[10];

    if( scanf( "%d%d", &N, &M ) != 2 ) {
        puts( "Input error." );
        exit( 0 );
    }

    for( i=0; i<M; i++ ) {
        if( scanf( "%d%d", &T[i].S, &T[i].C ) != 2 ) {
            puts( "Input error." );
            exit( 0 );
        }
    }

    qsort( T, M, sizeof(struct tmp_t), cmpfunc );

    for( i=0; i<M-1; i++ ) {
        if( T[i].S == T[i+1].S && T[i].C != T[i+1].C ) {
            puts( "-1" );
            exit( 0 );
        }
    }

    if( T[0].S == 1 && T[0].C == 0 && N != 1 ) {
        puts( "-1" );
        exit( 0 );
    }

    for( i=1; i<=N; i++ ) digit[i] = 0;
    for( i=0; i<M; i++ ) digit[T[i].S] = T[i].C;
    for( i=1; i<=N; i++ ) ret += powten(N-i) * digit[i];
    if( N > 1 && ret < powten(N-1) ) ret += powten(N-1);
//for(i=0; i<=N; i++ ) printf( "digit[%d] => %d\n", i, digit[i] );

    printf( "%lld\n", ret );
}


Measured memory_bytes: 128
// red green blue
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
using namespace std;
typedef long long ll;

#define PI 3.14159265358979323846264338327950L

string res;

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

    int A,B,C,K;
    cin >> A >> B >> C>> K;
    res = "No";
    int cnt = 0;
    while(B<=A){
        B *= 2;
        cnt++;
        //cout << "##"<< B<< endl;
    }
    while(C<=B){
        C *= 2;
        cnt++;
    }
    //cout << "$$"<<C << endl;
    if(cnt<=K){
        res = "Yes";
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>

using namespace std;

int main()
{
	string s, t;
	cin >> s >> t;
	vector<int> al(26, 0);
	int count = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] != t[i]) {
			count++;
		}
	}
	cout << count << endl;
}


Measured memory_bytes: 3448
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<limits.h>

using namespace std;


long max(long x, long y) {
	return x > y ? x : y;
}

long min(long x, long y) {
	return x < y ? x : y;
}


int main()
{
	int n;
	cin >> n;
	cout << pow(n*1.0, 2);
	
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int x[50];
  long int d[51][5010];
  int n,a,i,j;
  scanf("%d%d",&n,&a);
  for(i=0;i<51;i++)x[i]=0;
  for(i=0;i<n;i++){scanf("%d",&x[i]);x[i]-=a;}
  for(j=0;j<5001;j++)d[0][j]=0;
  d[0][n*50]=1;
  for(i=1;i<=n;i++)for(j=0;j<5001;j++){
    d[i][j]=d[i-1][j]+(j-x[i-1]>=0&&j-x[i-1]<5001?d[i-1][j-x[i-1]]:0);
    if(i==n&&j==n*50){
      printf("%ld",d[i][j]-1);
      return 0;
    }
  }
}


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

const int inf=1000000000;
int n,m,cnt,p[100001],P[100001],hd[200101],cur[200101],dis[200101],q[200101],l,r,K,x,ans;
struct node{int to,next,c;}e[1000001];
vector<int> v[100001],t[100001];
bool bo[200101];

void addedge(int x,int y,int c) 
{
	e[++cnt]=(node){y,hd[x],c},hd[x]=cnt;
	e[++cnt]=(node){x,hd[y],0},hd[y]=cnt;
}

bool bfs()
{
	for (int i=1; i<=n+n+1; i++) dis[i]=inf;
	q[l=r=1]=1,dis[1]=0,memset(bo,0,sizeof(bo)),bo[1]=1;
	while (l<=r)
	{
		x=q[l];
		for (int i=hd[x]; i; i=e[i].next)
			if (e[i].c&&!bo[e[i].to]) bo[e[i].to]=1,q[++r]=e[i].to,dis[e[i].to]=dis[x]+1;
		l++;
	}
	return dis[n+n+1]<inf;
}

bool dinic(int x)
{
	if (x==n+n+1) return 1;
	for (int &i=cur[x]; i; i=e[i].next)
		if (e[i].c&&dis[e[i].to]==dis[x]+1&&dinic(e[i].to)) 
			return e[i].c--,e[i^1].c++,1;
	return 0;
}

int main()
{
	scanf("%d",&n),cnt=1;
	memset(hd,0,sizeof(hd));
	for (int i=1; i<n; i++)
	{
		scanf("%d",&K),v[i].clear();
		for (int j=1; j<=K; j++) scanf("%d",&x),v[i].push_back(x);
	}
	for (int i=1; i<n; i++) addedge(1,i+1,1);
	for (int i=1; i<=n; i++) addedge(i+n,n+n+1,1),t[i].clear();
	for (int i=1; i<n; i++)
		for (int siz=v[i].size(),j=0; j<siz; j++) 
			addedge(i+1,v[i][j]+n,1);
	ans=0;
	while (bfs())
	{
		for (int i=1; i<=n+n+1; i++) cur[i]=hd[i];
		while (dinic(1)) ans++;
	}
	if (ans!=n-1) return puts("-1"),0;
	memset(bo,0,sizeof(bo));
	for (int i=1; i<n; i++) 
		for (int j=hd[i+1]; j; j=e[j].next)
			if (!e[j].c) {bo[p[i]=e[j].to-n]=1; break;}
	for (int i=1; i<n; i++) 
		for (int j=0,siz=v[i].size(); j<siz; j++)
			if (v[i][j]!=p[i]) t[v[i][j]].push_back(p[i]);
	for (int i=1; i<=n; i++) if (!bo[i]) q[l=r=1]=i;
	memset(P,0,sizeof(P));
	while (l<=r)
	{
		x=q[l];
		for (int i=0,siz=t[x].size(); i<siz; i++)
			if (!P[t[x][i]]) P[t[x][i]]=x,q[++r]=t[x][i];
		l++;
	}
	if (r<n) return puts("-1"),0;
	for (int i=1; i<n; i++) printf("%d %d\n",p[i],P[p[i]]);
	return 0;
}

Measured memory_bytes: 26240
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

using namespace std;


int Init(string S) {
	int count = 0;
	for (int i = 1; i < S.length(); i++) {
		if (S[i] == 'E')count++;
	}
	return count;
}

int main() {
	int N;
	cin >> N;
	string S;
	cin >> S;
	int Min = Init(S);
	int Count = Min;
	for (int i = 1; i < N; i++) {
		if (S[i - 1] == 'E'&&S[i] == 'E') {
			Count--;
			Min = min(Min, Count);
		}
		if (S[i - 1] == 'W'&&S[i] == 'W')Count++;
	}
	cout << Min<< endl;
	return 0;
}

Measured memory_bytes: 900
import math
import collections
import fractions
import itertools

def solve():
    n, m = map(int, input().split())
    mon = [0]*n
    mon2 = [0]*n
    for i in range(m):
        q, a = input().split()
        q = int(q)
        if a == "AC":
            mon[q-1] = 1
        else:
            if mon[q-1] == 0:
                mon2[q-1] += 1
    ac, pena = 0, 0
    for i in range(n):
        if mon[i] == 1:
            ac += 1
            pena += mon2[i]
    print(ac, pena)
    return 0

if __name__ == "__main__":
    solve()


Measured memory_bytes: 11400
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use proconio::{input, marker::*, fastout};
use superslice::*;
#[fastout()]
fn main() {
    input! {
        n: usize, abc: (i64, i64, i64),
        ss: [String; n],
    }

    let mut res = vec!['Z'; n];
    if dfs(abc, &ss, &mut res) {
        println!("Yes");
        for c in res {
            println!("{}", c);
        }
    } else {
        println!("No");
    }

}

fn dfs(abc: (i64, i64, i64), ss: &[String], res: &mut [char]) -> bool {
    let (a, b, c) = abc;

    if a < 0 || b < 0 || c < 0 {
        return false;
    }

    if ss.is_empty(){
        return true;
    }

    let pos = res.len() - ss.len();

    if &ss[0] == "AB" {
        res[pos] = 'B';
        if dfs((a-1, b+1, c), &ss[1..], res) {
            return true;
        } 
        res[pos] = 'A';
        return dfs((a+1, b-1, c), &ss[1..], res);
    }

    if &ss[0] == "AC" {
        res[pos] = 'C';
        if dfs((a-1, b, c+1), &ss[1..], res) {
            return true;
        } 
        res[pos] = 'A';
        return dfs((a+1, b, c-1), &ss[1..], res);
    }

    // BC
    res[pos] = 'B';
    if dfs((a, b+1, c-1), &ss[1..], res) {
        return true;
    } 
    res[pos] = 'C';
    return dfs((a, b-1, c+1), &ss[1..], res);
}


Measured memory_bytes: 20676
#include <iostream>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cfloat>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <set>
using namespace std;

const double PI=acos(-1);

int main(){
    int h, w;
    cin >> h >> w;
    string s = "";
    char ss;
    for(int i = 0; i < h+2; i++){
        s.clear();
        for(int j = 0; j < w+2; j++){
            if(i == 0 || i == h+1 || j == 0 || j == w+1)  s += "#";
            else{
                cin >> ss;
                s += ss;
            }
        }
        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
h = list(map(int,input().split()))
A = [0]*n
sum = 0

for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] > h[b-1]:
        A[b-1] = 1
    elif h[b-1] > h[a-1]:
        A[a-1] = 1
    else:
        A[a-1] = 1
        A[b-1] = 1
    #print(A)
for i in range(n):
    if A[i] == 0:
        sum += 1

print(sum)

Measured memory_bytes: 20088
#include <stdio.h>
int main(void){
    int n, min = 2000000000, ans = -1000000000, cur;
    
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &cur);
        if(i) {
            if(ans < cur - min) ans = cur - min;
        }
        if(min>cur) min = cur;
    }
    
    printf("%d\n", ans);
    
    return 0;
}



Measured memory_bytes: 2088
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define EPS 1e-14
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) FOR(i, 0, n)
#define PI 2*acos(0.0)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(x) cout<<#x <<": "<< x << "\n"
#define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; }
const int VX[] = { 0, 1, 0, -1 };
const int VY[] = { 1, 0, -1, 0 };
const long MOD = 1000000007;

int main() {
	//	--- I/O 高速化 ---
	cin.tie(0);
	ios::sync_with_stdio(false);
	// --- ここまで ---

	string s;
	cin >> s;

	for(int i = 0; i < s.length(); i += 2)
	{
		cout << s[i];
	}
	cout << "\n";

	return 0;
}



Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long int price[4];
  for(int i = 0;i < 4;i++)cin >> price[i];
  long long int N;
  cin >> N;
  long long int perL = min({price[2],2*price[1],4*price[0]});
  long long int answer;
  if(price[3] < 2*perL){
    answer = (N/2)*price[3] + (N%2)*perL;
  }else{
    answer = N*perL;
  }
  cout << answer << endl;
}

Measured memory_bytes: 256
#include<functional>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<string>
#include<cstdio>
#include<vector>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};// 上 左 下 右
const int N=100005,M=1000005,K=200005,mod=1000000007;
const long long llinf=9223372036854775807ll;
//int & long long
int n;
string s,t1,t2;
int main(){
	cin>>n>>s;
	if(n%2==1)
		cout<<"No";
	else
	{
		t1=s.substr(0,n/2);
		t2=s.substr(n/2,n/2);
		if(t1==t2)
			cout<<"Yes";
		else
			cout<<"No";
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 1000
#define EMPTY 2000000000

int main(){
	int n,q,i;
	int a[N];
	int copy[N];
	int b,m,e;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		copy[i]=EMPTY;
	}
	
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d %d %d",&b,&m,&e);
		
		for(int j=0;j<(e-b);j++){
			copy[b+((j+(e-m))%(e-b))]=a[b+j];
		}
		
		for(int j=0;j<n;j++){
			if(copy[j]!=EMPTY){
				a[j]=copy[j];
				copy[j]=EMPTY;
			}
		}
		
	}
	
	for(i=0;i<n-1;i++){
		printf("%d ",a[i]);
	}
	printf("%d\n",a[n-1]);
	
	return 0;
	
}


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

// Shrotening
#define fst first
#define snd second
#define pb push_back

// Loop
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define RFOR(i,a,b) for(long i=(a);i>=(b);--i)

#define REP(i,a) for(long i=0;i<(a);++i)
#define RREP(i,a) for(long i=(a);i>=0;--i)

#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)
#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)

//Algorithm
#define ALL(a) (a).begin(), a.end()
#define RALL(a) (a).rbegin(), a.rend()
#define EXIST(a,x) ((a).find(x)!=(a).end())
#define SORT(a) std::sort((a).begin(), (a).end())
#define UNIQUE(a) std::sort((a).begin(), a.end()), a.erase(std::unique((a).begin(), a.end()), a.end());
#define SUM(a) std::accumulate((a).begin(), (a).end(), 0);

//Setting
#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);

//debug message
bool debug = true;
#define MSG(s)   if(debug){std::cout << s << std::endl;}
#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}

//alias
typedef long long LL;
typedef std::vector<char> VC;
typedef std::vector<int>  VI;
typedef std::vector<long> VL;
typedef std::vector<long long> VLL;

typedef std::vector< VC > VC2;
typedef std::vector< VI > VI2;
typedef std::vector< VL > VL2;
typedef std::vector< VLL > VLL2;

typedef std::pair<int,int> PII;


int main() {
    char a, b, c, d, e, f;
    std::cin >> a >> b >> c;
    std::cin >> d >> e >> f;
    if(a == f && b == e && c == d) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int a, b, c, x;
    cin >> a >> b >> c >> x;
    x /= 50;
    int cnt = 0;
    for (int i=0;i<=c;i++) {
        for (int j=0;j<=b;j++) {
            for (int k=0;k<=a;k++) {
                if (i + j * 2 + k * 10 == x) {
                    cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
x = int(input())
import math
a = int(math.floor(x/100))
b = int(math.floor((x-100*a)/10))
c = int(math.floor((x-100*a-10*b)))

if a == 7:
    print("Yes")
elif b == 7:
    print("Yes")
elif c == 7:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9128
#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld =long double;
//#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<int,pii> piii;

int main(){
    int n; cin>>n;
    int l; cin>>l;
    vector<string>v(n);
    rep(i,n)cin>>v[i];
    sort(all(v));
    rep(i,n)cout<<v[i];
    cout<<endl;
}


Measured memory_bytes: 256
from operator import itemgetter
n,m=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
num=[]
for _ in range(m):
    b,c=map(int,input().split())
    num.append([b,c])
num=sorted(num,key=itemgetter(1),reverse=True)
i=0
j=0
cnt=0
ans=0
while cnt<n:
    if j<m:
        if a[i]<=num[j][1]:
            if n-cnt<=num[j][0]:
                ans+=(n-cnt)*num[j][1]
                print(ans)
                exit()
            else:
                ans+=num[j][0]*num[j][1]
                cnt+=num[j][0]
                j+=1
        else:
            ans+=a[i]
            i+=1
            cnt+=1
    else:
        ans+=a[i]
        i+=1
        cnt+=1

print(ans)


Measured memory_bytes: 26312
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> a(n),b(n);
	for(int i=0;i<n;i++)
		cin >> a[i];
	for(int i=0;i<n;i++)
	{
		int pos=(i%2==1 ? i:0)+(n+1)/2-(i-1+1)/2-1;
		if(n%2==0)pos=n-pos-1;
		b[pos]=a[i];
	}

	for(int i=0;i<n;i++)
		cout << b[i] << " ";
	cout << endl;


	
}

Measured memory_bytes: 3712
//code by lynmisakura.wish to be accepted!
/****************************/
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<bitset>
#include <climits>
#include<set>
#include<bitset>
using namespace std;
/***************************/
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> vpi;

const long long MOD = 998244353;
const long long mod = 1000000007;
const long long INF = 10000000000000;
 
#define itn int
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
 
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
 
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//mint
struct mint {
   //this library is created by snuke.
  ll x; // typedef long long ll;
  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 pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

//i文字目まで見て、ペアが未決定な数の組数、確定している奇妙さ
mint dp[60][60][2501];
int n,z;

void solve(){
   dp[0][0][0] = 1;
   for(int i = 1;i <= n;i++){
      for(int j = 0;j <= i;j++){
         for(int k = 0;k <= 2500;k++){
            if(k - 2*j >= 0){
               dp[i][j][k] += (mint)(2*j + 1)*dp[i-1][j][k-2*j];
               dp[i][j][k] += (mint)(j + 1)*(mint)(j + 1)*dp[i-1][j + 1][k-2*j];
               if(j - 1 >= 0)dp[i][j][k] += dp[i-1][j - 1][k-2*j];
            }
         }
      }
   }
   
   cout << dp[n][0][z].x << endl;
}
int main(void){
   cin >> n >> z;
   solve();
}


Measured memory_bytes: 70528
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)
ll a,b,n;
ll f(ll x){
   return a*x/b + a*(x/b);
}
int main(){
   cin >> a >> b >> n;
   ll mx = min(b-1,n);
   cout << f(mx) << endl;
   return 0;
}


Measured memory_bytes: 3532
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod


x,y=map(int,input().split())

if not(-(-x//2) <= y and y <= x*2):
    print(0)
    exit()

flag = True

count = 0
while flag:
    if y*2 == x: # yCc
        print(comb(y, count, 10**9+7))
        exit()
    if y*2 < x: # ない
        print(0)
        exit()
    
    count += 1
    x += 1
    y -= 1


 

Measured memory_bytes: 40044
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
	int a, b, k;
	cin >> a >> b >> k;
	rep(i, k){
		if(i % 2 == 0){
			if(a % 2 == 1){
				a--;
			}
			b += a/2;
			a /= 2;
		}else{
			if(b % 2 == 1){
				b--;
			}
			a += b/2;
			b /= 2;
		}
	}
	cout << a << " " << b << endl;
	return 0;
}

Measured memory_bytes: 256
L = [0]
N = int(input())
A = list(map(int, input().split()))
cnt = 0
dic = {}
dic[0] = 1
for i in range(N):
    n = L[-1] + A[i]
    L.append(n)
    dic.setdefault(n, 0)
    dic[n] += 1
for key in dic.keys():
    n = dic[key]
    if n > 1:
        cnt += n * (n - 1) // 2
print(int(cnt))

Measured memory_bytes: 111440
#include<iostream>
#include<cmath>
#include<stdio.h>
#include <ctype.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<deque> //<< fixed << setprecision()
#include<queue> //priority_queue
#include<vector>
#define em3 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define iof freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

using namespace std;
#define f first
#define s second
#define X real()
#define Y imag()
#define cross(a, b) ((conj(a) * (b)).Y)
#define dot(a, b) ((conj(a) * (b)).X)
#define inFile(t) freopen((t),"r",stdin)
#define outFile(t) freopen((t),"w",stdout)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define EPS 1e-7
long long mod = 1e9 + 7;
const int N = 1e4 + 5;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const double pi = acos(-1);
//typedef complex <ll> point;
typedef tuple<int, int, int> line;
//typedef vector<point> polygon;


int main()
{
	priority_queue<ll>q;
	ll n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		ll x;
		cin >> x;
		q.push(x);
	}
	for (int i = 0; i < m; i++)
	{
		ll x = q.top();
		q.pop();
		q.push(x / 2);
	}
	ll sum = 0;
	for (; q.size();)
	{
		sum += q.top();
		q.pop();
	}
	cout << sum;
}

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

int main()
{
  int h, w;
  while (1) {
    cin >> h >> w;
    if (h == 0 && w == 0) break;
    for (int i=0; i<h; i++) {
      for (int j=0; j<w; j++) {
        if (i > 0 && i < h-1 && j > 0 && j < w-1)
          printf(".");
        else printf("#");
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 3072
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>

using namespace std;

int main(){
	long long int a, b, x;
	scanf("%lld %lld %lld", &a, &b, &x);
	long long int ans = 0, i = 0;

	if(a == 0)
		ans = (b/x+1);
	else
		ans = (b/x+1) - ((a-1)/x+1);

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

	return 0;
}

Measured memory_bytes: 256
def main():
    D, G = [int(i) for i in input().split()]
    p = []
    c = []
    for i in range(D):
        pp, cc = [int(i) for i in input().split()]
        p.append(pp); c.append(cc)
    ans = 1e9
    for mask in range(1<<D):
        s = 0; num = 0; rest_max = -1
        for i in range(D):
            # どのビットが立っているか確認する
            if mask >> i & 1:
                # i 番目の問題を全完した時の点数を追加する
                s += 100 * (i+1) * p[i] + c[i]
                num += p[i]
            else:
                # ビットが立っていない点数が一番高い問題のメモ
                # 足りなかったらここから解いて点数を追加する
                # 残ったやつ 1 つだけを見ればばいい
                # なぜなら、bit全探索で、他のパターンは自動的に出るから
                rest_max = i
        if s < G:
            # rest_max 番目の点数をあらかじめ計算しておく
            s1 = 100 * (rest_max+1)
            # 目標 - 今まで解いた問題の得点 + rest_max 番目の問題の得点 - 1
            need = (G - s + s1 - 1) // s1 # max になってはいけない
            if need >= p[rest_max]:
                continue
            num += need
        ans = min(ans, num)
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)
cnt = 0
# print(1 / (4 * m))

for i in range(n):
    if a[i] >= total / (4*m):
        # print('a[i]:', a[i])
        cnt += 1

if cnt >= m:
    print('Yes')
else:
    print('No')

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

#define pb push_back
#define F first
#define S second
#define y1 dasdasfasfas
#define x1 wqdadfasfasfas
#define All(c) c.begin(), c.end()
#define SZ(A) (int((A).size()))
#define umap unordered_map
#define __ fflush(stdout)
#define FILENAME ""

typedef long long ll;
typedef long double ld;    

using namespace std;

void FREOPEN() {
	#ifdef LOCAL
		freopen(".in", "r", stdin);
		freopen("1.out", "w", stdout);
	#else
		//freopen(FILENAME".in", "r", stdin);
		//freopen(FILENAME".out", "w", stdout);
	#endif
}

inline double Time() {return (clock() * 1.0) / CLOCKS_PER_SEC; }             

const int N = 200500, inf = 1e9 * 2;

const ll MOD = 1e9 + 7ll, INF = 1e18;

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

ll t[N * 4], ch[N * 4], pref[N], dp[N];

vector<pair<int, int> > open[N], close[N]; 

void push(int v, int l, int r) {
	if (ch[v] == 0) return;
	t[v] += ch[v];
	if (l < r) {
		ch[v + v] += ch[v];
		ch[v + v + 1] += ch[v];
	}
	ch[v] = 0;
}

void upd(int v, int l, int r, int L, int R, ll x) {
	push(v, l, r);
	if (L > R || L > r || l > R) return;
	if (L <= l && R >= r) {
		ch[v] += x;
		push(v, l, r);
		return;
	}
	int mid = (l + r) / 2;
	upd(v + v, l, mid, L, R, x);
	upd(v + v + 1, mid + 1, r, L, R, x);
	t[v] = max(t[v + v], t[v + v + 1]);
}

ll get(int v, int l, int r, int L, int R) {
	push(v, l, r);
	if (L > r || L > r || l > R) return -INF;
	if (L <= l && R >= r) return t[v];
	int mid = (l + r) / 2;
	return max(get(v + v, l, mid, L, R), get(v + v + 1, mid + 1, r, L, R));
}

int main() {
	FREOPEN();
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= m; i++) {
		int l, r, x;
		scanf("%d %d %d", &l, &r, &x);
		open[l].pb({r, x});
		close[r].pb({l, x});
		pref[l] += x;
		pref[r + 1] -= x;
	}
	for (int i = 1; i <= n; i++) pref[i] += pref[i - 1];
	
 	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		while (!open[i].empty()) {
			int l = i, r = open[i].back().F, x = open[i].back().S;
			upd(1, 1, n, l, r, -x);
			open[i].pop_back();
		}
		dp[i] = max(pref[i], pref[i] + get(1, 1, n, 1, i - 1));
		ans = max(ans, dp[i]);
		upd(1, 1, n, i, i, dp[i]);
		while (!close[i].empty()) {
			int l = close[i].back().F, r = i, x = close[i].back().S;
			upd(1, 1, n, l, r, x);
			close[i].pop_back();
		}
 	}
 	printf("%lld", ans);
	return 0;
}


Measured memory_bytes: 37248
import os
import sys

import numpy as np


def solve(inp):
    def bit_add(arr, n, i, x):
        while i <= n:
            arr[i] += x
            i += i & -i

    def bit_sum(arr, i):
        result = 0
        while i > 0:
            result += arr[i]
            i ^= i & -i
        return result

    n = inp[0]
    q = inp[1]
    ccc = inp[2:2 + n]
    lll = inp[2 + n::2] - 1
    rrr = inp[3 + n::2] - 1

    just_left = {}
    segments = []
    for i in range(n):
        c = ccc[i]
        if c in just_left:
            segments.append((i, 0, just_left[c], 0))
        just_left[c] = i

    for i in range(q):
        segments.append((rrr[i], 1, lll[i], i))

    segments.sort()
    bit = np.zeros(n + 2, dtype=np.int64)
    ans = np.zeros(q, dtype=np.int64)

    for r, tp, l, i in segments:
        if tp == 0:
            bit_add(bit, n + 2, l + 2, 1)
        else:
            base = r - l + 1
            ans[i] = base - (bit_sum(bit, r + 2) - bit_sum(bit, l + 1))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC

    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()
    exit()

if os.name == 'posix':
    # noinspection PyUnresolvedReferences
    from my_module import solve
else:
    from numba import njit

    solve = njit('(i8[:],)', cache=True)(solve)
    print('compiled', file=sys.stderr)

inp = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
ans = solve(inp)
print('\n'.join(map(str, ans)))


Measured memory_bytes: 97924
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(n) begin(n),end(n)
using ll = long long;
using P = pair<int,int>;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n); 
    rep(i,n) {
        cin >> a[i];
        //cout << a[i] << endl;
        if(a[i] == 0){
            cout << 0 << endl;
            return 0;
        }
    }
    ll ans = 1;
    rep(i,n) {
        ans *= a[i];
        if(ans > 1000000000000000000) {
            cout << -1 << endl;
            return 0;
        }
    }
    if(ans==0) cout << -1 << endl; 
    else cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4052
//#13

#include <iostream>
using namespace std;

int main()
{
	int  a, b, c;
	cin >> a >> b >> c;
	int count = 0 , i;
	for (i = a; i <= b; i++)
	{
		if (c % i == 0)
		{
			++count;
		}
	}
	cout << count << endl;
	
	return 0;
}


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

string S;
bool x[26];

int main() {
  cin >> S;
  int l = S.size();
  if(S == "zyxwvutsrqponmlkjihgfedcba") {
    printf("-1\n");
  } else if(l == 26) {
    for(int i = 25; ; --i) {
      if(S[i - 1] < S[i]) {
        for(int j = 25; ; --j) {
          if(S[i - 1] < S[j]) {
            S[i - 1] = S[j];
            break;
          }
        }
        S.resize(i);
        break;
      }
    }
    cout << S << endl;
  } else {
    for(int i = 0; i < l; ++i) x[S[i] - 'a'] = true;
    for(int i = 0; ; ++i) {
      if(!x[i]) {
        S += 'a' + i;
        break;
      }
    }
    cout << S << endl;
  }
  return 0;
}


Measured memory_bytes: 256
//                                              Question ki ma ki chut !!
#include<bits/stdc++.h>
using namespace std;
#define Going_supersonic ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(a) a.begin(),a.end()
#define allr(v) v.rbegin(),v.rend()
#define sz() size()
#define l() length()
#define ll long long int
#define Ed endl
#define iv vector<long long int>
#define bg() begin()
#define ed() end()
#define ff first
#define ss second
ll n,m,cnt,mx,mn,l,r,sm;
iv a(42);

string s,t,ans;
int main(){
    Going_supersonic
    ll T=1;
    //cin>>T;
    while(T--){
        ll i,j,k;
        cin>>s>>t;
        n=s.l();
        m=t.l();
        ll dp[n+1][m+1];
        memset(dp,-1,sizeof(dp));

        for(i=0;i<=n;i++)
        {
            for(j=0;j<=m;j++)
            {
                if(i==0||j==0)
                    dp[i][j]=0;
                else if(s[i-1]==t[j-1])
                    dp[i][j]=1+dp[i-1][j-1];
                else
                    dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
        i=n;
        j=m;
        while(i>0 && j>0)
        {
            if(s[i-1]==t[j-1])
            {
                ans+=s[i-1];
                i--;
                j--;
            }
            else
            {
                if(dp[i][j-1]>dp[i-1][j])
                    j--;
                else
                    i--;
            }
        }
        reverse(all(ans));
        cout<<ans;


    }

    return 0;
}


Measured memory_bytes: 73988
#include <bits/stdc++.h>
//登録しよう！→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
const int mod = 1000000007;
int n,ans,a=0,b=0;
std::vector<int> x;
int main(){ //srand((unsigned)time(NULL));
  cin >> n;
  x.resize(n);
  for (size_t i = 0; i < n; i++) {
    cin >> x[i];
    a+=x[i]; b+=x[i];
  }
  a /= n;
  b = roundup(b,n);
  int temp=0;
  for (size_t i = 0; i < n; i++) {
    ans += pow((x[i]-a),2);
  }
  for (size_t i = 0; i < n; i++) {
    temp += pow((x[i]-b),2);
  }
  cout << min(ans,temp) << endl;
}


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

using namespace std;

int main() {
  int n, t;
  int64_t tt;
  std::cin >> n >> tt;
  int64_t ret = tt * n;
  std::cin >> t;
  int64_t endTime = t + tt;
  while (std::cin >> t) {
    ret -= std::max(endTime - t, INT64_C(0));
    endTime = t + tt;
  }
  std::cout << ret << std::endl;
  return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
void solve(void)
{
	char str[200];
	fgets(str, sizeof(str), stdin);
	while( fgets(str, sizeof(str), stdin) != NULL ){
		printf(str);
		printf(str);
	}
}
int main(int argc, char **argv)
{
	solve();
	return 0;
}


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

int main() {
    string w;
    cin >> w;

    map<char, int> numbers;

    rep(i, w.size()) {
        numbers[w.at(i)]++;
    }

    bool isBeautiful = true;
    for (auto number : numbers) {
        if (number.second % 2 != 0) isBeautiful = false;
    }

    if (isBeautiful) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stack>
#include <cctype>
#include <algorithm>
using namespace std;
int main(void){
  stack<int> s;
  int a,b;
  string n;
  while(cin>>n){
    if(isdigit(n[0]))
      s.push(atoi(n.c_str()));
    else{
      a=s.top();
      s.pop();
      b=s.top();
      s.pop();
      if(n[0]=='+')
	b+=a;
      else if(n[0]=='-')
	b-=a;
      else if(n[0]=='*')
	b*=a;
      s.push(b);
    }
  }
  cout<<s.top()<<endl;
  return 0;
}

Measured memory_bytes: 3188
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

int const MAX_N = 210;
int const MAX_R = 1010;
int const INF = 1<<29;
ll dpl[MAX_N][MAX_N];
ll dps[MAX_N][MAX_N];
ll dp[MAX_R][MAX_N];
ll N, M, R;
int z[MAX_R];

int main() {
     
  while(cin >> N >> M && (N|M)) {
    for(int i=0; i<N; i++) {
      dpl[i][i] = dps[i][i] = 0;
      for(int j=i+1; j<N; j++) {
        dpl[i][j] = dpl[j][i] = INF;
        dps[i][j] = dps[j][i] = INF;
      }
    }
     
    for(int i=0; i<M; i++) {
      int x, y, t; char sl;
      cin >> x >> y >> t >> sl; x--, y--;
      if(sl == 'L') {
        dpl[x][y] = dpl[y][x] = t;
      }
      else {
        dps[x][y] = dps[y][x] = t;
      }
    }
     
    int R; cin >> R;
    for(int i=0; i<R; i++) {
      cin >> z[i]; z[i] --;
    }
     
    // warshall floyd
    for(int k=0; k<N; k++)
      for(int i=0; i<N; i++)
        for(int j=0; j<N; j++) {
          dpl[i][j] = min(dpl[i][j], dpl[i][k]+dpl[k][j]);
          dps[i][j] = min(dps[i][j], dps[i][k]+dps[k][j]);
        }
     
    fill(dp[0], dp[0]+MAX_R*MAX_N, INF);
    dp[0][z[0]] = 0;
    for(int i=1; i<R; i++) {
      for(int u=0; u<N; u++) {
        for(int v=0; v<N; v++) {
          dp[i][v] = min(dp[i][v], dp[i-1][u] + dpl[z[i-1]][u] + dps[u][v] + dpl[v][z[i]]);
          dp[i][v] = min(dp[i][v], dp[i-1][v] + dpl[z[i-1]][z[i]]);
        }
      }
    }
     
    cout << *min_element(dp[R-1], dp[R]) << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3484
#include <iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<cmath>
#include<set>
#include<map>
typedef long long int ll;
using namespace std;

int main(){
    string str;
    cin >> str;
    string ans;
    
    for(int i=0;i<str.size();i++){
        if(str[i]=='0'){
            ans += '0';
        }else if(str[i]=='1'){
            ans += '1';
        }else{
            if(ans.size()!=0){
                ans.pop_back();
            }
        }
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import random


d = int(input())
c = list(map(int,input().split()))
s = []

class field:
    def __init__(self):
        self.ans = [-1 for i in range(365)]
        self.last = [-1 for i in range(26)]


    def score_day(self,day,type):
        inc = s[day][type]
        dec = 0
        for i in range(26):
            dec += c[i]*(day-self.last[i])

        return  inc-dec


for i in range(d):
    arr = list(map(int,input().split()))
    s.append(arr)

best_score = 0
alloc = []

F = field()
ans = 0
good = []
childs = 5
for day in range(d):
    if day == 0:
        tp_scores = []
        for j in range(25):
            prob = j
            befl = F.last[prob]
            F.last[prob] = day
            sc = F.score_day(day, prob)
            tp_scores.append([-sc, j,F.last.copy(),str(j)])

            F.last[prob] = befl

        tp_scores.sort()
        good = tp_scores[:childs]
    else:
        tp_scores = []
        for i in range(childs):
            befs = good[i][0]
            befp = good[i][1]
            befl = good[i][2]
            befa = good[i][3]
            F.last = befl
            for j in range(25):
                prob = j
                bt = F.last[prob]
                F.last[prob] = day
                sc = F.score_day(day,prob)
                tp_scores.append([befs-sc,j,F.last.copy(),befa+","+str(j)])

                F.last[prob] = bt

        tp_scores.sort()
        good = tp_scores[:childs]

# print(good[0])


# for g in good:
#     tp = 0
#     root = list(map(int,g[-1].split(",")))
#     F = field()
#     for i in range(len(root)):
#         F.ans[i] = root[i]
#         F.last[root[i]] = i
#         tp += F.score_day(i,root[i])
#     print(root,tp)

# print("bestscore:"+str(best_score))

root = map(int,good[0][-1].split(","))

for r in root:
    print(r+1)


Measured memory_bytes: 79648
n=int(input())
def gcd(m,n):
  if m<n:
    return gcd(n,m)
  if m%n==0:
    return n
  else:
    return gcd(n,m%n)
ans=int(input())
for i in range(n-1):
  t=int(input())
  d=gcd(ans,t)
  ans*=t//d
print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=998244353;
inline int add(int a,int b){a+=b;return a>=mod?a-mod:a;}
inline int sub(int a,int b){a-=b;return a<0?a+mod:a;}
inline int mul(int a,int b){return (ll)a*b%mod;}
inline int qpow(int a,int b){int ret=1;for(;b;b>>=1,a=mul(a,a))if(b&1)ret=mul(ret,a);return ret;}
/* math */
const int N = 4e6+5;
int fac[N],ifac[N];
inline void init(int n=4e6){
	fac[0]=ifac[0]=1;for(int i=1;i<=n;i++)fac[i]=mul(fac[i-1],i);
	ifac[n]=qpow(fac[n],mod-2);for(int i=n-1;i;i--)ifac[i]=mul(i+1,ifac[i+1]);
}
inline int binom(int a,int b){
	if(b>a)return 0;
	return mul(fac[a],mul(ifac[b],ifac[a-b]));
}
int n,m;

int main()
{
	init();
	cin >> n >> m;
	int dec1=mul(n, binom(m-1+n-1,n-1));
	int dec2=0;
	for(int d=0;d<=min(n,m);d++)if((m*3-d)%2==0){
		int w=binom(n,d);
		int d2=mul(w, binom((m*3-d)/2+n-1,n-1));
		// cout << " " << (m*3-d)/2 << endl;
		// cout << d << " " << w << " " << binom((m*3-d)/2+n-1,n-1) << endl;
		dec2=add(dec2,d2);
	}
	// cout << dec1 << " " << dec2 << endl;
	cout << sub(dec2,dec1) << endl;
}

Measured memory_bytes: 31616
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

#define NR 10000
#define E 500000
#define MAX 100000

typedef struct point {
  int x, ver, length;
} GVE;

void aaaaa(int a){
  int i, count=0;
  for(i=0; i<a; i++){
    count++;
  }
}

int main(){
  GVE W[E];
  int n, i, j, g, ci, size = 0, a=10;
  int d[NR];

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d", &ci);
    scanf("%d", &g);

    for(j = 1; j <= g; j++){
      W[size].x = ci;
      scanf("%d %d", &W[size].ver, &W[size].length);
      size++;
    }
  }

  for(i = 1; i < n; i++){
    d[i]=INT_MAX;
  }
  j = 1;
  while(j){
    j = 0;
    for(i = 0; i < size; i++) {
      if(d[W[i].x] !=INT_MAX && d[W[i].x]+W[i].length < d[W[i].ver]) {
        d[W[i].ver] = d[W[i].x]+W[i].length;
        j++;
      }
    }
  }
  for(i = 0; i < n; i++){
    printf("%d %d\n", i, d[i]);
  }

  aaaaa(a);
  
  return 0;
}



Measured memory_bytes: 7608
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

int H, W;
list<long long int>ans;
int dir[5] = { 1,0,-1,0,1 };

int main() {
	ios::sync_with_stdio(false);
	cin >> W >> H;
	while (H) {
		int N;
		vector<int>x;
		vector<int>y;
		set<int>xbox;
		set<int>ybox;
		vector<int>xzip;
		vector<int>yzip;
		bool field[2005][2005] = {};
		cin >> N;
		for (int i = 0; i < N; i++) {
			int a, b, c, d;
			cin >> a >> b >> c >> d;
			x.push_back(a);
			y.push_back(b);
			x.push_back(c);
			y.push_back(d);
			xbox.insert(a);
			xbox.insert(c);
			ybox.insert(b);
			ybox.insert(d);
		}
		xbox.insert(-1);
		xbox.insert(W);
		xbox.insert(0);
		ybox.insert(-1);
		ybox.insert(H);
		ybox.insert(0);
		for (auto i : xbox) {
			xzip.push_back(i);
		}
		for (auto i : ybox) {
			yzip.push_back(i);
		}
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < xzip.size(); j++) {
				if (x[i] == xzip[j]) {
					x[i] = j;
					break;
				}
			}
		}
		for (int i = 0; i < N * 2; i++) {
			for (int j = 0; j < yzip.size(); j++) {
				if (y[i] == yzip[j]) {
					y[i] = j;
					break;
				}
			}
		}
		for (int i = 1; i < yzip.size()-1; i++) {
			for (int j = 1; j < xzip.size()-1; j++) {
				field[i][j] = true;
			}
		}
		for (int i = 0; i < N; i++) {
			for (int j = y[i * 2]; j < y[i * 2 + 1];j++) {
				for (int k = x[i * 2]; k < x[i * 2 + 1]; k++) {
					field[j][k] = false;
				}
			}
		}

		/*for (int i = yzip.size(); i >= 0; i--) {
			for (int j = 0; j < xzip.size(); j++) {
				if (field[i][j])cout << '.';
				else cout << '#';
			}
			cout << endl;
		}*/

		//cout << yzip.size() << endl;
		//cout << xzip.size() << endl;

		int box = 0;
		for (int i = 1; i < yzip.size(); i++) {
			for (int j = 1; j < xzip.size(); j++) {
				if (field[i][j]) {
					box++;
					queue<int>Q;
					field[i][j] = false;
					Q.push(i * 10000 + j);
					while (!Q.empty()) {
						int cy = Q.front()/10000;
						int cx = Q.front()%10000;
						for (int k = 0; k < 4; k++) {
							if (field[cy + dir[k]][cx + dir[k + 1]]) {
								Q.push((cy + dir[k]) * 10000 + cx + dir[k + 1]);
								field[cy + dir[k]][cx + dir[k + 1]] = false;
							}
						}
						Q.pop();
					}
				}
			}
		}
		ans.push_back(box);
		cin >> W >> H;
	}
	for (auto i : ans)cout << i << endl;
	return 0;
}

Measured memory_bytes: 7072