akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main(){
  int n,m,d[11][10010];
  while(cin>>n>>m&&n&&m){
    rep(i,n)rep(j,m)cin>>d[i][j];
    int ans=0,t,a;
    for(int i=0;i<1<<n;i++,t=0){
      for(int j=0,a=0;j<m;j++,a=0){
        rep(k,n)
          if(i&(1<<k))a+=!d[k][j];
          else a+=d[k][j];
        t+=max(a,n-a);
      }
      ans=max(ans,t);
    }
    cout<<ans<<endl;
  }
}

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

int main() {
	ios_base::sync_with_stdio( false );

	vector<int> a( 5 );
	for( auto& v: a ) { cin >> v; }

	sort( a.begin(), a.end(), greater<>() );

	for( int i = 0; i < a.size(); ++i ) {
		cout << a[i];

		if( i < a.size()-1 ) { cout << ' '; }
	}
	
	cout << endl;
}



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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Dictionary<int,int> di = new Dictionary<int,int>();
		for(int i=0;i<N;i++){
			if(di.ContainsKey(A[i]) == false) di.Add(A[i],0);
			di[A[i]]++;
		}
		int tot = 0;
		foreach(var k in di.Keys){
			if(di[k] > 1) tot += di[k]-1;
		}
		int ans = tot/2;
		if(tot %2 == 1) ans++;
		Console.WriteLine(N - 2*ans);
		
		
		
	}
	int N;
	int[] A;
	public Sol(){
		N = ri();
		A = ria();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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


void solve(long long N, vector<vector<long long>> abc){
  vector<vector<long long>> dp(N, vector<long long>(3));

  dp[0][0] = abc[0][0];
  dp[0][1] = abc[0][1];
  dp[0][2] = abc[0][2];

  for(long long i = 1; i < N; i++){
    for(long long j = 0; j < 3; j++){
      dp[i][j] = max(dp[i-1][(j+2) % 3] + abc[i][j], dp[i-1][(j+1) % 3] + abc[i][j]);
    }
  }


  cout << *max_element(dp[N-1].begin(), dp[N-1].end()) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N,a,b,c;
  scanf("%lld",&N);
  vector<vector<long long>> abc;

  for(int i = 0 ; i < N ; i++){
    cin >> a >> b >> c;
    abc.push_back({a,b,c});
  }
    solve(N, std::move(abc));
    return 0;
}


Measured memory_bytes: 11952
namespace inonoa{
    class Ino{
        static void Main(){
            long n = long.Parse(System.Console.ReadLine());
            long ans = 0;
            long mn = (long)System.Math.Sqrt(n);
            for(long i=1;i<=mn;i++){
                if(n%i==0){
                  long m = n/i -1;
                  if(m!=0){if(n%m==n/m){ans += m;}}
                  if(i-1!=0){if(n%(i-1)==n/(i-1)){ans += i-1;}}
                }
            }
            System.Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13140
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <numeric>
#include <tuple>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
#define ALL(x)   (x).begin(),(x).end()
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define mp       make_pair
#define eb       emplace_back
typedef pair<LL, LL> P;
typedef pair<P, P> PP;

int main() {
	char a, b;
	cin >> a >> b;
	int na, nb;
	if ('0' <= a&&a <= '9') {
		na = a - '0';
	}
	else {
		na = 10 + a - 'A';
	}

	if ('0' <= b&&b <= '9') {
		nb = b - '0';
	}
	else {
		nb = 10 + b - 'A';
	}
	if (na == nb) {
		cout << "=" << endl;
		return 0;
	}
	cout << (na < nb ? "<" : ">") << endl;
}

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


def compute_max(n, bs):
    cs = sorted(bs, reverse=True)
    if n == 1:
        return 0
    else:
        coefficients = [0 for _ in range(n)]
        coefficients[0] = 1
        d, m = divmod(n - 2, 2)
        for i in range(1, d + 1):
            coefficients[i] = 2
        coefficients[d + 1] = m
        res = sum(c * d for c, d in zip(cs, coefficients))
        return res


def main():
    n = int(input())
    bs = [int(b) for b in input().split()]
    res = compute_max(n, bs)
    print(res)


if __name__ == '__main__':
    main()

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


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

    string s[N+1];
    for(int i = 0; i < N ; i++) cin >> s[i];

    string aToZ="abcdefghijklmnopqrstuvwxyz";

    map<string, long> anagram_group;
    //文字カウント(24桁の文字にして0~Aまでの文字で各文字の数を表現)
    for(int i = 0; i < N ; i++){

        string chrCount = string(26, '0');
        string targetStr = s[i];

        for(int j = 0; j < 10 ; j++){
/*             cout << targetStr[j] << endl;
            cout << aToZ.find(targetStr[j]) << endl;
            cout << chrCount[aToZ.find(targetStr[j])] << endl;
            cout << "----" << endl;
*/          
            char c = chrCount[aToZ.find(targetStr[j])];
            if('c' == '9') {
                chrCount[aToZ.find(targetStr[j])] = 'A';
            } else {
                chrCount[aToZ.find(targetStr[j])] = to_string(std::stoi(string(1,c))+1)[0];
            }
        } 

         

        if (anagram_group.count(chrCount) == 0){
            anagram_group[chrCount] = 1L;
        } else {
            anagram_group[chrCount]++;
        }

    
    }
    
    long result = 0;
    auto begin = anagram_group.begin(), end = anagram_group.end();
    for (auto iter= begin; iter != end; iter++){
        long value = iter->second;


        if (value > 1L) {
            result += (value * (value - 1L)) /2L;
        }
    }
    cout << result << endl;

    return 0;
}

Measured memory_bytes: 19840
# -*- coding: utf-8 -*-
import sys

#S = input()
#N = int(input())
#n = [list(map(int,input().split())) for i in range(N)]
#n, y = map(int, input().split())

x, y = list(map(int,input().split())) 
#print(x, y)

for i in range(x+1):
    if((i ) * 2 + (x -i) * 4 == y):
        print("Yes")
        sys.exit(0)
print("No")









Measured memory_bytes: 9160
var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();
var lines = input.split('\n');

var n = +lines.shift();

var g = [[]];
for (var i = 1; i <= n; i++) {
    g.push([]);
    for (var j = 1; j <= n; j++) {
        g[i][j] = 0;
    }
}

for (var i = 1; i <= n; i++) {
    var u = lines.shift().split(' ').map(function(n){return +n;});
    var id = u[0];
    var k = u[1];

    for (var j = 0; j < k; j++) {
        g[i][u[2 + j]] = 1;
    }
}

var ts = 1;
var v = [];
for (var i = 1; i <= n; i++) {
    v[i] = {d: 0, f: 0};    
}
function visit(id) {
    if (v[id].d) return;

    v[id].d = ts++;

    for (var i = 1; i <= n; i++) {
        if (g[id][i] == 1) {
            visit(i);
        }
    }

    v[id].f = ts++;
}
for (var i = 1; i <= n; i++) {
    visit(i);
}

for (var id = 1; id <= n; id++) {
    console.log(id, v[id].d, v[id].f);
}

Measured memory_bytes: 9732
# D
n = int(input())
ali = list(map(int, input().split()))

log = []
max_ = max(ali)
min_ = min(ali)

if abs(max_) >= abs(min_):
    max_index = ali.index(max_)+1
    for i in range(n):
        log_i = i+1
        log.append((max_index, log_i))
    for j in range(n-1):
        log_j = j+1
        mae = log_j
        ushiro = log_j+1
        log.append((mae, ushiro))
elif abs(max_) < abs(min_):
    min_index = ali.index(min_) + 1
    for i in range(n):
        log_i = i + 1
        log.append((min_index, log_i))
    for j in range(1, n)[::-1]:
        log_j = j+1
        mae = log_j
        ushiro = log_j -1
        log.append((mae, ushiro))

print(len(log))
for v1, v2 in log:
    print(str(v1) + ' ' + str(v2))

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

using namespace std;

#define vv vector< vector< int > >
#define ll long long
#define ALL(a) (a).begin(), (a).end()
const long long mod = 1000000000 + 7;
const long long INF = 9e18;
const double PI = 3.14159265358979323846;

ll gcd(ll a, ll b){if (b == 0) return a;return gcd(b, a % b);}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

map<int, int> num;

int main(){
    string S;
    cin >> S;
    int ans = 0, tmp = 0;

    for(int i = 0; i < S.length(); ++i){
        if(S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T'){
            tmp++;
        }
        else {
            ans = max(ans, tmp);
            tmp = 0;
        }
    }
    ans = max(ans, tmp);
    cout << ans << endl;
    return 0;
}

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

t = list(map(int, input().split()))

#print("0_OK")

m = int(input())

#print("1_OK")

ans = []

for i in range(m):
    p, x = map(int, input().split())
    tsum = sum(t)
    tsum = tsum - t[p - 1] + x
    ans.append(tsum)

for i in ans:
    print(i)


Measured memory_bytes: 3060
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;

int K, A, B;

int main() {
  cin >> K;
  cin >> A >> B;
  
  string res = "NG";
  for (int i = A; i <= B; i++) {
    if (i % K == 0) res = "OK"; 
  }
  
  cout << res << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
 
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("http://in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long
#define pb push_back
#define pll pair<ll,ll>
#define ff first
#define ss second
#define N 2000001
#define M 1000000007
#define INF 1000000000000000
 
 
int main()
{
	ll n;
	cin>>n;
	ll a[n];
	ll i,j,k;
	ll ans=0;
	for(i=0;i<n;i++)
	{
	    cin>>a[i];
	}
	ll maxi=a[0];
	for(i=1;i<n;i++)
	{
	    ans=ans+max(0ll,maxi-a[i]);
	    //cout<<maxi<<" "<<a[i]<<" "<<ans<<endl;
	    maxi=max(maxi,a[i]);
	}
	cout<<ans;
 
}

Measured memory_bytes: 5168
#include <iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a;
    cin >> b;
    
    if(a < b) cout << "a < b" << endl;
    else if(a > b) cout << "a > b" << endl;
    else if( a == b) cout << "a == b" << endl;
    
    return 0;
}

Measured memory_bytes: 3040
///
// File:  c.go
// Author: ymiyamoto
//
// Created on Wed Dec 26 15:55:47 2018
//
package main

import (
	"fmt"
	"strings"
	"sort"
)

type strs []string

func (s strs) Len()int{
	return len(s)
}

func (s strs) Swap(i, j int){
	s[i], s[j] = s[j], s[i]
}

func (s strs) Less(i, j int)bool{
	return strings.Compare(s[i], s[j]) == -1
}

func find(slice []string, s string) bool {
	for i := range slice {
		if slice[i] == s {
			return true
		}
	}
	return false
}

func main() {
	var s string
	var K int
	fmt.Scan(&s, &K)

	var arr strs
	alpha := "abcdefghijklmnopqrstuvwxyz"
	for i, _ := range alpha {
		c := alpha[i]
		for j := range s {
			if s[j] == c {
				for k := j + 1; k <= len(s) && k <= j+K; k++ {
					if !find(arr, s[j:k]) {
						arr = append(arr, s[j:k])
						}
					}
				}
		}
		if len(arr) >= K {
			sort.Sort(arr)
			fmt.Println(arr[K-1])
			return
		}
	}
}


Measured memory_bytes: 768
main = do
  [a1, b1, c1] <- map return <$> getLine
  [a2, b2, c2] <- map return <$> getLine
  putStrLn $ solved a1 b1 c1 a2 b2 c2

solved:: String -> String -> String -> String -> String -> String -> String
solved a1 b1 c1 a2 b2 c2
  | a1 == c2 && b1 == b2 && c1 == a2 = "YES"
  | otherwise = "NO"
  

Measured memory_bytes: 380
#include <iostream>
#include <vector>
#include <climits>
#include <queue>

//ダイクストラ法
std::vector<long long> dijkstra(long long n, std::vector<std::vector<std::vector<long long>>> &nx, long long start) {
	std::vector<long long> ret(n, LLONG_MAX);
	ret[start] = 0;
	std::queue<long long> task;
	task.push(start);
	std::priority_queue<std::vector<long long>, std::vector<std::vector<long long>>, std::greater<std::vector<long long>>> pq;
	while (task.size()) {
		while (task.size()) {
			long long x = task.front();
			task.pop();
			for (long long i = 0; i < nx[x].size(); i++) {
				std::vector<long long> v = nx[x][i];
				if (ret[v[1]] < LLONG_MAX) continue;
				pq.push({ret[x] + v[0], v[1]});
			}
		}
		while (pq.size() && ret[pq.top()[1]] < LLONG_MAX) pq.pop();
		if (pq.size()) {
			std::vector<long long> v = pq.top();
			pq.pop();
			ret[v[1]] = v[0];
			task.push(v[1]);
		}
	}
	return ret;
}

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

	long long n, m, s;
	std::cin >> n >> m >> s;
	s = std::min(s, 2500ll);

	//頂点aで銀貨b枚所持
	auto index = [&] (long long a, long long b) {return a + b * n;};

	std::vector<std::vector<std::vector<long long>>> nx(n * 2501, std::vector<std::vector<long long>>(0));
	for (long long i = 0; i < m; i++) {
		long long u, v, a, b;
		std::cin >> u >> v >> a >> b;
		u--;
		v--;
		for (long long j = a; j <= 2500; j++) {
			nx[index(u, j)].push_back({b, index(v, j - a)});
			nx[index(v, j)].push_back({b, index(u, j - a)});
		}
	}

	for (long long i = 0; i < n; i++) {
		long long c, d;
		std::cin >> c >> d;
		for (long long j = 0; j <= 2500 - c; j++) {
			nx[index(i, j)].push_back({d, index(i, j + c)});
		}
	}

	std::vector<long long> ans = dijkstra(n * 2501, nx, index(0, s));
	for (long long i = 1; i < n; i++) {
		long long x = LLONG_MAX;
		for (long long j = 0; j <= 2500; j++) {
			x = std::min(x, ans[index(i, j)]);
		}
		std::cout << x << std::endl;
	}
}


Measured memory_bytes: 57416
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#include <climits>
#define ll long long
#define MAX 25 * 1e13
#define N  200010

using namespace std;
int MOD = 1000000007;

int main(){
  int n;
  int m;
  cin >> n >> m;
  int ret = 0;
  vector<vector<int>> c(m,vector<int>(2));
  for(int i = 0 ; i < m ; i++ ){
    cin >> c[i][0] >> c[i][1];
    c[i][0]--;
  }
  vector<int> hasc(n,-1);

  int confli = 0;//no confli
  for(int i = 0 ; i < m ; i++ ){
    int pos = c[i][0];
    int v = c[i][1];

    if( hasc[pos] == -1 ){
      hasc[pos] = v;
    }
    else if(hasc[pos] != v ){
      confli = 1;
      break;
    }
  }
  if( confli == 1 ) {
    cout << -1 << endl;
    return 0;
  }
  if( n == 1 ){
    if( hasc[0] == 0 || hasc[0] == -1 ){
      cout << 0 << endl;
      return 0;
    }
    else{
      cout << hasc[0] << endl;
      return 0;
    }
  }
  if( hasc[0] == 0 ) {
    cout << -1 << endl;
    return 0;
  }
  ret = 0;
  for(int i = 0 ; i < n ; i++ ){
    if( hasc[i] == - 1 ){
      hasc[i] = 0;
      if( i == 0 ) hasc[i] = 1;
    }
    ret *= 10;
    ret += hasc[i];
  }


  cout << ret << endl;
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define IO std::ios::sync_with_stdio(false)
#define int long long
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, l, r) for (int i = l; i >= r; i--)
#define mset(s, _) memset(s, _, sizeof(s))
#define pb push_back
#define pii pair <int, int>
#define mp(a, b) make_pair(a, b)
#define INF 0x3f3f3f3f

inline int read() {
  int x = 0, neg = 1; char op = getchar();
  while (!isdigit(op)) { if (op == '-') neg = -1; op = getchar(); }
  while (isdigit(op)) { x = 10 * x + op - '0'; op = getchar(); }
  return neg * x;
}
inline void print(int x) {
  if (x < 0) { putchar('-'); x = -x; }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}

const int maxn = 1e6 + 10;
int n,m,a[maxn];
signed main() {
	IO;
	cin >> n >> m;
	int sum = 0;
	rep(i,1,n){
		cin >> a[i];
		sum += a[i];
	}
	if(sum > n) cout << -1 << '\n';
	else cout << n - sum << '\n';
	return 0;
}

Measured memory_bytes: 3700
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> pippi;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<62;
int iinf=1<<30;
double pi=3.141592653589793238462643383279L;
double eps=1e-8;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto& itr:mp)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
//#define endl "\n"
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<int,int,custom_hash>
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    if(k<0)return 0;
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}

int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int x,y;cin>>x>>y;
    rep(i,0,x+1){
        int xx=x-i;
        int asi=i*2+xx*4;
        if(asi==y){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 3656
PROGRAM-ID.                      ABC_100_B.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 S       PIC X(10).
    01 len     PIC 9(2).

    01 chr.
        03 num USAGE BINARY-CHAR.

    01 i       PIC 9(2).

    01 cnt     PIC 9(1).
    01 idx     PIC 9(2).

    01 flg     PIC 9(1).

PROCEDURE                        DIVISION.
    ACCEPT S.

    COMPUTE len = FUNCTION STORED-CHAR-LENGTH(S).

    IF S(1:1) = 'A' THEN
        MOVE 0 TO cnt
        MOVE 99 TO idx
        PERFORM VARYING i FROM 3 BY 1 UNTIL len - 1 < i
            IF S(i:1) = 'C' THEN
                ADD 1 TO cnt
                MOVE i TO idx
            END-IF
        END-PERFORM

        IF cnt = 1 THEN
            PERFORM VARYING i FROM 2 BY 1 UNTIL len < i
                IF i NOT = idx THEN
                    MOVE S(i:1) TO chr
                    IF S(i:1) < 'a' OR 'z' < S(i:1) THEN
                        MOVE 1 TO flg
                    END-IF
                END-IF
            END-PERFORM

            IF flg = 1 THEN
                DISPLAY "WA"
            ELSE
                DISPLAY "AC"
            END-IF

        ELSE
            DISPLAY "WA"
        END-IF

    ELSE
        DISPLAY "WA"
    END-IF

    STOP RUN.


Measured memory_bytes: 892
x = int(input())
d= {}
for a in range(10**25):
    #print(a,d)
    a5 = a**5
    b5 = a5-x
    if b5 in d:
        print(a,d[b5])
        exit()
    d[a5] = a
    #print('--------------',a,d)
    a5 = -a5
    b5 = a5-x
    if b5 in d:
        print(a,d[b5])
        exit()
    d[a5] = -a





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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    int N;
    cin >> N;
    cout << N * 800 - 200 * (N / 15) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  ll N, sa=0;
  bool flag = true;
  std::cin >> N;
  std::vector<int> A(N);
  for(int i=0;i<N;i++) {
    std::cin >> A[i];
    sa += A[i];
  }
  ll time = (N*(N+1))/2;
  if(sa%time!=0) flag = false;
  ll k = sa/time;
  //std::cout << k << '\n';
  ll count=0;
  for(int i=0;i<N;i++){
    ll a = (A[i]-(i==0?A[N-1]:A[i-1]));
    ll b = (i==0?A[N-1]:A[i-1])-A[i] + k;
    if(a!=k && (b%N!=0 || b<=0)) flag = false;
    else if(b%N==0 && b>0)count+=b/N;
  }
  //std::cout << count << " " << k << '\n';
  std::cout << (flag&&count==k?"YES":"NO") << '\n';
  return 0;
}


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

int main(){
	int a,b;
	cin>>a>>b;

	if(a==1)a=14;
	if(b==1)b=14;
	
	if(a>b)cout<<"Alice";
	else if(a<b)cout<<"Bob";
	else cout<<"Draw";
}


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

#define LL long long
#define pii pair<int,int>
using namespace std;
const int inf = 2147483647;

int _max(int x, int y) {return x > y ? x : y;}
int _min(int x, int y) {return x < y ? x : y;}
inline int read() {
    int x = 0, f = 1; char ch = getchar();
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
    return x * f;
}
void put(int x) {
	if(x < 0) putchar('-'), x = -x;
	if(x >= 10) put(x / 10);
	putchar(x % 10 + '0');
}

int s[100001];

int main() {
	int n = read(), k = read(), q = read();
	for(int i = 1; i <= q; i++) s[read()]++;
	for(int i = 1; i <= n; i++) {
		if(k - q + s[i] <= 0) puts("No");
		else puts("Yes");
	}
	return 0;
}


Measured memory_bytes: 1024
$s=<>;
chomp($s);
@D = ($s=~/\D/g);
$len = @D;
$flg = 0;
if($D[0] eq "A"){
	$flg = 1;
}
if(!($D[1] =~ /[a-z]/) or !($D[$#D] =~ /[a-z]/)){
	$flg = 0;
}
for($i=2;$i<$len-1;$i++){
	if($D[$i] =~ /[a-z]/){
    }elsif($D[$i] eq "C"){
    	$ccnt++;
    }
}

if($flg == 1 && $ccnt == 1){
	print "AC";
}else {
	print "WA";
}

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

int main() {
  int N;
  cin>>N;
  
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  
  vector<int> hik(N);
  hik.at(0)=vec.at(0);
  for(int i=1;i<N;i++){
    hik.at(i)=min(hik.at(i-1),vec.at(i));
  }
  
  int sum=1;
  for(int i=1;i<N;i++){
    if(vec.at(i)<=hik.at(i-1)) sum+=1;
  }
  
  cout<<sum<<endl;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int liner_search(int key,int A[],int n){
	int i=0;
	A[n]=key;
	while(A[i]!=key){
		i++;
	}
	if(i==n)
		return -1;
	else
		return i;
}
int main(){
	
	int num1;
	cin>>num1;
	int a[num1+1];
	for(int i=0;i<num1;i++)
		cin>>a[i];
	int num2;
	cin>>num2;
	int b[num2];
	for(int i=0;i<num2;i++)
		cin>>b[i];
	int num=0;
	for(int i=0;i<num2;i++){
		if(liner_search(b[i],a,num1)!=-1)
			num++;
	}
	cout<<num<<endl;
	
	return 0;
}

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

int main() {
	int n;
	cin >> n;
	
	int thousands_place = n / 1000;
	int hundreds_place = (n - 1000 * thousands_place) / 100;
	int tens_place = (n - 1000 * thousands_place - 100 * hundreds_place) / 10;
	int units_digit = n - 1000 * thousands_place - 100 * hundreds_place - tens_place *10;
	
	if (thousands_place == hundreds_place && hundreds_place == tens_place) {
		cout <<  "Yes" << endl;
	}
	else if (hundreds_place == tens_place && tens_place == units_digit) {
		cout <<  "Yes" << endl;
	}
	else {
		cout <<  "No" << endl;
	}
}

Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 100010
int Adj[MAXN],V[MAXN],nxt[MAXN],c;
void AddEdge(int u,int v)
{
	c++;V[c]=v,nxt[c]=Adj[u];Adj[u]=c;
}
int fa[MAXN],dep[MAXN],k,n,ans;
void dfs(int u)
{
	dep[u]=1;
	for(int i=Adj[u];i;i=nxt[i])
	{
		dfs(V[i]);
		dep[u]=max(dep[u],dep[V[i]]+1);
	}
	if(fa[u]!=1&&dep[u]==k)
	{
		ans++;
		dep[u]=0;
	}
}
int main()
{
	scanf("%d%d",&n,&k);
	scanf("%d",&fa[1]);
	if(fa[1]!=1) ans++,fa[1]=1;
	for(int i=2;i<=n;i++)
	{
		scanf("%d",&fa[i]);
		AddEdge(fa[i],i);
	}
	dfs(1);
	printf("%d\n",ans);
}

Measured memory_bytes: 5248
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int n = s.size();
    for(int i = n - 2; i; i -= 2){
        string t = "";
        for(int j = 0; j < i; j++){
            t += s[j];
        }
        bool ans = true;
        for(int k = 0; k < i / 2; k++){
            if(t[k] != t[k + i / 2])
            ans = false;
        }
        if(ans)
        {
            cout << i << endl;
            return 0;
        }
    }
}

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

int main(){
	string str,str2,cmd,p;
	int q,a,b;
	cin>>str;
	cin>>q;
	for(int k=0;k<q;k++){
		cin>>cmd;
		if(cmd=="print"){
			cin>>a>>b;
			str2=str.substr(a,b-a+1);
			cout<<str2<<endl;
		}
		else if(cmd=="reverse"){
			cin>>a>>b;
			str2=str.substr(a,b-a+1);
			int j=0;
			for(int i=b;i>=a;i--){
				str[i]=str2[j];
				j++;
			}
		}
		else if(cmd=="replace"){
			cin>>a>>b>>p;
			int m=0;
			for(int i=a;i<=b;i++){
				str[i]=p[m];
				m++;
			}
		}
	}
}


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

#define sc(x) scanf("%d",&x);
#define rep(x ,n) for(int x=0; x<n; x++)
#define ll long long
#define finish(x) return cout << x << endl,0;
#define scarr(a,n) for(int x=0; x<n; x++)scanf("%d",&a[x]);

#define MAX_N 100005

const int mod = 1e9+7;

int n ,k;
vector <int> adj[MAX_N];
int fact[MAX_N] ,factinv[MAX_N] ,ans = 1;

int modinv(int a ,int p=mod-2){
    int x = 1;
    for( ; p; p>>=1){
        if(p&1)
            x = 1LL*x*a%mod;
        a = 1LL*a*a%mod;
    }
    return x;
}
int P(int n ,int r){
    if(n < 0 || r > n) return 0;
    return 1LL*fact[n]*factinv[n-r]%mod;
}
void dfs(int u ,int d=1){
    ans = 1LL*ans*P(k-min(d ,2) ,adj[u].size())%mod;
    for(int v : adj[u]){
        adj[v].erase(find(adj[v].begin() ,adj[v].end() ,u));
        dfs(v ,d+1);
    }
}

int main()
{
    fact[0] = factinv[0] = 1;
    for(int i=1; i<MAX_N; i++){
        fact[i] = 1LL*i*fact[i-1]%mod;
        factinv[i] = modinv(fact[i]);
    }

    sc(n)sc(k)
    rep(i ,n-1){
        int a ,b;
        sc(a)sc(b)
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    ans = k ,dfs(1);
    finish(ans);
}


Measured memory_bytes: 11136
while True:
    try:
        s = raw_input()
    except EOFError:
        break
    for i in range(26):
    	S = ''
    	for c in s:
    		if c.islower():
    			n = (ord(c)-ord('a')+i)%26
    			S +=chr(ord('a')+n)
    		else:
    			S += c
    	if 'the' in S or 'this' in S or 'that' in S:
    		print S
    		break

Measured memory_bytes: 4204
len = 1000000
p = Array.new(len,1)
p[0] = 0
i = 1
m = Math.sqrt(len).to_i
loop do
  begin i += 1; end while p[i-1] == 0 && i < m
  j = i
  p[j-1] = 0 while (j += i) <= len
  break if i == m
end

(1..(len-1)).each do |i|
  p[i] += p[i-1]
end

while (line = STDIN.gets)
  n = line.chomp.to_i
  puts p[n-1]
end

Measured memory_bytes: 13904
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int N = Integer.parseInt(sc.next());
        
        int[] colors = new int[8];
        int free_color = 0;
        
        for(int i=0; i<N; i++){
            int a = Integer.parseInt(sc.next());
            if(1 <= a && a <= 399){
                colors[0] = 1;
            }
            if(400 <= a && a <= 799){
                colors[1] = 1;
            }
            if(800 <= a && a <= 1199){
                colors[2] = 1;
            }
            if(1200 <= a && a <= 1599){
                colors[3] = 1;
            }
            if(1600 <= a && a <= 1999){
                colors[4] = 1;
            }
            if(2000 <= a && a <= 2399){
                colors[5] = 1;
            }
            if(2400 <= a && a <= 2799){
                colors[6] = 1;
            }
            if(2800 <= a && a <= 3199){
                colors[7] = 1;
            }
            if(3200 <= a){
                free_color++;
            }
        }
        
        int ans = 0;
        for(int i=0; i<8; i++){
            ans += colors[i];
        }
        
        if(ans == 0){
            System.out.println(1 + " " + free_color);
        }else{
            System.out.println(ans + " " + (free_color + ans));    
        }
    }
}

Measured memory_bytes: 21844
data class Section(val from:Int, val to:Int) {
    fun shift(diff:Int):Section = Section(from + diff, to + diff)
    fun intersection(that:Section): Int = (minOf(this.to, that.to) - maxOf(this.from, that.from) + 1).let{if (it >= 0) it else 0}
}
fun main(args:Array<String>): Unit {
    val (n, h, w) = readLine()!!.trim().split(' ').map(String::toInt)
    val instructions = readLine()!!.trim().split(' ').map(String::toInt).toIntArray()
    var openArea = 0
    for (i in 0 until n / 2){
        val left = Section(0, w - 1).shift(instructions[i * 2])
        val right = Section(w, w * 2 - 1).shift(-instructions[i * 2 + 1])
        openArea += left.intersection(right) * h
    }
    println(openArea)
}


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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    string s;
    rep(i, 3)
    {
        cin >> s;
        transform(ALL(s), s.begin(), ::toupper);
        cout << s[0];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
// #include<unordered_map>
#include<set>
// #include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
#include<functional>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
#define wl() cout << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll from, to, cost;
	bool operator<(const edge& right) const {
		return cost < right.cost;
	}
};
struct point {
	ll x, y, idx;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

ll bisect_left(ll arr[], ll arr_size, ll key) {
	return distance(arr, lower_bound(arr, arr + arr_size, key));
}

ll bisect_left(vector<ll> vc, ll key) {
	return lower_bound(vc.begin(), vc.end(), key) - vc.begin();
}

ll pow_mod(ll a, ll x) {
	if (x == 0) return 1;
	if (x == 1) return a;
	ll ret = pow_mod(a, x / 2);
	if (x % 2 == 0) ret = (ret*ret) % MOD;
	else ret = (a * ((ret*ret) % MOD)) % MOD;
	return ret;
}

void build_mod_fact(ll arr[], ll n) {
	arr[0] = 1;
	repi(i, 1, n + 1) {
		arr[i] = (arr[i - 1] * i) % MOD;
	}
	return;
}

void build_mod_fact_inv(ll arr_fact[], ll arr_fact_inv[], ll n) {
	arr_fact_inv[n] = pow_mod(arr_fact[n], MOD - 2);
	repd(i, n - 1, -1) {
		arr_fact_inv[i] = (arr_fact_inv[i + 1] * (i + 1)) % MOD;
	}
	return;
}

ll comb_mod(ll n, ll r, ll arr_fact[], ll arr_fact_inv[]) {
	return (((arr_fact[n] * arr_fact_inv[n - r]) % MOD) * arr_fact_inv[r]) % MOD;
}


///////////////////////////////////////////////////////////////////////////////////////

ll N, K;
ll a[5050];

bool judge(ll x) {
	// 不必要ならtrue, 必要ならfalse
	ll const bs_size = 5050;
	bitset<bs_size> bs;
	bs.set(0);
	repi(i, 0, N) {
		if (i == x) continue;
		bitset<bs_size> temp;
		temp |= bs;
		bs <<= a[i];
		bs |= temp;
	}
	repi(i, max(K - a[x], 0LL), K) {
		if (bs[i]) return false;
	}
	return true;
}

ll solv() {
	// 不必要な枚数を返す
	if (judge(0) == false) {
		return 0;
	}
	if (judge(N - 1) == true) {
		return N;
	}
	ll left = 0, right = N - 1;
	ll next = -1, prev = -1;
	while (1) {
		next = (left + right) / 2;
		if (prev == next) {
			return next + 1;
		}
		if (judge(next)) left = next;
		else right = next;
		prev = next;
	}
}

int main() {
	cin >> N >> K;
	repi(i, 0, N) cin >> a[i];
	sort(a, a + N);
	cout << solv() << endl;
	return 0;
}


Measured memory_bytes: 256
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[] a = new int[N];
        for (int i = 0; i < a.length; ++i) {
            a[i] = sc.nextInt();
        }

        System.out.println(solve(a) ? "Yes" : "No");

        sc.close();
    }

    static boolean solve(int[] a) {
        int countOdd = (int) Arrays.stream(a).filter(x -> x % 2 != 0).count();
        int count4 = (int) Arrays.stream(a).filter(x -> x % 4 == 0).count();

        return countOdd <= count4 || (countOdd == count4 + 1 && countOdd + count4 == a.length);
    }
}

Measured memory_bytes: 51004
from collections import Counter
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
nums = [int(i) for i in input().split()] # 配列で数字

c = Counter(nums)
ans = [0] * n
for k, v in c.items():
    ans[k - 1] = v

for a in ans:
    print(a)

Measured memory_bytes: 35624
import java.util.Scanner;
public class Main {
	//?????°
	public static int x;
	//????????????
	public static void solve(){
		Scanner sc = new Scanner(System.in);
		x=sc.nextInt();
		System.out.println(x*x*x);
	}
	public static void main(String[] args) {
	       solve();
	}

}

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

a = [0]*N
b = [0]*N

for i in range(N):
        a[i],b[i] = map(int,input().split())

ab = list(zip(a,b))
quickwork = sorted(ab, key=lambda x: x[1])

t = 0
for i in range(N):
        t += quickwork[i][0]
        if t > quickwork[i][1]:
                print("No")
                break
        
        if i == N-1:
                print("Yes")

Measured memory_bytes: 36496
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(long long int (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long int (i)=(a); (i)<=(b); ++(i))
int n,W;
ll dp[100001];
int main(){
	cin >> n >> W;
	for(int i=0;i<=100000;++i){
		dp[i]=2e18;
	}
	dp[0]=0;
	for(int i=0;i<n;++i){
		int w,v;
		cin >> w >> v;
		for(int j=100000-v;j>=0;--j){
			if(dp[j+v]>dp[j]+w)dp[j+v]=dp[j]+w;
		}
	}
	for(int i=100000;i>=0;--i){
		if(dp[i]<=W){
			cout << i << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 1024
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}

int main(){
  int n;
  cin >> n;
  string w;
  char tail;
  set<string> words;
  for(int i = 0; i < n; i++){
    cin >> w;
    words.insert(w);
    if(w[0] != tail && i != 0){
      cout << "No" << endl;
      return 0;
    }
    tail = w[w.size()-1];
  }
  if(words.size() == n) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
	int now_money = 100000;
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		now_money += now_money * 5 / 100;
		if(now_money % 1000 != 0){
			now_money -= now_money % 1000;
			now_money += 1000;
		}
	}
	cout << now_money << endl;
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define space putchar(' ')
#define enter putchar('\n')
#define mp make_pair
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
template<class T>
void read(T &res) {
    res = 0;char c = getchar();T f = 1;
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 + c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {putchar('-');x = -x;}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int A,B,w = 100,h = 0;
char a[105][105];
void Calc(int R,char W,char B)  {
    ++h;
    for(int i = 1 ; i <= w ; ++i) a[h][i] = B;
    if(!R) return;
    while(R >= 50) {
	R -= 50;
	for(int i = 1 ; i <= w ; ++i) {
	    if(i & 1) a[h + 1][i] = W;
	    else a[h + 1][i] = B;
	}
	for(int i = 1 ; i <= w ; ++i) a[h + 2][i] = B;
	h += 2;
    }
    if(R) {
	int t = 1;
	while(R--) {
	    a[h + 1][t] = W;
	    a[h + 1][t + 1] = B;
	    t += 2;
	}
	for(int i = t ; i <= w ; ++i) a[h + 1][i] = B;
	for(int i = 1 ; i <= w ; ++i) a[h + 2][i] = B;
	h += 2;
    }
}
void Solve() {
    read(A);read(B);
    --A;--B;
    while(A >= 50 || B >= 50) {
	if(!A || !B) break;
	if(A >= B) {
	    if(a[h][1] != '#') --B;
	    else --h;
	    for(int i = 1 ; i <= w ; ++i) a[h + 1][i] = a[h + 3][i] = '#';
	    A -= 50;
	    for(int i = 1 ; i <= w ; ++i) {
		if(i & 1) a[h + 2][i] = '.';
		else a[h + 2][i] = '#';
	    }
	    h += 3;
	}
	else {
	    if(a[h][1] != '.') --A;
	    else --h;
	    B -= 50;
	    for(int i = 1 ; i <= w ; ++i) a[h + 1][i] = a[h + 3][i] = '.';
	    for(int i = 1 ; i <= w ; ++i) {
		if(i & 1) a[h + 2][i] = '#';
		else a[h + 2][i] = '.';
	    }
	    h += 3;
	}
    }
    if(a[h][1] == '.') {Calc(A,'.','#');Calc(B,'#','.');}
    else {Calc(B,'#','.');Calc(A,'.','#');}
    out(h);space;out(w);enter;
    for(int i = 1 ; i <= h ; ++i) {
	for(int j = 1 ; j <= w ; ++j) {
	    putchar(a[i][j]);
	}
	enter;
    }
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <vector>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
#define PI 3.141592653589793
using vll = vector<ll>;
using Graph = vii;
const ll MOD = 1e9 + 7;

int main() {
	int n;
	string s, t;
	cin >> n;
	cin >> s >> t;
	rep(i, n) {
		cout << s[i] << t[i];
	}
	cout << endl;
}


Measured memory_bytes: 256
import scala.io.StdIn.readLine

object Main extends App {
  val Array(x1,y1,x2,y2) = readLine.split(" ").map(_.toDouble)

  printf("%.8f\n",Math.sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) ))
}

Measured memory_bytes: 44276
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.end(), v.begin());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////

int a,b,c,d[100005] = {},n,m;
string s,t;

int main(){
    
    IN a >> b;

    P(a - ((b-a >= 0)? 0 : 1));
    
	return  0;
}


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

int main()
{
    int k; cin>>k;
    long res=0;
    for(int a=1; a<=k; ++a)
        for(int b=1; b<=k; ++b)
            for(int c=1; c<=k; ++c)
                res+=gcd(a, gcd(b, c));
    cout<<res<<endl;
}


Measured memory_bytes: 3620
import sys
import heapq
MAX_INT = float("Inf")

def find_shortest_path_with_weight(graph,start_v,v_num):
    distance = [MAX_INT]*v_num
    distance[start_v] = 0
    queue = []*v_num
    queue.append((distance[start_v],start_v))
    while True:
        if(len(queue)==0):
            break
        #weight,v = heapq.heappop(queue)
        #queue = sorted(queue,key=lambda k:k[0])
        weight,v = queue.pop(0)
        if(distance[v] < weight):
            continue
        for i,(to,weight) in enumerate(graph[v]):
            if(weight + distance[v] < distance[to]):
                distance[to] = weight + distance[v]
                #queue.append((distance[i],i))
                heapq.heappush(queue,(distance[to],to))
    
    for i in distance:
        if(i < MAX_INT):
            print(i)
        else:
            print("INF")

        
if __name__ == '__main__':
    v_num,e_num,start_v = map(int, input().split())
    # omomituki graph tukuruyo
    graph = [ [] for _ in range(v_num)]
    for i in range(e_num):
        s,t,w = map(int, input().split())
        graph[s].append((t,w))
    find_shortest_path_with_weight(graph,start_v,v_num)








Measured memory_bytes: 89288
#include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>

using namespace std;

typedef long long ll;
// constexpr ll MOD = 998244353;
constexpr ll MOD = 1000000007;

// struct UnionFind {
//     vector<int> par;
    
//     UnionFind(int N): par(N) {
//         for (int i=0;i<N;i++) par[i] = i;
//     }

//     int root(int x) {
//         if (par[x] == x) return x;
//         else return par[x] = root(par[x]);
//     }

//     void unite(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         if (rx == ry) return;
//         par[rx] = ry;
//     }

//     bool same(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         return rx == ry;
//     }
// };

int main(void) {
    int N;
    ll D, A;
    vector<pair<ll,ll>> M(200010,make_pair(1001001001LL,0LL));
    cin >> N >> D >> A;
    for (int i=0;i<N;i++) {
        ll X, H;
        cin >> X >> H;
        M[i] = make_pair(X,H);
    }

    ll res = 0;
    vector<ll> p(200010,0);
    // cout << "Range: " << D << ", Attack: " << A << endl;
    sort(M.begin(), M.end());
    for (int i=0;i<N;i++) {
        if (i>0) p[i] += p[i-1];
        M[i].second -= p[i];
        if (M[i].second <= 0) continue;
        ll start = M[i].first;
        ll end = start + 2*D;
        auto ptr = upper_bound(M.begin() + i, M.end(), make_pair(end,1001001001LL));
        ll t = M[i].second/A;
        if (M[i].second%A != 0) t++;
        p[i] += A*t;
        p[ptr-M.begin()] += -A*t;
        // for (auto itr = M.begin() + i; itr < ptr; itr++) {
        //     itr->second -= A*t;
        // }
        res += t;
        // cout << start << ", " << end << ", " << ptr-M.begin() << ", " << t << endl;
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 4992
#include <array>
#include <iostream>
#include <string>

int main() {
  std::array<int32_t, 100> stack;
  uint32_t stack_pos = 100;

  std::string s;
  while (std::cin >> s) {
    stack_pos++;
    if (s == "+") {
      stack[stack_pos] += stack[stack_pos - 1];
    } else if (s == "-") {
      stack[stack_pos] -= stack[stack_pos - 1];
    } else if (s == "*") {
      stack[stack_pos] *= stack[stack_pos - 1];
    } else {
      stack_pos -= 2;
      stack[stack_pos] = std::stoi(s);
    }
  }
  std::cout << stack[stack_pos] << std::endl;

  return 0;
}


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

const int MOD = 1e9 + 7;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    ll ans = 1;
    unordered_map<ll, ll> counter;
    counter[-1] = 3;
    for (int i = 0; i < n; i++) {
        ans *= counter[a[i] - 1];
        ans %= MOD;
        counter[a[i]]++;
        counter[a[i] - 1]--;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5156