akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<n;i++)
using namespace std;

int main() {
  string s,t;
  cin >> s >> t;
  int cnt=0;
  rep(i,s.size()) {
    if(s.at(i)!=t.at(i)) cnt ++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3836
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtcoderTemplateForCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            var sides = Console.ReadLine()
                .Split(' ')
                .Select(int.Parse);

            var sortedSides = sides.OrderBy(side => side);


            // 実装1（愚直に）
            if (sortedSides.Last() < sortedSides.Sum() - sortedSides.Last())
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }

            // 実装2（こっちのほうが効率がいいかも？）
            //if (sortedSides.Last() < sortedSides.Sum() - sortedSides.Last())
            //{
            //    Console.WriteLine("Yes");
            //}
            //else
            //{
            //    Console.WriteLine("No");
            //}
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int M=105;
int n,a[M];

int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		a[x]++;
	}
	int t=0;
	for(int i=M-1;i>0;i--){
		t+=a[i];
		if(t>=i){
			cout<<i<<endl;
			break;
		}
	}
}


Measured memory_bytes: 3096
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
#define rep(i,strt,end) for(long long i = strt;i < end;i++)


int main(){
    int n,m;
    long long x;
    cin >> n >> m >> x;
    long long a[n][m];//0始まり
    long long c[n];
    rep(i,0,n){
        cin >> c[i];
        rep(j,0,m){
            cin >> a[i][j];
        }
    }
    long minVal = -1;
    rep(i,0,1 << n){
        long totalVal = 0;
        long powerU[m];
        rep(j,0,m){
            powerU[j] = 0;
        }
        rep(j,0,n){
            if((i&(1 << j)) < 1){
                continue;
            }
            rep(k,0,m){
                powerU[k] += a[j][k];
                
            }
            totalVal+= c[j];
        }
        rep(j,0,m){
            //cout << powerU[j] << endl;
            if(powerU[j] < x){
                totalVal = -1;
                break;
            }
        }
        if(totalVal < 0){continue;}
        if(minVal == -1){
            minVal = totalVal; 
        }else{
            minVal = min(totalVal,minVal);
        }
    }
    cout << minVal << endl;
    //--------------
    return 0;
}

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

constexpr int MAX_N=(int)1e5;

int n,t;
int A[MAX_N];

int main(){
	std::cin>>n>>t;
	for(int i=0;i<n;++i)
		std::cin>>A[i];
	int diff=0, count=0,min=(int)1e9;

	for(int i=0;i<n;++i){
		min=std::min(A[i],min);
		if(A[i]-min==diff)
			++count;
		else if(A[i]-min>diff){
			diff=A[i]-min;
			count=1;
		}
	}
	std::cout<<count<<std::endl;
	return 0;
}

Measured memory_bytes: 768
# -*- coding: utf-8 -*-

amax = int(input())
bmax = int(input())
cmax = int(input())
x = int(input())

count = 0

for a in range(amax+1):
  for b in range(bmax+1):
    for c in range(cmax+1):
       if x == 500 * a + 100 * b + 50 * c:
        count+=1
        
print("{}".format(count))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

int main()
{
 int n,count;
    while(scanf("%d",&n)!=EOF){
        if(n >= 37){
            printf("0\n");
        }else{
            count = 0;
 
            for(int a=0;a<=9;a++){
                for(int b=0;b<=9;b++){
                    for(int c=0;c<=9;c++){
                        for(int d=0;d<=9;d++){
                            if(a+b+c+d==n)count++;
                        }
                    }
                }
            }
            printf("%d\n",count);
        }
    }
}



Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	return (a %= p) >= 0 ? a : a + p;
}

int power(int a, int N){
	if(N == 0) return 1;
	else if(N % 2 == 0) return power(MOD(a * a), N / 2);
	else return MOD(a * power(a, N - 1));
}

int push(int x, int k){
	x <<= k;
	x += (1 << (k - 1));
	return x;
}

bool haveXYZ(int v, int X, int Y, int Z){
	int u = 1;
	u <<= X;
	u++;
	u <<= Y;
	u++;
	u <<= (Z - 1);
	return (v & u) == u;
}

signed main(){
	int N, X, Y, Z, i, j, k;
	scanf("%lld%lld%lld%lld", &N, &X, &Y, &Z);
	int S = X + Y + Z;
	vector<vector<int>> dp(N + 1, vector<int>(1 << S, 0));
	dp[0][0] = 1;
	for(i = 0; i < N; i++){
		for(j = 0; j < (1 << S); j++){
			for(k = 1; k <= 10; k++){
//				printf("(i, j, k) = (%lld, %lld, %lld)\n", i, j, k);
				int next = (push(j, k) & ((1 << S) - 1));
				if(haveXYZ(next, X, Y, Z) == false){
					dp[i + 1][next] = MOD(dp[i + 1][next] + dp[i][j]);
				}
			}
		}
	}
	int ans = 0;
	for(j = 0; j < (1 << S); j++){
		ans = MOD(ans + dp[N][j]);
	}
	printf("%lld\n", MOD(power(10, N) - ans));
	return 0;
}

Measured memory_bytes: 43392
a = input().split()

