akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

void solve(){
    string s, t;
    cin >> s >> t;
    ll cnt = 0;
    for(ll i = 0; i < s.length(); i++) s[i]!= t[i] ? ++cnt:0;
    cout << cnt << endl;
}


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  //int t;cin>>t;while(t--)
  solve();
  return 0;
}


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

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18

int main() {
	// 入力
	ll X,A;cin>>X>>A;
    
    // 出力
    if (X<A) cout<<0<<endl;
    else cout<<10<<endl;
    
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<list>
#include<queue>
#include<set>
#include<string>
#include <vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORL(i,a,b) for(ll i=(a);i<(b);++i)
#define REPL(i,n) FORL(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   RFOR(i,n,0)

using namespace std;

int main(){
	int a, b, c, d;
	scanf("%d %d %d %d", &a, &b, &c, &d);
	bool f = false;
	if (abs(a - c) <= d){
		f = true;
	}
	else if (abs(a - b) <= d&&abs(b - c) <= d){
		f = true;
	}
	if (f){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
//import java.util.Map.Entry;
//import java.util.stream.*;
//import java.math.*;

public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        Scanner sc = new Scanner(System.in);
        long MOD = (long) (Math.pow(10, 9) + 7);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int array[] = new int[n];
        forl_0(n, array, sc);
        Arrays.sort(array);
        long sum = 0;
        for (int i = n - 1; n - i <= k; i--) {
            sum += array[i];
        }
        System.out.println(sum);
        bw.flush();
    }
//==============================================//
//==============================================//
//==============================================//
//==============================================//
//==============================================//
//==============================================//
//==============================================//
//==============================================//

    static class Pair implements Comparable<Pair> {

        int a, b;

        public Pair(int x, int y) {
            a = x;
            b = y;
        }

        @Override
        public int compareTo(Pair p) {
            return a - p.a;
        }
    }

    static void forl_0(int n, int[] array, Scanner sc) {
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
    }

    static void forl_1(int n, int[] array, Scanner sc) {
        for (int i = 1; i <= n; i++) {
            array[i] = sc.nextInt();
        }
    }

    static void two_d(int n, int m, int[][] array, Scanner sc) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                array[i][j] = sc.nextInt();
            }
        }
    }

    static boolean isPrime(long n) {
        if (n < 2) {
            return false;
        } else if (n == 2 || n == 3) {
            return true;
        } else if (n % 2 == 0 || n % 3 == 0) {
            return false;
        }
        long sqrtN = (long) Math.sqrt(n) + 1;
        for (long i = 6L; i <= sqrtN; i += 6) {
            if (n % (i - 1) == 0 || n % (i + 1) == 0) {
                return false;
            }
        }
        return true;
    }

    public static long gcd(long a, long b) {
        return (b == 0) ? a : gcd(b, a % b);
    }

    public static long lcm(long a, long b) {
        return a / gcd(a, b) * b;
    }
}


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

namespace _0003
{
    class Program
    {
        static void Main(string[] args)
        {
            string Kaisuu;
            int kaisuu;
            int a;
            int b;
            int c;
            Kaisuu = Console.ReadLine();
            kaisuu = Int32.Parse(Kaisuu);
            for (int i = 0; i < kaisuu; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                Array.Sort(x);
                a = x[0] * x[0];
                b = x[1] * x[1];
                c = x[2] * x[2];
                if(a+b==c)
                {
                    Console.WriteLine("YES");
                }
                else
                {
                    Console.WriteLine("NO");
                }
            }
        }
    }
}

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

P node[6]{
	{1,3},{-1,2},{4,5},{1,-1},{5,3},{3,1}
};
int main() {
	string p;
	while (cin >> p, p != "#") {
		int pos = 0;
		for (char c : p) {
			if (c == '0')pos = node[pos].first;
			else pos = node[pos].second;
			if (!~pos)break;
		}
		puts(pos == 5 ? "Yes" : "No");
	}
}

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

#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);

int main() {
    fast_io;

    ll n;
    cin>>n;

    vector<ll> even;

    while(n--) {
        ll num;
        cin>>num;

        if(num%2==0) {
            even.push_back(num);
        }
    }

    bool condition=true;
    for(int i=0;i<even.size();i++) {
        if(even[i]%3!=0&&even[i]%5!=0) {
            condition=false;
        }
    }

    if(condition) cout<<"APPROVED"<<endl;
    else cout<<"DENIED"<<endl;
}




Measured memory_bytes: 3624
// Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2!!!!

#include <cmath>
#include <iostream>
#include <algorithm>

using namespace std;

inline long long mod_fibonacci_numberDiv2(int n)
{
	if (n < 3)
	{
		return n == 0 ? 0 : 1;
	}

	int dp[3] = { 1, 1, 2 };

	for (int i = 3; i < n; i += 3)
	{
		dp[0] = (dp[1] + dp[2]) % 1000000007;
		dp[1] = (dp[2] + dp[0]) % 1000000007;
		dp[2] = (dp[0] + dp[1]) % 1000000007;
	}

	return dp[(n - 1) % 3];
}

