akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <limits>

using namespace std;

//BEGIN
template <typename T, typename E>
struct PrimalDual {
	struct edge {
		int to, rev;
		T cap;
		E cost;

		edge() {}
		edge(int to, T cap, E cost, int rev) :to(to), cap(cap), cost(cost), rev(rev) {}
	};

	const E INF = numeric_limits<E>::max();
	vector<vector<edge> > G;
	vector<E> h, dist;
	vector<int> prevv, preve;

	PrimalDual() {}
	PrimalDual(int n) :G(n), h(n), dist(n), prevv(n), preve(n) {}

	void add_edge(int from, int to, T cap, E cost) {
		G[from].emplace_back(to, cap, cost, G[to].size());
		G[to].emplace_back(from, 0, -cost, G[from].size() - 1);
	}

	E min_cost_flow(int s, int t, T f) {
		E res = 0;
		priority_queue<pair<E, int>, vector<pair<E, int> >, greater<pair<E, int> > > pq;
		
		while (f > 0) {
			fill(dist.begin(), dist.end(), INF);
			pq.emplace(0, s);
			dist[s] = 0;
			while (!pq.empty()) {
				pair<E, int> p = pq.top();
				pq.pop();
				if (dist[p.second] < p.first) continue;
				for (int i = 0; i < G[p.second].size(); ++i) {
					edge& e = G[p.second][i];
					E ncost = dist[p.second] + e.cost + h[p.second] - h[e.to];
					if (e.cap > 0 && dist[e.to] > ncost) {
						dist[e.to] = ncost;
						prevv[e.to] = p.second; preve[e.to] = i;
						pq.emplace(dist[e.to], e.to);
					}
				}
			}
			if (dist[t] == INF) return -1;
			for (int v = 0; v < h.size(); ++v)
				if (dist[v] < INF) h[v] += dist[v];
			T d = f;
			for (int v = t; v != s; v = prevv[v]) d = min(d, G[prevv[v]][preve[v]].cap);
			f -= d;
			res += d * h[t];
			for (int v = t; v != s; v = prevv[v]) {
				edge& e = G[prevv[v]][preve[v]];
				e.cap -= d;
				G[v][e.rev].cap += d;
			}
		}
		return res;
	}
};
//END

int main() {
	int V, E, F; cin >> V >> E >> F;
	PrimalDual<int, int> G(V);
	for (int i = 0; i < E; ++i) {
		int u, v, c, d; cin >> u >> v >> c >> d;
		G.add_edge(u, v, c, d);
	}
	cout << G.min_cost_flow(0, V - 1, F) << endl;

	return 0;
}


/*
	created: 2020-01-06
	https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/6/GRL_6_B
*/


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

#define watch(x) (cout << #x << " = " << x << endl)
#define int long long

int w[101];
int v[101];

int32_t main() {
	int n, ww;
	cin >> n >> ww;

	for(int i = 1; i <= n; i++)
		cin >> w[i] >> v[i];
	int sum_v = accumulate(v, v + n + 1, 0); 

	vector<int> dp(sum_v+1);
	fill(dp.begin(), dp.end(), INT_MAX);
	dp[0] = 0;
	for(int i = 1; i <= n; ++i){
		for(int j = sum_v; j > 0; j--){
			if(j >= v[i])
				dp[j] = min(dp[j],
						dp[j - v[i]] + w[i]);
		}
	}

	for(int i = sum_v; i >= 0; i--)
		if(dp[i] <= ww){
			cout << i << endl;
			return 0;
		}
	cout << 0 << endl;

	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    int N,K;
    cin>>N>>K;
    double ans=0;
    for(int i=1;i<=N;i++){
        int count=0,now=i;
        double p=1;
        p/=N;
        while(now<K){
            count++;
            now*=2;
            p*=0.5;
        }
        ans+=p;
    }
    
    cout<<fixed<<setprecision(13);
    cout<<ans<<endl;
}

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

using namespace std;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int r;
    cin >> r;
    if(r < 1200)    cout << "ABC\n";
    else if(r < 2800)    cout << "ARC\n";
    else cout << "AGC\n";


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
int main(){
  ll N,P,a,x=0;
  cin>>N>>P;
  rep(i,N){
    cin>>a;
    x+=a%2;
  }
  ll ans=pow(2,N-1);
  if(!x){
    if(P) ans=0;
    else ans*=2;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env ruby

if __FILE__ == $0 then
	s = gets.split('').map(&:ord)
    s.size.times do |i|
        if s[i] > 0x40 and (s[i]-0x41)%0x20 < 0x1a then
            s[i]^=0x20
		end
	end
	puts s.map(&:chr).join('')
end



Measured memory_bytes: 6896
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var n = cin.next();
            Console.WriteLine(((n[0] == n[1] && n[1] == n[2]) ||
                               (n[1] == n[2] && n[2] == n[3]))? "Yes":"No");
        }
    }

    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[] ArrayString(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 int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            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 long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            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;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define pb emplace_back
#define mp make_pair

using namespace std;

int32_t main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.precision(10);
	int n; cin >> n;
	string s; cin >> s;
	std::vector<int> pre(n + 1, 0);
	int cw = 0;
	for (int i = 0; i < n; ++i) {
		if (s[i] == '.') pre[i + 1]++;
		pre[i + 1] += pre[i];
	}
	int mi = 10000000;
	for (int i = 0; i <= n; ++i) {
		mi = min(mi, i - pre[i] + (pre[n] - pre[i]));
	}
	cout << mi;
}