if(a[1]  >= a[2]):
  b = a[2]
else:
  b = a[1]

if(int(a[0]) >= int(a[1]) + int(a[2])):
  c=0
else:
  c = int(a[1]) + int(a[2]) - int(a[0])
print(b," ",c)



Measured memory_bytes: 3060
a, b, c, x, y = map(int, input().split())
res = 0
if a+b > c*2:
    mi = min(x, y)
    res += c*2 * mi
    x -= mi
    y -= mi
res += x * min(a, c*2)
res += y * min(b, c*2)
print(res)


Measured memory_bytes: 3316
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;

int main(void){
    int a,b,ans = -1,n = 0,m = 0;
    cin >> a >> b;

    for(int i = 1; n <= 100; i++){
        n = int(i * 0.08);
        if(n == a){
            m = int(i * 0.1);
            if(m == b){
                ans = i;
                break;
            }
        }
    }
    //a * 12.5;
    //b * 10;    

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

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <unordered_set>
#include <unordered_map>
#include <chrono>
#include <random>
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define PI 3.14159265358979323846
#define min(a,b) ((a<b)?(a):(b))
#define max(a,b) ((a<b)?(b):(a))
#define abs(a) ((a>0)?a:-(a))
#define pii pair<int,int>

const double eps = (double)1e-6;
const int maxn = 1e5+5;
const ll mod = 1e9+7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


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

    int h,a; cin >> h >> a;
    if (h % a) cout << h/a + 1 << endl;
    else cout << (h/a) << endl;


}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int w , h , n ;
    cin >> w >> h >> n ;
    int sum ;
    sum = w * h ;
    
    int x , y ,  a; 
    int xmax , xmin , ymax , ymin ;
    xmax = w ;
    xmin = 0 ;
    ymax = h ;
    ymin = 0 ;
     for(int i = 0 ; i < n ; i++){
      cin >> x >> y >> a ;
      if(a == 1 ){
          xmin = max(x, xmin) ;

      }else if(a == 2){
           xmax = min(x , xmax) ;

      }else if(a == 3){
           ymin = max(y , ymin) ;

      }else if(a == 4){
          
          ymax = min(y , ymax) ;
      }
    }
    if(xmax-xmin<= 0||ymax - ymin<=0){
        cout << 0 << endl;
    }else{
        cout <<(xmax-xmin)  *(ymax - ymin) << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()
for i in range(len(s)):
	if i%2 == 0 and s[i] not in ["R","U","D"]:
		print("No")
		exit()
	elif i%2 == 1 and s[i] not in ["L","U","D"]:
		print("No")
		exit()
print("Yes")

Measured memory_bytes: 9012
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())
Edges=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    a-=1; b-=1
    Edges[a].append(b)
    Edges[b].append(a)
Colors=[0]*n

def dfs(v,color):
    Colors[v]=color
    for to in Edges[v]:
        if Colors[to]==color:
            return False
        if Colors[to]==0 and not dfs(to,-color):
            return False
    return True

def isbipartite():
    return dfs(0,1)

if isbipartite():
    black=(sum(Colors)+n)//2
    white=n-black
    print(black*white-m)