long long K;

int main()
{
	cin >> K;

	long long x_yDiv2 = 2 * sqrt(K - sqrt(K / 100) - 0.01) - 1; // x + y

	long long min_Div2 = ((x_yDiv2 + 1) * (x_yDiv2 + 1) / 4) + 1;
	long long max_Div2 = ((x_yDiv2 + 2) * (x_yDiv2 + 2) / 4);

	long long x, y;

	if (2 * K <= min_Div2 + max_Div2)
	{
		y = (K - min_Div2) * 2;
	}
	else
	{
		y = (max_Div2 - K) * 2 + 1;
	}

	x = x_yDiv2 - y;

	cout << (mod_fibonacci_numberDiv2(x + 2) * mod_fibonacci_numberDiv2(y + 2)) % 1000000007 << endl;

	return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

  int n;
  cin >> n;
  int a[n];
  vector<pair<int, int> > dic[n];
  rep(i,n){
    cin >> a[i];
    rep(j,a[i]){
      int x,y;
      cin >> x >> y;
      --x;
      dic[i].pb(mp(x,y));
    }
  }
  int ans=0;
  rep(k,(1<<n)){
    bool ok=true;
    rep(i,n)rep(j,a[i]){
      if(k & (1<<i)){
	int x = dic[i][j].first;
	int y = dic[i][j].second;
	//	if(k==3){
	//	  cout << bitset<3>( k && (1<<i)) << endl;
	//	  cout << "k, x " << bitset<3>(k)<< " " << bitset<3>((1<<x)) << endl;
	//      cout << x << y << endl;
	//	}
	if(y==1){//xは親切
	  if((k & (1<<x))){}
	  else ok=false;
	}
	else{//xは不親切
	  if((k & (1<<x))) ok=false;
	}
      }
    }
    //    if(k==3) cout << ok << endl;
    //    cout << ok << endl;
    if(ok) ans = max(ans, __builtin_popcount(k));
  }
  cout << ans << endl;
  
  
  return 0;
    

}


Measured memory_bytes: 256
N = int(input())

lis = ["3","5","7"]

count = 0

num = ""

def dfs(num):
    global count
    n = int(num)
    if n <= N:
        if "3" in num and "5" in num and "7" in num:
            count += 1
    else:
        return
    if int(num + "3") <= N:
        tmp1 = dfs(num + "3")
    if int(num + "5") <= N:
        tmp2 = dfs(num + "5")
    if int(num + "7") <= N:
        tmp3 = dfs(num + "7")




dfs(num + "3")
dfs(num + "5")
dfs(num + "7")
print(count)

Measured memory_bytes: 3064
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
-- import System.IO.Unsafe
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getDouble = readLn :: IO Double
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnBin :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
fnBin op f g x = op (f x) $ g x
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
modifyArray :: (Ix i, MArray a e m) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = readArray arr ix >>= writeArray arr ix . f
-- end of templete

f n t = min t (n-1-t)

main = do
    n <- getInt
    k <- getInt
    replicateM k getInts >>= mapM_ (print . (+1) . (`mod` 3) . minimum . map (f n . (subtract 1)))

Measured memory_bytes: 5212
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m;
  cin>>n;
  vector<int> ts(n);
  int sum=0;
  for(int i=0;i<n;i++){
    cin>>ts.at(i);
    sum+=ts.at(i);
  }
  cin>>m;
  for(int i=0;i<m;i++){
    int p,x;
    cin>>p>>x;
    cout<<sum-ts.at(p-1)+x<<endl;
  }
}

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 << '1' << endl;
        else if(a==b || a==c || b==c)cout << '2' << endl;
            else cout << '3' << endl;
    return 0;
}

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = int;

