akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
	"math"
)

var INF = math.MaxInt32
var INF64 = math.MaxInt64

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func readLineNums(bf *bufio.Reader) []int {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []int{}
	for _, field := range fields {
		num, _ := strconv.Atoi(field)
		nums = append(nums, num)
	}
	return nums
}

func readLineFloats(bf *bufio.Reader) []float64 {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	fields := strings.Split(line, " ")
	nums := []float64{}
	for _, field := range fields {
		num, _ := strconv.ParseFloat(field, 64)
		nums = append(nums, num)
	}
	return nums
}

func readLineStrs(bf *bufio.Reader) []string {
	line, _ := bf.ReadString('\n')
	line = strings.Trim(line, "\n")
	return strings.Split(line, " ")
}

func dfs(dp [][][]float64, a, b, c, N int) float64 {
	if a == 0 && b == 0 && c == 0 {
		return 0.0
	}
	if dp[a][b][c] > -0.1 {
		return dp[a][b][c] // 已经有值, 则不需要重复计算
	}

	ans := float64(N)/float64(a+b+c) // 平均需要e步, 才能选中a,b,c中的一个

	if a > 0 {
		p := float64(a) / float64(a+b+c)
		ans += p*(dfs(dp, a-1, b, c, N))
	}
	if b > 0 {
		p := float64(b) / float64(a+b+c)
		ans += p*(dfs(dp, a+1, b-1, c, N))
	}
	if c > 0 {
		p := float64(c) / float64(a+b+c)
		ans += p*(dfs(dp, a, b+1, c-1, N))
	}

	dp[a][b][c] = ans
	return ans
}

func main() {
	bf := bufio.NewReader(os.Stdin)
	N := readLineNums(bf)[0]
	A := readLineNums(bf)
	/*
		定义:
			dp[i][j][k]: 表示有i个碟子剩1个, j个碟子剩2个, k个碟子剩3个, 需要操作次数
		初始值:
			dp[a][b][c]=0, a b c为初始状态时, 数量为1 数量为2 数量为3的碟子数
		转移方程:
			dp[i][j][k]
				i,j,k可以转换到下面的状态
					dp[i-1][j][k]
					dp[i+1][j-1][k]
					dp[i][j+1][k-1]

				i,j,k可以由下面的状态转化
					dp[i-1][j+1][k] // 选中剩余数量为2的碟子
					dp[i+1][j][k] // 选中剩余数量为1的碟子
					dp[i][j-1][k+1] // 选中剩余数量为3的碟子
		答案:
			dp[0][0][0]
	*/
	a, b, c := 0, 0, 0
	for _, n := range A {
		if n == 1 {
			a++
		}
		if n == 2 {
			b++
		}
		if n == 3 {
			c++
		}
	}

	dp := make([][][]float64, N+1)
	for i := range dp {
		dp[i] = make([][]float64, N+1)
		for j := range dp {
			dp[i][j] = make([]float64, c+1)
			for k := range dp[i][j] {
				dp[i][j][k] = -1.0
			}
		}
	}

	fmt.Println(dfs(dp, a, b, c, N))
}


Measured memory_bytes: 256936
import numpy as np
v = []
for i in range(5):
    v.append(int(input()))

v = np.array(v)

s = [(i-1)%10 for i in v]

v = v[np.argsort(s)][::-1]

