akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

#define debug(var)  do{ std::cout << #var << " : "; view(var); }while(0)
using ll = long long;
using ld = long double;
inline int num (const std::string& S, int idx) noexcept { return S.at(idx) - '0'; }
inline int ctoi(char c) noexcept { return c - '0'; }
inline bool isNumber(char c) noexcept { return ('0'<c && c<'9'? true : false); }
inline int safeCtoi(char c) { if(isNumber(c)) { return ctoi(c); } else { throw 1; } }
inline char itoc(int i) noexcept { return i + '0'; }
inline unsigned int bitMask(int i) noexcept { return (1 << i); }
inline bool isTrue(unsigned int bit, int i) noexcept { return bit & bitMask(i); }
inline bool isEven(int num) noexcept { return !num%2; }
inline bool isOdd(int num) noexcept { return num%2; }
template<typename T> inline short sgn(T num) noexcept { return (num==0? 0 : (num>0? 1 : -1) ); }
template<typename T> inline bool isZero(T num) noexcept { return (num==0? true : false); }
template<typename T> inline bool isPositive(T num) noexcept { return (num>0? true : false); }
template<typename T> inline bool isNegative(T num) noexcept { return (num<0? true : false); }
template<typename T> void view(T e) noexcept { cout << e; }
template<typename T> void view(std::vector<T> v) noexcept { for(const auto& e : v) cout << e << " "; }
template<typename T> void view(std::vector<std::vector<T>> vv) noexcept { for(const auto& v : vv) view(v); }


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	double r;
	cin >> r;
	cout << 2 * M_PI * r << endl;
	return 0;
}


Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
using vl=vector<ll>;
using vb=vector<bool>;
using vs=vector<string>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
const ll oo =0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORD(i,a,b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })
int main(){ cin.sync_with_stdio(0);
	ll N; cin >> N;

	set<pll> edges;

	ll S;
	if (N % 2 == 0) S = N+1;
	else S = N;
	FOR(i, 1, N+1) {
		FOR(j, 1, N+1) {
			if (i == j) continue;
			if (i + j == S) continue;
			edges.insert({min(i,j),max(i,j)});
		}
	}
	cout << sz(edges) << endl;
	for (pll e : edges) {
		cout << e.xx << " " << e.yy << "\n";
	}
} //cin.tie(0) bei schnellem Wechseln


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

using namespace std;
const int INF = 1e9;

int main(){
    int N,K;
    cin >> N >> K;

    vector<int> heights(N);
    for(int i=0; i<N; i++)cin >> heights.at(i);

    vector<int> dp(N, INF);
    dp.at(0) = 0;
    for(int i=1; i<N; i++){
        for(int j=max(0, i-K); j<i; j++)dp.at(i) = min(dp.at(i), dp.at(j) + abs(heights.at(j) - heights.at(i)));
    }

    cout << dp.at(N-1) << endl;
}

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

int N;
int a[100];

int main() {
    int minv = 1e7;

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

    for (int y = -100; y <= 100; y++) {
        int cost = 0;
        for (int i = 0; i < N; i++) {
            int t = a[i] - y;
            cost += t * t;
        }
        minv = min(minv, cost);
    }
    cout << minv << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <unordered_set>
#include <set>
#include <cstring>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>

using namespace std;

using ll = long long;
const ll INF = 1e18 + 1;




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

    ll n;
    cin >> n;
    if (n >= 30) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }


}

Measured memory_bytes: 3128
def f(n) 1<<n.to_s(2).size end
a,b=$<.map &:to_i
(p 1;exit)if 0==x=a^b
c=f(x)
a&=c-1
b&=c-1
i=c>>1
b=b-i>0?(f(b-i))-1:0
p c-a-[a-1-b,0].max

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

#define INF 1000000007
#define LINF 1000000000000000007

using namespace std;

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

Int gcd(Int x, Int y){
	if(y == 0)
		return x;
	return gcd(y, x % y);
}

Int lcm(Int x, Int y){
	return x * y / gcd(x, y);
}

bool sosuu(int x){
	bool b = 1;
	if(x == 1) b = 0;
	for(int i = 2; i * i <= x; i++){
		if(x % i == 0) {
			b = 0;
			break;
		}
	}
	return b;
}

int a,b;

