akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define printfdouble(x) printf("%.12f\n",(x))
#define chartoint(c) (int)((c) - '0')
#define chartoll(c) (long long)((c) - '0')
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}


int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int N; cin >> N;
    int a[100100], b[100100], c[100100];
    int dp[100100][3];
    Fill(dp,0);
    rep(i,0,N) cin >> a[i] >> b[i] >> c[i];
    rep(i,0,N){
        chmax(dp[i+1][1], dp[i][0] + b[i]);
        chmax(dp[i+1][2], dp[i][0] + c[i]);
        chmax(dp[i+1][0], dp[i][1] + a[i]);
        chmax(dp[i+1][2], dp[i][1] + c[i]);
        chmax(dp[i+1][0], dp[i][2] + a[i]);
        chmax(dp[i+1][1], dp[i][2] + b[i]);
    }

    int ans = 0;
    chmax(ans, dp[N][0]);
    chmax(ans, dp[N][1]);
    chmax(ans, dp[N][2]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5960
#include <iostream>

using namespace std;

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

  size_t sum = 0;
  switch (A) {
    case 3:
      sum += 100000;
      break;
    case 2:
      sum += 200000;
      break;
    case 1:
      sum += 300000;
  }
  switch (B) {
    case 3:
      sum += 100000;
      break;
    case 2:
      sum += 200000;
      break;
    case 1:
      sum += 300000;
  }
  if (A == 1 &&  B == 1) {
    sum += 400000;
  }

  cout << sum << endl;

  return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var NCK = Sarray();
            var N = NCK[0];
            var C = NCK[1];
            var K = NCK[2];
            var Ti = new long[N];
            for (var i = 0; i < N; ++i)
                Ti[i] = Sarray()[0];
            Array.Sort(Ti);

            var bt = Ti[0];
            var cnt = 0L;
            var ans = 0L;
            for (var i = 0; i < N - 1; ++i)
            {
                //次の人を待っていたら待ちの最初の人が怒る
                if (bt + K < Ti[i + 1])
                {
                    bt = Ti[i + 1];
                    cnt = 0;
                    ++ans;
                    continue;
                }
                //待っている人がC人になった
                ++cnt;
                if (cnt == C)
                {
                    bt = Ti[i + 1];
                    cnt = 0;
                    ++ans;
                    continue;
                }
            }
            //最後の人を乗せる
            ++ans;
            WriteLine(ans);
            //Out.Flush();
        }
    }
}

Measured memory_bytes: 16196
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

struct UnionFind{
  //自身が親なら、その集合に属する頂点数に-1をかけたもの
  //そうでなければ親のid
  vector<int> r;

  UnionFind(int n){
    r=vector<int>(n,-1);
  }
  //親要素を返す
  int root(int x){
    if(r[x]<0) return x;
    return r[x] = root(r[x]);
  }
  //二つの要素それぞれを含む友達集合をくっつける
  bool unite(int x, int y){
    x=root(x); y=root(y);
    //親要素が等ければ、失敗
    if(x==y) return false;
    if(r[x]>r[y]) swap(x,y);
    r[x]+=r[y];
    r[y]=x;
    return true;
  }
  int size(int x){
    return -r[root(x)];
  }
};

int main(){
  int n,m; cin>>n>>m;
  //友達集合を作る
  UnionFind UF(n);
  rep(i,m){
    int a,b; cin>>a>>b;
    a--;b--;
    UF.unite(a,b);
  }
  //最大の友達集合を求める
  int ans=0;
  rep(i,n) ans=max(ans,UF.size(i));
  cout<<ans<<endl;
}


Measured memory_bytes: 3956
from numba import njit, b1, i4, i8, f8
import numpy as np
import numba
from heapq import heappop as hpp, heappush as hp

@njit((b1[:, :],i8,i8,i8,i8), cache=True)
def main(ss,ch,cw,dh,dw):
    h,w = ss.shape
    inf = 1<<30
    start = ch*w+cw
    goal = dh*w+dw
    n = h*w
    seen = np.full(n, inf, np.int64)
    seen[start] = 0
    q = [(0, start)] # ワープ回数, 現在位置, 最後の道の位置
    while q:
        pnum,pu = hpp(q)
        ux,uy = divmod(pu,w)
        if pu==goal:
            break
        for xx in range(-2, 3):
            for yy in range(-2, 3):
                if xx==yy==0:
                    continue
                if (xx if xx>=0 else -xx)+(yy if yy>=0 else -yy)<=1:
                    vv = 0
                else:
                    vv = 1
                x,y = ux+xx, uy+yy
                u = x*w + y
                num = pnum+vv
                if x<0 or y<0 or x>=h or y>=w or ss[x][y]:
                    continue
        #         print(x,y)
                if seen[u]>num:
                    seen[u] = num
                    hp(q,(num, u))
                
    val = seen[goal]
    if val==inf:
        return -1
    else:
        return val
      