else:
    print(n*(n-1)//2-m)

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


int main(){
  string s;
  cin >> s;
  
  int cnt = 1;
  rep(i,3){
    if(s.at(i) == s.at(i+1)) {
      cnt++;
      if(cnt == 3) {
        cout << "Yes" << endl;
        break;
      } 
    }
    else cnt = 1;
  }
  if(cnt != 3) cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>

using namespace std;

int main(){
    int N,C,K,Cnum=0,count=1,ans=1;
    cin>>N>>C>>K;
    int T[N];
    for(int i=0;i<N;i++)cin>>T[i];
    sort(T,T+N);
    int min=T[0]+K;//時刻
    for(int i=1;i<N;i++){
        if(min>=T[i]&&count<C){
            count++;
        }else{
            ans++;
            count=1;
            min=T[i]+K;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){


int a[10000] , b[10000] ;
char op[10000] ;
int x[10000]; 



 	for (int i=1; i<=10000; i=i+1 )
 	{
 	 cin >> a[i] >> op[i] >> b[i] ;

		if( op[i] == '?' )
 		{
 		break;
 		}else{
         }

                if ( op[i] == '+' ){
                cout<< a[i] + b[i] << endl; // �a
                } else if ( op[i] == '-' ){
                cout<< a[i] - b[i] << endl; // ��
                } else if ( op[i] == '*' ){
                cout<< a[i] * b[i] << endl; // ��
                } else if ( op[i] == '/' ){
                cout<< a[i] / b[i] << endl; // ��
                } else {
                break ; // �ُ�I��
                }


 	}

 return 0;
 }





Measured memory_bytes: 3116
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

int main(int argc, char *argv[]) {

  i64 X;
  cin >> X;
  i64 K0 = X / 105, K1 = X / 100;
  if(X % 105 != 0)
    ++K0;

  cout << ((K0 <= K1) ? 1 : 0) << endl;

  return 0;
}


Measured memory_bytes: 256
import collections as col

def comb(n):
	ret = 0
	if n == 0:
		ret = 0
	else:
		ret = n * (n-1) / 2

	return ret

if __name__ == '__main__':
	N = int(input())
	v = [int(a) for a in input().split()]

	count = col.Counter(v)

	ans = 0

	for i in range(N):
		k = i + 1
		c = count[k]
		if c > 1:
			ans += comb(c)

	for i in range(N):
		c = count[v[i]]
		if c > 1:
			ANS = ans - (c - 1)
		else:
			ANS = ans
		print(int(ANS))

Measured memory_bytes: 26780
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int a = 0;
        int b = 0;
        int c = 0;
        for (int i = 0; i < s.length(); i++) {
            switch (s.charAt(i)) {
                case 'a':
                    a++;
                    break;
                case 'b':
                    b++;
                    break;
                    case 'c':
                    c++;
                    break;
            }
        }
        int[] array = {a, b, c};
        Arrays.sort(array);
        int max = array[2];
        switch (s.length()) {
            case 1:
                System.out.println("YES");
                return;
            case 2:
                System.out.println(max == 1 ? "YES" : "NO");
                return;
            default:
                int limit = s.length() / 3;
                if (s.length() % 3 > 0) {
                    limit++;
                }
                System.out.println(max <= limit ? "YES" : "NO");
        }
    }
}

Measured memory_bytes: 26316
n = int(input())
print(0)
s = input()
if s == "Vacant":
    exit()
a = s
l = 0
r = n
while True:
    m = (l + r) // 2
    print(m)
    s = input()
    if s == "Vacant":
        exit()
    if (s == a) ^ ((m - l) % 2 == 1):
        l = m
        a = s
    else:
        r = m

Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main(){
	int n; cin >> n;
	vector<ll> a(n);
	for(int i = 0; i < n; ++i){
		cin >> a[i];
    }
    sort(a.begin(), a.end());
    int sum=0;
    for(int i = 0; i < n-1; ++i){
		sum += a[i];
    }
    string ans;
    if(a[n-1]<sum){
    	ans = "Yes";
    }
    else{
    	ans = "No";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
using static System.Math;
using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        if (n == 2)
        {
            Console.WriteLine(gcd(a[0], a[1]) == 1 ? "pairwise coprime" : "not coprime");
            goto exit;
        }
        var gcd0 = gcd(a[0], a[1]);
        for (int i = 2; i < n; i++)
        {
            var t = gcd(gcd0, a[i]);
            gcd0 = t;
        }
        if (gcd0 != 1) { Console.WriteLine("not coprime"); goto exit; }
        getAns(n, a);
    exit:;
    }
    static void getAns(int n, int[] a)
    {
        var amax = a.Max();
        if (amax == 1) { Console.WriteLine("pairwise coprime"); return; }
        var pr = GeneratePrime(amax);
        var b = new int[amax + 1];
        for (int i = 0; i < n; i++) b[a[i]]++;
        foreach (var x in pr)
        {
            var p = x;
            var check = 0;
            while (p <= amax)
            {
                check += b[p];
                if (check > 1) { Console.WriteLine("setwise coprime"); return; }
                p += x;
            }
        }
        Console.WriteLine("pairwise coprime");
    }
    static List<int> GeneratePrime(int m)
    {
        var a = new List<int>();
        int p;
        var sqrtMax = Sqrt(m);
        var s = Enumerable.Range(2, m - 1).ToList();
        do
        {
            p = s.First();
            a.Add(p);
            s.RemoveAll(n => n % p == 0);
        }
        while (p < sqrtMax);
        a.AddRange(s);
        return a;
    }
    static int gcd(int a, int b)
    {
        if (a < b) return gcd(b, a);
        while (b != 0)
        {
            var w = a % b;
            a = b;
            b = w;
        }
        return a;
    }
}


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

int main(){
	int n,cnt=0,h=0;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b;
		cin>>a>>b;
		if(a==b)cnt++;
		else cnt=0;
		if(cnt==3)h=1;
	}
	if(h)cout<<"Yes";
	else cout<<"No";
 	return 0;
}


Measured memory_bytes: 3632
import std.algorithm;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.meta;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


void main() {
  string s = readln.chomp;
  int n = s.to!int;
  int sn = 0;
  foreach (c; s)
    sn += c.to!string.to!int;
  writeln(n % sn == 0 ? "Yes" : "No");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    int lens = s.size();
    long long ans= 0;
    for(int i= 0; i< (1<<(lens-1) ) ; i++){
        long long num =s.at(0) - '0';
        for(int j = 0; j <lens -1 ; j++){
            if(i & 1<<j){
                ans += num;
                num = 0;
            }
            num = 10 * num + s.at( j + 1 ) - '0';
        }
        ans += num;
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    ll n, m;
    cin >> n >> m;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<vector<ll>> dp(n + 1, vector<ll>(m + 1, 0));
    dp[0][0] = 1;
    for(int i = 0; i < n; i++) {
        vector<ll> dr(m + 2, 0);
        for(int j = 0; j <= m; j++) {
            dr[j + 1] = (dr[j] + dp[i][j]) % MOD;
        }
        for(int j = 0; j <= m; j++) {
            dp[i + 1][j] = dr[j + 1] - dr[max(0LL, j - a[i])];
            dp[i + 1][j] = (dp[i + 1][j] + MOD) % MOD;
        }
    }
    cout << dp[n][m] << endl;
}


Measured memory_bytes: 83144
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<cmath>
#include<numeric>
#include<iomanip>
#include<functional>
#include<cstdlib>
#include<queue>
#include<deque>
const double PI = acos(-1);
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
using ll =long long;
const int mod = 1000000007;

//map<string>a
class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% mod + mod) % mod) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint & a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator-=(const mint & a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator*=(const  mint & a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint & a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint & a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint & a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint & a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint & a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream & os, const mint & m) {
		os << m.x;
		return os;
	}
};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
//組み合わせ
void recursive_comb(vector<int> indexes, int s, int rest, std::function<void(vector<int>)> f) {
	if (rest == 0) {
		f(indexes);
	}
	else {
		if (s < 0) return;
		recursive_comb(indexes, s - 1, rest, f);
		indexes[rest - 1] = s;
		recursive_comb(indexes, s - 1, rest - 1, f);
	}
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(vector<int>)> f) {
	vector<int>indexes(k);
	recursive_comb(indexes, n - 1, k, f);
}