int main()
{
    ll i,j,k;
    ll h,w;
    cin >> h >> w;
    ll inf = 160*80;
    vector<vector<ll>> a(h,vector<ll>(w,0));
    vector<vector<ll>> b(h,vector<ll>(w,0));
    for(i = 0;i < h;++i){
        rep(j,w) cin >> a.at(i).at(j);
    }
    for(i = 0;i < h;++i){
        rep(j,w) cin >> b.at(i).at(j);
    }
    vector<vector<vector<ll>>> dp(h, vector<vector<ll>>(w, vector<ll>(2*inf+1,0)));
    ll tmp = a.at(0).at(0) - b.at(0).at(0);
    dp.at(0).at(0).at(inf + tmp) = 1;
    dp.at(0).at(0).at(inf - tmp) = 1;
    for(i = 0;i < h;++i){
        rep(j,w){
            ll ni = i + 1;
            ll nj = j + 1;
            ll t1, t2;
            if(ni < h) t1 = a.at(ni).at(j) - b.at(ni).at(j);
            if(nj < w) t2 = a.at(i).at(nj) - b.at(i).at(nj);
            rep(k, 2*inf+1){
                if(dp.at(i).at(j).at(k)){
                    if(ni < h){
                        dp.at(ni).at(j).at(k + t1) = 1;
                        dp.at(ni).at(j).at(k - t1) = 1;
                    }
                    if(nj < w){
                        dp.at(i).at(nj).at(k + t2) = 1;
                        dp.at(i).at(nj).at(k - t2) = 1;
                    }
                }
            }
        }
    }
    ll ans = 1e9;
    for(i = 0;i < 2*inf + 1;++i){
        if(dp.at(h-1).at(w-1).at(i)){
            ans = min(ans, abs(i - inf));
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 651624
#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int n;
  vector<int> b;

  cin >> n;

  b.resize(n - 1);

  for (int i = 0; i < n - 1; i++)
  {
    cin >> b[i];
  }

  int sum = b.front() + b.back();
  for (int i = 1; i < n - 1; i++)
  {
    int min = b[i - 1];
    if (b[i] < min)
    {
      min = b[i];
    }
    sum += min;
  }

  cout << sum << endl;
  return 0;
}

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

// 一般に「xor和 <= 加算和」が成り立つ．
// xor和では1が重なると消えてしまうが，加算和だと繰り上がりとなる
// 「xor和 == 加算和」が成立しているとき，各桁を見ると1は高々1つ（両方の数字の同一桁に1が立っていることはない）
// だから，「xor和 == 加算和を満たす区間の部分区間」もxor和 == 加算和を満たしている => しゃくとり法

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

    long long res = 0;
    int right = 0;
    int sum = 0;

    for (int left = 0; left < n; left++) {
        while (right < n && (sum^a[right]) == (sum+a[right])) {
            sum += a[right];
            right++;
        }
        res += right - left;
        if (left == right) right++;
        else sum -= a[left];
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;
 
public class Main{
  public static void main(String[] args){
    Scanner stdIn=new Scanner(System.in);
    int N=stdIn.nextInt();
    int m=N%10;
    switch(m){
      case 0: System.out.println("pon"); break;
      case 2: System.out.println("hon"); break;
      case 4: System.out.println("hon"); break;
      case 5: System.out.println("hon"); break;
      case 7: System.out.println("hon"); break;
      case 9: System.out.println("hon"); break;
      case 1: System.out.println("pon"); break;
      case 6: System.out.println("pon"); break;
      case 8: System.out.println("pon"); break;
      case 3: System.out.println("bon"); break;
    }
  }
}

Measured memory_bytes: 35464
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int m = scanner.nextInt();
        long digit = 0;
        long all = 0;
        for (int i = 0; i < m; i++) {
            final long d = scanner.nextLong();
            final long c = scanner.nextLong();

            digit += c;
            all += d * c;
        }

        long answer = digit - 1 + (all - 1) / 9;
        System.out.println(answer);
    }
}


Measured memory_bytes: 93296
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int P = 998244353;
constexpr int BASE[] {19260817, 20030912, 19491001, 114514, 1919810};
constexpr int INV_BASE[] {494863259, 434508607, 157440299, 137043501, 595887626};
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    string s;
    cin >> n >> s;
    vector<vector<int>> a(n + 1);
    vector<vector<int>> b(n + 1);
    for (int i = 0; i <= n; ++i) {
        a[i].resize(5);
        b[i].resize(5);
    }
    for (int j = 0; j < 5; ++j) {
        int c = 0;
        for (int i = n - 1; i >= 0; --i) {
            switch (s[i]) {
                case '+' :
                    c = (c + 1) % P;
                    break;
                case '-':
                    c = (c - 1 + P) % P;
                    break;
                case '>':
                    c = 1LL * c * BASE[j] % P;
                    break;
                case '<':
                    c = 1LL * c * INV_BASE[j] % P;
                    break;
            }
        }
        auto calc = [&](vector<vector<int>> &a, int c) {
            a[n][j] = c;
            int k = 1, b = 0;
            for (int i = n - 1; i >= 0; --i) {
                switch (s[i]) {
                    case '+' :
                        b = (b - k + P) % P;
                        break;
                    case '-':
                        b = (b + k) % P;
                        break;
                    case '>':
                        k = 1LL * k * INV_BASE[j] % P;
                        break;
                    case '<':
                        k = 1LL * k * BASE[j] % P;
                        break;
                }
                a[i][j] = (1LL * k * c + b) % P;
            }
        };
        calc(a, c);
        calc(b, 0);
    }
    LL ans = 0;
    map<vector<int>, int> cnt;
    for (int i = 0; i <= n; ++i) {
        ans += cnt[b[i]];
        ++cnt[a[i]];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 82580
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }


main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a, b, n;
    cin >> a >> b >> n;
    int ans = 0;
    auto eval = [&] (int x) {
        if (x > n) return 0ll;
        return ((a * x) / b - a * (x / b));
    };
    int X = a;
    for (int i = 1; i * i <= X; i++) {
        if (X % i == 0) {
            umax(ans, eval(i));
            umax(ans, eval(X / i));
        }
    }
    for (int i = 1; i <= a; i++) {
        umax(ans, eval(i));
    }
    for (int i = max(1ll, b - a); i <= b; i++) {
        umax(ans, eval(i));
    }
    X = b;
    for (int i = 1; i * i <= X; i++) {
        if (X % i == 0) {
            umax(ans, eval(i));
            umax(ans, eval(X / i));
        }
    }
    X = n;
    for (int i = 1; i * i <= X; i++) {
        if (X % i == 0) {
            umax(ans, eval(i));
            umax(ans, eval(X / i));
        }
    }
    cout << ans << '\n';
}


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