h,w = map(int, input().split())
ch,cw = map(int, input().split())
dh,dw = map(int, input().split())
ch -= 1
cw -= 1
dh -= 1
dw -= 1
rows,cols = h,w

OK = "."
NG = "#"

ss = np.array([[c=="#" for c in input()] for _ in range(h)])

print(main(ss,ch,cw,dh,dw))

Measured memory_bytes: 118892
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
class data{
public:
  string words;  
  int page;
  bool operator < (const data&s)const{
    if(words < s.words) return true;
    else if(words > s.words) return false;
    else{
      if(page < s.page) return true;
      else return false;
    }
  }
};
int main(){
  int i=0;
  data in[1000];
  while(cin >> in[i].words){
    cin >> in[i].page;
    i++;
  }
  
  sort(in,in+i);

  cout << in[0].words << endl << in[0].page;
  for(int j=1;j<i;j++){
    if(in[j-1].words != in[j].words){
      cout << endl;
      cout << in[j].words << endl << in[j].page;
    }
    else{
      cout << ' ' << in[j].page;
    }
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;
import java.util.Arrays;
public class Main {
    public static int a,b;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            a=sc.nextInt();
            b=sc.nextInt();
            if(a==0&&b==0){
                sc.close();
                return;
            }
            int ans=0;
            ans+=bit_serch(a, b);
            System.out.printf("%d\n",ans);
        }
    }
    private static int bit_serch(int n,int s){
        int count=0;
        for(int bit=0;bit<(1<<10);++bit){
            int sum=0;
            int count2=0;
            for(int i=0;i<10;i++){
                if((bit&(1<<i))!=0){
                    sum+=i;
                    count2++;
                }
            }
            if (sum==s&&count2==n) count++;
        }
        return count;
    }
}


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

using namespace std;

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

int main(int argc, char** argv) {
  int n;
  cin >> n;

  int res = 0;

  if (n >= 1 && n <= 9) {
    cout << n;
  } else if (n >= 10 && n <= 99) {
    cout << 9;
  } else if (n >= 100 && n <= 999) {
    cout << 9 + (n - 99);
  } else if (n >= 1000 && n <= 9999) {
    cout << 9 + 900;
  } else if (n >= 10000 && n <= 99999) { // n >= 10000 && n <= 99999)
    cout << 9 + 900 + (n - 9999);
  } else { // 100000
    cout << 9 + 900 + 90000;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define PI acos(-1)
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define sp fixed<<setprecision
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int MOD = (1e9)+7;
const int N = (1e6)+5;

int mpower(int x, int y, int p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1){
            res = (res*x) % p;
        }
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

signed main()
{
    FAST
    int tc=1;
    //cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        int n,k;
        cin>>n>>k;
        int ans[k+1] = {};
        for(int i=k;i>=1;i--)
        {
            ans[i] = mpower(k/i,n,MOD);
            for(int j=2*i;j<=k;j+=i)ans[i]-=ans[j],ans[i]+=MOD,ans[i]%=MOD;
        }
        int tot = 0;
        for(int i=1;i<=k;i++)tot+=(i*ans[i])%MOD,tot%=MOD;
        cout<<tot<<endl;
    }
    return 0;
}
/*
Test Case
*/


Measured memory_bytes: 4416
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
  int n, m, x, a;
  int l=0, r=0;
  cin >> n >> m >> x;

  for(int i = 0; i < m; i++){
    cin >> a;
    if(a < x){
      l++;
    }else{
      r++;
    }
  }
  cout << min(l,r) << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.ComponentModel.DataAnnotations;
using System.IO.Pipes;
using System.Linq;

namespace ChokudaiScanner
{
    class MainClass
    {
        static void Main()
        {
            Scanner cin = new Scanner();

            int N = cin.NextInt();
            int[] a = cin.ArrayInt(N);
            int ans = 0;

            for(int i = 0; i < N; i++)
            {
                if (a[i] % 2 != 0)
                {
                    ans++;
                }
                i++;
            }
            Console.WriteLine(ans);
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string Next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return Next();
            i = 0;
            return s[i++];
        }

        public string[] ArrayNext(int N)
        {
            string[] Array = new string[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = Next();
            }
            return Array;
        }

        public int NextInt()
        {
            return int.Parse(Next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextInt() + add;
            }
            return Array;
        }

        public long NextLong()
        {
            return long.Parse(Next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextLong() + add;
            }
            return Array;
        }

        public double NextDouble()
        {
            return double.Parse(Next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextDouble() + add;
            }
            return Array;
        }
    }
}



Measured memory_bytes: 27348
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define INF 1000000007
using namespace std;

int main(void){
    int x,y;
    cin >>  x >> y;
    cout << x+y/2 << endl;
    return 0;
}

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

int gcd(int x, int y) {
    if (x<y) swap(x,y);
    if (x%y==0) return y;
    return gcd(y, x%y);
}

int main(void) {
    int x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    return 0;
}

Measured memory_bytes: 3068
total = 0
n = gets.chomp.to_i
k = gets.chomp.to_i
xs = gets.chomp.split(" ").map(&:to_i)
xs.each do |e|
  if k - e > e
    total += e * 2
  else
    total += (k - e) * 2
  end
end
puts total


Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007; // 998244353
using ll = long long;
using namespace std;

int main(){
	int n, k; cin >> n >> k;
	int cnt = 0;
	while( n > 0 ){
		n /= k;
		++cnt;
	}
	cout << cnt << endl;
}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define fil(a,b) memset((a),(b),sizeof(a))
#define sz(x) ((int)(x).size())
#define rep(i,a,b) for (int i=(a); i <= int(b); i++)
#define per(i,a,b) for (int i=(a); i >= int(b); i--)
#define foreach(it,c) for (auto it=(c).begin(); it != (c).end(); it++)

template<typename T>
void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( long long &x ) { cin>>x; }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }

void R() {}
template<typename T, typename... U>
void R( T& head, U&... tail ) {
    _R(head);
    R(tail...);
}

template<typename T>
void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
template<typename T>
void _W(const vector<T> &x) {
    for (auto i = x.cbegin(); i != x.cend(); i++) {
        if (i != x.cbegin()) putchar(' ');
        _W(*i);
    }
}

void W() {}
template<typename T, typename... U> void W(const T& head, const U&... tail) {
    _W(head);
    putchar(sizeof...(tail) ? ' ' : '\n');
    W(tail...);
}

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long long ll;
typedef double db;

const int inf = 0x3f3f3f3f;
// const ll inf = 0x3f3f3f3f3f3f3f3f;
const db pi = 3.14159265358979323846264338327950288L;
const db eps = 1e-6;
const int mo = 1e9+7;

ll arr[200005];

int main() {
    ll n, t;
    R(n,t);
    rep(i,0,n-1) R(arr[i]);
    arr[n] = LLONG_MAX;
    ll ans = 0;
    rep(i,0,n-1) {
        if (arr[i] + t < arr[i+1]) ans += t;
        else ans += (arr[i+1] - arr[i]);
    }
    W(ans);
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  char a, b;
  cin >> a >> b;
  string x = "", y = "";
  for(int i = '0'; i < a; i++){
    x += b;
  }
  for(int i = '0'; i < b; i++){
    y += a;
  }
  cout << (x < y ? x : y);
}

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

namespace _0430_atcoder問題_13
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(input[0]);
            int b = Convert.ToInt32(input[1]);
            if (a * b % 2 == 0)
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
        }
    }
}

Measured memory_bytes: 11220
n = int(input())
a = list(map(int, input().split()))

ans = 10 ** 9
for i in range(n):
    tmp_ans = 0
    while a[i] % 2 ==0:
        tmp_ans += 1
        a[i] = a[i] // 2

    ans = min(ans, tmp_ans)

print(ans)


Measured memory_bytes: 2940
# -*- coding: utf-8 -*-
import heapq
import sys
sys.setrecursionlimit(10**6)
N = input()
a = []
for i in range(N):
	x,y=map(int,raw_input().split())
	a.append((i,x,y))

#a => point,x,y
a1=sorted(a, key=lambda x: x[1])
a2=sorted(a, key=lambda x: x[2])