ll gcd(ll a, ll b) {
	if (a % b == 0) {
		return b;
	}
	else {
		return gcd(b, a % b);
	}
}
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
};
//fixed << setprecision(2)


int main() {
	int x;
	int a;
	cin >> x >> a;
	if (x < a) {
		cout << 0;
	}
	else {
		cout<<10;
	}
}

	



Measured memory_bytes: 3536
N = int(input(''))
dict = {}
for i in range(N):
    S = input('')
    if S in dict:
        dict[S] += 1
    else:
        dict[S] = 1
M = max(dict.values())
out = [j for j in dict.keys() if dict[j] == M]
out.sort()
for k in out:
    print(k)


Measured memory_bytes: 32092
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr start, itr goal){ for(auto i = start; i != goal; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(10)
#define highest(x) (63 - __builtin_clzl(x))

int main(){
    string S;
    cin >> S;
    cout << character_count(S, '+') - character_count(S, '-') << endl;
}


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

using namespace std;

#define mz 1000000007

struct Node
{
    int son[2];
}tre[100005];
int num[100005],cnt=0;
char s[100005];
long long ans=0;
long long l;

void add()
{
    int l=strlen(s);
    int now=0;
    for(int i=0;i<l;i++)
    {
        if(tre[now].son[s[i]-'0'])
            now=tre[now].son[s[i]-'0'];
        else
        {
            ++cnt;
            tre[now].son[s[i]-'0']=cnt;
            tre[cnt].son[0]=tre[cnt].son[1]=0;
            now=cnt;
        }
    }
}
long long lowb(long long x)
{
    return -x&x;
}
int dfs(int x,int f)
{
    if((!tre[x].son[0]) != (!tre[x].son[1]))
        ans^=lowb(l-f);
    for(int i=0;i<2;i++)
        if(tre[x].son[i])
            dfs(tre[x].son[i],f+1);
}

int main()
{
    int n;
    tre[0].son[0]=tre[0].son[1]=0;
    scanf("%d%lld",&n,&l);
    for(int i=0;i<n;i++)
    {
        scanf("%s",s);
        add();
    }
    dfs(0,0);
    if(ans)
        printf("Alice\n");
    else
        printf("Bob\n");
    return 0;
}


Measured memory_bytes: 3456
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            int[] abc = new int[] { A, B, C };
            Arrays.sort(abc);
            int count = 0;
            count += abc[2] - abc[1];
            abc[0] += count;
            abc[1] += count;
//            Utils.debug(abc);
            int c2 = (abc[2] - abc[0]) / 2 + (abc[2] - abc[0]) % 2;
            count += c2;
            abc[0] += 2 * c2;
//            Utils.debug(abc);
            if (abc[0] > abc[2]) {
                count++;
                abc[1]++;
                abc[2]++;
            }
//            Utils.debug(abc);
            System.out.println(count);
        }
    }
}


Measured memory_bytes: 22100
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

int main()
{
	int a[101][101], b[101][101];
	long long c[101][101], s;
	int i, j, k;
	int n, m, l;

	scanf("%d%d%d", &n, &m, &l);
	for (i = 0; i < n; i++) {
		for (j = 0; j < m; j++) scanf("%d", &a[i][j]);
	}
	for (i = 0; i < m; i++) {
		for (j = 0; j < l; j++) scanf("%d", &b[i][j]);
	}

	for (i = 0; i < n; i++) {
		for (j = 0; j < l; j++) {
			s = 0;
			for (k = 0; k < m; k++) {
				s += a[i][k] * b[k][j];
			}
			c[i][j] = s;
		}
	}

	for (i = 0; i < n; i++) {
		printf("%lld", c[i][0]);
		for (j = 1; j < l; j++) printf(" %lld", c[i][j]);
		putchar('\n');
	}
	return 0;
}


Measured memory_bytes: 2144
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>

inline void read(int &T) {
	int x=0;bool f=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=!f;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	T=f?-x:x;
}

int n,m,a[100001];
bool OK[100001];