string s, t;

bool check(int dir) {
	int i = 0;
	int j = 0;
	int len = 0;
	
	while (len < s.length()) {
		char key = s[len];
		if (dir == 0) {
			for (; i < s.length() && s[i] != key; i++);
			if (i == s.length()) return false;
			i++;
		}
		else {
			for (; j < t.length() && t[j] != key; j++);
			if (j == t.length()) return false;
			j++;
		}
		len++;
		dir = !dir;
	}
	return true;
}

int main() {
	cin >> s >> t;
	if (check(0) || check(1)) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }
	return 0;
}

Measured memory_bytes: 3224
S = input()
a = int(S[0:2])
b = int(S[2:4])
if 1 <= a <= 12 and 1 <= b <= 12:
    print('AMBIGUOUS')
elif 1 <= a <= 12:
    print('MMYY')
elif 1 <= b <= 12:
    print('YYMM')
else:
    print('NA')

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

int main(void) {
  string s;
  cin >> s;
  int i=0,j =s.size()-1;
  while(1) {
    if(s[i]=='A') break;
    i++;
  }
  while(1) {
    if(s[j]=='Z') break;
    j--;
  }
  cout << j-i+1 << endl;
}

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

int main()
{
  int n;
  cin>>n;
  int s[n];
  for (int i = 0; i < n;i++){
    cin >> s[i];
  }
  int count = 0;
  sort(s, s + n, greater<int>());
  for(int i=0;i<n-1;i++){
    if(s[i]==s[i+1])
      count++;
  }
  cout << n-count << endl;
}

Measured memory_bytes: 256
#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 rrng(a) a.rbegin(),a.rend()
#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 eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<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 tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
  ll a,b,c,d;
  cin >> a >>b >> c >> d;
  ll x = b/c-(a-1)/c + b/d-(a-1)/d;
  ll e = lcm(c,d);
  x -= (b/e-(a-1)/e);
  ll ans = b-a-x+1;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <utility>
#include <map>
int needleX[4] = { -1,0,1,0 };
int needleY[4] = { 0,1,0,-1 };

#define const INF=1<<21;
int main(){
	long long A,B,k;
    std::cin >> A >> B >> k;
    for(int i=0;i<k;i++){
        if(i%2==0){
            if(A%2==1){
                A-=1;
            }
            B+=A/2;
            A/=2;
        }else{
            if(B%2==1){
                B-=1;
            }
            A+=B/2;
            B/=2;
        }
    }
    std::cout << A << " " << B <<std::endl;
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int x,d;
    int y=0;
    cin>>x>>d;
    int z=0;
    while(1)
    {
        y+=(d*2)+1;
        z++;
        if(y>=x)
        {
            break;
        }
    }
    cout <<z;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int BS(int search,int *s,int start,int fin){
  if(start==fin)
    return start;
  if(s[(start+fin)/2]<search)
    return BS(search,s,start,(start+fin)/2);
  return BS(search,s,(start+fin)/2+1,fin);
}

int main(){
  int n,i,j,colornum=0;
  scanf("%d",&n);
  int a[n+1],color[n+1];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    color[i]=-1;
  }
  for(i=0;i<n;i++){
    int num;
    num=BS(a[i],color,0,colornum);
    if(num==colornum && color[num]>=a[i]){
      colornum++;
      color[colornum]=a[i];
    }
    else
      color[num]=a[i];
  }
  printf("%d\n",colornum+1);
  return 0;
}


Measured memory_bytes: 896
import java.util.*;

public class Main {

    int[] parents;

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int q = sc.nextInt();
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }

        for (int i = 0; i < q; i++) {
            int comm = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();

            if (comm == 0) {
                unite(x, y);
//                debug(i, parents);
            } else if (comm == 1){
                System.out.println(same(x, y) ? "1" : "0");
            }
        }

        // write your code
//        System.out.println("Hello World");
    }

    void unite(int x, int y) {
        int rep1 = findSet(x);
        int rep2 = findSet(y);
        parents[rep2] = rep1;
    }

    int findSet(int x) {
        int current = x;
        while (parents[current] != current) {
            current = parents[current];
        }
        return current;
    }

    boolean same(int x, int y) {
        return findSet(x) == findSet(y);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}



Measured memory_bytes: 102348
n = gets.to_i
vs = gets.chomp.split(" ").map(&:to_f)