#Union Find
#初めは各頂点が根
par=[ i for i in range(N) ]
#木の根を求める
def root(x):
	if par[x]==x:
		return x
	else:
		r=root(par[x])
		#経路圧縮
		par[x]=r
		return r
#xとyが同じ集合に属するか
def same(x,y):
	return root(x)==root(y)

#xとyが同じ根に所属していた場合、連結
def unite(x,y):
	x=root(x)
	y=root(y)
	if x==y:
		return
	else:
		par[x]=y


b=[]
for i in range(N-1):
	# len_x,x,y
	heapq.heappush( b, ( abs(a1[i+1][1]-a1[i][1]),a1[i][0],a1[i+1][0],  ))

for i in range(N-1):
	# len_y,x,y
	heapq.heappush( b, ( abs(a2[i+1][2]-a2[i][2]),a2[i][0],a2[i+1][0],  ))

#print "# b"
#print b


ans=0
cnt=0
for i in range(len(b)):
	if cnt==N-1:
		break
	val=heapq.heappop(b)
	#２点が同じ根でない場合は、木を結合する
	if not same(val[1],val[2]):
		unite(val[1],val[2])
		ans+=val[0]
		cnt+=1

print ans
	

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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    int N;
    cin >> N;
    vector<int> a(N, 0);
    REP(i, N)
    {
        cin >> a[i];
    }

    sort(a.begin(), a.end());

    int ans = 0;
    int num = a[0];
    int count = 1;
    for (int i = 1; i < N; ++i)
    {
        if (a[i] == num)
        {
            count++;
        }
        else
        {
            if (num > count)
            {
                ans += count;
            }
            else if (num < count)
            {
                ans += count - num;
            }
            num = a[i];
            count = 1;
        }   
    }
    if (num > count)
    {
        ans += count;
    }
    else if (num < count)
    {
        ans += count - num;
    }

    cout << ans << endl;
}


Measured memory_bytes: 640
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input!(n: i64);
    let mut fac = HashMap::new();
    for i in 1..n + 1 {
        let mut v = i;
        let mut p = 2;
        while v > 1 {
            let mut e = 0;
            while v % p == 0 {
                e += 1;
                v /= p;
            }
            if e > 0 {
                *fac.entry(p).or_insert(0) += e;
            }
            p += 1;
        }
    }
    let fac: Vec<(i64, i64)> = fac.into_iter().collect();
    let mut tot = 0;
    let k = fac.len();
    for i in 0..k {
        for u in 2..fac[i].1 + 2 {
            if u == 75 {
                tot += 1;
            }
            for j in i + 1..k {
                for v in 2..fac[j].1 + 2 {
                    if u * v == 75 {
                        tot += 1;
                    }
                    for l in j + 1..k {
                        for w in 2..fac[l].1 + 2 {
                            if u * v * w == 75 {
                                tot += 1;
                            }
                        }
                    }
                }
            }
        }
    }
    puts!("{}\n", tot);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


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

int main() {
  int N, M; cin >> N >> M;
  string S;
  if(N == 1) S = "0";
  else {
    for(int i = 0; i < N; i++) {
      if(i == 0) S.push_back('1');
      else S.push_back('0');
    }
  }
  map<int, int> mp;
  bool ok = true;
  for(int i = 0; i < M; i++) {
    int s, c; cin >> s >> c; s--;
    if(mp.find(s) != mp.end() && mp[s] != c) {
      ok = false;
    } else {
      S[s] = char(c + '0');
      mp[s] = c;
    }
  }
  if(S[0] == '0' && S.size() > 1) {
    ok = false;
  }
  if(!ok) cout << -1 << endl;
  else cout << S << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int N = sc.nextInt();
		Set<Integer> paper = new HashSet<>(N);
		for (int i = 0; i < N; i++) {
			Integer A = sc.nextInt();
			if (paper.contains(A)) {
				paper.remove(A);
			} else {
				paper.add(A);
			}
		}
		System.out.println(paper.size());
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}