Measured memory_bytes: 1300
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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 S(): return input()
def pf(s): return print(s, flush=True)

def inv(x):
    return pow(x, mod - 2, mod)

cms = 10**6
cm = [0] * cms

def comb_init():
    cm[0] = 1
    for i in range(1, cms):
        cm[i] = cm[i-1] * i % mod

def comb(a, b):
    return (cm[a] * inv(cm[a-b]) % mod) * inv(cm[b]) % mod


def main():
    rr = []

    def f(n,m,k):
        comb_init()
        r = 0
        for i in range(k+1):
            j = k - i
            mt = comb(n+m+k*2, n+i*2)
            lk = rk = 1
            if i > 0:
                lk = (comb(n+i*2, i) - comb(n+i*2, i-1)) % mod
            if j > 0:
                rk = (comb(m+j*2, j) - comb(m+j*2, j-1)) % mod
            r += mt * lk * rk % mod
            r %= mod

        return r

    while 1:
        n,m,k = LI()
        if n == 0:
            break
        rr.append(f(n,m,k))
        break

    return '\n'.join(map(str, rr))


print(main())



Measured memory_bytes: 48364
// https://atcoder.jp/contests/arc064/tasks/arc064_a
     
    #include <bits/stdc++.h>
    using namespace std;
    #define watch(x) cerr << (#x) << " is " << (x) << endl;
    #define endl '\n' 
    #define int long long
    signed main() {
        ios::sync_with_stdio(0);
        cin.sync_with_stdio(0);
        cin.tie(0);
     
        int N, x;
        cin >> N >> x;
     
        vector<int> a(N+5);
        for(int i = 1; i <= N; i++) {
            cin >> a[i];
        }
     
        int ans = 0;
        for(int i = 1; i <= N; i++) {
            ans += max(0LL, (a[i]+a[i-1])-x);
            a[i] -= max(0LL, (a[i]+a[i-1])-x);
            assert(a[i] >= 0);
        }
     
        cout << ans << endl;
    }


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

int
current_happy(int n, char *s)
{
    int i;
    int num=0;

    for (i=0; i<n-1; i++) {
        if (s[i]==s[i+1])
            num++;
    }
    return num;
}

int
main(int argc, char *argv[])
{
    int N, K;
    char S[100001];
    int current;
    int max_happy;

    scanf("%d%d", &N, &K);
    scanf("%s", S);

    max_happy = strlen(S)-1;
    current = current_happy(N, S);

    if (max_happy-current>K*2 ) {
        printf("%d\n", current + K*2);
    }
    else {
        printf("%d\n", max_happy);
    }
    return 0;
}



Measured memory_bytes: 256
from collections import deque

s = deque(input())
q = int(input())

flag = 1

for _ in range(q):
    tfc = input().split()
    if tfc[0] == "1":
        flag *= -1

    elif tfc[0] == "2":
        if (tfc[1] == "1" and flag == 1) or (tfc[1] == "2" and flag == -1):
            s.appendleft(tfc[2])
        elif (tfc[1] == "1" and flag == -1) or (tfc[1] == "2" and flag == 1):
            s.append(tfc[2])
else:

    if flag == -1:
        s = list(s)[::-1]

print("".join(s))

Measured memory_bytes: 10100
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
			while (true) {
				int x = sc.nextInt();
				int h = sc.nextInt();
				
					if (x == 0 && h == 0) { 
						break;
					}
				double S = surface_area_pyra(x, h);
				System.out.println(S);
			}
		sc.close();

	}

	private static double surface_area_pyra(int x, int h) {
		double x_2 = Math.pow(x, 2);
		double h_2 = Math.pow(h, 2);
		
		double S = x * Math.sqrt(4 * h_2 + x_2) + x_2;
		
		return S;
	}

}