res = v[-1]
for i in range(len(v)-1):
    res += ((v[i]+9) // 10 * 10)

print(res)

Measured memory_bytes: 12452
#include <bits/stdc++.h>
using namespace std;
long long N;
long long mod = 1e+9 + 7;
int main() {
    cin >> N;
    long long ans = 1;
    for(int i = 1; i <= N; ++i) {
        long long r = ans * i;
        ans = r % mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <stdio.h>
#include <functional>
#include <chrono>
using namespace std;

#define rep(i,s,n) for(ll i=s;i<(n);++i)
using ll = long long;
using pll = pair<ll, ll>;
constexpr ll INF = (1LL << 60);
constexpr ll MAX_INF = 9223372036854775807;
constexpr ll MOD = (1e9 + 7);
//constexpr ll MOD = (998244353);

using vl = vector<ll>;
using vvl = vector<vector<ll>>;

template<class T>
vector<vector<T>> vvt(T init, ll m, ll n) {
	vector<vector<T>> ans = vector<vector<T>>(m, vector<T>(n, init));
	return move(ans);
}

template<class T>
vector<T> vt(T init, ll n) {
	vector<T> ans = vector<T>(n, init);
	return move(ans);
}

template<class T>
T maxVec(vector<T>& v) {
	T ans = -INF;
	rep(i, 0, v.size()) {
		ans = max(ans, v[i]);
	}
	return ans;
}

// 素数判定
bool judge(ll n) {
	for (ll i = 2; i * i <= n; i++) if (n %= i)return false;
	return true;
}


template <class C>
void print(const C & c, std::ostream & os = std::cout)
{
	std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, ", "));
	os << std::endl;
}
/*
ll count(ll n,ll r) {
	ll ans = 0,check = 1;
	rep(i,0, r) {
		if ((n & check) > 0) {
			ans++;
		}
		check = check << 1;
	}
	return ans;
}
*/
bool sortreverse(ll a, ll b) {
	return a > b;
}


ll kiriage(ll a, ll b) {
	if (a % b == 0)return a / b;
	return a / b + 1;
}

ll n, m, t, q, s,k,h,w;

void warshall_floyd(ll v_num,vector<vector<long long>> &d) {
	for (long long k = 0; k < v_num; k++) {       // 経由する頂点
		for (long long i = 0; i < v_num; i++) {    // 始点
			for (long long j = 0; j < v_num; j++) {  // 終点
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}


int main() {
	cin >> n >> m;
	vvl graph(n);
	ll x, y;
	rep(i, 0, m) {
		cin >> x >> y;
		graph[x - 1].push_back(y - 1);
		graph[y - 1].push_back(x - 1);
	}
	queue <ll> que;
	vl check(n, -1);
	check[0] = 0;
	que.push(0);

	while (! que.empty()) {
		ll v = que.front();
		que.pop();

		for (ll to : graph[v]) {
			if (check[to] >= 0)continue;
			check[to] = check[v] + 1;
			que.push(to);
		}
	}
	printf("Yes\n");
	for (ll i = 1; i < n; i++) {
		for (ll moto : graph[i]) {
			if (check[i] - check[moto] == 1) {
				printf("%lld\n", moto + 1);
				break;
			}
		}
	}
}

Measured memory_bytes: 12872
#include <bits/stdc++.h>
using namespace std;
#define ll	    long long
#define vi      vector <ll>
#define vii     vector <pair<int,int>>
#define ii      pair<int,int>
#define loop(n)	for(ll i=0;i<n;i++)
#define pb      push_back
const ll mod=1e9+7;
void fast();
int main()
{
    string s;
    cin>>s;
    bool flagR=0,flagL=0;
    int cnt=0,idx=-1,cnt2=0;
    vector<int>res(s.size(),0);
    for(int i=0;i<s.size();i++){
        if(s[i]=='R'&&!flagR)
            flagR=1,cnt++;
        else if(s[i]=='R'&&flagR&&!flagL)
            cnt++;
        else if(s[i]=='R'&&flagL&&flagR){
            cnt+=cnt2;
            res[idx-1]=cnt/2+cnt%2;
            res[idx]=cnt/2;
            if(cnt2%2==1)
                swap(res[idx],res[idx-1]);
            cnt=cnt2=0;
            flagL=flagR=0;
            idx=-1;
            i--;
        }
        else if(s[i]=='L'&&!flagL){
            cnt2++,flagL=1;
            idx=i;
        }
        else if(s[i]=='L'&&flagL&&flagR)
            cnt2++;
    }
    if(idx!=-1){
        cnt+=cnt2;
        res[idx-1]=cnt/2+cnt%2,res[idx]=cnt/2;
        if(cnt2%2==1)
                swap(res[idx],res[idx-1]);
    }
    loop(s.size())
        cout<<res[i]<<" ";
}
void fast(){
std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
/// 20
/// 15 7 13 15 15 15 15 13 19
/*

*/


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


#define li          long long int
#define uli         unsigned long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;



int main() {
    li d, t, s;
    cin >> d >> t >> s;
    cout << (t * s >= d ? "Yes" : "No") << endl;


    return 0;
}


Measured memory_bytes: 3612
#include <iostream>

using namespace std;

int main()
{
	unsigned int h, w;

	while (true) {
		cin >> h >> w;
		if (h == 0 && w == 0)
			return 0;
		for (unsigned int j = 0; j < w; ++j)
			cout << "#";
		cout << endl;

		for (unsigned int i = 1; i < h - 1; ++i) {
			cout << "#";
			for (unsigned int j = 1; j < w - 1; ++j)
				cout << ".";
			cout << "#" << endl;
		}

		for (unsigned int j = 0; j < w; ++j)
			cout << "#";
		cout << endl << endl;
	}
}



Measured memory_bytes: 3088
import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
int sum=0;
for(int i=0;i<5;i++)
{
int x=Integer.parseInt(input.readLine());
if(x<40)
{
sum+=40;
continue;
}
sum+=x;
}
System.out.println(sum/5);
}
}

Measured memory_bytes: 16860
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

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

int main() {
  ll N, M;
  cin >> N >> M;

  cout << (1900*M + 100*(N-M))*(1 << M) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <math.h>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define PI 3.14159265358979323846264338327950L
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int diff_ab = abs(a - b);
  int diff_bc = abs(b - c);
  int diff_ac = abs(a - c);

  if (((diff_ab <= d) && (diff_bc <= d)) || (diff_ac <= d)) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}


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

typedef ostringstream OSS; typedef istringstream ISS;
typedef long long LL;
typedef pair<int, int> PII;  typedef pair<LL, LL> PLL;
typedef vector<int>    VI;   typedef vector<VI>   VVI;   typedef vector<VVI>   VVVI;
typedef vector<LL>     VLL;  typedef vector<VLL>  VVLL;  typedef vector<VVLL>  VVVLL;
typedef vector<double> VD;   typedef vector<VD>   VVD;   typedef vector<VVD>   VVVD;
typedef vector<string> VS;   typedef vector<VS>   VVS;   typedef vector<VVS>   VVVS;
typedef vector<bool>   VB;   typedef vector<VB>   VVB;   typedef vector<VVB>   VVVB;
typedef vector<PII>    VPII; typedef vector<VPII> VVPII; typedef vector<VVPII> VVVPII;
typedef vector<PLL>    VPLL; typedef vector<VPLL> VVPLL; typedef vector<VVPLL> VVVPLL;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define MAXUD(orig, target) orig = max(orig, target)
#define MINUD(orig, target) orig = min(orig, target)
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a)   { OSS oss; oss << a; return oss.str(); };

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int    DX[] = {1,  0, -1, 0};
const int    DY[] = {0, -1,  0, 1};
const double EPS  = 1e-12;
// const double PI   = acos(-1.0);
// lambda: [](T1 x)->T2{return y;}
// simple lambda: [](T x){return x;}

VI qs;

bool solve(string s, int x) {
    *find(ALL(s), '?') = '0' + x;

    int sum = 0;
    REP(i, 1, 12) {
        sum += (s[i] - '0') * qs[i];
    }

    int rem = sum % 11;
    int chk;
    if (rem <= 1) {
        chk = 0;
    } else {
        chk = 11 - rem;
    }

    bool is_valid = chk == (s[0] - '0');

    return is_valid;
}

int main(void) {
    qs = VI(12, -1);
    REP(i, 1, 6 + 1) {
        qs[i] = i + 1;
    }
    REP(i, 7, 11 + 1) {
        qs[i] = i - 5;
    }


    string s;
    cin >> s;
    reverse(ALL(s));

    int ans = -1;
    int anscnt = 0;
    rep(i, 10) {
        if (solve(s, i)) {
            ans = i;
            ++anscnt;
        }
    }

    if (anscnt == 1) {
        cout << ans << endl;
    } else if (anscnt == 0) {
        cout << "INVALID" << endl;
    } else {
        cout << "MULTIPLE" << endl;
    }

	return 0;
}

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

namespace agc013_b
{
    class Program
    {
        static List<int>[] d;
        static void Main(string[] args)
        {
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            x[0]++;
            d = new List<int>[x[0]];
            for (int i = 0; i < x[0]; i++) d[i] = new List<int>();
            for (int i = 0; i < x[1]; i++)
            {
                int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
                d[a[0]].Add(a[1]); d[a[1]].Add(a[0]);
            }
            LinkedList<int> ret = new LinkedList<int>();
            ret.AddFirst(1);
            int search = 1;
            bool[] visited = new bool[x[0]];
            while (!visited[search])
            {
                visited[search] = true;
                foreach (var item in d[search])
                {
                    if (!visited[item])
                    {
                        search = item;
                        ret.AddFirst(item);
                        break;
                    }
                }
            }
            search = 1; visited[1] = false;
            while (!visited[search])
            {
                visited[search] = true;
                foreach (var item in d[search])
                {
                    if (!visited[item])
                    {
                        search = item;
                        ret.AddLast(item);
                        break;
                    }
                }
            }
            Console.WriteLine(ret.Count);
            Console.WriteLine(string.Join(" ", ret));
        }
    }
}

Measured memory_bytes: 32396
n, m = map(int, input().split())
py = [list(map(int, input().split())) for i in range(m)]
c = [0]*(n + 1)
id = {}

for p, y in sorted(py, key = lambda x: x[1]):
    c[p] += 1
    id[y] =  format(p, "06") + format(c[p], "06")

for p, y in py:
    print(id[y])

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

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

#define fr first
#define sc second

int main(){
	static int n,k;
	static int x[100010],y[100010];
	static char c[100010];
	static int cnt[2002][2002] = {};
	scanf("%d%d",&n,&k);
	for(int i = 1 ; i <= n ; i ++){
		scanf("%d %d %c",&x[i],&y[i],&c[i]);
		if(c[i] == 'B'){
			cnt[x[i]%(2*k)][y[i]%(2*k)] ++;
		}
		else {
			cnt[(x[i]+k)%(2*k)][y[i]%(2*k)] ++;
		}
	}
	
	static int imos[2002][2002] = {};
	for(int i = 0 ; i < 2002 ; i ++){
		for(int j = 0 ; j < 2002 ; j ++){
			imos[i][j] = cnt[i][j];
		}
	}
	for(int i = 0 ; i < 2002 ; i ++){
		for(int j = 0 ; j+1 < 2002 ; j ++){
			imos[i][j+1] += imos[i][j];
		}
	}
	for(int i = 0 ; i+1 < 2002 ; i ++){
		for(int j = 0 ; j < 2002 ; j ++){
			imos[i+1][j] += imos[i][j];
		}
	}
	
	static int cnt_[2][2002] = {};
	for(int i = 0 ; i < 2002 ; i ++){
		for(int j = 0 ; j < 2002 ; j ++){
			cnt_[0][i] += cnt[i][j];
			cnt_[1][j] += cnt[i][j];
		}
	}
	for(int i = 0 ; i+1 < 2002 ; i ++){
		cnt_[0][i+1] += cnt_[0][i];
	}
	for(int j = 0 ; j+1 < 2002 ; j ++){
		cnt_[1][j+1] += cnt_[1][j];
	}
	
	/*for(int i = 0 ; i < 2*k ; i ++){
		for(int j = 0 ; j < 2*k ; j ++){
			cout << imos[i][j] << " ";
		}
		cout << endl;
	}*/
	
	int ret = 0;
	for(int i = 0 ; i < k ; i ++){
		for(int j = 0 ; j < k ; j ++){
			ret = max( ret , n-(cnt_[0][i+k]-cnt_[0][i]+cnt_[1][j+k]-cnt_[1][j]-2*(imos[i+k][j+k]+imos[i][j]-imos[i][j+k]-imos[i+k][j])) );
			ret = max( ret , cnt_[0][i+k]-cnt_[0][i]+cnt_[1][j+k]-cnt_[1][j]-2*(imos[i+k][j+k]+imos[i][j]-imos[i][j+k]-imos[i+k][j]) );
		}
	}
	cout << ret << endl;
}



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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    if(s[0]==s[2]) cout << "Yes" << "\n";
    else cout << "No" << "\n";

    return 0;
}

Measured memory_bytes: 3544
import java.util.*;
public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
    	int i, j, k;
    	
    	double x1 = sc.nextDouble();
    	double y1 = sc.nextDouble();
    	double x2 = sc.nextDouble();
    	double y2 = sc.nextDouble();
    	
    	System.out.println(Math.hypot(x2 - x1, y2 - y1));
    }
}