Measured memory_bytes: 63852
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(int i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(int i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<int,int>;
using PP=pair<int,P>;
using Pl=pair<ll,ll>;
using PPl=pair<ll,Pl>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
template<typename Monoid>
struct SegTree{
    //0-indexed
    using F=function<Monoid(Monoid,Monoid)>;
    int size;       //要素数
    vector<Monoid> dat;
    const F func;   //二項演算
    const Monoid Mdef;  //初期値
    SegTree(int sz,const F func,const Monoid &Mdef):func(func),Mdef(Mdef)
    {
        size=1;
        while(size<sz){
            size*=2;
        }
        dat.assign(size*2,Mdef);
    }
    void set(int k,const Monoid&x){
        //k番目の要素をxで初期化
        //あとでbuildが必要
        dat[k+size-1]=x;
    }
    void build(){
        //構築 O(N)
        for(int k=size-2;k>=0;k--){
            dat[k]=func(dat[k*2+1],dat[k*2+2]);
        }
    }
    void update(int k,const Monoid& x){
        //k番目の要素をxに変更 O(log N)
        int now=k+size-1;
        dat[now]=x;
        while(now){
            now=(now-1)/2;
            dat[now]=func(dat[now*2+1],dat[now*2+2]);
        }
    }
    Monoid _query(int a,int b,int k,int l,int r){
        if(r<a||b<l){
            return Mdef;
        }
        if(a<=l&&b>=r){
            return dat[k];
        }
        auto tl=_query(a,b,k*2+1,l,(l+r)/2);
        auto tr=_query(a,b,k*2+2,(l+r)/2+1,r);
        return func(tl,tr);
    }
    Monoid query(int l,int r){
        //[l,r]に対する演算funcの結果を返す O(log N)
        return _query(l,r,0,0,size-1);
    }
    Monoid operator[](const int &k)const{
        return dat[k+size-1];
    }
    int Size(){
        return size;
    }
};
ll rmq(SegTree<ll>& tr,int l,int r){
    ll res;
    if(l<=r){
        res=tr.query(l,r);
    }else{
        res=min(tr.query(l,tr.Size()-1),tr.query(0,r));
    }
    return res;
}
int main(){
    int n;
    ll x;
    cin>>n>>x;
    SegTree<ll> tr(n,[](ll a,ll b){return min(a,b);},LINF);
    REP(i,n){
        ll t;
        cin>>t;
        tr.set(i,t);
    }
    tr.build();
    ll ans=LINF;
    REP(i,n){//何回魔法を使うか
        ll sum=x*i;
        REP(j,n){
            sum+=rmq(tr,(j-i+n)%n,j);
        }
        chmin(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
#mod = 10**9 + 7
#mod = 9982443453
mod = 998244353
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
bottun = [I() for _ in range(n)]
if bottun.count(2) == 0:
    print(-1)
else:
    cnt = 0
    now = 1
    dic = defaultdict(int)
    while True:
        now = bottun[now-1]
        if dic[now] == 1:
            print(-1)
            exit()
        else:
            dic[now] = 1
        cnt += 1
        if now == 2:
            print(cnt)
            exit()


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int,int> pii;
typedef pair<char,int> pci;
typedef unordered_map<int,int> mii;
typedef unordered_map<int,int>::iterator iter;
typedef stack<int> si;
typedef stack<char> sc;





bool comp(int a,int b){
    cout<<a<<" "<<b<<endl;
    return a<b;
}

int main(){
    
    
    int x;
    cin>>x;
    if(x>=30)
    cout<<"Yes"<<endl;
    else
    {
        cout<<"No"<<endl;
    }
    
    
    return 0;

}

Measured memory_bytes: 3612
A, B, K = [int(x) for x in input().split()]

for i in range(K):
  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
print(A, B)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
if(S=="Sunny"){
    cout<<"Cloudy"<<endl;
}
else if(S=="Cloudy"){
    cout<<"Rainy"<<endl;
}
else{
    cout<<"Sunny"<<endl;
}
return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    int min8, max8, min10, max10;
    if (a%2 == 0) {
        min8 = (a*125)/10;
        max8 = ((a+1)*125)/10;
    } else {
        min8 = (a*125)/10 + 1;
        max8 = ((a+1)*125)/10 - 1;
    }
    min10 = b*10;
    max10 = (b+1)*10 - 1;
    if (min8 <= min10) {
        if (max8 >= min10) {
            cout << min10 << endl;
        } else {
            cout << -1 << endl;
        }
    } else {
        if (max10 >= min8) {
            cout << min8 << endl;
        } else {
            cout << -1 << endl;
        }
    }
}

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

alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

for i in range(len(S)):
    index = alphabet.index(S[i])
    if index + N < 26:
        S[i] = alphabet[index+N]
    else:
        S[i] = alphabet[index+N-26]

S = "".join(S)
print(S)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD = 1000000007;
ll cnt =0,ans=0;
const int MAX = 510000;

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

     if(s == "RRR"){
          cout << 3 << endl;
          return 0;
     }
     if(s == "RRS" || s == "SRR"){
          cout << 2 << endl;
          return 0;
     }
     if(s == "SRS" || s == "SSR" || s == "RSS" || s == "RSR"){
          cout << 1 << endl;
          return 0 ;
     }
      cout << 0 << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define range(i,l,h) for(int i=l;i<h;i++)
#define endl '\n'
#define I INT_MAX
#define L INT_MIN
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
using std::ios;
constexpr int MOD=1e9+7;
constexpr int mod=998244353;
vi adj[100005];

void bfs(int n,int start,map<pair<int,int>,int > &mp,int &k)
{
  vector<bool> vis(n+1,false);
  queue<int> q;
  q.push(start);
  vis[start]=true;
  vi color(n+1);
  while(!q.empty())
  {
    int curr=q.front();
    q.pop();
    int cl=1;
    k=max(k,(int)adj[curr].size());
    for(auto i:adj[curr])
    {
      if(vis[i])continue;     
      if(color[curr]==cl)cl++;
      color[i]=cl;
      mp[{curr,i}]=cl;
      mp[{i,curr}]=cl;
      cl++;
      q.push(i);
      vis[i]=true;
    }
  }
}

int main() 
{
  fastio;
  int n;
  cin>>n;
  vector<pair<int,int> > edges;
  range(i,0,n-1)
  {
    int u,v;
    cin>>u>>v;
    adj[u].pb(v);
    adj[v].pb(u);
    edges.pb(make_pair(u,v));
  }
  map<pair<int,int>,int > mp;
  int k=0;
  bfs(n,1,mp,k);
  cout<<k<<endl;
  for(auto p:edges)
    cout<<mp[p]<<endl;
    
}


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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define repr(i, N) for (ll i = N-1; i >= 0; i--)
#define repr1(i, N) for (ll i = N; i > 0; i--)

#define MOD 1000000007

using ll = long long;
using namespace std;

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<P> vpi;
typedef pair<ll,ll> Pl;
typedef vector<ll> vl;
typedef vector<Pl> vpl;

ll gcd(ll a, ll b){
    if(a < b) swap(a, b);
    if(b <= 0) return -1;
    ll r = a % b;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

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


int main() {
    string S,T;
    cin >> S >> T;

    bool flag = true;
    rep(i,S.size()) {
        if(S[i] != T[i]) flag = false;
    }


    string ans = ( flag ? "Yes" : "No" );
    //printf("%.8lf", ans);
    cout << ans;
    cout << "\n";
    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <cmath>
#include <string>

using namespace std;

int main(){
 int n;
  cin >> n;
 string s;
  cin >> s;
 
  int w[n+1];
  int e[n+1];
  int cnt=0;
  
  for(int i=0;i<=n;i++){
    w[i]=cnt;
    e[i]=i-cnt; 
    if(s[i]=='W') cnt++; 
  }
  
  int res=n;
  for(int i=0;i<n;i++){
    res=min(res,w[i]+e[n]-e[i+1]);
  }
  
 cout << res << endl;

}

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



int main() {
	string s;

	cin >> s;

	string nen = s.substr(0, 4);
	string tsuki = s.substr(5, 2);
	string hi = s.substr(8, 2);
	//cout << atoi(nen.c_str()) << endl;

	//cout << atoi(tsuki.c_str()) << endl;
	if (atoi(nen.c_str()) < 2019) {
		cout << "Heisei" << endl;
		return 0;
	}
	else if (atoi(nen.c_str()) > 2019) {
		cout << "TBD" << endl;
		return 0;
	}
	else {
		if (atoi(tsuki.c_str()) < 4) {
			cout << "Heisei" << endl;
			return 0;
		}
		else if(atoi(tsuki.c_str()) >4){
			cout << "TBD" << endl;
			return 0;
		}
		else {
			if (atoi(hi.c_str()) <= 30) {
				cout << "Heisei" << endl;
				return 0;
			}
			else {
				cout << "TBD" << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3636
/*
...........__________                                                                           ___  __
.............|       |                                                                           |   /
.............|       |                                                                           |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
...........__|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int                 long long
#define ull                 unsigned long long int
#define ld                  long double
#define vi                  vector<int>
#define vii                 vector<pair<int,int>>
#define vvi                 vector<vector<int>>
#define pii                 pair<int,int>
#define prec(x)             fixed<<setprecision(15)<<x
#define all(x)              x.begin(),x.end()
#define rall(x)             x.rbegin(),x.rend()
#define rev(x)              reverse(x.begin(),x.end())
#define mset(a,b)           memset(a,b,sizeof(a))
#define mcpy(a,b)           memcpy(a,b,sizeof(a))
#define fo0(i,n)            for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n)            for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b)           for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)            for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)            for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
const int inf=1e18;const int mod=1e9+7;const int N=2e5+9;
void read_And_write(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}

void raushan_kumar(){
    int d=0,e=0,f=0,g=0,p=0,w=0,flag=0,ans=0,res=0,cnt=0,sum=0;double f1=0.0,f2=0.0,f3=0.0;
    int n;cin>>n;n*=2;int a[n];fo0(i,n) cin>>a[i];
    sort(a,a+n);
    
    for(int i=0;i<n;i+=2)
    	sum+=a[i];
    cout<<sum;
}

int32_t main()
{
    fast;int t=1;
    // cin>>t;
    while(t--){raushan_kumar();}
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    char a, b;
    scanf("%c %c", &a, &b);
    if(a == 'H'){
        printf("%c\n", b);
    }else{
        if(b == 'H'){
            printf("%c\n", a);
        }else{
            a = 'H';
            printf("%c\n", a);
        }
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <queue>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
#define MAX_N 100100
#define MOD 1000000007
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ld n,ave=0,c;
    cin >> n;
    ld a[(ll)n];
    for (ll i=0;i<n;i++){
        cin >> a[i];
        ave+=a[i];
    }
    ave/=n;
    c=abs(a[0]-ave);
    bool flag=true;
    for (ll i=0;i<n;i++){
        if (c!=abs(a[i]-ave)){
            flag=false;
            c=min(c,abs(a[i]-ave));
        }
    }
    if (flag){
        cout << 0 << endl;
    }else{
        for (ll i=0;i<n;i++){
            if (c==abs(a[i]-ave)){
                cout << i << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
/*
  AtCoder Beginner Contest -94
  B - Toll Gates
*/

#include<iostream>
using namespace std;

int N, M, X, A;
int cost[101] = {0};

int main() {
  scanf("%d%d%d", &N, &M, &X);
  for (int i = 0; i < M; ++i) {
    scanf("%d", &A);
    cost[A] = 1;
  }

  for (int i = 1; i < N+1; ++i) cost[i] += cost[i-1];

  int minval = cost[X] < cost[N] - cost[X] ? cost[X] : cost[N] - cost[X];
  printf("%d\n", minval);
  return 0;
}

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

using namespace std;

int n, m, k;
char g[10][10];

int main(){
#ifdef LOCAL
	freopen("input", "r", stdin);
#endif

	scanf("%d %d %d", &n, &m, &k);

	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			scanf(" %c", &g[i][j]);
		}
	}

	int ans = 0;

	for (int a = 0; a < (1<<n); a++){
		for (int b = 0; b < (1<<m); b++){
			int black = 0;
			for (int i = 0; i < n; i++){
				for (int j = 0; j < m; j++){
					if (((a >> i) & 1) == 0 && ((b >> j) & 1) == 0)
						if (g[i][j] == '#') 
							black++;
				}
			}
			if (black == k)
				ans++;
		}
	}
	
	printf("%d\n", ans);

	return 0;
}

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

#define mp make_pair
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define FILE_IO(x) freopen((string(x) + ".in").c_str(), "r", stdin); freopen((string(x) + ".out").c_str(), "w", stdout)
#define f first
#define s second
#define x1 x1qwer
#define y1 y1qwer
#define foreach(it, v) for (auto it : v)
#define rep(it, n) for (int it = 0; it < n; ++it)
#define forin(it, l, r) for (int it = l; it < r; ++it)
#define all(x) x.begin(), x.end()

// #define FAST_ALLOCATOR_MEMORY 250000000
 
#ifdef FAST_ALLOCATOR_MEMORY
int allocator_pos = 0;
char allocator_memory[(int)FAST_ALLOCATOR_MEMORY];
inline void * operator new ( size_t n ) {
    char *res = allocator_memory + allocator_pos;
    allocator_pos += n;
    assert(allocator_pos <= (int)FAST_ALLOCATOR_MEMORY);
    return (void *)res;
}
inline void operator delete ( void * ) noexcept { }
//inline void * operator new [] ( size_t ) { assert(0); }
//inline void operator delete [] ( void * ) { assert(0); }
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const double DINF = numeric_limits<double>::infinity();
const ll MOD = 1e9 + 7;
const double EPS = 1e-7;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
mt19937 mmtw_(MOD);
uniform_int_distribution<ll> rd_;
ll randomll() { return rd_(mmtw_);}
ll rnd(ll x, ll y) { return rd_(mmtw_) % (y - x + 1) + x; }
template <class T> T fact(T n) { if (n == 1) return 1; return n * fact(n - 1); }
////////////////////////////////////////////////////////////////////////////////////////////////

const int MAXN = 100;

int n, m;
bool a[MAXN][MAXN];

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

bool check(int x, int y) {
    return 0 <= x && x < n && 0 <= y && y < m;
}

int main() {
    cin >> n >> m;
    rep(i, n) {
        rep(j, m) {
            char ch;
            cin >> ch;
            a[i][j] = (ch == '#');
        }
    }

    rep(i, n) {
        rep(j, m) {
            if (!a[i][j]) continue;
            bool flag = false;
            rep(t, 4) {
                int x = i + dx[t];
                int y = j + dy[t];
                if (check(x, y) && a[x][y]) {
                    flag = true;
                }
            }
            if (flag == false) {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define fi first
#define se second

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int cnt1 = 0, cnt4 = 0, cnt2 = 0;
    for(int i = 0; i < n; i++) {
        if(a[i] % 2 == 1) {
            cnt1++;
        }else if(a[i] % 4 == 0) {
            cnt4++;
        }else if(a[i] % 4 == 2) {
            cnt2++;
        }
    }
    if(cnt4 >= cnt1 || (cnt4 == cnt1 - 1 && cnt2 == 0)) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}

Measured memory_bytes: 1024
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def solve():
    s = input()
    if s == "ABC":
        print("ARC")
    else:
        print("ABC")

    return 0

if __name__ == "__main__":# {{{
    solve()

# vim: set foldmethod=marker: }}}


Measured memory_bytes: 75400
# coding: utf-8

# https://atcoder.jp/contests/abc097/tasks/arc097_a
# 0:37-0:50 chudan
# 12:14-12:20
# 12:30-
# 14:40-14:53


def main():
    S = input()
    N = len(S)
    K = int(input())

    def rec(tree, substr):
        if len(substr) > 0:
            ans.append(substr)

        if len(ans) == K:
            return None

        keys = sorted(tree.keys())
        for key in keys:
            rec(tree[key], substr+key)
    
    min_char_list = sorted(list(set(S)))

    ans = []
    for min_char in min_char_list:
        if len(ans) >= K:
            break

        min_char_i = []
        for i, s in enumerate(S):
            if s == min_char:
                min_char_i.append(i)

        substrs = []
        for i in min_char_i:
            substrs.append(S[i:min(i+(K-len(ans)), N)])

        prefix_tree = {}
        for substr in substrs:
            tree = prefix_tree
            for c in substr:
                if c not in tree:
                    tree[c] = {}
                tree = tree[c]

        # prefix tree starting the minimum letter: created

        rec(prefix_tree, "")

    return ans[K-1]


print(main())


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int n,k;
int a[200];
int f[200][100005];
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=0;i<=k;i++)f[0][i]=1;
	for(int i=1;i<=n;i++){
		for(int j=0;j<=k;j++){
			if(j<a[i]+1)f[i][j]=f[i-1][j]%mod;
			else f[i][j]=(f[i-1][j]-f[i-1][j-a[i]-1]+mod)%mod;
		}
//		for(int j=0;j<=k;j++)printf("%d ",f[i][j]);puts("");
		for(int j=1;j<=k;j++)f[i][j]=(f[i][j]+f[i][j-1])%mod;
	}
	printf("%d\n",(f[n][k]-f[n][k-1]+mod)%mod);
	return 0;
}

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

int main()
{
    int n,m;
    cin >> n >> m;
    vector<string> palabras;
    for(int i=0; i<n; i++){
        string s;
        cin >> s;
        palabras.push_back(s);
    }
    sort(palabras.begin(), palabras.end());
    for(int i=0; i<palabras.size(); i++){
        cout << palabras[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256