sorted = vs.sort
result = 0
sorted.each_with_index do |val, i|
    if i == sorted.length - 1
        break
    end
    if i == 0
        result += (val + sorted[i + 1]) / 2
        next
    end
    result = (result + sorted[i + 1]) / 2
end
print result    

Measured memory_bytes: 14312
l = list()
l.append(int(input()))
s = set(l)

while(1):
    if(int(l[-1] % 2) == 0):
        l.append(int(l[-1]/2))
    else:
        l.append(int(l[-1]*3 + 1))
    s = set(l)
    if(len(s) != len(l)):
        print(len(l))
        break

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int long
using pi=pair<int,int>;
struct edge{
    int a, b;
    edge(){};
    edge(int x, int y)
        : a(x)
        , b(y){};
};
signed main() {
    int n;
    cin>>n;
    vector<edge> E(n - 1);
    vector<vector<int>> G(n);
    for (int i = 0; i < n - 1; ++i) {
        cin >> E[i].a >> E[i].b;
        --E[i].a, --E[i].b;
        G[E[i].a].push_back(E[i].b);
        G[E[i].b].push_back(E[i].a);
    }
    int m0 = 3, m1 = 1, m2 = 2;
    queue<pi> que;
    vector<bool> vis(n, false);
    vector<int> col(n, 0),res(n);
    int cred = 0, cblue = 0;
    que.push(pi(0, -1));
    while (!que.empty()) {
        pi q = que.front();
        que.pop();
        col[q.first] = q.second;
        ++(q.second==-1 ? cred : cblue);
        vis[q.first] = true;
        for (auto i : G[q.first]) {
            if (!vis[i]) que.push(pi(i, -3-q.second));
        }
    };

    for(int i=0;i<n;++i){
        if(m2<=n&&(cred*3<=n&&col[i]==-2&&m1>m2 || cblue*3<=n&&col[i]==-1&&m1>m2 || min(cred,cblue)*3>n&&col[i]==-2)){
            res[i] = m2;
            m2 += 3;
        }
        else if(m1<=n&&(cred*3<=n&&col[i]==-2&&m1<=m2 || cblue*3<=n&&col[i]==-1&&m1<=m2 || min(cred,cblue)*3>n&&col[i]==-1)){
            res[i] = m1;
            m1 += 3;
        }
        else{
            res[i]=m0;
            m0 += 3;
        }
    }

    for (int i = 0; i < n; ++i) cout << (i ? " " : "") << res[i];
    cout << endl;
}

Measured memory_bytes: 22632
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
            while(true){
            int x = sc.nextInt();
            int y = sc.nextInt();
            if(x==0 && y==0)
            break;
            if(x<y)
            System.out.println(x + " " + y);
            else
            System.out.println(y + " " + x);
        }
    }
}


Measured memory_bytes: 35972
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

int x,a;

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

Measured memory_bytes: 256
local function meld(a,b)
    if not a then
        return b
    elseif not b then
        return a
    elseif a[1]<b[1] then
        b[4]=a[3]
        a[3]=b
        return a
    else
        a[4]=b[3]
        b[3]=a
        return b
    end
end

local function pair(a)
    local b,c,d,e
    while a do
        c=false
        b=a
        a=a[4]
        b[4]=false
        if a then
            c=a
            a=a[4]   
            c[4]=false
        end
        b=meld(b,c)
        b[4]=d
        d=b
    end
    while d do
        e=d
        d=d[4]
        a=meld(a,e)
    end
    return a
end


local PairingHeap={}

PairingHeap.empty=function(self)
    return not self[1]
end

PairingHeap.push=function(self,key,value)
    self[1]=meld(self[1],{key,value,false,false})
end

PairingHeap.top=function(self)
    return self[1][2]
end

PairingHeap.pop=function(self)
    self[1]=pair(self[1][3])
end

PairingHeap.join=function(self,other)
    if self[1][1]<other[1][1]then
		other[1][4]=self[1][3]
        self[1][3]=other[1]
	else
		self[1][4]=other[1][3]
        other[1][3]=self[1]
        self[1]=other[1]
    end
    return self
end

PairingHeap.new=function(self)
    local obj={}
    setmetatable(obj,{__index=PairingHeap})
    return obj
end

----------
 
local n,d,a=io.read("n","n","n")
local pq=PairingHeap:new()
for i=1,n do
    local x,h=io.read("n","n")
    pq:push(x,{x,h,0})
end
 
local atack=0
local total=0
while not pq:empty() do
    local x,h,c=table.unpack(pq:top())
    pq:pop()
    if c==0 then
        if atack*a<h then
            h=h-atack*a
            local count=(h-1)//a+1
            pq:push(x+2*d+0.5,{x+2*d,count,1})
            total=total+count
            atack=atack+count
        end
    else
        atack=atack-h
    end
end
print(total)

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

public class Main{