Measured memory_bytes: 26200
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
//#define MOD 998244353
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=100050;
//↑templete
signed main(){

	int N, R;
	cin>>N>>R;
	cout<<R+max(0, 100*(10-N))<<endl;;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n, b[N], a[N];
int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", b + i);
    vector<int> vec;
    for (int i = 1; i <= n; ++i) vec.push_back(i);
    for (int i = n; i; --i) {
        if ((int)vec.size() < b[i]) return puts("-1"), 0;
        a[vec[b[i] - 1]] = b[i];
        vec.erase(vec.begin() + b[i] - 1);
    }
    for (int i = 1; i <= n; ++i) printf("%d\n", a[i]);
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
    
    class Main {
     
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int A = sc.nextInt();
            int B = sc.nextInt();
            int C = sc.nextInt();
            int D = sc.nextInt();
            sc.close();
           if( A <= C && B <= D && C <= B) {
        	   System.out.println( B - C );
           }else if( A <= C && D <= B && A <= C ){
        	   System.out.println( D - C );
           }else if( C <= A && D <= B && A <= D) {
        	   System.out.println( D - A );
           }else if( C <= A && B <= D && B <= D ) {
        	   System.out.println( B - A );
           }
           else {
        	   System.out.println(0);
           }
        }
    }

Measured memory_bytes: 23764
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <fstream>


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>

ll n;
string s;
set<ll> se;
bool ok[31000][10], ok2[31000][10];
int main() {
	cin >> n >> s;
	REP(i, n) {
		ok[i][s[i] - '0'] = true;
		REP(j, 10) {
			if (ok[i][j])ok[i + 1][j] = true;
		}
	}
	REPR(i, n - 1) {
		ok2[i][s[i] - '0'] = true;
		REP(j, 10) {
			if (ok2[i + 1][j])ok2[i][j] = true;
		}
	}
	FOR(i, 1, n - 1) {
		REP(j, 10) {
			REP(k, 10) {
				if (ok[i - 1][j] and ok2[i + 1][k])se.insert(j * 100 + ((ll)s[i] - '0') * 10 + k);
			}
		}
	}
	cout << se.size() << endl;
}


Measured memory_bytes: 896
import itertools

n, m, x = map(int, input().split())
A = []
for _ in range(n):
  A.append(list(map(int, input().split())))

c = [ (0, 1) for _ in range(n)]
min_price = float('inf')

for cc in itertools.product(*c):
  xx = [0] * m
  price = 0
  for i, ccc in enumerate(cc):
    if ccc==1:
      price += A[i][0]
      xx = [a +b for a, b in zip(xx, A[i][1:])]
  if min(xx) >= x:
    min_price = min(min_price, price)

if min_price==float('inf'):
  print(-1)
else:
  print(min_price)

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

int main() {
    int N; cin >> N;
    vector<ll> vx(N), vy(N), vh(N);
    int si = -1;
    for (int i = 0; i < N; ++i) {
        cin >> vx[i] >> vy[i] >> vh[i];
        if (vh[i] > 0) si = i;
    }
    
    ll resx = -1, resy = -1, resh = -1;
    for (ll x = 0; x <= 100; ++x) {
        for (ll y = 0; y <= 100; ++y) {
            ll h = vh[si] + abs(x - vx[si]) + abs(y - vy[si]);
            bool ok = true;
            for (int i = 0; i < N; ++i) {
                if (vh[i] > 0 && h - vh[i] != abs(x - vx[i]) + abs(y - vy[i]))
                    ok = false;
                if (vh[i] == 0 && h > abs(x - vx[i]) + abs(y - vy[i]))
                    ok = false;
            }
            if (ok) resx = x, resy = y, resh = h;
        }
    }
    cout << resx << " " << resy << " " << resh << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <assert.h>
#include <numeric>
#include <climits>

using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;

template <typename T>
T gcd(T a, T b) {
    if(a < b) gcd(b, a);
    T r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

int main() {
    ll N;
    cin >> N;
    vector<ll> pa;
    REP(i, 5) {
        ll a;
        cin >> a;
        pa.push_back(a);
    }
    
    ll t = 0;
    // simulation
    /*
    vector<ll> x(6);
    vector<ll> y(5);
    x[0] = N;
    while(x[5] < N) {
        REP(i, 5) {
            y[i] = min(pa[i], x[i]);
            x[i] -= y[i];
        }
        REP(i, 5) {
            x[i+1] += y[i];
        }
        t++;
    }
    cout << "sim: " << t << endl;
     */
    sort(all(pa));
    if (pa[0] == pa[4]) {
        t = (N-1)/pa[0]+5;
    } else {
        t = (N + pa[0] + 1) / pa[0] + 3;
    }

    cout << (N-1)/pa[0]+5 << endl;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
#include <iomanip>
using namespace std;
    
#define int long long
#define pb push_back
#define ub upper_bound
#define lb upper_bound
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define ve vector
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
    
using ll = long long;
const ll INF = LLONG_MAX - 100;
ll mod = 1e9 + 7;
int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
vector<ll> prime;
    
class fact {
public:
    int fmod = 1e9+7;
    vector<int> fac, inv;
    fact (int n, int Mod = 1e9+7) {
        fmod = Mod;
        fac = vector<int>(n,0);
        inv = vector<int>(n,0);
        fac[0] = 1; for (int i = 1; i < n; i++) fac[i] = fac[i-1] * i % fmod;
        for (int i = 0;i < n;i++) inv[i] = fact::POW(fac[i],fmod-2);
    }
    ll nCr(ll n, ll r) {return (fac[n] * inv[r] % fmod) * inv[n-r] % fmod;}
    ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%fmod;}a = a * a%fmod; b >>= 1;}return c;}
};
    