int main(){
	cin >> a >> b;
	
	if((b - a) % 2 == 0 && a < 0 && b < 0) cout << "Negative" << endl;
	else if(a > 0 && b > 0 || a < 0 && b < 0) cout << "Positive" << endl;
	else cout << "Zero" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    bool cards[4][13];
    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < 13; ++j) {
            cards[i][j] = false;
        }
    }
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        char c;
        int a;
        cin >> c >> a;
        int ci = 0;
        if (c == 'S') ci = 0;
        else if (c == 'H') ci = 1;
        else if (c == 'C') ci = 2;
        else if (c == 'D') ci = 3;
        if (a <= 13) {
            cards[ci][a - 1] = true;
        }
    }
    
    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < 13; ++j) {
            if (!cards[i][j]) {
                char c = '\0';
                if (i == 0) c = 'S';
                else if (i == 1) c = 'H';
                else if (i == 2) c = 'C';
                else if (i == 3) c = 'D';
                cout << c << " " << j + 1 << endl;
            }
        }
    }
    return 0;
}



Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 	int h,w;cin>>h>>w;
  	vector<vector<char>> s(h,vector<char>(w));//元のデータ
  	vector<vector<char>> t(h,vector<char>(w));//行を除いたデータ
  	vector<vector<char>> u(h,vector<char>(w));//列を除いたデータ
  	int nh=0,nw=0;
  
  	//データをsに格納する。
  	for(int i=0;i<h;i++){
    	for(int j=0;j<w;j++){
        	cin>>s.at(i).at(j);
        }
    }
  	
  //wの行....分を移行せずにコピー
 	 for(int i=0;i<h;i++){
       bool a=false;
    	for(int j=0;j<w;j++){
        	if(s.at(i).at(j)=='#') a=true;
        }
       
       if(a){
       		for (int k=0;k<w;k++){
        		t.at(nh).at(k)=s.at(i).at(k);
        	}
         nh++;
       }
    }
        
   //hの列....分を移行せずにコピー
 	 for(int i=0;i<w;i++){
       bool a=false;
    	for(int j=0;j<nh;j++){
        	if(t.at(j).at(i)=='#') a=true;
        }
       
       if(a){
       		for (int k=0;k<nh;k++){
        		u.at(k).at(nw)=t.at(k).at(i);
        	}
         nw++;
       }
    }
  
  	for(int i=0;i<nh;i++){
    	for (int k=0;k<nw;k++){
        		cout<<u.at(i).at(k);
        	}
      cout<<endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=3e3+10;
const ll mod=998244353;
ll dp[maxn][maxn];

int main(){
	memset(dp,0,sizeof(dp));
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	dp[a][b]=1ll;
	for(ll i=1;i<=c+1;i++){
		for(ll j=1;j<=d+1;j++){
			dp[i][j]+=dp[i][j-1]*i%mod;
			dp[i][j]+=dp[i-1][j]*j%mod;
			dp[i][j]%=mod;
			dp[i][j]-=dp[i-1][j-1]*(i-1)*(j-1)%mod;
			dp[i][j]=(dp[i][j]+mod)%mod;
		}
	}
	cout<<dp[c][d]<<endl;
	return 0;
}

Measured memory_bytes: 74320
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>
#include <list>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
#define dbgv(x) cout<<#x<<endl;reps(y,x){cout<<y<<" ";}cout<<endl

int main(){
  string a,b;cin>>a>>b;
  ll c=stoi(a+b);
  if(pow(ll(sqrt(c)),2)==c){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
/*
 *
 * link : https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/7f30c9c/
 * */
public class Main {
    final static long MOD = 1000000007;

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int n = fs.nextInt();
        long a[] = fs.nextLongArray(n);

        long dp[] = new long[n+1];

        dp[0] = 0;

        for(int i = 1; i < n; i++) {
            dp[i] = i > 1 ?  Math.min(dp[i-1]+Math.abs(a[i-1] - a[i]), dp[i-2]+Math.abs(a[i-2] - a[i])) : Math.abs(a[i-1] - a[i]);
        }

        out.println(dp[n-1]);

        out.flush();
        out.close();
    }


    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                //                br = new BufferedReader(new FileReader("testdata.out"));
                st = new StringTokenizer("");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public String next() {
            if (st.hasMoreTokens())
                return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String line = "";
            try {
                line = br.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return line;
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public Integer[] nextIntegerArray(int n) {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }

        public char[] nextCharArray() {
            return nextLine().toCharArray();
        }
    }
}



Measured memory_bytes: 34304
a = list(map(str,input().split()))
S = []
top = -1
for i in range(len(a)):
    if a[i].isdigit()==True:
        top+=1
        #print('数値')
        S.append(int(a[i]))
        #print(S)
    else:
        #print('not')
        operand = a[i]
        b = S.pop()
        c = S.pop()
        if operand =='+':
            S.append(c + b)
        if operand =='-':
            S.append(c - b)
        if operand =='*':
            S.append(c * b)
        #print(S)
        #top-=2
print(*S)
    
    
    
    


Measured memory_bytes: 5600
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin>>n;
  vector<long long> arr(n);
  for(int i=0;i<n;++i){
    cin>>arr[i];
    arr[i] *= 2;
  }
  bool f = true;
  long long s = 0;
  for(int i=0;i<n;++i){
    if(f){
      s += arr[i];
    } else {
      s -= arr[i];
    }
    f = !f;
  }
  s = s/2;
  int start = s;
  cout<<s<<" ";
  for(int i=1;i<n-1;++i){
    cout<<arr[i-1]-s<<" ";
    s = arr[i-1]-s;
  }
  cout<<arr[n-1]-start<<endl;

  return 0; 
}

Measured memory_bytes: 2048
using System;
using System.Linq;

namespace AtCoder1
{
    class Program
    {
        static void Main()
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var M = input[0];
            var D = input[1];

            var ans = 0;

            for (int i = 1; i <= M; i++)
            {
                for (int j = 1; j <= D; j++)
                {
                    if (j % 10 < 2 || j / 10 < 2) continue;

                    if ((j % 10) * (j / 10) == i) ans++;
                }
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13268
class UnionFindNode(object):
    """
    Union-Find構造
    ノードのグループ併合や、所属グループ判定を高速に処理する
    """

    def __init__(self, group_id, parent=None, value=None):
        self.group_id_ = group_id
        self.parent_ = parent
        self.value = value
        self.size_ = 1

    def __str__(self):
        template = "UnionFindNode(group_id: {}, \n\tparent: {}, value: {}, size: {})"
        return template.format(self.group_id_, self.parent_, self.value, self.size_)

    def is_root(self):
        return not self.parent_

    def root(self):
        parent = self
        while not parent.is_root():
            parent = parent.parent_
            self.parent_ = parent
        return parent

    def find(self):
        parent = self.root()
        return parent.group_id_

    def size(self):
        parent = self.root()
        return parent.size_

    def unite(self, unite_node):
        parent = self.root()
        unite_parent = unite_node.root()

        if parent.group_id_ != unite_parent.group_id_:
            if parent.size() > unite_parent.size():
                unite_parent.parent_ = parent
                parent.size_ = parent.size_ + unite_parent.size_
            else:
                parent.parent_ = unite_parent
                unite_parent.size_ = parent.size_ + unite_parent.size_

    def same(self, node):
        return self.root() == node.root()


if __name__ == "__main__":
    N, M = map(int, input().split())
    p = list(map(int, input().split()))
    uf = [UnionFindNode(i) for i in range(N)]
    for i in range(M):
        x, y = map(int, input().split())
        uf[x - 1].unite(uf[y - 1])
    ans = 0
    for i, n in enumerate(p):
        if uf[i].same(uf[n - 1]):
            ans += 1
    print(ans)

Measured memory_bytes: 36836
#include<stdio.h>
int main()
{
  int a,b,i,j;
  while(1)
       {
  scanf("%d%d",&a,&b);
  if(a==0&&b==0){break;}
 
  for(i=1;i<=a;i++)
    {
      for(j=1;j<=b;j++)
    {
      if(j%2==1)
        {
          if(i%2==1)printf("#");
          else printf(".");
        }
      else
        {
              if(i%2==1)printf(".");
          else printf("#");
        }
    }
      printf("\n");
    }
  printf("\n");
     
       }
  return 0;
}


Measured memory_bytes: 2056
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return (a % 1000000007);
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}


int main(){
  ll n,k; cin >> n >> k; vl num(n); ll cnt = 0;
  
  rep(i,k){
    ll x; cin >> x;
    rep(i,x){
      ll t; cin >> t;
      num[t-1]++;
    }
  }
  
  rep(i,n){
    if(num[i] == 0) cnt++;
  }
  
  cout << cnt << endl;
}

Measured memory_bytes: 3632
fun main(args : Array<String>) {
    val N = readLine()!!.toInt()
    val W = readLine()!!.split(" ").map { it.toInt() }

    var min = Int.MAX_VALUE
    (1..(N-1)).forEach { T ->
        val groupA = W.filterIndexed { index, i ->  index <= T }
        val groupB = W.filterIndexed { index, i ->  index > T }


        min = Math.min(min, Math.abs(groupA.sum() - groupB.sum()))
    }
    println(min)
}

Measured memory_bytes: 37908
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
const int N = 1e6 + 9, M = 1e9 + 7;
int n, m, s, t;
ll bst[N];
ll dis1[N], dis2[N];
vector<pair<int, int>>y[N], d[N];
void dijk() {
	priority_queue<pair<long long, int>>q;
	for (int i = 1; i <= n; i++)dis1[i] = 1e18;
	dis1[s] = 0;
	q.push({0, s});
	while (!q.empty()) {
		pair<long long, int>x = q.top();
		q.pop();
		x.first *= -1;
		if (dis1[x.second] < x.first)continue;
		for (auto i : y[x.second]) {
			if (dis1[i.first] <= dis1[x.second] + i.second)continue;
			dis1[i.first] = dis1[x.second] + i.second;
			q.push({ -dis1[i.first], i.first});
		}
	}
}
void dijk2() {
	priority_queue<pair<long long, int>>q;
	for (int i = 1; i <= n; i++)dis2[i] = 1e18;
	dis2[t] = 0;
	q.push({0, t});
	while (!q.empty()) {
		pair<long long, int>x = q.top();
		q.pop();
		x.first *= -1;
		if (dis2[x.second] < x.first)continue;
		for (auto i : d[x.second]) {
			if (dis2[i.first] <= dis2[x.second] + i.second)continue;
			dis2[i.first] = dis2[x.second] + i.second;
			q.push({ -dis2[i.first], i.first});
		}
	}
}


int main() {
	scanf("%d%d%d%d", &n, &m, &s, &t);
	for (int a, b, yen, sd, i = 0; i < m; i++) {
		scanf("%d%d%d%d", &a, &b, &yen, &sd);
		y[a].push_back({b, yen});
		y[b].push_back({a, yen});
		d[a].push_back({b, sd});
		d[b].push_back({a, sd});
	}
	dijk();
	dijk2();
	multiset<ll>st;
	for (int i = n; i >= 1; i--) {
		bst[i] = dis1[i] + dis2[i];
		st.insert(bst[i]);
	}
	ll start=1e15;
	for (int i = 1; i <= n; i++) {
		printf("%lld\n",start- *(st.begin()));
		st.erase(st.find(bst[i]));
	}




}

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

void push(int);
int pop(void);
int isFull(void);

int top=0;
  int a[100];

int main(){
  
  int x,data[2];
  char s[100];

  while(scanf("%s",&s)!=EOF){
    if(s[0]=='+'|| s[0]=='-'||s[0]=='*'){
       data[0]=pop();
       data[1]=pop();
    }

      if(s[0]=='+'){
	push(data[1]+data[0]);

     }else if(s[0]=='-'){
	push(data[1]-data[0]);
  
     }else if(s[0]=='*'){
	push(data[1]*data[0]);

     }else {
	 x = atoi(s);
         push(x);
     }
    } 
   printf("%d\n",a[1]);
  return 0;
}


int isFull(void){
  if(top>=99)return 0;
  else return 1;
 }

void push(int x){
  /* if (isFull()==0){ fprintf(stderr,"オーバーフロー\n");
     exit(1);}*/
  top++;
  a[top]=x;

}

int pop(){
  /*
  if (isFull()==0){fprintf(stderr,"アンダーフロー\n");
  exit(2);}*/
   top--;
  return a[top+1];
}
 

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

using namespace std;
using ll = long long;

const int N = 1000006;

int n;
int a[N];
int dp[N][2];

int f(int i, int carry) {
	if(i == n) return carry;
	int &ans = dp[i][carry];
	if(~ans) return ans;
	int val = a[i] + carry;
	ans = min(f(i + 1, 0) + val, (10 - val) + f(i + 1, 1));
	return ans;
}

int main() {
	memset(dp, -1, sizeof dp);

	while(scanf("%1d", a + n) == 1) n++;

	reverse(a, a + n);

	printf("%d\n", f(0, 0));
}


Measured memory_bytes: 58880
N,M = map(int,input().split())
xyz = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for a in [-1,1]:
  for b in [-1,1]:
    for c in [-1,1]:
      s = []
      for x,y,z in xyz:
        s.append(a*x + b*y + c*z)
      s.sort(reverse=True)
      ans = max(ans, sum(s[:M]))
print(ans)


Measured memory_bytes: 3316
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  while (cin >> n) {
    if (n == 0) return 0;
    int a[n];
    int sum = 0;
    REP(i, n) {
      cin >> a[i];
      sum += a[i];
    }
    int ans = 0;
    REP(i, n) if (n * a[i] <= sum) ans++;
    cout << ans << endl;
  }
  return 0;
}


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

#define chmax(x, y) (x = max<int>(x, y))

int n, m;
int16_t dp[5010][5010];

int main()
{
	cin >> n >> m;
	for (int i = 0; i < m; i++){
		int a, b, x;
		cin >> a >> b >> x;
		chmax(dp[a - 1][b - 1], x + 1);
	}

	for (int i = 0; i < n; i++){
		for (int j = 0; j <= i; j++){
			chmax(dp[i + 1][j], dp[i][j] - 1);
			chmax(dp[i + 1][j + 1], dp[i][j] - 1);
		}
	}

	int res = 0;
	for (int i = 0; i < n; i++){
		for (int j = 0; j <= i; j++){
			res += dp[i][j] > 0;
		}
	}

	cout << res << endl;
}

Measured memory_bytes: 43448
#include<stdio.h>
int main(){
  char a[4];
  char b[4];
  scanf("%s\n",a);
  scanf("%s\n",b);
  printf((a[0] == b[2] && a[1] == b[1] && a[2] == b[0]) ? "YES\n" : "NO\n");
  return 0;
}

Measured memory_bytes: 128
pub fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn readn<T: std::str::FromStr>(delimiter: &str) -> Vec<T> {
    let s = read1::<String>();
    s.split(delimiter).map(|e| e.parse().ok().unwrap()).collect::<Vec<T>>()
}

fn main() {
    let s = read1::<String>().chars().map(|c| c as usize - 48).collect::<Vec<usize>>();
    let mut ans = 0;
    for i in 0..2_usize.pow(s.len() as u32 - 1) {
        let mut tmp = vec![s[0]];
        let mut count = 0;
        for j in 1..s.len() {
            if i>>(j-1)&1 == 1 {
                tmp[count] *= 10;
                tmp[count] += s[j];
            } else {
                tmp.push(s[j]);
                count += 1;
            }
        }
        ans += tmp.iter().sum::<usize>();
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
//file_name:ABC51_A.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


int main() {
    string s;
    cin >> s;
    s[5]=' ';
    s[13]=' ';


    ll ans = 0;

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



Measured memory_bytes: 256
var main = function(input){
input = input.split(' ')
  var A = parseInt(input[0]);
  var B = parseInt(input[1]);
  if(A<9){
    if(B<9){
    	console.log('Yay!');
    } else {
      console.log(':(');
  }
  } else{
    console.log(':(');
    return 0;
  }
  
}
main(require("fs").readFileSync("/dev/stdin", "utf8").trim());


Measured memory_bytes: 7372
#[allow(unused_macros)]
macro_rules! invec {
    ( $t:ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s.trim().split_whitespace().map(|s| s.parse::<$t>().unwrap()).collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }}
}

#[allow(unused_macros)]
macro_rules! input {
    ( $($t:ty),* ) => {{
        let mut s = String::new();
        std::io::stdin().read_line(&mut s);
        let mut splits = s.trim().split_whitespace();
        ($(
            {
                 splits.next().unwrap().parse::<$t>().unwrap()
            },
        )*)
    }}
}

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
    let (s,) = input!(String);
    let c0 = s.match_indices("0").count() as i32;
    let c1 = s.match_indices("1").count() as i32;
    let ans = (c0 - c1).abs();
    println!("{}", s.len() as i32 - ans);
}

fn main() {
    solve();
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main()
{
  ll n,k;
  cin>>n>>k;
  vecll a(n);
  for(auto&& e:a) cin>>e;
  boost::sort(a);
  ll pos = 0, neg = 0;
  for(auto&& e:a) {
    if (e<0) ++neg;
    if (e>0) ++pos;
  }
  auto endneg = boost::lower_bound(a, 0l);
  auto begpos = boost::upper_bound(a, 0l);
  ll pneg = pos * neg;
  ll pnpos = n*(n-1)/2 - pos*(pos-1)/2 - neg*(neg-1)/2;
  if (k <= pneg) {
    ll lo = -2e18;
    ll hi = 0;
    while (hi-lo > 1) {
      ll mid = (hi+lo) / 2;
      auto itr = begpos;
      ll cnt = 0;
      for(auto&& i:irange(0l,neg)) {
        while (itr != end(a) && a[i] * *itr > mid) ++itr;
        cnt += end(a)-itr;
      }
      if (cnt < k) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    cout<<hi<<endl;
  } else if (k <= pnpos) {
    cout<<0<<endl;
  } else {
    ll lo = 0;
    ll hi = 2e18;
    vecll b(begpos, end(a));
    a.erase(endneg, end(a));
    boost::reverse(a);
    for(auto&& e:a) e=-e;
    while (hi-lo > 1) {
      ll mid = (hi+lo) / 2;
      auto itr1 = end(a);
      auto itr2 = end(b);
      ll cnt = pnpos;
      for(auto&& i:irange(0l,neg)) {
        while (itr1 != begin(a) && a[i] * itr1[-1] > mid) --itr1;
        cnt += max(0l, itr1 - (begin(a)+i+1));
      }
      for(auto&& i:irange(0l,pos)) {
        while (itr2 != begin(b) && b[i] * itr2[-1] > mid) --itr2;
        cnt += max(0l, itr2 - (begin(b)+i+1));
      }
      if (cnt < k) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    cout<<hi<<endl;
  }
  return 0;
}


Measured memory_bytes: 2560
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String today = sc.next();
        
        String[] weekdays = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
        List<String> weekdayList = Arrays.asList(weekdays);
        int i = weekdayList.indexOf(today);

        System.out.println(7 - i);
    }
}


Measured memory_bytes: 21076
#include<bits/stdc++.h>
using namespace std;
int row,col,n,la;
pair<int,int> a[1111111];
int init(){
	int x,y;
	scanf("%d%d",&x,&y);
	if(x == 0)return y;
	if(y == col)return col + x;
	if(x == row)return col + row + col - y;
	if(y == 0)return col + row + col + row - x;
	return -1;
}
int st[1111111],top;
bool chk(){
	top = 0;
	for(int i=0; i<la; i++){
		if(a[i].second > 0)
			st[top ++] = a[i].second;
		else{
			if(st[top-1] != -a[i].second)
				return false;
			top--;
		}
	}
	return true;
}
int main(){
	int m;
	scanf("%d%d%d",&row,&col,&m);
	while(m--){
		int X = init();
		int Y = init();
		if(X != -1 && Y != -1){
			if(X>Y)swap(X,Y);
			++n;
			a[la++] = make_pair(X, n);
			a[la++] = make_pair(Y, -n);
		}
	}
	sort(a,a+la);
	puts(chk()?"YES":"NO");
	return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // 入力
    int N;
    string S;
    cin >> N >> S;
    
    //黒い石と白い石の位置を確認する
    vector<int> black(N);
    vector<int> white(N);
    for (int i = 0; i < N; i++){
        if (S[i] == '#') black[i]++;
        else white[i]++;
    }
    
    //累積和をつくる
    vector<int> black_ruisekiwa(N + 1);
    vector<int> white_ruisekiwa(N + 1);
    black.insert(black.begin(), 0);
    white.push_back(0);
    for (int i = 0; i < N; i++){
        black_ruisekiwa[i + 1] = black_ruisekiwa[i] + black[i + 1];
    }
    for (int i = N; i > 0; i--){
        white_ruisekiwa[i - 1] = white_ruisekiwa[i] + white[i - 1];
    }
    
    //出力
    int ans = 999999999;
    for (int i = 0; i < N + 1; i++){
        ans = min(ans, black_ruisekiwa[i] + white_ruisekiwa[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 4484
#include <string>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,h[100005];
ll dp[100005];
 
int main()  {

  string s1;
  std::cin >> s1;
  int a,b,c;
  a=stoi(s1.substr(0, 4));
  b=stoi(s1.substr(5, 6));
  c=stoi(s1.substr(8, 9));
  //printf("a=%d,b=%d,c=%d",a,b,c);
  if(stoi(s1.substr(0, 3)) > 2019){
	puts("TBD");
	return 0;
  }
  else if(a == 2019){
	if(b > 4){
	  puts("TBD");
	  return 0;
	}
	else if(b == 4){
		if(c > 30){
			puts("TBD");
			return 0;
		}
	}
  }
  puts("Heisei");
	
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		int a= scanner.nextInt();
		int b= scanner.nextInt();
		int c= scanner.nextInt();
		if(a + b+ c > 21) {
			System.out.println("bust");
		} else {
			System.out.println("win");
		}
		scanner.close();
	}

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
    int n,k;
    ll dis=0LL;
    int bef;
    cin >> n>>k;
    rep(i,k){
        cin>>bef;
        dis|=(1LL<<bef);
    }
   // cout<<bitset<10>(dis)<<endl;
    int ans=n-1;
    bool can=true;
    while(1){
      //  clog<<endl;
        ans++;
        can=true;
        bef=ans;
       // clog<<ans<<endl;
        while(bef!=0){
          //  clog<<bef%10<<" ";
            if(dis & (1<<(bef%10))){
                can=false;
                break;
            }
            bef/=10;
        }
        if(can){
        cout<<ans<<endl;
        break;
        }
    }
 
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main(){
  int a, b, c;
  cin >> a >> b >> c; // ????????????
  
  // ??¨???
  if(a < b && b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3052
def main():
    N, A, B = map(int, input().split())
    if A % 2 == B % 2:
        return abs(A - B)//2
    else:
        x = A + (B - A - 1)//2
        y = (N - B) + (- A + B + 1)//2
        return min(x, y)

print(main())


Measured memory_bytes: 2940
#include <iostream>
#include <set>
#include <map>

using namespace std;

set<long> s;
map<long,long> m;
long n,res;

int main(){
	cin>>n;
	int x;
	for(int i=0;i<n;i++){
		cin>>x;
		s.insert(x);
		if(m[x]==0) m[x]++;
		else m[x]=0;
	}
	set<long>::iterator it;
	for(it=s.begin();it!=s.end();it++){
		if(m[*it]>0) res++;
	}
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B;
  cin >> A >> B;
  int N=0;
  for(int i=A/100;i<=B/100;i++){
    int tmp=i*100+(i%100/10)*10+(i/100);
    if(A<=tmp&&tmp<=B)N++;
  }
  cout<<N<<endl;
}

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

const int N = (1e5) + 5;
priority_queue<int> pq;
vector<int> val[N];
int n, m;

// claudio van
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    int a, b; scanf("%d %d", &a, &b);
    if (a <= m) {
      val[m - a].emplace_back(b);
    }
  }
  int sum = 0;
  for (int i = m - 1; i >= 0; --i) {
    for (int j = 0; j < (int) val[i].size(); ++j) {
      pq.push(val[i][j]);
    }
    if ((int) pq.size() != 0) {
      sum += pq.top();
      pq.pop();
    }
  }
  printf("%d\n", sum);
  return 0;
}

Measured memory_bytes: 5632
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
	int n,a,b;
	cin>>n>>a>>b;
	if(n==1){
		if(a!=b){
			cout<<0;
		}
		else {
			cout<<1;
		}
		return 0;
	}
	cout<<max(0LL,(a+n*b-b)-(b+a*n-a)+1);
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int n,m,p;
long long x[100010],f[100010],s[100010];
int main()
{
	//freopen("sequence.in","r",stdin);
	//freopen("sequence.out","w",stdout);
	int i,j;
	long long k;
	scanf("%d%d",&n,&m);
	p=1;
	x[1]=n;
	while(m--)
	  {
       scanf("%lld",&k);
       while(x[p]>=k)
         p--;
       x[++p]=k;
      }
    f[p]=1;
    for(i=p;i>0;i--)
      {
       k=x[i];
       while(1)
         {
          j=upper_bound(x+1,x+i,k)-x-1;
          if(!j)
            break;
          f[j]+=k/x[j]*f[i];
          k%=x[j];
         }
       s[k]+=f[i];
      }
    for(i=n;i>0;i--)
      s[i]+=s[i+1];
    for(i=1;i<=n;i++)
      printf("%lld\n",s[i]);
	return 0;
}


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

using namespace std;

int const N = 441;
int const MOD = 1e9 + 7;

int dp[N][N], n, a[N], b[N], c, deg[N][N], prefDeg[N][N];

int get(int l, int r, int d){
	return ( ( ( (prefDeg[r][d] - prefDeg[l-1][d]) % MOD) + MOD) % MOD);
}

void precalc(){
	for(int i=0;i<N;++i){
		deg[i][0] = 1;
		for(int j=1;j<N;++j){
			deg[i][j] = deg[i][j-1] * 1LL * i % MOD;
		}
	}
	for(int i=0;i<N;++i){
		for(int j=1;j<N;++j){
			prefDeg[j][i] = (prefDeg[j-1][i] + deg[j][i]) % MOD;
		}
	}
}

int main(){
	precalc();
	scanf("%d%d",&n,&c);
	for(int i=1;i<=n;++i){
		scanf("%d",&a[i]);
	}
	for(int i=1;i<=n;++i){
		scanf("%d",&b[i]);
	}
	dp[0][0] = 1;
	for(int i=1;i<=n;++i){
		for(int j=0;j<=c;++j){
			for(int k=0;k<=c-j;++k){
				dp[i][j+k] += dp[i-1][j] * 1LL * get(a[i], b[i], k) % MOD;
				dp[i][j+k] %= MOD;
			}
		}
	}

	printf("%d\n",dp[n][c]);


	return 0;
}

Measured memory_bytes: 2432
t,s=open(0)
n,k=map(int,t.split())
l=2*k+1
x=[0]*(2+int(s[0]))+[i+1for i in range(n-1)if s[i]!=s[i+1]]+[n]*l
print(max(x[i+l]-x[i]for i in range(0,len(x)-l,2)))

Measured memory_bytes: 8720
import sys
input = sys.stdin.readline
from collections import *

A, B, C = map(int, input().split())
M = max(A, B, C)

if M%2==(A+B+C)%2:
    print((3*M-A-B-C)//2)
else:
    print((3*(M+1)-A-B-C)//2)

Measured memory_bytes: 38256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
/*-*/

int main() {
	std::string s,t;
	std::cin >> s >> t;
	std::vector<int> f;
	{
		int curr=0;
		rep(i,s.size()) {
			if(curr==t.size()) break;
			if(s[i]==t[curr]) {
				f.emplace_back(i);
				curr++;
			}
		}
		if(curr!=t.size()) {
			print("no");
			return 0;
		}
	}
	std::reverse(all(s));
	std::reverse(all(t));
	std::vector<int> ff;
	{
		int curr=0;
		rep(i,s.size()) {
			if(curr==t.size()) break;
			if(s[i]==t[curr]) {
				ff.emplace_back(i);
				curr++;
			}
		}
		if(curr!=t.size()) {
			print("no");
			return 0;
		}
	}
	std::reverse(all(ff));
	rep(i,f.size()) {
		debug(f[i],ff[i]);
		if(f[i]!=s.size()-1-ff[i]) {
			print("no");
			return 0;
		}
	}
	print("yes");
}



Measured memory_bytes: 8928
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long int ll;
typedef unsigned long long ull;
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;}
typedef pair<ll,ll> P;


int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    sort(a.begin(),a.end());
    int ans=a[0];
    rep(i,n-1)
    {
        ans = __gcd(ans,a[i+1]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import std.stdio;
 
void main() {
  int hp, n;
  readf(" %s %s", &hp, &n);
  
  foreach (i;0..n) {
    int a;
    readf(" %s", &a);
    hp -= a;
    if (hp <= 0) {
      writeln("Yes");
      return;
    }
  }
  writeln("No");
}


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

using namespace std;

priority_queue<pair<int, string> > pq;

int main()
{
	int n,m;
	scanf("%d",&n);
	for (int i = 0; i < n; i++)
	{
		string s;
		int dense;
		cin >> s >> dense;	
		
		pq.push(make_pair(dense,s));
	}
	
	string strs[100200];
	scanf("%d",&m);
	for (int i = 0; i < m; i++)
		cin >> strs[i];
	
	int f = 1;
	int lastdense;
	
	for (int i = m-1; i >= 0; i--)
	{
		if (!pq.size()) 
		{
			f = 0;
			break;	
		}
		
		int tke = 0;
		while(pq.size())
		{
			string s2 = pq.top().second;
			int dense = pq.top().first;
			pq.pop();
			if (s2 == strs[i] && lastdense != dense)
			{
				lastdense = dense;
				tke = 1;
				break;
			}
		}
		
		if (tke == 0) 
		{
			f = 0;
			break;
		}
	}
	
	if (f)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}
	
	return 0;
}


Measured memory_bytes: 20780
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int A[1];
int size=1;
int m=2;
#define N 101
#define mod 1000000007
#define f(i,n) for(int i=0;i<n;i++)

int main()
{
    fast;
 
    int a,b,c;
    cin>>a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<" "<<b<<" "<<c;



}

Measured memory_bytes: 3572
#include <iostream>
#include <string>
using namespace std;
int main()
{
  string a, b;
  cin >> a >> b;
  string num = a + b;
  int val = stoi(num);
  
  bool ans = false;
  for (int i = 1; i <= 317; i++) {
    if (i*i==val) ans = true;
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    int caseNum = 1;
    while(true) {
      int data = Integer.parseInt(br.readLine());
      if(data == 0) {
        break;
      }
      sb.append("Case ").append(Integer.toString(caseNum++)).append(": ").append(Integer.toString(data)).append("\n");
    }
    System.out.print(sb);
  }
}

Measured memory_bytes: 30768
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> V;

int main() {
  int n, m;
  cin >> n >> m;
  vector<pi> a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < m; i++) cin >> b[i].first >> b[i].second;
  for (int i = 0; i < n; i++) {
    int mi = 1e9;
    int res;
    for (int j = 0; j < m; j++) {
      int x = abs(a[i].first-b[j].first)+abs(a[i].second-b[j].second);
      if (mi > x) {
	mi = x;
	res = j;
      }
    }
    dump(res+1);
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<iomanip>

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int MOD = 1e9 + 7;
const int MAX = 1e9;
const ll LLMAX = 1e18;
const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const double PI = acos(-1.0);

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

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

    if (A <= C and C <= B) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3572
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


signed main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);  
//  #ifndef ONLINE_JUDGE
//     freopen ("INPUT.txt" , "r" , stdin);
//     freopen ("OUTPUT.txt" , "w" , stdout);
//  #endif

// -------------------------------------Code starts here---------------------------------------------------------------------     

   int k,x;
   cin>>k>>x;
   k*=500;
   if(k>=x)
      cout<<"Yes";
   else
      cout<<"No";

// -------------------------------------Code ends here------------------------------------------------------------------
     clock_t clk;
 	clk = clock();
 
    clk = clock() - clk;
 	cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
 	return 0;
 }

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
template <typename T> using V = vector<T>;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T> constexpr bool chmax(T &a, const T &b) {
    if(a >= b) return false;
    a = b;
    return true;
}
template <typename T> constexpr bool chmin(T &a, const T &b) {
    if(a <= b) return false;
    a = b;
    return true;
}

/*-------------------------------------------*/

ll a;
double b;

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

    cin >> a >> b;

    a *= ll(b * 100 + 0.5);
    a /= 100;

    cout << a << endl;

    return 0;
}

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

typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

ull const inf = 1e19;
ll const maxn = 1e6+5;
ll const mod = 1e9+7l;

// code begins here

int main(){
    fast;
    
    ld a,b;
    cin>>a>>b;
    
    ld ans = a*b;
    
    cout<<(ll)ans<<endl;
    
    return 0;
}

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

int main() {
    vector<int> a={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};
    int k;
    cin>>k;
    cout<<a[k-1];
}

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

using namespace std;

constexpr long long INF64 = 1e18;

class Graph {
  std::vector<std::vector<long long>> dist;

  bool flag = false;

  void WarshallFloyd() {
    const int n = dist.size();
    for (int k = 0; k < n; ++k) {
      for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
          if (dist[i][j] > dist[i][k] + dist[k][j]) {
             if(dist[i][k]!=INF64 && dist[k][j]!=INF64){
                dist[i][j] = dist[i][k] + dist[k][j];
             }
          }
        }
      }
    }
    flag = true;
  }

public:
  Graph(int n)
      : dist(n, std::vector<long long>(n,INF64)) {
        for(int i=0;i<n;++i){
            dist[i][i]=0;
        }
      }

  void addEdge(int s, int t, long long cost) {
    dist[s][t] = std::min(dist[s][t], cost);
    flag = false;
  }
    
  bool onNegativeCycle(int i){
      if (!flag) {
        WarshallFloyd();
      }
      if(dist[i][i]<0)return true;
      else return false;
  }
      
  long long getCost(int s, int t) {
    assert(!onNegativeCycle(s) && !onNegativeCycle(t));
    if (!flag) {
      WarshallFloyd();
    }
    return dist[s][t];
  }
};

int main(){
    int n,m;
    cin>>n>>m;
    Graph g(n);
    for(int i=0;i<m;++i){
        int from,to;
        long long weight;
        cin>>from>>to;
        cin>>weight;
        g.addEdge(from,to,weight);
    }
    for(int i=0;i<n;++i){
        if(g.onNegativeCycle(i)){
            cout<<"NEGATIVE CYCLE"<<endl;
            return 0;
        }
    }
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            long long ans=g.getCost(i,j);
            if(ans==INF64)cout<<"INF";
            else cout<<ans;
            if(j<n-1)cout<<" ";
            else cout<<endl;
        }
    }
}
        


Measured memory_bytes: 3244
s = gets
f2 = s[0..1].to_i
l2 = s[2..3].to_i

if f2 > 12 && l2 <= 12 && l2 >= 1
  puts 'YYMM'
elsif l2 > 12 && f2 <= 12 && f2 >= 1
  puts 'MMYY'
elsif f2 <= 12 && l2 <= 12 && l2 >= 1 && f2 >= 1
  puts 'AMBIGUOUS'
elsif f2 == 0 && l2 <= 12 && l2 >= 1
  puts 'YYMM'
elsif l2 == 0 && f2 <= 12 && f2 >= 1
  puts 'MMYY'
else
  puts 'NA'
end

Measured memory_bytes: 3836
#include <stdio.h>  /*入出力*/
#include <stdlib.h> /*標準ライブラリ*/
#include <string.h> /*文字列*/
#include <math.h>   /*計算*/

/*ABC 142*/

int main(void)
{
  int N, K;
  int count = 0;
  int *array;

  scanf("%d%d", &N, &K);
  array = (int *)malloc(sizeof(int) * N);
  if (array == NULL) {
    exit(0);
  }

  for (size_t i = 0; i < N; i++) {
    scanf("%d", &array[i]);
  }

  for (size_t i = 0; i < N; i++) {
    if (array[i] >= K) {
      count++;
    }
  }
  printf("%d\n", count);
  free(array);
  return 0;
}


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

int main() {
	int a,b,c,d;
	cin >> a >> b;
	
	if(a==1) cout << a;
	else if(b < a) cout << a-1;
	else if (b >= a) cout << a;
	
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define INF 100000000
typedef long long ll;

using namespace std;

int main()
{
    int N;
    int a[1000];
    int ans=INF;
    cin >> N;
    REP(i, N) {
        cin >> a[i];
    }
    REP(i, N) {
        REP(j, 10000) {
            if (a[i] % 2 == 0) {
                a[i] /= 2;
            }
            else {
                ans = min(ans, j);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256