	public static void BubbleSort(String[] array){
		String[] array_cl=(String[])array.clone();

        int len=array_cl.length;
        String swap;
        for(int i=0;i<len-1;i++){
            for(int j=len-1;i<j;j--){

                if(array_cl[j].charAt(array_cl[j].length()-1)<array_cl[j-1].charAt(array_cl[j-1].length()-1)){
                    swap=array_cl[j];array_cl[j]=array_cl[j-1];array_cl[j-1]=swap;
                }
            }
        }
        for(int i=0;i<len;i++){
        System.out.print(array_cl[i]);
        if(i!=len-1)System.out.print(" ");}
        System.out.println();

        //array??¨array_cl???????????????
		int a,b, cnt;
		cnt=a=b=0;

        for(int i=0;i<len-1;i++){
        	if(array_cl[i].charAt(array_cl[i].length()-1)==array_cl[i+1].charAt(array_cl[i+1].length()-1)){
        		for(int j=0;j<len;j++){
        			if(array[j]==array_cl[i])a=j;
        			if(array[j]==array_cl[i+1])b=j;
                	}

        		if(a>b){cnt++;break;}
        	}
        }
        if(cnt>0)System.out.println("Not stable");
        if(cnt==0)System.out.println("Stable");
    }

	public static void SelectionSort(String[] array){
		String[] array_cl=(String[])array.clone();
		int len=array_cl.length;
		int min;
		String swap;
		for(int i=0;i<len-1;i++){
			min=i;
			for(int j=i+1;j<len;j++){
			if(array_cl[min].charAt(array_cl[min].length()-1)>array_cl[j].charAt(array_cl[j].length()-1))min=j;
			}
			if(min!=i){
				swap=array_cl[i];array_cl[i]=array_cl[min];array_cl[min]=swap;

		}

		}

		//??\????????????
		for(int i=0;i<len;i++){
		System.out.print(array_cl[i]);
		if(i!=len-1)System.out.print(" ");}
		System.out.println();

		int a,b, cnt;
		cnt=a=b=0;

        for(int i=0;i<len-1;i++){
        	if(array_cl[i].charAt(array_cl[i].length()-1)==array_cl[i+1].charAt(array_cl[i+1].length()-1)){
        		for(int j=0;j<len;j++){
        			if(array[j]==array_cl[i])a=j;
        			if(array[j]==array_cl[i+1])b=j;
                	}

        		if(a>b){cnt++;break;}
        	}
        }
        if(cnt>0)System.out.println("Not stable");
        if(cnt==0)System.out.println("Stable");
	}

	public static void main(String[] args){

		int n;
		String str;
		String[] str_array;
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));

		try{
		n=Integer.parseInt(reader.readLine());
		str=reader.readLine();
		str_array=str.split(" ");

		BubbleSort(str_array);
		SelectionSort(str_array);
		}catch(IOException e){
			//????????????
		}

	}

}

Measured memory_bytes: 24168
A,B,C,D,E,F = map(int,input().split())
W=set()
for a in range(0,F+1,100*A):
    for b in range(0,F+1-a,100*B):
        W.add(a+b)
S=set()
for c in range(0,F+1,C):
    for d in range(0,F+1-c,D):
        S.add(c+d)
rate = -1
for w in W:
    for s in S:
        if 0 < w+s <= F and s <= w*E//100:
            if s/(w+s) > rate:
                rate = s/(w+s)
                ans = w+s, s
print(ans[0],ans[1])


Measured memory_bytes: 3188
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
typedef long long ll;
typedef double dd;
#define For(i,j,k) for (int i=(int)j;i<=(int)k;++i)
#define Forr(i,j,k) for (int i=(int)j;i>=(int)k;--i)
#define Set(a,p) memset(a,p,sizeof(a))
using namespace std;

template<typename T>bool chkmax(T &a,T b) { return a<b?a=b,1:0; }
template<typename T>bool chkmin(T &a,T b) { return a>b?a=b,1:0; }

const int maxn=2e5+1e2;
int n;
ll Ans;
int val[maxn];

inline void file() {
	freopen("ARC100C.in","r",stdin);
	freopen("ARC100C.out","w",stdout);
}

inline int read() {
	int x=0,p=1;
	char c=getchar();
	while (!isdigit(c)) { if (c=='-') p=-1; c=getchar();}
	while (isdigit(c)) { x=(x<<1)+(x<<3)+(c-'0'); c=getchar();}
	return x*p;
}