int main() {
	read(n),read(m);
	for(int i=1;i<=n;++i) read(a[i]);
	for(int i=1,u,v;i<=m;++i) {
		read(u),read(v);
		if(a[u]>=a[v]) OK[v]=1;
		if(a[v]>=a[u]) OK[u]=1;
	}
	int ans=0;
	for(int i=1;i<=n;++i) {
		if(!OK[i]) ++ans;
	}
	std::cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 4112
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
const int MaxN = 4e5;
typedef long long LL;
using namespace std;
int pre[MaxN + 5], last[MaxN + 5], other[MaxN + 5];
int all, n, m; bool ok = true;
int col[MaxN + 5], cnt[3];
void Build(int u, int v) {
	pre[++all] = last[u];
	last[u] = all;
	other[all] = v;
}

void Dfs(int x, int fa, int d) {
	if(col[x] == -1) col[x] = d;
	else if(col[x] != d) {
		ok = false;
		return;
	}
	else return;
	int ed = last[x], dr;
	while(ed != -1) {
		dr = other[ed];
		if(dr != fa) Dfs(dr, x, d ^ 1);
		ed = pre[ed];
	}
}
void Init() {
	ok = true;
	all = -1; memset(last, -1, sizeof(last));
	memset(col, -1, sizeof(col));
	for (int i = 1; i <= m; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		Build(u, v); Build(v, u);
	}
}

void Solve () {
	int t = 1;
	LL res = n * (n - 1) / 2;
	Dfs(1, 0, 1);
	cnt[0] = cnt[1] = 0;
	for (int i = 1; i <= n; i++) cnt[col[i]]++;
	if(ok) printf("%lld\n", 1LL * cnt[0] * cnt[1] - m);
	else printf("%lld\n", 1LL * n * (n - 1) / 2 - m);
}

int main ()
{
	while(~scanf("%d%d", &n, &m)) {
		Init();
		Solve();
	}
}

Measured memory_bytes: 7808
import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        int sqt = (int) Math.sqrt(n);
        
        
        for (int i = sqt; i >= 1; i --) {
            if (n % i == 0) {
                System.out.println(i + n / i - 2);
                break;
            }
        }
        
    }
    
}


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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

ll A[200050];
ll B[200050];

int main() {
  // std::cout << std::fixed << std::setprecision(10);

  ll N, K;
  scanf("%lld %lld", &N, &K);

  for (ll i = 0; i < N; i++) {
    ll v;
    scanf("%lld", &v);
    A[i] = v;
  }

  if (K > 600) {
    fill_n(B, 200005, N);
  } else {
    for (ll i = 0; i < K; i++) {
      fill_n(B, N, 0);
      for (ll i = 0; i < N; i++) {
        ll v = A[i];

        ll l = max(i - v, 0LL);
        ll r = min(i + v, N - 1LL);

        B[l] += 1;
        if (r + 1 < N) {
          B[r + 1] -= 1;
        }
      }
      for (int i = 1; i < N; i++) {
        B[i] += B[i - 1];
      }
      memcpy(A, B, sizeof(A));
    }
  }

  cout << B[0];
  for (ll i = 1; i < N; i++) {
    cout << " " << B[i];
  }
}