template <class T = ll> T in() {T x; cin >> x; return (x);}
void DEBUG(vector<int> a) {for(int i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<endl;}
void EMP(int x) {cout<<"!!!"<<x<<"!!!"<<endl;}
ll GCD(ll a, ll b) {ll c; while (b != 0) {c = a % b; a = b; b = c;}return a;}
ll LCM(ll a, ll b) {return a * b / GCD(a, b);}
ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%mod;}a = a * a%mod; b >>= 1;}return c;}
void PRI(ll n) {bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) {a[i] = 1LL;}for (int i = 2; i < n + 1LL; i++) {if (a[i]) {prime.pb(i); ll b = i; while (b <= n) {a[b] = 0; b += i;}}}}
template <typename T> T chmin(T& a, T b) {if(a>b)a=b;return a;}
template <typename T> T chmax(T& a, T b) {if(a<b)a=b;return b;}
bool isSqrt(ll a) {return pow(sqrt(a),2) == a ? 1 : 0;}
void YesNo(bool a) {if (a) cout << "Yes"; else cout << "No"; cout << endl;}
void yesno(bool a) {if (a) cout << "yes"; else cout << "no"; cout << endl;}
void YESNO(bool a) {if (a) cout << "YES"; else cout << "NO"; cout << endl;}
int poorpow(int b, int a) {
    int tmp = 1;
    REP (i,a) {
        tmp *= b;
    }
    return tmp;
}


bool solve() {
    int a,b,c; cin >> a >> b >> c;
    int sum = a + b + c;
    cout << max({a,b,c}) * 10 + sum - max({a,b,c}) << endl;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();    
}


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

int main(void){
    int n;
    cin >> n;
    string book[] = {"pon", "pon", "hon", "bon", "hon", "hon", "pon", "hon", "pon", "hon"};
    cout << book[n%10] << endl;
    return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void tokenize(std::string const &str, const char delim,
			std::vector<std::string> &out)
{
	// construct a stream from the string
	std::stringstream ss(str);

	std::string s;
	while (std::getline(ss, s, delim)) {
		out.push_back(s);
	}
}

void Main() {
    string S;
    cin >> S;
    string ans(S.size(), 'x');
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

int main() {
    ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    string S; cin >> S;
    //ll H,W; cin >> H >> W;
    ll ans=1;
    ll r,g,b,rg,gb,br;
    r=0;
    g=0;
    b=0;
    rg=0;
    gb=0;
    br=0;
    rep(i,S.length()){
        if(S[i]=='R'){
            if(gb){
                ans=(ans*gb)%mod;
                gb--;
            }
            else if(g){
                ans=(ans*g)%mod;
                g--;
                rg++;
            }
            else if(b){
                ans=(ans*b)%mod;
                b--;
                br++;
            }
            else r++;
        }
        else if(S[i]=='G'){
            if(br){
                ans=(ans*br)%mod;
                br--;
            }
            else if(r){
                ans=(ans*r)%mod;
                r--;
                rg++;
            }
            else if(b){
                ans=(ans*b)%mod;
                b--;
                gb++;
            }
            else g++;
        }
        else{
            if(rg){
                ans=(ans*rg)%mod;
                rg--;
            }
            else if(r){
                ans=(ans*r)%mod;
                r--;
                br++;
            }
            else if(g){
                ans=(ans*g)%mod;
                g--;
                gb++;
            }
            else b++;
        }
    }
  	rep(i,N){
      ans=(i+1)*ans%mod;
    }
    cout << ans;


}

/*



 */



Measured memory_bytes: 900
#include<bits/stdc++.h>
#ifndef ONLINE_JUDGE
#include"custom_header.h"
#else
#define openfile 
#endif
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
#define ll long long
#define ld long double
#define fo(i,v,e) for(v=i;v<e;v++)
#define rfo(i,v,e) for(v=i;v>e;v--)
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define vl vector<ll>
#define sz(x) (ll)x.size()
#define vvl vector<vl>
#define vpl vector<pll>
const ll mod = 1000000007;
bool check(vl&temp)
{
    sort(all(temp));
    if(unique(all(temp))-temp.begin()<3)return false;
    return temp[2]<temp[1]+temp[0];
}
void solve()
{
    ll n,i,j,k,ans = 0;cin>>n;
    vl arr(n);
    fo(0,i,n)
    {
        cin>>arr[i];
    }
    sort(all(arr));
    fo(0,i,n)
    {
        fo(i+1,j,n)
        {
            fo(j+1,k,n)
            {
                vl temp;
                temp.push_back(arr[i]);
                temp.push_back(arr[j]);
                temp.push_back(arr[k]);
                if(check(temp))ans++;
            }
        }
    }
    cout<<ans<<endl;
}
int main()
{
    // openfile;fastio;
    ll T = 1; 
    // cin>>T;
    while(T--)
    {solve();}
}

Measured memory_bytes: 3628
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.lang.Math;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int Y=scanner.nextInt();
        for(int x=0;x<(Y/1000-N)/9+1;x++){
            if((Y/1000-N-9*x)%4==0){
                int y=(Y/1000-N-9*x)/4;
                int z=N-x-y;
                if(z>=0){

                    System.out.println(String.format("%d %d %d",x,y,z));
                    return;
                }
            }
        }
        System.out.println("-1 -1 -1");
    }
}