int main() {
//	file();
	n=read();
	For (i,1,n) val[i]=read(),val[i]-=i;
	sort(val+1,val+n+1);
	int Val=(n&1?val[(n+1)/2]:val[n/2]);
	For (i,1,n) Ans+=1ll*abs(val[i]-Val);
	printf("%lld",Ans);
	return 0;
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int h, w, d;
int ans[500][500], z[1000][1000];
string s = "RYGB";
template<typename T> T setmod(T & x, T y) { return ((x %= y) += y) %= y; }

int main() {
	cin >> h >> w >> d;
	
	if(d % 2 != 0) {
		inc(i, h) {
		inc(j, w) {
			ans[i][j] = (i + j) % 2;
		}
		}
	} else {
		inc(i, d) {
		inc(j, d) {
			int I = i; if(d % 4 == 0) { I -= (i + 1) / (d / 2); }
			int J = j; if(d % 4 == 0) { J -= (j + 1) / (d / 2); }
			I %= 2;
			J %= 2;
			z[i][j] = I * 2 + J;
		}
		}
		
		inc(i, h) {
		inc(k, w) {
			int j = k + (i + k) % 2;
			int I = (i - j) / 2;
			int J = (i + j) / 2;
			setmod(I, d);
			setmod(J, d);
			ans[i][k] = z[I][J];
		}
		}
	}
	
	inc(i, h) {
	inc(j, w) {
		cout << s[ans[i][j]];
	} cout << "\n";
	}
	
	return 0;
}


Measured memory_bytes: 5376
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

//import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// Scanner in = new Scanner(System.in);
		int count;
		while ((count = Integer.parseInt(br.readLine())) > 0) {
			int[] ice = new int[10];
			while (count-- > 0) {
				ice[Integer.parseInt(br.readLine())]++;
			}
			for (int b : ice) {
				if (b != 0) {
					char[] c = new char[b];
					Arrays.fill(c, '*');
					System.out.println(c);
				} else {
					System.out.println('-');
				}
			}
		}
	}
}

Measured memory_bytes: 25384
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


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

	long sub = 1;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		if (a % 2 == 0) {
			sub *= 2;
		}
	}
	cout << pow(3,n) - sub << endl;


	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
#define int long long
#define str string
#define rep(i,j) for(int i=0;i<(int)(j);i++)
typedef long long ll;
typedef long double ld;
const ll inf = 4523372036854775807;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct S {//辺の情報を入れる変数
	int from, to, cost;
};
struct H {
	int x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(ld a, ld b, ld c, ld d) {
	return sqrt(pow(a - c, 2) + pow(b - d, 2));
}//rad＝座標上の2点間の距離
int ari(int a, int b, int c) {
	return (a + b)*c / 2;
}//等差数列の和
bool suf(ld a, ld b, ld c, ld d) {
	if (b <= c || d <= a) return 0;
	return 1;
}//[a,b),[c,d)
//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	string a[2];
	for (int i = 0; i < 2; i++)
		cin >> a[i];
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < 3; j++) {
			if (a[1 - i][2 - j] != a[i][j]) {
				cout << "NO\n";
				return 0;
			}
		}
	}
	cout << "YES\n";
	getchar(); getchar();
}

Measured memory_bytes: 256
///I am Groot |*|
///19.09.2020>>03.40 PM
#include <iostream>
using namespace std;

int main()
{
    int n;

    string s;
    cin>>n;
    cin>>s;
    if(n%2==1)
    {
        cout<<"No";
    }
    else
    {
        int x[125] = {0},flag=1;
        for(int i=0; i<n; i++)
        {
            x[s[i]]++;
        }
        for(int i=97; i<123; i++)
        {
            //cout<<x[i]<<" ";
            if(x[i]%2==1)
            {
                cout<<"No";
                flag=0;
                break;
            }
        }
        if(flag==1)
        {
            cout<<"Yes";
        }
    }
}


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[100001]; for(int i = 0; i < n; i++) a[sc.nextInt()]++;
		int max = 0;
		for(int i = 0; i+2 < 100001; i++) {
			max = Math.max(max, a[i]+a[i+1]+a[i+2]);
		}
		System.out.println(max);
		sc.close();
	}
}

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

int64_t mod=1e9+7;

int64_t modpow(int64_t a,int64_t n){
  int64_t res=1;
  while(n>0){
    if(n&1){
      res*=a;
      res%=mod;
    }
    a*=a;
    a%=mod;
    n>>=1;
  }
  return res;
}

int64_t modinv(int64_t a){
  return modpow(a,mod-2);
}

int64_t comb(int64_t n,int64_t r){
  int64_t res=1;
  for(int i=1;i<=r;i++){
    res*=((n-i+1)*modinv(i))%mod;
    res%=mod;
  }
  return res;
}
// int64_t comb(int64_t n,int64_t r){
//   if(r==0){
//     return 1;
//   }
//   return (((n-r+1)*modinv(r))%mod*comb(n,r-1))%mod;
// }