Measured memory_bytes: 6828
H,W=map(int,input().split())
def ABC(a):
    if a%2==1:
        return (a//2)+1
    elif a%2==0:
        return a//2
if H>1 and W>1:
    ans=(H//2)*(W//2)+(ABC(H)*ABC(W))
    print(ans)
else:
    print(1)


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

int main() {
  int x,y;
  
  cin >> x;
  vector<string> blue(x);
  
  for(int i=0 ; i<x ; i++){
    cin >> blue.at(i);
  }
  
  cin >> y;
  vector<string> red(y);
  
  for(int j=0 ; j<y ; j++){
    cin >> red.at(j);
  }
  
  int max=0;
  int p;
  int m;
  
  for(int i=0 ; i<x ; i++){
    
    p=0;
    m=0;
    
    for(int j=0 ; j<x ; j++){
      if(blue.at(i) == blue.at(j)) p++;
    }
    
    for(int k=0 ; k<y ; k++){
      if(blue.at(i) == red.at(k)) m++;
    }
    
    if(p-m > max)max=p-m;
  }
  
  cout << max << endl;
}

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

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

  ll A; cin >> A;
  ll B; cin >> B;
  ll ans = -1;
  for (ll i = 1; i < 1000 * 1000; i++) {
  // for (ll i = 1; i < 100; i++) {
    // cout << (i * 100 /8) << '\n';
    if ((i * 8 / 100 == A) && (i * 10 / 100 == B)) {
      ans = i;
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
S=input()
judge1=False
judge3=0
judges=len(S)-2
if S[0]=='A':
    judge1=True
for i in range(len(S)):
    if S[i].islower():
        judges=judges-1
for j in range(2,len(S)-1):
    if S[j]=='C':
        judge3=judge3+1
if judge1==True and judge3==1 and judges==0:
    print("AC")
else:
    print("WA")

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

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fbo find_by_order
#define ook order_of_key
#define INF (ll)1e18
#define PI (ld)3.14159265358979323846
#define print(a); for(auto x:a)cout<<x<<" "; cout<<"\n";
#define mset(a); memset(a,0,sizeof(a));

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
    int a,b,c;cin>>a>>b>>c;
    if(a+b+c>=22)cout<<"bust\n";else cout<<"win\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

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

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;


int main()
{
    int n,m;
    cin >> n >> m;
    int bools[n];
    bool p[n];
    for(int i = 0; i < n; i++){
        bools[i] = 1;
        p[i] = false;
    }
    p[0] = true;
    for(int i = 0; i < m; i++){
        int x,y;
        cin >> x >> y;
        x--; y--;
        if(p[x]){
            p[y] = true;
            if(bools[x] == 1){
                p[x] = false;
            }
        }
        bools[x]--;
        bools[y]++;
    }
    int ans = 0;
    for(int i = 0; i < n; i++){
        if(p[i]) ans++;
    }
    cout << ans << endl;
}

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

void deleteFirst(int**);
void deleteLast(int**);
void insertOne(int**, int**, int, int);
bool deleteOne(int**, int**, int);

int main(void){
    int xs[2000001] = {};
    int* default_ptr = xs + 2000000;
    int* fp = default_ptr;
    int* lp = default_ptr;
    int len = 0;
    int n;
    char str[20];
    fgets(str, sizeof(str), stdin);
    sscanf(str, "%d", &n);
    for(int i=0; i < n; ++i){
        fgets(str, sizeof(str), stdin);
        if(str[6] == 'F'){
            deleteFirst(&fp);
            --len;
        }else if(str[6] == 'L'){
            deleteLast(&lp);
            --len;
        }else{
            char *tp;
            int m;
            tp = strtok(str, " " );
            tp = strtok(NULL," ");
            sscanf(tp, "%d", &m);
            if(str[0] == 'i'){
                insertOne(&fp, &lp, m, len);
                ++len;
            }else if(deleteOne(&fp, &lp, m)){
                --len;
            }
        }
        
        if(len == 0){
            fp = default_ptr;
            lp = default_ptr;
        }
    }
    
    for(int i = 0; i < lp - fp; ++i){
        if(*(fp + i) != -1){
            printf("%d ", *(fp + i));
        }
    }
    printf("%d\n", *lp);
}

void deleteFirst(int** fp){
    **fp = -1;
    while(**fp == -1) ++*fp;
}

void deleteLast(int** lp){
    **lp = -1;
    while(**lp == -1) --*lp;
}

void insertOne(int** fp, int** lp, int m, int len){
    if(len == 0){
        **fp = m;
    }else{
        --*fp;
        **fp = m;
    }
}

bool deleteOne(int** fp, int** lp, int m){
    for(int j = 0; j <= *lp - *fp; ++j){
        if(*(*fp + j) == m){
            *(*fp + j) = -1;
            if(j == 0){
                while(**fp == -1) ++*fp;
            }else if((*fp + j) == *lp){
                while(**lp == -1) --*lp;
            }
            return true;
        }
    }
    return false;
}

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

int main() {
  
  int A,B;
  cin >> A >> B;
  if(A==1)A+=13;
  if(B==1)B+=13;
  
  if(A>B)cout << "Alice" << endl;
  else if(A==B)cout << "Draw" << endl;
  else cout << "Bob" << endl;
  
  return 0;
}

Measured memory_bytes: 256
n, k = $stdin.readline.chomp.split.map(&:to_i)
a = $stdin.readline.chomp.split.map(&:to_i).sort!

g = a.inject(a[0]) {|acc, x| acc.gcd(x) }
res = false
while !a.empty?
  b = a.pop
  if b < k
    break
  elsif (b - k) % g == 0
    res = true
    break
  end
end
puts (res)? "POSSIBLE" : "IMPOSSIBLE"

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

template<typename T>
class tRMQ {
  vector<T> data;
  T unit;

public:
  static const long long INF = 100000000000;
  int n;
  function<T(const T &, const T &)> f;

  tRMQ(int _, T u, function<T(T, T)> bi) {
    unit = u;
    f = bi;
    n = 1;
    while (n < _) {
      n <<= 1;
    }
    data.resize(n * 4);
    for (int i = 0; i < n * 4; i++)
      data[i] = unit;
  }

  void update(int index, T val) {
    int i = index + n - 1;
    data[i] = val;
    while (i > 0) {
      i = (i - 1) / 2;
      data[i] = f(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }

  // [a, b)
  T query(int a, int b, int k, int l, int r) {
    if (a < 0 || r <= a || b <= l)
      return unit;
    if (a <= l && r <= b)
      return data[k];
    else
      return f(query(a, b, k * 2 + 1, l, (l + r) / 2),
               query(a, b, k * 2 + 2, (r + l) / 2, r));
  }

  T query(int a, int b) { return query(a, b, 0, 0, n); }
};

tRMQ<ll> minrmq(int n) {
  return tRMQ<ll>(n, 10000000000000000LL, [](ll r, ll l) { return min(l, r); });
}

tRMQ<ll> maxrmq(int n) {
  return tRMQ<ll>(n, -10000000000000000LL,
                  [](ll r, ll l) { return max(l, r); });
}

tRMQ<ll> sumrmq(int n) {
  return tRMQ<ll>(n, 0, [](ll l, ll r) { return l + r; });
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  auto r = sumrmq(n);
  ll ans = n + 1;
  for (int i = 0; i < n; i++) {
    if (r.query(0, a[i]) == a[i] - 1) {
      ans = min(ans, n - a[i]);
      r.update(a[i], 1);
    }
  }
  if (ans <= n)
    cout << ans << endl;
  else cout << -1 << endl;
  return 0;
}


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

#define SIZE_OF_ARRAY(array) sizeof(array)/sizeof(array[0])

int main() {
    int N;
    cin >> N;
    bool b = true;
    int count = 0;
    for(int i = 0; i < N; i++){
        int a;
        cin >> a;
        if(b){
            if((a%2==0 && a%3!=0 && a%5!=0)){
                b = false;
            }
        }
    }
    if(b){
        cout << "APPROVED" << endl;
    } else {
        cout << "DENIED" << endl;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
int n, k;
vector<vector<int> > ans;

void add(int x, int y, int c){
  ans[x + 2 * k + 1][y + 2 * k + 1] += c;
}

void add_rect(int x, int y){
  add(x + k - 1, y, 1);
  add(x + k - 1, y + k, -1);
  add(x - 1, y, -1);
  add(x - 1, y + k, 1);
}

int main(int argc, char const* argv[])
{
  cin >> n >> k;
  ans = vector<vector<int> >(5 * k + 2, vector<int>(4 * k + 2, 0));
  for(int i = 0; i < n; i++){
    int x, y;
    char c;
    cin >> x >> y >> c;
    if(c == 'B')y += k;
    x %= (2 * k);
    y %= (2 * k);
    if(y >= k){
      y -= k;
      x += k;
      x %= (2 * k);
    }
    add_rect(x + 1, y + 1);
    add_rect(x + 1, y - 2 * k + 1);
    add_rect(x - k + 1, y - k + 1);
    add_rect(x - 2 * k + 1, y - 2 * k + 1);
    add_rect(x - 2 * k + 1, y + 1);
  }
  for(int i = 1; i < 4 * k + 2; i++){
    for(int j = 0; j < 5 * k + 2; j++){
      ans[j][i] = ans[j][i] + ans[j][i - 1];
    }
  }
  int res = 0;
  for(int i = 5 * k; i >= 0; i--){
    for(int j = 0; j < 4 * k + 2; j++){
      ans[i][j] = ans[i + 1][j] + ans[i][j];
      res = max(res, ans[i][j]);
    }
  }
  cout << res << endl;
	return 0;
}


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

namespace AtCoder.Question
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var (h1, m1, h2, m2, k) = ReadValue<int, int, int, int, int>();
            var kisyou = new TimeSpan(h1, m1, 0);
            var syusin = new TimeSpan(h2, m2, 0);
            var result = syusin - kisyou - new TimeSpan(0, k, 0);
            Console.WriteLine(result.TotalMinutes.ToString());
        }
        static T ReadValue<T>()
        {
            return (T)Convert.ChangeType(Console.ReadLine(), typeof(T));
        }
        static (T1, T2) ReadValue<T1, T2>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T1)Convert.ChangeType(input[0], typeof(T1)), (T2)Convert.ChangeType(input[1], typeof(T2)));
        }
        static (T1, T2, T3) ReadValue<T1, T2, T3>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T1)Convert.ChangeType(input[0], typeof(T1)), (T2)Convert.ChangeType(input[1], typeof(T2)), (T3)Convert.ChangeType(input[2], typeof(T3)));
        }
        static (T1, T2, T3, T4) ReadValue<T1, T2, T3, T4>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T1)Convert.ChangeType(input[0], typeof(T1)), (T2)Convert.ChangeType(input[1], typeof(T2)), (T3)Convert.ChangeType(input[2], typeof(T3)), (T4)Convert.ChangeType(input[3], typeof(T4)));
        }
        static (T1, T2, T3, T4, T5) ReadValue<T1, T2, T3, T4, T5>()
        {
            var input = Console.ReadLine().Split(' ');
            return ((T1)Convert.ChangeType(input[0], typeof(T1)), (T2)Convert.ChangeType(input[1], typeof(T2)), (T3)Convert.ChangeType(input[2], typeof(T3)), (T4)Convert.ChangeType(input[3], typeof(T4)), (T5)Convert.ChangeType(input[4], typeof(T5)));
        }
        static T[] ReadValues<T>()
        {
            var input = Console.ReadLine().Split(' ');
            return input.Select(x => (T)Convert.ChangeType(x, typeof(T))).ToArray();
        }
    }
}