Measured memory_bytes: 21844
#include <iostream>

int main(){
 int H1,M1,H2,M2,K;
 std::cin>>H1>>M1>>H2>>M2>>K;
 int min1=60*H1+M1;
 int min2=60*H2+M2;
 int ans=0;
 if(min2>=min1){
  ans=min2-min1-K;
 }else{
  ans=min2+60*24-min1-K;
 }

 if(ans<0){
  ans=0;
 }
 std::cout<<ans<<std::endl;
}

Measured memory_bytes: 3648
#include <stdio.h>
using namespace std;
int main(void)
{
    int a,b;
    scanf("%d",&a);
    scanf("%d",&b);
    if(a<10&&b<10)
    {
        printf("%d",a*b);
    }
    else
    {
        printf("-1");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

#define MAX 100010
#define NIL -1

typedef struct{int parent, left, right; }Node;

Node T[MAX];
int depth[MAX];

void Print(int x){
	int i,c;
	printf("node %d: parent = %d, depth = %d, ",x,T[x].parent,depth[x]);
	if(T[x].parent == NIL)printf("root, ");
	else if(T[x].left == NIL)printf("leaf, ");
	else printf("internal node, ");

	printf("[");
	for(i=0,c=T[x].left;	c!=NIL;		i++,c=T[c].right){
		if(i)printf(", ");
		printf("%d",c);
	}
	printf("]\n");
}

void getDepth(int x, int d){
	depth[x]=d;
	if(T[x].right != NIL)getDepth(T[x].right, d);
	if(T[x].left != NIL)getDepth(T[x].left, d+1);
}

int main(){
	int i,j,n,id,k,c,l,r;	scanf("%d",&n);
	for(i=0;i<n;i++)T[i].parent=T[i].left=T[i].right=NIL;

	for(i=0;i<n;i++){
		scanf("%d%d",&id,&k);
		for(j=0;j<k;j++){
			scanf("%d",&c);
			if(j==0)T[id].left=c;
			else T[l].right=c;
			l=c;

			T[c].parent = id;
		}
	}

	for(i=0;i<n;i++){
		if(T[i].parent == NIL){
			getDepth(i,0);
			break;
		}
	}

	for(i=0;i<n;i++)Print(i);


	return 0;
}


Measured memory_bytes: 6392
object Main extends App {
    var get = readLine
    var n = get.split(" ")(0).toInt
    var m = get.split(" ")(1).toInt
    var c = get.split(" ")(2).toInt

    var get2 = readLine
	val b = new Array[Int](m)
    var get3 = readLine
    var a = new Array[Int](m)
    var sum=0
    var ans=0
  	for(loop <- 0 to m - 1) {
	  b(loop)=get2.split(" ")(loop).toInt
    }
  	for(loop <- 0 to n - 1){
      for(loop2 <- 0 to m - 1){
        sum+=b(loop2)*get3.split(" ")(loop2).toInt
      }
      if(sum+c>0)
      	ans+=1
      sum=0
      get3 = readLine
    }      
  println(ans)
}

Measured memory_bytes: 27184
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

void debug_out() { cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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

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

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll INF = 1000000000000001;

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

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    vector<ll> a(26,0);
    ll n = s.size();
    Rep(i,n){
        a[s[i]-'a']++;
    }
    ll ans = n*(n-1)/2 + 1;
    Rep(i,26){
        ans -= a[i]*(a[i]-1)/2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 720
r,g,b,n = map(int, input().split())

s = n//r
t = n//g

ans = 0
for i in range(s+1):
    for j in range(t+1):
        if (n-r*i-g*j)%b == 0 and (n-r*i-g*j)>=0:
            ans += 1

print(ans)

Measured memory_bytes: 40556
S = gets.chomp

case S
  when 'SUN'
  puts 7
  when 'MON'
  puts 6
  when 'TUE'
  puts 5
  when 'WED'
  puts 4
  when 'THU'
  puts 3
  when 'FRI'
  puts 2
  when 'SAT'
  puts 1
end

Measured memory_bytes: 1788
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.16f\n", a)//少数出力
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue

using ll = long long;

const int INF = 1073741823;
const int MINF = -1073741823;
const ll LINF = ll(4661686018427387903);
const ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

#include <iostream>

using namespace std;

void scans(string & str) {
	char c;
	scanf("%c", &c);
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {

	int n;
	scanf("%d", &n);
	int t, x, y, beft = 0, befx = 0, befy = 0;
	bool possi = true;
	rep(i, n) {
		scanf("%d%d%d", &t, &x, &y);
		if (t < abs(x - befx) + abs(y - befy)) {
			possi = false;
			break;
		}
		else if (t == abs(x - befx) + abs(y - befy)) {
			befx = x;
			befy = y;
			beft = t;
		}
		else {
			if ((t - (abs(x - befx) + abs(y - befy)) - beft) % 2 == 0) {
				befx = x;
				befy = y;
				beft = t;
			}
			else {
				possi = false;
				break;
			}
		}
	}

	printyn(possi);
 	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    vector<int> ans(101, 0);
    for(int i = a; i < b; i++) {
        ans[i]++;
    }
    for(int i = c; i < d; i++) {
        ans[i]++;
    }
    ll ou = 0;
    for(size_t i = 0; i < 101; i++) {
        ou += (ans[i] == 2);
    }
    cout << ou << endl;
}

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

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



    cin.tie(0);
    ios::sync_with_stdio(false);

    /////////////////////
    // Write code below /
    /////////////////////
    
    int A,B,C;

    cin>>A>>B>>C;

    if((A != B && A != C && B != C) || (A == B && A == C && B == C)){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static string ReadLine() { return Console.ReadLine().Trim(); }
    static int ReadInt() { return int.Parse(Console.ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    static bool IsPrime(int n) {
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        for (int i = 3; i * i <= n; i += 2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    static void Main() {
        int ans = 0;
        int n = ReadInt();
        for (int i = 0; i < n; i++) {
            int x = ReadInt();
            if (IsPrime(x)) {
                ans++;
            }
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 5720
#include <cmath>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)

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

    int sum = 0;
    bool exist = false;
    for(int i = A; i < B*A; i = i + A)
    {
        if(i % B == C)
            exist = true;
    }

    if(exist)   cout << "YES" << endl;
    else    cout << "NO" << endl;
    
    return 0;
}


Measured memory_bytes: 256
//#define DEBUG 2

#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <regex>
#include <fstream>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
using namespace std;

#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
inline mp::cpp_int gcd(mp::cpp_int a, mp::cpp_int b) { return b ? gcd(b, a%b) : a; }

void run() {
	string s; cin >> s;
	mp::cpp_int x(s);
	mp::cpp_int y = x / 11;
	mp::cpp_int z = x - (y * 11);

	y *= 2;
	if (z > 6) {
		y += 2;
	} else if (z > 0) {
		y += 1;
	}

	cout << y.str() << endl;
}

int main() {
#ifdef DEBUG
	ifstream in("input.txt");
	cin.rdbuf(in.rdbuf());
	for(int i = 0; i < DEBUG; i++) {
		cout << "cnt:" << i << " ------------" << endl;
		run();
	}
#else
	run();
#endif
	return 0;
}


Measured memory_bytes: 256
io = STDIN
n,k=io.gets.split.map(&:to_i)
tele=[nil]+io.gets.split.map(&:to_i)

visited=Array.new(n+1)
seq=Array.new(n+1)
t=1
cnt=0
while !visited[t]
  if cnt==k
    puts t
    exit
  end
  visited[t]=t
  seq[cnt]=t
  cnt+=1
  t=tele[t]
end
pre=seq.index(t)
puts seq[pre+(k-pre)%(cnt-pre)]


Measured memory_bytes: 31968
#include <iostream>

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

    if (A < C && C < B)
    {
        std::cout << "Yes" << std::endl;
    }
    else if (B < C && C < A)
    {
        std::cout << "Yes" << std::endl;
    }
    else
    {
        std::cout << "No" << std::endl;
    }

    return 0;
}


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

int main() {
    string S;
    cin >> S;
    int ans=-1;
    for(int bit = 0;bit<(1<<4);bit++){
        int now = (S[0]-'0');
        rep(i,3){
            if(bit&(1<<i)){
                now += (S[i+1]-'0');
            }else{
                now -= (S[i+1]-'0');
            }
        }
        if(now==7){
            ans = bit;
        }
    }
    rep(i,3){
        cout<<(S[i]-'0');
        if(ans&(1<<i)){
            cout << "+";
        }else{
            cout << "-";
        }
    }
    cout<<(S[3]-'0')<<"=7"<<endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split()) 
X = list(map(int, input().split()))

Xs = [X[0]]
for i in range(N-1):
    Xs.append(Xs[-1]+X[i+1]-X[i])

ans = 2*(X[N-1] - X[0])
for i in range(N-K+1):
    zerodim = min(abs(X[i]), abs(X[i+K-1]))
    dis = Xs[K+i-1] - Xs[i]
    #print(X[i], X[i+K-1])
    #print(zerodim)
    #print(dis)
    ans = min(dis + zerodim, ans)

print(ans)

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

int main(){
    int n,x;
    cin>>n>>x;
    vector<int>a(n);
    int ans=0;
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a.begin(),a.end());
    int tmp=x;
    for(int i=0;i<n;i++){
        x-=a[i];
        if(x<0){
            break;
        }
        ans++;
    }
    if(x>0)--ans;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int n=s.length();
    for(int i=0;i<n;i++)
        if(s[i]==',')
            cout<<" ";
        else
            cout<<s[i];
        cout<<endl;
    
    return 0;   
}




 
 


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int c[5];
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	c[0]=a+b;
	c[1]=a-b;
	c[2]=a*b;
	sort(c,c+3);
	printf("%d\n",c[2]);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll N[maxn];
int main()
{
	int a,b,c;cin>>a>>b>>c;
	if((c>=a&&c<=b)||(c<=a&&b<=c)) cout<<"Yes"<<endl;
	else cout<<"No"<<endl; 
 } 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a;
	cin>>b;
	cin>>c;
	map<int,int>m;
	m[a]++;
	m[b]++;
	m[c]++;
	if(m.size()==2){
		cout<<"Yes";
	}
    else{
    	cout<<"No";
	}
}

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

using namespace std;

int main(){
	int m, f, b;
	cin >> m >> f >> b;
	if(m >= b){
		cout << 0;
	}
	else if(m + f >= b){
		cout << b - m;
	}
	else{
		cout << "NA";
	}
	cout << "\n";
}



Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

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

	int n;
	cin >> n;

	ll ans = 0;
	rep(i, n){
		ll l, r;
		cin >> l >> r;
		ans += r - l + 1;
	}	

	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
//cout << setprecision(20) << 

int main() {
    ll k; cin >> k;
    for (int i = 0; i < k; ++i) {
        cout << "ACL";
    }
    cout << endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>

using namespace std;

int main(){
    int num, run;
    vector<int> ans;
    run = 5;

    for (int i = 0; i < run;i++){
        cin >> num;
        if(num==0){
            cout << i + 1;
            break;
        }
    }
}

Measured memory_bytes: 3164
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto A = readln.chomp.to!int;
    auto B = readln.chomp.to!int;
    if (A + B == 5) {
        writeln(1);
    } else if (A + B == 4) {
        writeln(2);
    } else if (A + B == 3) {
        writeln(3);
    }
}

Measured memory_bytes: 256
//6Ã»ÓÐ£¬½øÈë;2Ã»ÓÐ£¬½øÈë£»6ÓÐ£¬³ö¡£ÓÃ¶ÓÁÐÄ£Äâ£¿ 
#include <bits/stdc++.h>
using namespace std;
map<int,bool> mp;

int main() {
	int n;cin>>n;
	int cnt = 0;
	while(n--) {
		int v;cin>>v;
		if(mp[v]==0){
			cnt++;
			mp[v]=1;
		}
		else if(mp[v] == 1) {
			cnt--;
			mp[v] = 0;
		}
	}
	cout<<cnt;
	return 0;
}

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

using ll = long long;
#define ld long double
#define ull unsigned long long int

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  // (i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define ret return

typedef pair<int, int>    pii;
typedef vector<int>       vi;
typedef vector<vi>        vii;
typedef vector<long long> vl;

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    // cout << fixed << setprecision(5);

    // 入力
    int n, a, b;
    cin >> n >> a >> b;

    // 処理
    int sum = 0;

    for (int i = 1; i <= n; i++) {
        string s;
        int    peace = 0;
        s            = to_string(i);
        if (i < 10) {
            if (i >= a && i <= b) sum += i;
        } else if (i >= 10 && i < 100) {
            for (int k = 0; k < 2; k++) peace += s[k] - '0';
            if (peace >= a && peace <= b) sum += i;
        } else if (i >= 100 && i < 1000) {
            for (int k = 0; k < 3; k++) peace += s[k] - '0';
            if (peace >= a && peace <= b) sum += i;
        } else if (i >= 1000 && i < 10000) {
            for (int k = 0; k < 4; k++) peace += s[k] - '0';
            if (peace >= a && peace <= b) sum += i;
        } else if (i >= 10000) {
            for (int k = 0; k < 5; k++) peace += s[k] - '0';
            if (peace >= a && peace <= b) sum += i;
        }
    }
    // 出力
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 256
n = gets.chomp!.to_i
num = []
for i in 1..n do
  num << i
end
#p num
count = 0
num.each do |e|
  if e.to_i % 2 != 0
    count += 1
  end
end
#p count

a = count.to_f / num.size
#p sprintf("%.6f", a)
#if count%num.length == 0
print(a.to_s + "000000000\n")

Measured memory_bytes: 1788
A = input()
B = input()
C = input()

def match(c1, c2):
    return c1 == "?" or c2 == "?" or c1 == c2

la = len(A)
lb  =len(B)
lc = len(C)

ml = max(la, lb, lc)

# 。a の左端の位置を 0 としたとき、他の文字列の左端の位置は −4000 から 4000 まで動く可能性があることに注意してください  より、４倍
ab = [False for _ in range(ml * 4 + 1)]
ac = [False for _ in range(ml * 4 + 1)]
bc = [False for _ in range(ml * 4 + 1)]

"""
下の２重forで(i,j) = (0,0)と(1,1)で配列のindexが同じになってしまうが、AとBの０文字目どうし、1文字目どうしを比べるのは、
同じところから先頭が始まっている場合なので、あるずれの配置について、全文字比較していることになる
i=0,j=2とかだとBのほうが左にある場合で、i=3,j=0だとAが左にある場合

ab[i - j]のindexに+2mlして、-2ml ~ 2ml 感を出したい気持ちがあるが、意味がないのでしない
"""


def main():

    for i in range(la):
        for j in range(lb):
            # すでにそのずらし方で文字が重ねられないことが分かっている場合はスキップ
            if ab[i - j]:
                continue
            # そのずらし方で重ねられない場合はTrue
            if not match(A[i], B[j]):
                ab[i - j] = True


    for i in range(la):
        for j in range(lc):
            # すでにそのずらし方で文字が重ねられないことが分かっている場合はスキップ
            if ac[i - j]:
                continue
            # そのずらし方で重ねられない場合はTrue
            if not match(A[i], C[j]):
                ac[i - j] = True

    for i in range(lb):
        for j in range(lc):
            # すでにそのずらし方で文字が重ねられないことが分かっている場合はスキップ
            if bc[i - j]:
                continue
            # そのずらし方で重ねられない場合はTrue
            if not match(B[i], C[j]):
                bc[i - j] = True       

    ans = la + lb + lc
    # BCAとかACBみたいにAの前後に並ぶ場合があるので、AとBの位置関係について±2*ml分探索（Aの頭が０の位置にあるとしてBをどこに置くか(それがi)ということ。）
    for i in range(-2*ml, 2*ml+1):
        # a,bについて、あるずらし方で重ねられない場合は飛ばす
        if ab[i]:
            continue
        # CBA,ABCのパターンがあるので～
        for j in range(-2*ml, 2*ml+1):
            if ac[j]:
                continue
            
            # ここでi,jはaの頭をindexの0としたときの位置にあたるので、B基準で見たときのCとの位置関係はj - iとなる
            # で、そのとき重ねられないならスキップ
            if bc[j - i]:
                continue

            # 文字列Sの左端のindex
            l = min(0, i, j)
            # 文字列Sの右端のindex
            r = max(0 + la, i + lb, j + lc)
            ans = min(ans, r - l)

    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 56540
#include "bits/stdc++.h"
using namespace std;
#define long int64_t

struct Solver {
	void solve() {
		int N;
		cin >> N;

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

		for( int i = 0; i < N-1; ++i ) {
			cout << (s ^ a[i]) << ' ';
		}
		cout << (s ^ a[N-1]) << endl;
	}
};

int main() {
	ios::sync_with_stdio( false );
	cout << fixed << setprecision( 10 );
	Solver().solve();
	return 0;
}


Measured memory_bytes: 3972
main=do
    line <- getLine
    let w:h:x:y:r:_ = map read $ words line :: [Int]
    let s | x<r = "No"
          | x+r>w = "No"
          | y<r = "No"
          | y+r>h = "No"
          | otherwise = "Yes"
    putStrLn s


Measured memory_bytes: 3584
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        long[] line = Array.ConvertAll(System.Console.ReadLine().Trim().Split(' '), long.Parse);
        long n = line[0];
        long m = line[1];
        string s = System.Console.ReadLine().Trim();
        string t = System.Console.ReadLine().Trim();

        if (n > m)
        {
            long tmp1;
            string tmp2;

            tmp1 = n;
            n = m;
            m = tmp1;
            tmp2 = s;
            s = t;
            t = tmp2;

        }

        long gcd = Gcd(n, m);
        for (long i = 0; i < gcd ; i++)
        {
            if (s[(int)(i * (n / gcd))] != t[(int)(i * (m / gcd))])
            {
                System.Console.WriteLine("{0}", -1);
                return;
            }
        }

        System.Console.WriteLine("{0}", Lcm(n, m));

    }

        // 最小公倍数
        static long Lcm(long a, long b)
    {
        return a / Gcd(a, b) * b;
    }

    // 最大公約数
    static long Gcd(long a, long b)
    {
        if (a < b)
            return Gcd(b, a);  // 引数を入替えて自分を呼び出す
        long d = 0;
        do
        {
            d = a % b;
            a = b;
            b = d;
        } while (d != 0);
        return a;
    }

}


Measured memory_bytes: 11616