int main(){
  int64_t n,a,b;
  cin >> n >> a >> b;
  int64_t ans=0;
  ans=modpow(2,n)-1;
  ans-=comb(n,a);
  ans%=mod;
  if(ans<0){
    ans+=mod;
  }
  ans-=comb(n,b);
  ans%=mod;
  if(ans<0){
    ans+=mod;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(a==5&&b==5&&c==7)
	{
	  cout<<"YES"<<endl;return 0;
	}
    if(a==5&&b==7&&c==5)
	{
	  cout<<"YES"<<endl;return 0;
	}
    if(a==7&&b==5&&c==5)
	{
   	  cout<<"YES"<<endl;return 0;
	}
    cout<<"NO"<<endl;
}

Measured memory_bytes: 256
def factorization(n):
    m=n
    counter_map={}
    i=2
    tmp=1
    while n!=1:
        #因数に持つか判定
        if n%i==0:
            n=n//i
            #素数判定
            for j in range(2,int(i**(1/2))+1):
                if i%j==0:
                    break
            else:
                tmp*=i
                if i not in counter_map:
                    counter_map[i]=1
                    tmp=1
                else:
                    if tmp not in counter_map:
                        counter_map[tmp]=1
                        tmp=1
        else:
            i+=1
            tmp=1
        if i>int(m**(1/2)) and n!=1:
            counter_map[n]=1
            break
    return counter_map


a=int(input())
b=factorization(a)
sum=0

for i in b.keys():
    counter=0
    for j in range(1,41):
        if b[i]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter

print(sum)



Measured memory_bytes: 64792
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int a, b;
  string text, ans = "Yes";
  cin >> a >> b >> text;
  for (int i = 0; i < a; ++i) {
    if (!isdigit(text[i])) ans = "No";
  }
  if (text[a] != '-') ans = "No";
  for (int j = a + 1; j < text.size(); ++j) {
    if (!isdigit(text[j])) ans = "No";
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {
	int num, target;

	cin >> num;
		target = num % 10;

		if (target == 2 or target == 4 or target == 5 or target == 7 or target == 9) {
			cout << "hon" << endl;
		}
		else if (target == 0 or target == 1 or target == 6 or target == 8) {
			cout << "pon" << endl;
		}
		else {
			cout << "bon" << endl;
		}

	return 0;
}

Measured memory_bytes: 3132
#include <stdio.h>

int main()
{
    int m, f, r;

    do
    {
        scanf("%d %d %d", &m, &f, &r);
        if (m != -1 || f != -1 || r != -1)
        {
            if (m == -1 || f == -1)
            {
                printf("F\n");
            }
            else if (m + f >= 80)
            {
                printf("A\n");
            }
            else if (m + f >= 65)
            {
                printf("B\n");
            }
            else if (m + f >= 50)
            {
                printf("C\n");
            }
            else if (m + f >= 30)
            {
                if (r >= 50)
                {
                    printf("C\n");
                }
                else 
                {
                    printf("D\n");  
                }    
            }
            else
            {
                printf("F\n");
            }
            
        }
    } while (m != -1 || f != -1 || r != -1);
    return 0;
}


Measured memory_bytes: 2104
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4,sse4.1,sse4.2,avx,tune=native")
#include <bits/stdc++.h>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amax(T& a,T b){if(a < b) a = b;}

ll gcd(ll x, ll y){ return y? gcd(y, x%y): x; }
int main(){
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VL a(n), lf(n), rg(n);
	rep(i, n) cin >>a[i];
	
	if(n <=2) {cout <<max(a[0], a[1])<<"\n"; return 0;}
	rep(i, n){
		if(i==0) lf[0] = a[0];
		else lf[i] = gcd(lf[i-1], a[i]);
	}
	repr(i, n-1, 0){
		if(i== n-1) rg[i] = a[i];
		else rg[i] = gcd(rg[i+1], a[i]);
	}

	ll ans = max(rg[1], lf[n-2]);
	rep(i, n-2) ans = max(ans, gcd(lf[i], rg[i+2]));
	cout << ans <<"\n";
	return 0;
}


Measured memory_bytes: 2560
N=int(input())
L=[]
n=1
while n<=N:
    L.append(list(input().split()))
    L[n-1][1]=int(L[n-1][1])*(-1)
    L[n-1].append(n)
    n+=1
L_sorted=sorted(L, key=lambda _:(_[0],_[1]))
n=1
while n<=N:
    L_sorted[n-1].append(n)
    n+=1
n=1
while n<=N:
    print(L_sorted[n-1][2])
    n+=1

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

using namespace std;

int main () {
    int a, b; cin >> a >> b;
    if (a < 10 && b < 10) {
        cout << a * b << endl;
    } else  {
        cout << -1 << endl;
    }
}

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

int A[100005];

int main() {
    
    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);

    int N, K, Q;
    cin >> N >> K >> Q;

    for(int i=1; i<=Q; i++)
    {
        int x;
        cin >> x;

        A[x]++;
    }

    for(int i=1; i<=N; i++)
    {
        if(Q - A[i] < K)
            cout << "Yes\n";
        else
            cout << "No\n";
    }

    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  int maxv = 0;;
  int premax = 0;
  for (int i = 0;i < N;i++){
    cin >> A.at(i);
    if ( maxv < A.at(i)){
      maxv = A.at(i);
    }else{
      premax = max(premax,A.at(i));
    }    
  }
  for ( int i =0; i < N; i++){
    if ( A.at(i) == maxv){
      cout << premax << endl;
    }else{
      cout <<maxv << endl;
    }
  }
}



Measured memory_bytes: 2432