Measured memory_bytes: 27660
A,B = map(int,input().split())
a = []
b = []

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i ==0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr

a = factorization(A)
b = factorization(B)

c = 1
for i in range(len(a)):
    for j in range(len(b)):
        if a[i][0] == b[j][0]:
            if a[i][0] != 1:
                c += 1

print(c)

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

int main(){
    int N;
    cin>>N;
    vector<int> cnt(4,0);
    for(int i=0;i<N;i++){
        string out;
        cin>>out;
        if(out=="AC"){
            cnt[0]++;
        }else if(out=="WA"){
            cnt[1]++;
        }else if(out=="TLE"){
            cnt[2]++;
        }else{
            cnt[3]++;
        }
    }
    cout<<"AC"<<" x "<<cnt[0]<<endl;
    cout<<"WA"<<" x "<<cnt[1]<<endl;
    cout<<"TLE"<<" x "<<cnt[2]<<endl;
    cout<<"RE"<<" x "<<cnt[3]<<endl;
    return 0;
}

Measured memory_bytes: 3628
/*
スタック
*/
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"log"
	"os"
	"strconv"
	"strings"
)

// Stack スタック
type Stack struct {
	data []int
	idx  int
}

// NewStack スタック作成
func NewStack(maxLength int) *Stack {
	return &Stack{make([]int, maxLength+1), 0}
}
func (s *Stack) isFull() bool {
	return s.idx >= len(s.data)
}
func (s *Stack) isEmpty() bool {
	return s.idx == 0
}
func (s *Stack) push(e int) {
	if s.isFull() {
		panic("stack is full.")
	}
	s.idx++
	s.data[s.idx] = e
}
func (s *Stack) pop() int {
	if s.isEmpty() {
		panic("stack is empty.")
	}
	e := s.data[s.idx]
	s.idx--
	return e
}
func (s *Stack) String() string {
	var buf bytes.Buffer
	sep := ""
	for i := 1; i <= s.idx; i++ {
		buf.WriteString(fmt.Sprintf("%s%d", sep, s.data[i]))
		sep = " "
	}
	return buf.String()
}