Measured memory_bytes: 28140
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int N;
	cin >> N;
	for (int i = 0; i < N + 100; i++) {
		if ((int)(i * 1.08) == N) {
			cout << i << endl;
			break;
		}
		if (i == N + 99) {
			cout << ":(" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3648
def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


a = int(input())
b = list(map(int, input().split()))
b.append(0)
b.insert(0, 0)
c = [0]*(len(b))
d = [0]*(len(b))
for i in range(1, len(b)):
    c[i] = (g_c_d(b[i], c[i-1]))
    d[-i-1] = (g_c_d(b[-i-1], d[-i]))
e = 0
for i in range(0, len(c)-2):
    e = max(g_c_d(c[i], d[i+2]), e)
print(e)



Measured memory_bytes: 14436
#include <iostream>
#include <cstring>
using namespace std;
char p[8][9];
void rotate()
{
	int i;
	char tmp[8][9];
	for (i = 0; i < 8; i++)
		strcpy(tmp[i], p[i]);
	for (int x = 7; x >= 0; x--)
		for (int y = 0; y < 8; y++)
			tmp[y][x] = p[7-x][y];
	for (i = 0; i < 8; i++)
	{
		strcpy(p[i], tmp[i]);
		cout << p[i] << endl;
	}
}
int main()
{
	int i;
	for (i = 0; i < 8; i++)
		cin >> p[i];
	for (i = 1; i <= 3; i++)
	{
		cout << 90*i << endl;
		rotate();
	}
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

const int kMaxN = 200000;

int main() {
    int n;
    int A[kMaxN];
    cin >> n;

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

    int min = A[0] < A[1] ? A[0] : A[1];
    int r = A[1] - A[0];

    for (int i = 2; i < n; i++) {
        if (A[i] - min > r) {
            r = A[i] - min;
        }
        
        if (A[i] < min) {
            min = A[i];
        }
    }

    cout << r << endl;
}




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

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



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

int main() {

	string s; cin >> s;
	int ans = 2147483647;
	for (int i = 0; i < s.size()-2; i++) {
		string tmp = s.substr(i, 3);
		ans = min(ans, abs(stoi(tmp) - 753));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <iostream>
using namespace std;
int main(){
	int d;
	while(cin>>d){
		long s=0;
		int a = 600/d;
		for(int i=0;i<a;i++){
			s += i*d*i*d*d;
		}
		cout<<s<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
using namespace std;
int main(void){
  int width, height;
  
  while(true) {
    cin >> height >> width;
    
    if(height == 0 && width == 0) {
      break;
    }
    
    for(int i = 0; i < height; i++) {
      string rect(width, '#');
      if(i == 0 || i == height - 1) {
      } else {
        for(int j = 1; j < width - 1; j++) {
          rect[j] = '.';
        }
      }
      cout << rect << endl;
    }
    cout << endl;
  }
}

Measured memory_bytes: 3108
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("faild to read char") as char)
        .take_while(|c| !c.is_whitespace())
        .collect();
    token
        .parse()
        .ok()
        .expect("faild to parse token")
}

fn main(){
    let n: u64 = read();
    let k: u64 = read();
    let m = k + 1;
    let mut times: Vec<ModInt> = (0..m).map(|_| ModInt(0)).collect();

    let mut ret = ModInt(0);
    for i in (1..m).rev() {
        let mut t = ModInt(k / i).pow(n);
        for j in (1..m).map(|a| i * a).take_while(|&a| a <= k) {
            t -= times[j as usize];
        }
        times[i as usize] = t;
        ret += t * ModInt(i);
    }

    println!("{}", ret);
}

#[derive(Clone, Copy)]
struct ModInt(u64);
const MOD: u64 = 1000000007;

impl std::ops::Add for ModInt {
    type Output = ModInt;

    fn add(self, other: ModInt) -> ModInt {
        let ModInt(a) = self;
        let ModInt(b) = other;
        ModInt((a + b) % MOD)
    }
}

impl std::ops::AddAssign for ModInt {
    fn add_assign(&mut self, other: ModInt) {
        let ModInt(a) = self;
        let ModInt(b) = other;
        *a = (*a + b) % MOD;
    }
}

impl std::ops::Sub for ModInt {
    type Output = ModInt;

    fn sub(self, other: ModInt) -> ModInt {
        let ModInt(a) = self;
        let ModInt(b) = other;
        ModInt((a + MOD - b) % MOD)
    }
}

impl std::ops::SubAssign for ModInt {
    fn sub_assign(&mut self, other: ModInt) {
        let ModInt(a) = self;
        let ModInt(b) = other;
        *a = (*a + MOD - b) % MOD;
    }
}

impl std::ops::Mul for ModInt {
    type Output = ModInt;

    fn mul(self, other: ModInt) -> ModInt {
        let ModInt(a) = self;
        let ModInt(b) = other;
        ModInt((a * b) % MOD)
    }
}

impl std::ops::MulAssign for ModInt {
    fn mul_assign(&mut self, other: ModInt) {
        let ModInt(a) = self;
        let ModInt(b) = other;
        *a = (*a * b) % MOD;
    }
}

impl ModInt {
    fn pow(&self, n: u64) -> ModInt {
        if n == 0 {
            return ModInt(1);
        }
        let prev = self.pow(n / 2);
        if n % 2 == 1 {
            prev.clone() * prev * self.clone()
        } else {
            prev.clone() * prev
        }
    }

    fn inverse(&self) -> ModInt {
        self.pow(MOD - 2)
    }
}

impl std::ops::Div for ModInt {
    type Output = ModInt;

    fn div(self, other: ModInt) -> ModInt {
        self * other.inverse()
    }
}

impl std::fmt::Display for ModInt {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let ModInt(a) = self;
        write!(f, "{}", a)
    }
}


Measured memory_bytes: 2744
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;
int INF = 1000000007;

int main(){
  int H,W;
  cin >> H >> W;
  int d[10][10];
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      cin >> d[i][j];
    }
  }
  int A[H][W];
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) cin >> A[i][j];
  }
  //ワーシャルフロイド
  for(int k=0;k<10;k++){
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }


  ll ans = 0LL;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(A[i][j]!=-1){
        ans += d[A[i][j]][1];
      }
    }
  }

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


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

