akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  int a,b,c,d,e,f,g=0,h=0;
  cin>>a>>b>>c;
  rep(i,b){
    cin>>d;
    if(a>d&&d<c)g++;
    if(0<d&&d>c)h++;
  }
  cout<<min(g,h);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

int main(void){
    string a, b, s;
    ll n;
    cin >> n >> s;

    if(n % 2 == 1){
        cout << "No" << endl;
        return 0;
    }

    rep(i, 0, n / 2){
        if(s[i] != s[i + n / 2]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


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

d = int(input())
C = list(map(int,input().split()))
S = [list(map(int,input().split())) for i in range(d)]
# T = [int(input()) for i in range(d)]
c = 26

ans = 0
L = [-1] * c

# for i in range(d):
#     T[i] -= 1

for i in range(d):
    ANS = [0] * c
    for k in range(c):
        ANS[k] = S[i][k] + C[k] * (i - L[k])
    ind = ANS.index(max(ANS))
    ans += S[i][ind]
    L[ind] = i
    for j in range(c):
        ans -= C[j] * (i - L[j])
    # print(ans)
    print(ind + 1)

Measured memory_bytes: 74336
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T> using Graph = vector<vector<T>>;

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define endl '\n'

const int inf = (int)1e8;

int N, M;
int a[55], b[55];
int G[55][55], X[55][55];

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  cin >> N >> M;
  rep(i, N) rep(j, N) G[i][j] = (i == j ? 0:inf);

  rep(i, M) {
    cin >> a[i] >> b[i];
    a[i]--; b[i]--;
    G[a[i]][b[i]] = 1;
    G[b[i]][a[i]] = 1;
  }

  int ans = 0;
  rep(z, M) {
    rep(i, N) rep(j, N) X[i][j] = G[i][j]; 
    X[a[z]][b[z]] = X[b[z]][a[z]] = inf;

    rep(k, N) rep(i, N) rep(j, N) X[i][j] = min(X[i][j], X[i][k] + X[k][j]);

    bool flag = true;
    rep(i, N) {
      rep(j, N) {
        if (X[i][j] == inf) {
          ans++;
          flag = false;
          break;
        }
      }
      if (!flag) break;
    }
  }

  cout << ans << endl;

  return 0;
}


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

int main() {
	int X, Y;
	scanf("%x %x", &X, &Y);

	if (X < Y) {
		cout << "<" << endl;
	} else if (X > Y) {
		cout << ">" << endl;
	} else {
		cout << "=" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <string>

using namespace std;

void solve(map<string, long long> m) {
  long long ans = 0;
  for (auto item : m) {
    ans += item.second * (item.second - 1) / 2;
  }
  printf("%lld\n", ans);
}

int main() {
  int n;
  cin >> n;
  map<string, long long> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    m[s] += 1;
  }
  solve(m);
  return 0;
}

Measured memory_bytes: 15872
#include <iostream>
#include <iomanip>
#include <cassert>

#define debug(x) cout << #x << "==" << x << endl;

typedef long long ll;

const int INF = 1e+9 + 7;

using namespace std;

//入力
#define MAX_N 100000
int N, x;
int a[MAX_N + 1];

int main() {
  ios::sync_with_stdio(false);

  cin >> N >> x;

  for(int i = 0; i < N; i++) { cin >> a[i]; }


  ll sum = 0;
  for(int i = 0; i < N-1; i++) {
    if( x < a[i] ) {
      sum += a[i] - x;
      a[i] = x;
    }
    if( x < a[i] + a[i+1] ) {
      sum += a[i+1] + a[i] - x;
      a[i+1] =  x - a[i];
    }
  }

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    ll n; cin >> n;
    ll gcdv; cin >> gcdv;
    for(ll i=1; i<n; i++){
        ll in; cin >> in;
        gcdv = __gcd(gcdv, in);
    }
    cout << gcdv << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
#define f2(i,j,k) for(int i=j;i>k;i--)
using namespace std;
int main(){
    long long x,y,ans=0;
    cin>>x>>y;
    while(x<=y){
        x*=2;
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3644
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		if(a==1&&b!=1) System.out.println("Alice");
		else if(b==1&&a!=1) System.out.println("Bob");
		else if(a>b) System.out.println("Alice");
		else if(b>a) System.out.println("Bob");
		else System.out.println("Draw");
	}
	
}


Measured memory_bytes: 35644
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication34
{
    class Program
    {
        static void Main()
        {
            string a = Console.ReadLine();
            foreach(char b in a)
            {
                if (b > 96 && b < 123) Console.Write((char)(b - 32));
                else Console.Write((char)b);
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 8820
#include<cstdio>
using namespace std;
typedef long long LL;
const int N=2003,p=1000000007;
int f[N][N],c[N*N],fc[N*N],i,j,k,n,m,K,X,z,an;

void plus(int &a,int b){ a+=b,a-=a<p?0:p; }

int power(int z,int k)
{
	int d=1;
	for (;k;z=(LL)z*z%p,k>>=1) if (k&1) d=(LL)d*z%p;
	return d;
}

int C(int n,int m)
{
	return (LL)c[n]*fc[m]%p*fc[n-m]%p;
}

int main()
{
	scanf("%d%d",&n,&K);
	if (K==1)
	{
		puts("1");
		return 0;
	}
	X=n*K;
	for (c[0]=i=1;i<=X;++i) c[i]=(LL)c[i-1]*i%p;
	for (fc[X]=power(c[X],p-2),i=X;i;--i) fc[i-1]=(LL)fc[i]*i%p;
	f[1][1]=1;
	for (i=1;i<n;++i)
		for (z=0,j=i;~j;--j)
			plus(z,f[i][j]),
			f[i+1][j+1]=(LL)z*C((i+1)*K-j-2,K-2)%p;
	for (i=1;i<=n;++i) plus(an,f[n][i]);
	printf("%d\n",(LL)an*c[n]%p);
	return 0;
}

Measured memory_bytes: 47104
#include<stdio.h>
#include<math.h>
int main(void)
{
    int a,b,C;
    double rad,h,l,S,x,PI;
    scanf("%d %d %d",&a,&b,&C);
    PI=acos(-1);
    rad=C*PI/180;
    h=b*sin(rad);
    S=(a*h)/2;
    x=(a*a)+(b*b)-2*a*b*cos(rad);
    x=sqrt(x);
    l=a+b+x;
    printf("%f\n%f\n%f\n",S,l,h);
    return 0;
}


Measured memory_bytes: 2108
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toString() }.toTypedArray()

    val bubbleSorted = bubbleSort(n, a)
    println(bubbleSorted.joinToString(" "))

    println("Stable")

    val insertionSorted = insertionSort(n, a)
    println(insertionSorted.joinToString(" "))

    val isStable = isStable(bubbleSorted, insertionSorted, n)
    if(isStable) {
        println("Stable")
    } else {
        println("Not stable")
    }
}

private fun isStable(first: Array<String>, second: Array<String>, n: Int):Boolean {
    for(i in 0 until n) {
        if(first[i] != second[i]) {
            return false
        }
    }
    return true
}

fun bubbleSort(n:Int, a: Array<String>):Array<String> {
    val copied = a.copyOf()

    var flag = true
    var i = 0
    while (flag) {
        flag = false
        for (j in n - 1 downTo i + 1) {
            if (copied[j].last().toInt() < copied[j - 1].last().toInt()) {
                var temp = copied[j]
                copied[j] = copied[j - 1]
                copied[j - 1] = temp
                flag = true
            }
        }
        i++
    }
    return copied
}

fun insertionSort(n:Int, a: Array<String>):Array<String> {
    val copied = a.copyOf()

    for (i in 0 until n) {
        var minj = i
        for (j in i + 1 until n) {
            if (copied[j].last().toInt() < copied[minj].last().toInt()) {
                minj = j
            }
        }
        if (i != minj) {
            val tmp = copied[i]
            copied[i] = copied[minj]
            copied[minj] = tmp
        }
    }

    return copied
}



Measured memory_bytes: 32556
n = int(input())
a = [int(input()) for i in range(n)]
m = max(a)

k = [i for i, x in enumerate(a) if x == m]

if len(k)>=2:
	for i in a:
		print(m)
else:
	b = []
	b += a
	mi = b.index(m)
	b.pop(mi) 
	m2 = max(b)
	for i in a:
		if i != m:
			print(m)
		else:
			print(m2)

Measured memory_bytes: 20448
#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
#define mod 1000000007
int main()
{
    ll n;
    cin>>n;
    
    ll v[n];
    ll sum[n];
    
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    
   ll ans = 0;
   sum[0] = v[0];
   for (int i = 1; i < n; i++)
   {
      sum[i] = (sum[i - 1] + v[i]);
   }
   ll sm = sum[n - 1];
   for(int i=0;i<n;i++)
   {
      ans = (ans + mod + (((sm - sum[i]) % mod) * v[i]) % mod) % mod;
   }
   cout << ans << endl;
    
    
    return 0;
}

Measured memory_bytes: 6768
class UnionFind():
	def __init__(self, n):
		self.par = [i for i in range(n + 1)]
		self.rank= [1] * (n + 1)

	def root(self, x):
		return x if self.par[x] == x else self.root(self.par[x])
	
	def same(self, x, y):
		return self.root(x) == self.root(y)

	def unite(self, x, y):
		rx = self.root(x)
		ry = self.root(y)
		if rx == ry:
			return
		if self.rank[rx] < self.rank[ry]:
			self.par[rx] = ry
		else:
			self.par[ry] = rx
			if self.rank[rx] == self.rank[ry]:
				self.rank[rx] += 1
		
			
			
x, y = map(int, raw_input().split())
g1 = [1, 3, 5, 7, 8, 10, 12]
g2 = [4, 6, 9, 11]
g3 = [2]
uf = UnionFind(12)
for i in g1:
	uf.unite(g1[0], i)
for i in g2:
	uf.unite(g2[0], i)
for i in g3:
	uf.unite(g3[0], i)

print "Yes" if uf.same(x, y) else "No"



Measured memory_bytes: 2696
#include <iostream>
#include <string>

using namespace std;

int main() {
    int h, w;
    cin >> h >> w;

    string pattern[50];
    for (int i = 0; i < h; i++) {
        cin >> pattern[i];
    }

    string newPattern[50];

    for (int i = 0; i < h; i++) {
        newPattern[i] = string(w, ' ');
        for (int j = 0; j < w; j++) {
            if (pattern[i][j] == '#') {
                newPattern[i][j] = '#';
                continue;
            }

            int bombCount = 0;
            for (int k = -1; k <= 1; k++) {
                for (int l = -1; l <= 1; l++) {
                    if (i + k < 0 || i + k >= h || j + l < 0 || j + l >= w) continue;
                    bombCount += (int)(pattern[i + k][j + l] == '#');
                }
            }

            newPattern[i][j] = '0' + bombCount;
        }
    }

    for (int i = 0; i < h; i++) {
        cout << newPattern[i] << "\n";
    }

    int a;
    cin >> a;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#define f first
#define s second

using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;
typedef pair<int,int> P;

mat mul(mat &A,mat &B){
  mat C(A.size(),vec(B[0].size()));
  for(int i=0;i<A.size();i++){
    for(int k=0;k<B.size();k++){
      for(int j=0;j<B[0].size();j++){
	C[i][j]=(C[i][j]+A[i][k]*B[k][j]);
      }
    }
  }
  return C;
} 

mat pow(mat A,ll n){
  mat B(A.size(),vec(A.size()));
  for(int i=0;i<A.size();i++)B[i][i]=1;
  while(n>0){
    if(n&1)B=mul(B,A);
    A=mul(A,A);
    n>>=1;
  }
  return B;
}

int main(void){

  int n,m,z,s,d;
  vector<P>G;

  while(cin >> n >> m >> z,n|m|z){
    G.clear();
    G.push_back(P(1,1));
    for(int i=0;i<m;i++){
      cin >> s >> d;
      G.push_back(P(s,d));
      G.push_back(P(d,s));
    }

    mat A(G.size(),vec(G.size()));
 
    for(int i=0;i<G.size();i++){
      for(int j=0;j<G.size();j++){
	if(i!=j && j && G[i].f!=G[j].s)A[i][j]=(G[i].s==G[j].f);
      }
    }
    
    A=pow(A,z);

    bool fg=false;
    for(int i=0;i<A.size();i++){
      if(G[i].s==n && A[0][i])fg=true;
    }

    if(fg)cout << "yes" << endl;
    else cout << "no" << endl;
  }
  return 0;
}

Measured memory_bytes: 1380
#include<bits/stdc++.h>
using namespace std;
//#include<ext/rope>
//using namespace __gnu_cxx
//#include<ext/pb_ds/priority_queue.hpp>
//using namespace __gnu_pbds;
#define lowbit(x) (x&-x)
#define pb push_back
#define empb emplace_back
#define all(x) (x).begin(),(x).end()
#define clr(a,b) memset(a,b,sizeof(a))
#define caze(T) for(cin>>T;T;T--)
#define inf (1<<29)
#define Endl ('\n')
#define fi first
#define se second
#define db double
#define ldb long double
#define ll long long
#define pii pair<int,int>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define ull unsigned long long
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
inline char nc() {
	#define SZ 1000000
	static char buf[SZ], *p1, *p2;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,SZ,stdin),p1==p2)?EOF:*p1++;
}
template<typename T>
inline int scan(T &x) {
	char c, sign=1; 
	while(!isdigit(c=nc())&&c!=EOF)if(c=='-')sign*=-1;
	if(c==EOF) return EOF;
	for(x = 0; isdigit(c); c = nc())
		x = (x<<1) + (x<<3) + (c&15);
	return x *= sign, 1;
}
template<typename T, typename...Args>
inline int scan(T &x, Args&...args) {
	return scan(x), scan(args...);
}
void no(){exit((cout<<-1<<Endl,0));}
int main()
{IOS;
	int n;cin>>n;
	map<ll,int>id;
	vector<ll>d(n);
	vector<int>x(n);
	vector<vector<int> >G(n);
	vector<int>sz(n,1);
	function<ll(int,int)>dfs=[&](int u,int d)
	{
		ll ret=d;
		for(auto v:G[u])
			ret+=dfs(v,d+1);
		return ret;
	};
	for(int i=0;i<n;++i)
		cin>>d[i],id[d[i]]=i;
	iota(all(x),0);
	sort(all(x),[&](const int&A,const int&B){return d[A]>d[B];});
	for(int i=0;i<n-1;++i)
	{
		int u=x[i];
		ll df=d[u]-n+2*sz[u];
		if(id.find(df)==id.end()) no();
		int fa=id[df];
		G[fa].pb(u);sz[fa]+=sz[u];
	}
	if(d[x[n-1]]!=dfs(x[n-1],0))
		no();
	for(int i=0;i<n;++i)
		for(auto c:G[i])
			cout<<i+1<<' '<<c+1<<Endl;
}

Measured memory_bytes: 17792
#include <iostream>
#include <algorithm>
using namespace std;
static const int N = 10;

int main(){
  int input[N], left[N], right[N], leftNum, rightNum;
  int T;
  cin >> T;
  while(T--){
    for(int i = 0; i < N; i++)
      cin >> input[i];
    leftNum = 0;
    rightNum = 0;
    leftNum++;
    for(int i = 1; i < N; i++){
      if(left[leftNum - 1] < input[i]){
        left[leftNum] = input[i];
        leftNum++;
      } else {
        right[rightNum] = input[i];
        rightNum++;
      }
    }
    if(is_sorted(right, right + rightNum)){
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}

Measured memory_bytes: 1152
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int answer = 0;
		int hp = sc.nextInt();
		int attack = sc.nextInt();

		while(hp > 0) {
			hp -= attack;
			answer++;
		}

		System.out.println(answer);
	}
}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define mat vector<vector<double>>
const int inf = 1 << 30;
const ll linf = 1e18;
const db EPS = 1e-7;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

string S, T;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> S >> T;
    cout << T << S << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma warning (disable:4996)
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int z=0;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		int j;
		for (j = 0; ; j++)
		{
			if (a % 2 == 0)a = a / 2;
			else break;
		}
		//if (j > z)z = j;
		z += j;
	}
	cout << z << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1}; 
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int ddy[8] = {-1,0,1,-1,1,-1,0,1};
int ddx[8] = {-1,-1,-1,0,0,1,1,1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++) 
#define INF 999999999999
const double PI = acos(-1.0); 
ll n,m,k;
ll a[200000];
ll b[200000];
ll ans;
ll ret;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n >> m >> k;
    rep1(i,0,n) cin >> a[i];
    rep1(i,0,m) cin >> b[i];
    int i = 0,j = 0;

    while(j < m && ret + b[j] <= k) ret += b[j++];
    ans = j;
    while(i < n){
        ret += a[i++];
        while(ret > k && j > 0) ret -= b[--j];
        if(ret <= k) ans = max(ans, (ll)i + j);
    }
    cout << ans;
    return 0;  
}

Measured memory_bytes: 6748
import java.util.*;

class Main {
public static void main(String args[]) {
  Scanner sc = new Scanner(System.in);
  
  int N = sc.nextInt();
  int A[] = new int[N];
  int B[] = new int[N];
  for(int i = 0;i < N;i++) {
    A[i] = sc.nextInt();
    B[i] = sc.nextInt();
  }
  
  
  Dish d[] = new Dish[N];
  
  for(int i = 0;i < N;i++) {
  	d[i] = new Dish(A[i],B[i],i);
  }
  


  quick_sort(d,0,N - 1);
  

  long tSum = 0;
  long aSum = 0;
  for(int i = N - 1;i >= 0;i = i - 2){
    tSum += A[d[i].I];
  }

  for(int i = N - 2;i >= 0;i = i - 2){
    aSum += B[d[i].I];
  }
  
  
  System.out.println(tSum - aSum);
}
  
  
  
  
  static void quick_sort(Dish[] d, int left, int right) {
        if (left >=right) {
            return;
        }
        int p = d[(left+right)/2].SUM;
        int l = left, r = right;
    	Dish tmp;
        while(l<=r) {
            while(d[l].SUM < p) { l++; }
            while(d[r].SUM > p) { r--; }
            if (l<=r) {
                tmp = d[l]; d[l] = d[r]; d[r] = tmp;
                l++; r--;
            }
        }
        quick_sort(d, left,r );  
        quick_sort(d, l, right);
    }
  
}

class Dish {
  int A;
  int B;
  int SUM;
  int I;
  
  Dish(int A,int B,int I){
    this.A = A;
    this.B = B;
    this.SUM = A + B;
    this.I = I;
  }
}

Measured memory_bytes: 64464
#include<stdio.h>
int main(void)
{
	int x,y,flg1,flg2;
	scanf("%d %d",&x,&y);

	flg1=0;  flg2=0;
	if(x==1 || x==3 ||x==5 ||x==7 || x==8 || x==10 || x==12)  flg1=1;
	else if(x==4 || x==6 ||x==9 || x==11)  flg1=2;
	else if(x==2)  flg1=3;
	if(y==1 || y==3 ||y==5 ||y==7 || y==8 || y==10 || y==12)  flg2=1;
	else if(y==4 || y==6 ||y==9 || y==11)  flg2=2;
	else if(y==2)  flg2=3;
	if(flg1==flg2)  printf("Yes\n");
	else  printf("No\n");
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define M  1000005
#define LL long long
using namespace std;
int A[M],B[M],C[M];
bool cmp(int a,int b){
	return a>b;
}
int main(){
	int x,y,a,b,c;
	cin>>x>>y>>a>>b>>c;
	for(int i=0;i<a;i++)scanf("%d",&A[i]);
	for(int i=0;i<b;i++)scanf("%d",&B[i]);
	for(int i=0;i<c;i++)scanf("%d",&C[i]);
	sort(A,A+a,cmp);
	sort(B,B+b,cmp);
	for(int i=x;i<x+y;i++)A[i]=B[i-x];
	sort(A,A+x+y); 
	LL ans=0,s0=0,s1=0,tmp=0;
	for(int i=0;i<x+y;i++)
		ans+=A[i];
	sort(C,C+c,cmp);
	for(int i=0;i<min(c,x+y);i++){
		s0+=A[i];
		s1+=C[i];
		if(s0<s1){
			tmp=max(tmp,s1-s0);
		}else break;
	}
	cout<<ans+tmp<<endl;
	return 0;
}

Measured memory_bytes: 8832
#include "bits/stdc++.h"
using namespace std;
int main(){
    int n,i;
    double x,ans=0;
    string u;
    cin >> n;
    for(i=0;i<n;i++){
        cin>>x>>u;
        if(u=="JPY") ans += x;
        else ans += x*380000.0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

main(){
  int i, r, l, m, rs, rt, S[100000], T[50000],c = 0;

  scanf("%d", &rs);
  for(i = 0;i < rs;i++) scanf("%d", &S[i]);

  scanf("%d", &rt);
  for(i = 0;i < rt;i++) scanf("%d", &T[i]);

  for(i = 0;i < rt;i++){
    r = rs + 1;
    l = 0;
    while(l < r){
      m = (r + l - 1) / 2;
      if(T[i] < S[m]) r = m;
      else if(T[i] > S[m]) l = m + 1;
      else if(T[i] == S[m]){
	c++;
	break;
      }
    }
  }
  printf("%d\n", c);
  return 0;
}

Measured memory_bytes: 1184
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String s = sc.next();

        boolean ans = false;

        //        for (int i = 0; i < n; i++) {
        //
        //        }

        String str = s.replace("R", "");

        int num = s.length() - str.length();

        if ((n / 2) < num)
            ans = true;

        sc.close();

        System.out.println(ans ? "Yes" : "No");

    }
}

Measured memory_bytes: 21588
#include<stdio.h>

int countPrimeNum (int n) {
	int numbers[1000000] = {1};
	int count = 0;
	int i , s;
	numbers[2] = 0;
	for(i = 2; i <= n; i++) {
		if (numbers[i] == 0) {
			for(s = i * 2; s <= n; s += i) {
				numbers[s] = 1;
			}
		}
	}

	for(i = 2; i <= n; i++) {
		if (numbers[i] == 0) {
			count++;
		}
	}
	return count;
}

int main () {
	int n;
	while(scanf("%d" , &n) > 0) {
		printf("%d\n" , countPrimeNum(n));
	}
	return 0;
}

Measured memory_bytes: 4508
// B
#include<bits/stdc++.h>
#define pb push_back 
#define mp make_pair
using namespace std;

const int maxn=65;
typedef long long ll;

int n,m,ans;

char s[5][65];

ll f[65];
ll mod=1000000007;

int main()
{
/* 
#ifndef LOCAL
	freopen("","r",stdin);
	freopen("","w",stdout);
#endif*/

	int i,j,k,T;
	scanf("%d",&n);
	scanf("%s%s",s[0]+1,s[1]+1);
	
	int pre;
	
	i=1;
	if(s[0][i]==s[1][i])
	{
		f[i]=3;
		pre=1;
		i++;
	}
	else
	{
		f[i+1]=6;
		pre=2;
		i+=2;
	}
	
	for(;i<=n;++i)
	{
		if(s[0][i]==s[1][i])
		{
			if(pre==1)
			  f[i]=f[i-1]*2;
			else f[i]=f[i-1];
			f[i]%=mod;
			pre=1;
		}
		else
		{
			if(pre==1)
			  f[i+1]=f[i-1]*2;
			else f[i+1]=f[i-1]*3;
			f[i+1]%=mod;
			pre=2;
			i++;
		}
	}
	
	printf("%lld",f[n]);
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define endl '\n'
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define mod 10000007
#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define REP(i,a,b) for(ll i=a;i<b;i++)

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

int main() {
    FASTIO
    int n,a=0,w=0,r=0,t=0;
    cin>>n;
    string s;
    REP(i,0,n){
      cin>>s;
      if(s=="AC") a++;
      else if(s=="WA") w++;
      else if(s=="TLE") t++;
      else if(s=="RE") r++;
    }
    cout<<"AC x "<<a<<endl<<"WA x "<<w<<endl<<"TLE x "<<t<<endl<<"RE x "<<r<<endl;
    return 0;
}


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

#define INF -1

int main()
{

	int h,w;
	cin >> h >> w;
	vector<vector<char> > map(h,vector<char>(w,'.'));
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			cin >> map[i][j];
	vector<vector<int> > dis(h,vector<int>(w,INF));

	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			if(map[i][j]=='#')dis[i][j]=0;
	
	for(int i=0;i<h;i++)
	{
		int bef=INF;
		for(int j=0;j<w;j++)
		{
			if(bef!=INF)
			{
				if(dis[i][j]!=INF)
					dis[i][j]=min(dis[i][j],bef+1);
				else dis[i][j]=bef+1;
			}
			bef=dis[i][j];
		}
	}

	for(int i=0;i<h;i++)
	{
		int bef=INF;
		for(int j=w-1;j>=0;j--)
		{
			if(bef!=INF)
			{
				if(dis[i][j]!=INF)
					dis[i][j]=min(dis[i][j],bef+1);
				else dis[i][j]=bef+1;
			}
			bef=dis[i][j];
		}
	}
	for(int i=0;i<w;i++)
	{
		int bef=INF;
		for(int j=0;j<h;j++)
		{
			if(bef!=INF)
			{
				if(dis[j][i]!=INF)
					dis[j][i]=min(dis[j][i],bef+1);
				else dis[j][i]=bef+1;
			}
			bef=dis[j][i];
		}
	}

	for(int i=0;i<w;i++)
	{
		int bef=INF;
		for(int j=h-1;j>=0;j--)
		{
			if(bef!=INF)
			{
				if(dis[j][i]!=INF)
					dis[j][i]=min(dis[j][i],bef+1);
				else dis[j][i]=bef+1;
			}
			bef=dis[j][i];
		}
	}

	int ans=0;

	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			ans=max(ans,dis[i][j]);

	cout << ans << endl;

		

}

Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}



struct Combinations {
  static int num;
  vi fact,factr,inv;

  Combinations(int num) {

    fact.assign(num+1,0);
    factr.assign(num+1,0);
    inv.assign(num+1,0);
    inv[1]=fact[0]=factr[0]=1;
    FOR(i,2,num+1) inv[i]=inv[M%i]*(M-M/i)%M;
    FOR(i,1,num+1) fact[i]=fact[i-1]*i%M,factr[i]=factr[i-1]*inv[i]%M;
  }


  int comb(int n,int c){
    if(c<0||c>n) return 0;
    return factr[c]*fact[n]%M*factr[n-c]%M;
  }

  int per(int n,int c){
    if(c<0||c>n) return 0;
    return fact[n]*factr[n-c]%M;
  }

  int hcomb(int n,int c){
    if(n==0&&c==0) return 1;
    return comb(n+c-1,c);
  }

};

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

  int n,k;
  cin>>n>>k;
  Combinations comb(k);
  cout<<comb.per(k,n)<<endl;


}


Measured memory_bytes: 3232
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N, K;
    cin >> N >> K;
    int V[N];
    for(int i=0;i<N;i++)
        cin >> V[i];

    vector<int> p, n;
    int max = 0, value;
    // 1~K(=i)個取る
    for(int i=1;i<=min(N,K);i++){
        // (l,r) = {(i,0), (i-1,1),..., (0,i)}
        int l, r;
        for(int j=0;j<=i;j++){
            l = i-j;
            r = j;
            for(int k=0;k<l;k++){
                if(V[k] >= 0)
                    p.push_back(V[k]);
                else
                    n.push_back(V[k]);
            }
            for(int k=0;k<r;k++){
                if(V[N-1-k] >= 0)
                    p.push_back(V[N-1-k]);
                else
                    n.push_back(V[N-1-k]);
            }
            // 負の価値を戻す
            sort(n.begin(), n.end());
            for(int k=0;k<(K-i);k++){
                if(k < n.size())
                    n[k] = 0;
            }
            // 結果の計算
            value = 0;
            for(int k=0;k<p.size();k++)
                value += p[k];
            for(int k=0;k<n.size();k++)
                value += n[k];
            if(value > max)
                max = value;
            p.erase(p.begin(), p.end());
            n.erase(n.begin(), n.end());     
        }

    }
    
    cout << max << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for(Int i = 0; i < (Int)(n); ++i)

int main() {
   Int v, e, r;
   std::cin >> v >> e >> r;
   std::vector<Int> ss(e), ts(e), ds(e);
   rep(i, e) std::cin >> ss[i] >> ts[i] >> ds[i];
   const Int inf = (Int)1 << 53;
   std::vector<Int> xs(v, inf);
   xs[r] = 0;
   std::vector<bool> ys(v, false);
   ys[r] = true;
   for(Int i = 0; i < v; ++i) {
      for(Int k = 0; k < e; ++k) {
         Int s = ss[k], t = ts[k], d = ds[k];
         xs[t] = std::min(xs[t], xs[s] + d);
         if( ys[s] ) ys[t] = true;
      }
   }
   bool negativeCycle = false;
   rep(k, e) {
      Int s = ss[k], t = ts[k], d = ds[k];
      if( ys[s] and ys[t] and xs[s] + d < xs[t] ) negativeCycle = true;
   }
   if( negativeCycle ) {
      puts("NEGATIVE CYCLE");
   }
   else {
      rep(i, v) {
         if( ys[i] ) {
            printf("%ld\n", xs[i]);
         }
         else {
            puts("INF");
         }
      }
   }
}

Measured memory_bytes: 3252
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    int D, N;
    cin >> D >> N;
    int ans = 0;
    if (N==100)ans = pow(100,D)*(N+1);
    else ans = pow(100,D)*N;

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

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<vector>
#include<functional>
using namespace std;
typedef long long ll;
//typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N,M,V,P;
ll A[100010];
bool Able_UnderL(vector<ll>& v,ll b,ll L){
    ll nowRemain=b*M;
    for(auto o:v){
      nowRemain -= max(0ll,min(L-o,M));
    }
    return nowRemain<=0 ;
}

bool Check(ll i){
  if(i>=N)return false;

  if(A[i]+M<A[P-1]){
    return false;
  }
  vector<ll> v;
  ll topOfSameAsI;
  for(ll j=P-1;j<N;j++){
    if(A[j]==A[i]){
      topOfSameAsI=j;
      break;
    }
    v.push_back(A[j]);
  }
  return Able_UnderL(v,V-P-(N-1-topOfSameAsI),A[i]+M);
}

ll binarySearch(function<bool(ll)> check, ll ok, ll ng) {
  while ((ok - ng > 1) || (ng - ok > 1)) {
    ll mid = (ok + ng) / 2;
    if (check(mid)) ok = mid;
    else ng = mid;
  }
  return ok;
}
int main(){
    cin>>N>>M>>V>>P;
    for(ll i=0;i<N;i++){
      cin>>A[i];
    }sort(A,A+N,greater<ll>());
    cout<<binarySearch(Check,0ll,N)+1<<endl;
    return 0;
}

Measured memory_bytes: 2812
package main

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

var sc = bufio.NewScanner(os.Stdin)

// var rdr = bufio.NewReaderSize(os.Stdin, 100000)
var rdr *bufio.Reader

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	solve()
}

func solve() {
	const mod = 1000000007
	n := nextInt()
	m := nextInt()
	isBroken := make([]bool, n+1)
	for i := 0; i < m; i++ {
		isBroken[nextInt()] = true
	}

	dp := make([]int64, n+2)
	dp[0] = 1
	for i := 0; i < n; i++ {
		if isBroken[i] {
			continue
		}

		dp[i+1] = (dp[i+1] + dp[i]) % mod
		dp[i+2] = (dp[i+2] + dp[i]) % mod
	}

	ans := dp[n]
	fmt.Println(ans)
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextI64() int64 {
	sc.Scan()
	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func max(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func maxi64(a int64, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func updateMax(a *int, b int) {
	if *a < b {
		*a = b
	}
}

func min(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

func mini64(a int64, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func updateMin(a *int, b int) {
	if *a > b {
		*a = b
	}
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absi64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func anser(b bool, y string, n string) string {
	if b {
		return y
	}
	return n
}

Measured memory_bytes: 1792
//------------------------------------------
// C++ templete 
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

//REPEAT
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

//grobal variable
//------------------------------------------
int N,M;
VI Vec;

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int N; cin>>N;
    VI h(N); 
    REP(i, N) cin>>h.at(i);

    VI dp(N, INF);
    dp.at(0) = 0;

    FOR(i, 1, N)
    {
        chmin(dp.at(i), dp.at(i-1)+abs(h.at(i)-h.at(i-1)));
        if (i>1) chmin(dp.at(i), dp.at(i-2)+abs(h.at(i)-h.at(i-2)));
    }
    
    cout << dp.back() << endl;
    return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define x first
#define y second
#define mp make_pair
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(),x.end()
#define show(x) cout<<(#x)<<" is "<<(x)<<endl

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const ll INF=1e18+123;
const ld EPS=1e-9;
const int inf=1e9+123;
const int MOD=1e9+7;
const int N=1e5+123;
const int dx[]={0,0,1,-1};
const int dy[]={1,-1,0,0};

int a[N],s1[N],s2[N];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin>>n;
    vector<int>m1,m2;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(i&1){
            s1[a[i]]++;
        }
        else{
            s2[a[i]]++;
        }
    }
    int q=0;
    multiset<int>s;
    for(int i=1;i<N;i++){
        s.insert(s1[i]);
    }
    for(int i=1;i<N;i++){
        s.erase(s.find(s1[i]));
        q=max(q,s2[i]+*s.rbegin());
        s.insert(s1[i]);
    }
    cout<<n-q;
    return 0;
}


Measured memory_bytes: 6144
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int f,q,x;

  string s,l,r;

  multimap<string,int>m;
  multimap<string,int>::iterator it1,it2;
  cin>>q;
  while(q--){
    cin>>f;

    if(f==0){
      cin>>s;
      cin>>x;
     m.insert(make_pair(s,x));
    }
    else if(f==1){
      cin>>s;
    it1=m.lower_bound(s);
      it2=m.upper_bound(s);
      for(;it1!=it2;it1++)
        cout<<(*it1).second<<endl;


    }
    else if(f==2){
      cin>>s;
    m.erase(s);

    }

    else{
      cin>>l>>r;
      it1=m.lower_bound(l);
      it2=m.upper_bound(r);
      for(;it1 !=it2;it1++)
        cout<<(*it1).first<<' '<<(*it1).second<<endl;
    }
  }
return 0;
}


Measured memory_bytes: 24740
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  std::string S, T;

  std::cin >> S >> T;

  int c = 0;

  for (int i = 0; i < 3; i ++)
    if (S[i] == T[i])
      c ++;

  std::cout << c << std::endl;

  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	string s; cin >> s;
	rep(i, 0, s.size()) {
		if (s[i] == ',')cout << " ";
		else cout << s[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 384
package main

import "fmt"

func main() {
	list := []int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
	var index int
	fmt.Scan((&index))
	fmt.Println(list[index-1])
}


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

int main() {
  string a, b;
  cin >> a >> b;
  string S = a + b;
  int N = stoi(S);
  bool ans = false;
  for (int i = 1; i <= N; i++) {
    if (i * i == N) {
      ans = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())


# nの約数列挙
def divisor(n):
    ass = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass  # sortされていない


div_n = divisor(N)
div_n1 = divisor(N - 1)

ans = []
for d in div_n:
    if d == 1:
        continue
    n = N
    while n % d == 0:
        n //= d

    if n % d == 1 or n == 1:
        ans.append(d)

for d in div_n1:
    if d == 1:
        continue
    if N % d == 0:
        nd = N // d
        if nd % d == 1 or nd % d == 0:
            ans.append(d)
    else:
        ans.append(d)


ans = list(set(ans))
# print(ans)
print(len(ans))


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

struct process{
	string name;
	int time_ms;
};

int main() {
	int n,q,time_temp;
	string name_temp;
	queue<process> Process_Begin,Process_EndLog;
	process process_temp;
	
	cin >> n >> q;
	
	for(int i = 0;i < n;i++){
		cin >> name_temp >> time_temp;
		Process_Begin.push(process{
			name_temp,
			time_temp});
	}
	
	time_temp = 0;
	
	while(Process_Begin.empty() != true){
		process_temp = Process_Begin.front();
		
		if(process_temp.time_ms - q <= 0){
			time_temp += process_temp.time_ms;
			Process_EndLog.push(process{
				process_temp.name,
				time_temp
			});
		}else{
			time_temp += q;
			process_temp.time_ms -= q;
			Process_Begin.push(process{
				process_temp.name,
				process_temp.time_ms
			});
		}
		Process_Begin.pop();
	}
	
	while(Process_EndLog.empty() != true){
		process_temp = Process_EndLog.front();
		Process_EndLog.pop();
		cout << process_temp.name << " " << process_temp.time_ms << endl;
	}
	
	return 0;
}

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

using namespace std;

struct Edge {
	int to, cost, time;
	Edge(int _t, int _c, int _ti) : to(_t), cost(_c), time(_ti) {}
};

bool operator > (const Edge& e1, const Edge& e2) {
	if (e1.cost > e2.cost) return true;
	if (e1.cost == e2.cost) {
		if (e1.time > e2.time) return true;
		if (e1.to > e2.to) return true;
	}
	return false;
}

int n, m, k;
vector< vector<Edge> > G;

int INF = (int)1e9;
int dist[110];

int dks(int s, int t, int r) {
	fill(dist, dist + 110, INF);
	
	priority_queue<Edge, vector<Edge>, greater<Edge> > que;
	que.push(Edge(s, 0, 0));
	
	while (!que.empty()) {
		Edge e1 = que.top(); que.pop();
		
		for (int i = 0; i < (int)G[e1.to].size(); i++) {
			Edge e2 = G[e1.to][i];
			
			if (r%2) {
				if (dist[e2.to] > e1.time + e2.time) {
					dist[e2.to] = e1.time + e2.time;
					que.push(Edge(e2.to, 0, e1.time + e2.time));
				}
			} else {
				if (dist[e2.to] > e1.cost + e2.cost) {
					dist[e2.to] = e1.cost + e2.cost;
					que.push(Edge(e2.to, e1.cost + e2.cost, 0));
				}
			}
		}
	}
	
	return dist[t];
}

int main() {
	while (1) {
		cin >> n >> m; if (n==0 && m==0) break;
		
		G.assign(n, vector<Edge>());
		
		for (int i = 0; i < n; i++) {
			int a, b, c, t; cin >> a >> b >> c >> t;
			a--; b--;
			G[a].push_back(Edge(b, c, t));
			G[b].push_back(Edge(a, c, t));
		}
		
		cin >> k;
		
		for (int i = 0; i < k; i++) {
			int p, q, r; cin >> p >> q >> r;
			p--; q--;
			cout << dks(p, q, r) << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 1452
A,B,K = list(map(int,input().split()))

def solve():
    m = min(A,B)
    count = 0
    res = []
    for i in range(1,m+1):
        if A % i == 0 and B % i == 0:
            count += 1
            res.append(i)
    res.reverse()
    print(res[K-1])

solve()

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

typedef long long LL;

const LL mod = 1000000007;
const int maxn = 100000 + 10;

LL fac[maxn * 2] = {1};
LL inv[maxn * 2] = {1};

LL pow_mod(LL a, LL p, LL m) {
	LL ret = 1;
	for (; p; p >>= 1, a = a * a % m)
		if (p&1) ret = ret * a % m;
	return ret % m;
}

int main() {

  for (int i = 1; i < maxn * 2; ++i) {
    fac[i] = fac[i - 1] * i % mod;
    inv[i] = pow_mod(fac[i], mod - 2, mod);
  }

  LL h, w, a, b;
  scanf("%lld%lld%lld%lld", &h, &w, &a, &b);

  LL x = h - a;
  LL y = 1 + b;

  LL ans = 0;
  LL dx, dy;
  while (x >= 1 && y <= w) {
    dx = x - 1;
    dy = y - 1;
    LL a = (fac[dx + dy] * inv[dx] % mod) * inv[dy] % mod;
    
    dx = h - x;
    dy = w - y;
    LL b = (fac[dx + dy] * inv[dx] % mod) * inv[dy] % mod;
    ans = (ans + (a * b % mod)) % mod;
    x--;
    y++;
  }

  printf("%lld\n", ans);
  return 0;
}


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

using namespace std;

int main() {
	string s,t;
	cin >> s;
	int i = 1;
	for (int i = 0; i < s.length(); i += 2) {
		t += s[i];
	}
	cout << t << endl;
	return 0;
}

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

#define MAX_N 100000

using namespace std;

typedef long long lint;

int n, m;

lint add[MAX_N + 1];
lint cost[MAX_N + 1];
int tata[MAX_N + 1];

vector <int> g[MAX_N + 1];

void adda(int a, int b)
{
    g[a].push_back(b);
}

struct elem
{
    int a, b, need, i;
};

struct cmp
{
    bool operator() (const elem &a, const elem &b) const
    {
        return (a.need < b.need);
    }
};

elem v[MAX_N + 1];

int getTata(int a)
{
    return (tata[a] < 0 ? a : tata[a] = getTata(tata[a]));
}

int main()
{
    cin >> n >> m;

    int i;
    for(i = 1; i <= n; i ++)
    {
        cin >> v[i].a >> v[i].b;
        v[i].need = v[i].a - v[i].b;
        v[i].i = i;
    }

    int a, b;
    for(i = 1; i <= m; i ++)
    {
        cin >> a >> b;

        adda(a, b);
        adda(b, a);
    }

    sort(v + 1, v + n + 1, cmp());

    tata[0] = -1;
    for(i = 1; i <= n; i ++)
    {
        int cr = v[i].i;
        cost[cr] = v[i].b;
        add[cr] = max(0, v[i].need);
        tata[cr] = -1;
      //  cout << cr << " " << cost[cr] << "++++++++\n";

        for(auto u : g[cr])
        {
            int t = getTata(u);
            if(t != 0 && t != cr)///If t == 0 the vertex is on an upper level and if t == v[i].i the vertex has already been used, cause we work only with the old root of it's subtree
            {
             //   cout << "BAGA PE " << t << " " << cost[t] << "\n";
                u = t;
                tata[u] = cr;
                cost[cr] += cost[u];
                add[cr] = min(add[cr], max(add[u], v[i].need - cost[u]));///First time we donate to cr then to u, so we have as an extra all its cost or his need
            }
        }
    }

    cout << cost[v[n].i] + add[v[n].i] << "\n";

    return 0;
}


Measured memory_bytes: 9468
#include<bits/stdc++.h>
using namespace std;
int main(){
  int ans;
  int R,G,B,N,r,g;
  cin>>R>>G>>B>>N;
  for(int r=0;r<=N/R;r++){
    for(int g=0;g<=N/G;g++){
      int O=N-(r*R+g*G);
      if(O>=0 && O%B==0){
        ans++;
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;
using static AtCoderTemplate.MyLibrary;

namespace AtCoderTemplate
{
    class Program
    {
        static void Main (string[] args)
        {
            string[] str;
            str = Console.ReadLine ().Split (' ');

            int N = int.Parse (str[0]);

            long ans = 0;
            for (int i = 1; i <= N; i++)
            {
                if (i % 3 == 0) continue;
                if (i % 5 == 0) continue;
                ans += i;
            }

            Console.Write (ans);
        }
    }

    class MyLibrary
    {

        // 自作の関数
        public static int MyFunction (int n)
        {
            return 0;
        }
    }
}

Measured memory_bytes: 27524
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let a: Vec<f64> = sc.vec(n);
    let all = a.iter().fold(1.0, |p, e| p * *e);
    let mut sum = 0.0;
    for i in 0..n {
        sum += all / a[i];
    }
    println!("{}", all / sum);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352