func main() {
	stack := NewStack(100)
	reader := bufio.NewReader(os.Stdin)
	operands := eGetFields(reader)
	for _, op := range operands {
		switch op {
		case "+":
			rhs := stack.pop()
			lhs := stack.pop()
			stack.push(lhs + rhs)
		case "-":
			rhs := stack.pop()
			lhs := stack.pop()
			stack.push(lhs - rhs)
		case "*":
			rhs := stack.pop()
			lhs := stack.pop()
			stack.push(lhs * rhs)
		default:
			stack.push(eAtoi(op))
		}
		// fmt.Println(stack)
	}
	fmt.Println(stack.pop())
}
func eGetLine(r *bufio.Reader) string {
	s, err := r.ReadString(byte('\n'))
	if err != nil {
		if err != io.EOF {
			log.Fatal(err.Error())
		}
		return s
	}
	return strings.TrimRight(s, "\r\n")
}
func eGetInt(r *bufio.Reader) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Reader) []string {
	line := eGetLine(r)
	fields := strings.Split(line, " ")
	return fields
}
func eGetInts(r *bufio.Reader) []int {
	line := eGetLine(r)
	fields := strings.Split(line, " ")
	var ints []int
	for _, f := range fields {
		ints = append(ints, eAtoi(f))
	}
	return ints
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = " "
	}
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}



Measured memory_bytes: 1152
#include<iostream>
using namespace std;
int main(){
	int a,b,rone=100000;
	cin>>a;
	for(int i=0;i<a;i++){
		rone *=1.05;
		b = rone % 1000;
		rone -= b;
		if(b>0)	rone += 1000;		
	}
	cout<<rone<<endl;
}

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

using namespace std;
typedef long long ll;

const ll INF = ll(1e18) + 1;

int main(int argc, char *argv[])
{
	int N;
	ll K;

	cin >> N >> K;

	vector<ll> a(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	ll l = -INF, r = INF;
	while (l + 1 < r) {
		ll x = (l + r) / 2;
		bool ok = [&]{
			ll tot = 0;
			for (int i = 0; i < N; i++) {
				if (a[i] < 0) {
					int l = -1, r = N;
					while (l + 1 < r) {
						int c = (l + r) / 2;
						if  (a[c] * a[i] < x) {
							r = c;
						} else {
							l = c;
						}
					}
					tot += N - r;
				} else {
					int l = -1, r = N;
					while (l + 1 < r) {
						int c = (l + r) / 2;
						if (a[c] * a[i] < x) {
							l = c;
						} else {
							r = c;
						}
					}
					tot += r;
				}
				if (a[i] * a[i] < x) {
					tot--;
				}
			}
			tot /= 2;
			return tot < K;
		}();
		if (ok) {
			l = x;
		} else {
			r = x;
		}
	}
	cout << l << endl;
	return 0;
}

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

int main(){
	int a,b;

	cin >> a >> b;
	      if (a < b){
		  cout << "a < b" << endl;
	      }else if (a > b){
	      cout << "a > b" << endl;
	      }else if (a == b){
	      cout << "a == b"<< endl;
	      }

	return 0;
}



Measured memory_bytes: 3076
#include<iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main()
{
    int ans1 = 0, ans2 = 0;
    string str;
    cin >> str;
    REP(i, str.length()) {
        if (i % 2 == 0){
            if (str[i] == '0') ans1++;
            else ans2++;
        }
        else{
            if (str[i] == '1') ans1++;
            else ans2++;
        }
    }
    cout << min(ans1, ans2) << endl;

    return 0;
}

Measured memory_bytes: 512