using namespace std;

int main(){

	int a,b,c,k;

	cin >> a >> b >> c >> k;

	int ans = a+b+c;
	int mx = max({a,b,c});

	while(k--){
		ans+=mx;
		mx*=2;
	}

	cout << ans << '\n';

return 0;
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N, L = MI()
    A = [L + i for i in range(N)]
    if A[0] * A[-1] < 0:
        print(sum(A))
    else:
        if A[0] >= 0:
            print(sum(A) - A[0])
        else:
            print(sum(A)-A[-1])
if __name__ == '__main__':
    main()

Measured memory_bytes: 38384
#include <iostream>
using namespace std;
int main() {
    int h, w; cin >> h >> w;
    int count[128] = {};
    for (int i=0; i<h; i++) {
        string s; cin >> s;
        for (char x : s) count[x]++;
    }
    for (int x = 'a'; x <= 'z'; x++) count[count[x]%4]++;

    if (h*w%2 == 0)
        cout << (count[1] == 0 && count[3] == 0 &&
                 count[2] <= h%2*(w/2) + w%2*(h/2) ? "Yes\n" : "No\n");
    else if (count[1] + count[3] > 1) cout << "No\n";
    else if (count[1] == 1)
        cout << (count[2] <= h%2*(w/2) + w%2*(h/2) ? "Yes\n" : "No\n");
    else if (count[3] == 1)
        cout << (count[2] < h%2*(w/2) + w%2*(h/2) ? "Yes\n" : "No\n");
    else cout << "No\n";
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int N;
    cin>>N;
    int ori_N=N;
    int sum=0;
    for(int i=0;i<10;i++){
        sum+=N%10;
        N=N/10;
    }
    if(ori_N%sum==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
/**
*    created: 10.07.2020 17:09:09
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
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;}
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;

signed main() {

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

    string s; cin >> s;
    cout << s.substr(0,5) << " " << s.substr(6,7) << " " << s.substr(14,5);
    cout << endl;
    return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <map>
#define for1(x,y) for(long long x = 1; x<ll(y); x++)
#define forn(x,y,z) for(long long x = y; x< ll(z); x++)
#define for0(x,y,z) for(long long x = y; x< ll(z); x++)
# define PII pair<int,int>
# define FF first
# define SS second
# define PB push_back

#define forn(x,y,z) for(long long x = y; x< ll(z); x++)
#define for0(x,y,z) for(long long x = y; x< ll(z); x++)
using namespace std;
typedef long long ll;
typedef long double ld;	

#define maxn 1000015
const double EPS = (1e-7), EPSm= (1e7);
const ll linf = (ll)1e17 + 5;
long double PI = 3.14159265359;
int dir[8][2]={{1,0},{-1,0},{0,1},{0,-1},{-1,-1},{1,1},{-1,1},{1,-1}};
	
const int MAXN = 1e5 + 10;
const int NINF = -1e5;
const int INF = 2000000000;

void solve()
{
	int n;
	cin>>n;
	if(n>=30) cout<<"Yes\n";
	else cout<<"No\n";
	return;
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	setprecision(20);
	int test;
	//cin >> test;
	//while(test--)
		solve();
	return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <queue>
#include <vector>
#include <set>
#include <algorithm>
#include <functional>
using namespace std;

const int INF = 1<<28;

struct edge_t {
    int from, to, cost;
    edge_t(int from=0, int to=0, int cost=0) : from(from), to(to), cost(cost) {}
    bool operator<(const edge_t &o) const {
        return (cost < o.cost);
    }
    bool operator>(const edge_t &o) const {
        return (cost > o.cost);
    }
};
struct state_t {
    int v;
    int min_cost;
    state_t(int v, int min_cost) : v(v), min_cost(min_cost) {}
    bool operator<(const state_t &o) const {
        return (min_cost < o.min_cost);
    }
    bool operator>(const state_t &o) const {
        return (min_cost > o.min_cost);
    }
};
typedef vector<edge_t> vertex_t;
struct graph_t {
    vector<vertex_t> g;

    graph_t() {}

    graph_t(int vertex_count) {
        g.resize(vertex_count);
        for (int i = 0; i < vertex_count; i++) {
            g[i].resize(1000);
        }
    }
    graph_t(vector<vertex_t> g) : g(g) {}

    inline vertex_t& operator[](int index) {
        return g[index];
    }

    inline void add_edge(int from, int to, double cost) {
        g[from].push_back(edge_t(from, to, cost));
    }
    
    int prim(int hotspots) {
        bool used[g.size()];
        int min_span_cost = 0;
        priority_queue< edge_t, vector<edge_t>, greater<edge_t> > q;

        fill(used, used+g.size(), false);

        for (int i = 0; i < hotspots; i++) {
            used[i] = true;
            for (int j = 0; j < g[0].size(); j++) {
                q.push(g[i][j]);
            }
        }

        while (!q.empty()) {
            edge_t e = q.top(); q.pop();
            if (used[e.to]) continue;
            used[e.to] = true;
            min_span_cost += e.cost;
            for (int i = 0; i < g[e.to].size(); i++) {
                q.push(g[e.to][i]);
            }
        }

        return min_span_cost;
    }
};

int main() {
    int s, d;
    while (cin >> s >> d) {
        if (s == 0 && d == 0) break;
        graph_t graph(1000);
        for (int i = 0; i < s; i++) {
            for (int j = 0; j < d; j++) {
                int distance; cin >> distance;
                if (distance == 0) continue;
                graph[i][s+j] = edge_t(i, s+j, distance);
                graph[s+j][i] = edge_t(i, s+j, distance);
            }
        }
        for (int i = d-1; i >= 0; i--) {
            for (int j = 0; j <= i; j++) {
                if (s+d-i-1 == s+d-i+j-1) continue;
                int distance; cin >> distance;
                if (distance == 0) continue;
                graph[s+d-i-1][s+d-i+j-1] = edge_t(s+d-i-1, s+d-i+j-1, distance);
                graph[s+d-i+j-1][s+d-i-1] = edge_t(s+d-i+j-1, s+d-i-1, distance);
            }
        }

        cout << graph.prim(s) << endl;

//        for (int i = 0; i < s+d; i++) {
//            for (int j = 0; j < s+d; j++) {
//                cout << graph[i][j].cost << ' ';
//            }
//            cout << endl;
//        }
    }
    return 0;
}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
string s="CODEFESTIVAL2016",a;
int ans;
int main() {
	cin>>a;
	for(int i=0; i<=15; i++) {
		if(a[i]!=s[i])ans++;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		long a, b, x, count = 0;
		
		a = sc.nextLong();
		b = sc.nextLong();
		x = sc.nextLong();
		
		count = (b - a) / x + 1;
		if(a != 0 && a % x != 0)count = (b / x) - ((a - 1) / x);
		if(b == a && a % x != 0)count = 0;
		
		System.out.println(count);
		
		sc.close();
	}

}


Measured memory_bytes: 22868
using System;

class Program {
    static void Main(string[] args) {
        //入力
        string s = Console.ReadLine();

        int N = int.Parse(s.Split(' ')[0]);
        int A = int.Parse(s.Split(' ')[1]);
        int B = int.Parse(s.Split(' ')[2]);

        //出力
        Console.Write(Math.Min(A, B));
        Console.Write(" ");
        if (A + B <= N) {
            Console.Write("0");
        } else {
            Console.Write(A + B - N);
        }

        

    }
}

Measured memory_bytes: 11092
LOG = 18

def main():
    S = input()
    N = len(S)
    to = []
    for _ in range(LOG):
        l = [0]*N
        to.append(l)
        
    for i in range(N):
        to[0][i] = i + 1 if S[i] == "R" else i -1
    
    for i in range(1, LOG):
        for j in range(N):
            to[i][j] = to[i-1][to[i-1][j]]
            
    ans = [0]*N
    for j in range(N):
        ans[to[LOG-1][j]] += 1
        
    print(*ans)
    return

main()

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

char feild[101][101];

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

void dfs(int x,int y,int w,int h,char symbol)
{
	feild[x][y] = '.';
	int nx,ny;
	for(int i = 0; i < 4; i++)
	{
		nx = x+dx[i], ny = y+dy[i];
		if((0<=nx&&nx<h)&&(0<=ny&&ny<w)&&feild[nx][ny]==symbol)
		dfs(nx,ny,w,h,symbol);
	}
	
}



int main()
{
	int W,H;

	while(cin>>H>>W,W||H)
	{
		for(int i = 0 ; i < H ; i++)
		cin>>feild[i];
        ans = 0;
		for(int i = 0 ; i < H ; i++)
		    for(int j = 0 ; j < W ; j++)
		    {
		    	if(feild[i][j] != '.')
		    	{
		    		dfs(i,j,W,H,feild[i][j]);
		    		ans++;
				}
			}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 3856
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;

int main() {
  int64_t a, b, x, p, q;
  cin >> a >> b >> x;
  p = b / x + 1;
  if(a == 0) q = 0;
  else q = (a-1)/x + 1;
  cout << p - q << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		//int n = sc.nextInt();
		//String s = sc.next();
		long n = sc.nextLong();
		//double n = sc.nextDouble();
		int a = 0;
		int b = 0;
		int c = 0;
		int d = 0;

		
		for(int i = 0; i < n ; i++) {
			String s = sc.next();
			if(s.equals("AC")) {
				a++;
			}else if (s.equals("WA")) {
				b++;
			}else if (s.equals("TLE")) {
				c++;
			}else {
				d++;
			}
		}
		
		System.out.println("AC x "+ a);
		System.out.println("WA x "+ b);
		System.out.println("TLE x "+ c);
		System.out.println("RE x "+ d);


		//System.out.println("Yes");
		//System.out.println("No");
		

	}
}


Measured memory_bytes: 58980
object Main{
  def main(args:Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val a = sc.nextInt;
    val b = sc.nextInt;
    val c = sc.nextInt;
    if(a == b){
      println(c)
    }else if(a == c){
      println(b)
    }else{
      println(a)
    }
  }
}


Measured memory_bytes: 25768
import math


k = int(input())
answer = 0
for w_a in range(1, k + 1):
    for w_b in range(1, k + 1):
        w = math.gcd(w_a, w_b)
        for w_c in range(1, k + 1):
            answer += math.gcd(w, w_c)

print(answer)


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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int[] L = new int[2 * N];
        for (int i = 0; i < L.length; i++) {
            L[i] = sc.nextInt();
        }
        Arrays.sort(L);

        int result = 0;
        for (int i = 0; i < L.length; i += 2) {
            result = result + Math.min(L[i] , L[i + 1]);
        }
        System.out.println(result);
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main()
{
    int N;
    cin >> N;
    long long ns[5] = {};
    for (int i = 0; i < N; i++) {
        string s;
        cin >> s;
        if (s[0] == 'M') ns[0]++;
        if (s[0] == 'A') ns[1]++;
        if (s[0] == 'R') ns[2]++;
        if (s[0] == 'C') ns[3]++;
        if (s[0] == 'H') ns[4]++;
    }
    long long result = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                result += ns[i] * ns[j] * ns[k];
            }
        }
    }
    cout << result << endl;
    return 0;
}

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

int main(){
  int N;cin>>N;
  if(N==3){
    cout << 2 << endl;
    cout << 1 << ' ' << 3 << endl;
    cout << 2 << ' ' << 3 << endl;
    return 0;
  }

  if(N==4){
    cout << 4 << endl;
    cout << 1 << ' ' << 2 << endl;
    cout << 1 << ' ' << 3 << endl;
    cout << 4 << ' ' << 2 << endl;
    cout << 4 << ' ' << 3 << endl;
    return 0;
  }

  if(N%2==1){
    int q=N/2;
    cout << 4*q << endl;
    for (int m=1;m<q;++m){
      cout << m << ' ' << m+1 << endl;
      cout << m << ' ' << N-m-1 << endl;
      cout << N-m << ' ' << m+1 << endl;
      cout << N-m << ' ' << N-m-1 << endl;
    }
    cout << 1 << ' ' << N << endl;
    cout << N-1 << ' ' << N << endl;
    cout << q << ' ' << N << endl;
    cout << q+1 << ' ' << N << endl;
    return 0;
  }

  if(N%2==0){
    int q=N/2;
    cout << 4*q << endl;
    for (int m=1;m<q;++m){
      cout << m << ' ' << m+1 << endl;
      cout << m << ' ' << N-m << endl;
      cout << N-m+1 << ' ' << m+1 << endl;
      cout << N-m+1 << ' ' << N-m << endl;
    }
    cout << 1 << ' ' << q << endl;
    cout << 1 << ' ' << q+1 << endl;
    cout << N << ' ' << q << endl;
    cout << N << ' ' << q+1 << endl;
    return 0;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define sz(a) int((a).size())
#define int long long
#define Int int32_t
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define pii pair< int , int >
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define bitcnt(n) __builtin_popcountll(n)
#define setpre(n) cout << fixed << setprecision(n)
#define tr(c) for(auto x : c )cout << x << " ";
#define ol(c , s , e ) for(int pos=s; pos<e ; pos++) cout << c[pos] << " ";
#define inf 1e18;
#define PI acos(-1)
const int M = 1000000007;
const int N=1e5+5;

//#define rohit
#ifdef rohit
template<typename... T >
void bug(T... __VA_ARGS__) {
    ((cerr << __VA_ARGS__ << " ") , ...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", bug(__VA_ARGS__) , cerr << endl;
#endif
void solve() {
    string s;
    cin >> s;
    if(s == "ABC"){
        cout << "ARC\n";
    }
    else{
        cout << "ABC\n";
    }

}
signed main()
{
    FAST;
    //TODO:  check test cases are there or not?
    int tc=1;
//    cin >> tc;
    for(int t = 1 ; t <= tc ; t++)
    {
        solve();
    }
}

Measured memory_bytes: 3588
# abc168_c.py
# https://atcoder.jp/contests/abc168/tasks/abc168_c

# C - : (Colon) /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 300点

# 問題文
# 時針と分針の長さがそれぞれ Aセンチメートル、Bセンチメートルであるアナログ時計を考えます。
# 時針と分針それぞれの片方の端点は同じ定点に固定されており、この点を中心としてそれぞれの針は一定の角速度で時計回りに回転します。
# 時針は 12時間で、分針は 1 時間で 1周します。
# 0時ちょうどに時針と分針は重なっていました。
# ちょうど H 時 M 分になったとき、2本の針の固定されていない方の端点は何センチメートル離れているでしょうか。

# 制約
#     入力はすべて整数
#     1≤A,B≤1000
#     0≤H≤11
#     0≤M≤59

# 入力
# 入力は以下の形式で標準入力から与えられる。
# A B H M

# 出力
# 答えを、単位を除いて出力せよ。正しい値との絶対誤差または相対誤差が 10−9以下であれば正解とみなされる。

# 入力例 1
# 3 4 9 0

# 出力例 1
# 5.00000000000000000000

# 2本の針は図のようになるので、答えは 5センチメートルです。
# 9時0分のアナログ時計

# 入力例 2
# 3 4 10 40

# 出力例 2
# 4.56425719433005567605

# 2本の針は図のようになります。各針は常に一定の角速度で回ることに注意してください。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    A, B, H, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    h = 360 / 12 * (H+(M/60))
    m = 360 / 60 * M
    a = abs(h-m)
    log(f'h=[{h}], m=[{m}], a=[{a}]')

    # Ｈ軸をＸ扱いで、(3, 0) ※この座標は固定
    # x, y = 3.0, 0

    # M軸の座標を計算
    import math
    x = math.cos(a/180*math.pi) * B
    y = math.sin(a/180*math.pi) * B

    log(f'x=[{x}], y=[{y}]')

    result = ((x-A)**2 + y**2)**0.5

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 4 9 0']
        lines_export = [5.00000000000000000000]
    if pattern == 2:
        lines_input = ['3 4 10 40']
        lines_export = [4.56425719433005567605]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()


Measured memory_bytes: 9552
#include <stdio.h>
#include <stdlib.h> 
#include <time.h>
int main(){
    int i=0,j;
    char S[20];
    scanf("%s", S);
    while(S[i]){
        i++;
    }
    srand(time(NULL));
    if(i==3){
        j = 0;
    }else{
    j = rand()%(i-3);
    }
    printf("%c%c%c", S[j],S[j+1],S[j+2]);
    return 0;
}


Measured memory_bytes: 2148
#include <bits/stdc++.h>
using namespace std;
#define UF_SIZE 1 // 1/0: 同値類のサイズを記録する/しない

struct UnionFind{
// 同値関係をサポートするデータ構造
// 併合,所属する同値類の代表元:O(logN), 集合の分割はNG
// 経路圧縮する場合,各クエリはO(a(n)) (a(n): アッカーマン関数A(m,n)について,f(n)=A(n,n)としたときの逆関数)
  vector<int> m_root;
#if (UF_SIZE==1)
  vector<int> m_size;
#endif

  UnionFind(int N)
  : m_root(N)
#if (UF_SIZE==1)
  , m_size(N,1)
#endif
  { iota(m_root.begin(), m_root.end(), 0); }

  int find(int a){
    if(m_root.at(a)==a){
      return a;
    }
    else{
      return m_root.at(a)= find(m_root.at(a));
    }
  }

  void unify(int a, int b){
    int r_a= find(a);
    int r_b= find(b);
#if (UF_SIZE==1)
    if(r_a != r_b){
      if(m_size.at(r_a) < m_size.at(r_b)){
        m_root.at(r_a)= r_b;
        m_size.at(r_b)+= m_size.at(r_a);
        return;
      }
      else{
        m_root.at(r_b)= r_a;
        m_size.at(r_a)+= m_size.at(r_b);
        return;
      }
    }
#else
    if(r_a != r_b){
      m_root.at(r_b)= r_a;
      return;
    }
#endif
  }
  
  bool are_comrade(int a, int b){
    return find(a)==find(b);
  }

#if (UF_SIZE==1)
  int get_size(int a){
    return m_size.at(find(a));
  }
#endif
};

int main(){
  using coord= pair<int, int>;
  using pii  = pair<int, int>;

  int N;
  cin >> N;

  vector<coord> data(N);
  map<coord, int> ids;
  priority_queue<pair<int, pii>, vector<pair<int, pii>>, greater<pair<int, pii>>> pq;
  UnionFind uf(N);

  coord buf;
  for(int i=0; i<N; i++){
    cin >> buf.first >> buf.second;
    data.at(i)= buf;
    if(!ids.count(buf)){
       ids[buf]= i;
    }
    else{
      uf.unify(ids.at(buf), i);
    }
  }

  auto comp1= [](coord p1, coord p2){
    bool ans= (p1.first != p2.first) ? (p1.first  < p2.first)
                                     : (p1.second < p2.second);
    return ans;
  };
  auto comp2= [](coord p1, coord p2){
    bool ans= (p1.second != p2.second) ? (p1.second < p2.second)
                                       : (p1.first  < p2.first);
    return ans;
  };
  auto dist= [](coord p1, coord p2){
    return min(abs(p1.first- p2.first), abs(p1.second- p2.second));
  };


  sort(data.begin(), data.end(), comp1);
  for(int i=1; i<N; i++){
    coord p1= data.at(i-1);
    coord p2= data.at(i);

    pq.push(make_pair(dist(p1, p2), make_pair(ids.at(p1), ids.at(p2))));
  }
  sort(data.begin(), data.end(), comp2);
  for(int i=1; i<N; i++){
    coord p1= data.at(i-1);
    coord p2= data.at(i);

    pq.push(make_pair(dist(p1, p2), make_pair(ids.at(p1), ids.at(p2))));
  }

  int ans= 0;
  while(uf.get_size(0) < N){
    auto tmp= pq.top();
    int d,id1,id2; pii ids_tmp;
    tie(d, ids_tmp)= tmp;
    tie(id1, id2)= ids_tmp;

    if(!uf.are_comrade(id1, id2)){
      uf.unify(id1, id2);
      ans+= d;
    }
    pq.pop();
  }

  cout << ans << endl;
}


Measured memory_bytes: 12788
X, Y = map(int, input().split())
for x in range(1,X+1):
  # print(x,4*x+2*(X-x))
  if 4*x + 2*(X-x) == Y:
    print('Yes')
    exit()
for x in range(1,X+1):
  if 2*x + 4*(X-x) == Y:
    print('Yes')
    exit()
print('No')

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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	int N;
	cin >>N;
	int A=-1;
	int S=0;
	for (int i=0; i<N; i++) {
		int B;
		cin >>B;
		if (A==B) {
			S++;
			A=-1;
		} else
			A=B;
	}
	cout <<S <<endl;
	return 0;
}



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

int main(){
  int N, K, x;
  int A = 0;
  cin >> N >> K;
  for(int i = 0; i < N; i++){
    cin >> x;
    if(x >= K-x){
      A += 2*(K-x);
    }
    else{
      A += 2*x;
    }
  }
  cout << A << endl;
}

Measured memory_bytes: 256