akhauriyash/Code-Regression huggingface dataset:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n = ni()
    d = dict()
    for _ in range(n):
        x = ns()
        d[x] = d.get(x, 0) + 1
    for x in ['AC', 'WA', 'TLE', 'RE']:
        print(x, 'x', d.get(x, 0))
    return

solve()


Measured memory_bytes: 73736
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        long [] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = cin.nextLong();
        }
        long[] summaries = new long[n];
        long count = 0L;
        Map<Long, Integer> countNums = new HashMap<>();
        for (int i = 0; i < n; i++) {
            final long s = (i == 0 ? 0L : summaries[i - 1]) + a[i];
            summaries[i] = s;
            if (s == 0) count++;
            int countNum = countNums.getOrDefault(s, 0);
            count += countNum;
            countNums.put(s, countNum + 1);
        }
        System.out.println(count);
    }
}


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

int main(){
  int A,B,flag = 0; string S;
  cin >> A >> B;cin.ignore(); getline(cin,S);
  if (S[A] == '-'){
    for (int i = 0;i <= A+B;i++){
      if (i != A){
        if (S[i] != '-'){
          flag ++;
        }else{
          i = A+B+1;
        }
      }
    }
  }
  if (flag == A+B){
    cout << "Yes" <<endl;
  }else{
    cout << "No" <<endl;
  }
}


Measured memory_bytes: 256
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
import static java.lang.System.*;

public class Main {
	public static int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int m = parseInt(sc.next());
		Integer[] a = new Integer[n];
		long sum = 0;
		int aa = 0;
		for(i=0;i<n;i++) {
			aa = parseInt(sc.next());
			sum += (long)aa;
			a[i] = aa;
		}
		sc.close();
		Arrays.sort(a, Comparator.reverseOrder());
		ArrayList<Integer> dif = new ArrayList<>();
		for (i = 1; i <= 31; i++) {
			int tmp=0;
			int tmp2=0;
			for (j = 0; j < a.length; j++) {
				tmp2 = a[j] >> 1;
				tmp = a[j] - tmp2;
				if(tmp == 0) break;
				a[j] = tmp2;
				dif.add(tmp);
			}
			if(j==0) break;
		}
		Collections.sort(dif, Comparator.reverseOrder());
		long dsum = 0;
		for (i = 0; i < Math.min(m, dif.size()); i++) {
			dsum += (long)dif.get(i);
		}
		out.println(sum - dsum);
	}
}


Measured memory_bytes: 151920
package main

import "fmt"

const MOD = 1e9+7

type Matrix [][]int64

func NewMatrix(n int) Matrix {
  m := make(Matrix, n)
  for i := 0; i < n; i++ {
    m[i] = make([]int64, n)
  }
  return m
}

func (m Matrix) multiply(rhs Matrix) Matrix {
  n := len(m)
  result := NewMatrix(n)
  for i := 0; i < n; i++ {
    for j := 0; j < n; j++ {
      s := int64(0)
      for k := 0; k < n; k++ {
        s = (s + m[i][k] * rhs[k][j]) % MOD
      }
      result[i][j] = s
    }
  }
  return result
}

func (m Matrix) dump() {
  n := len(m)
  for i := 0; i < n; i++ {
    fmt.Println(m[i])
  }
}

func (m Matrix) pow(k int64) Matrix {
  n := len(m)
  result := NewMatrix(n)
  for i := 0; i < n; i++ {
    result[i][i] = 1
  }
  unit := m
  cnt := 1
  for k > 0 {
    if k & 1 > 0 {
      result = result.multiply(unit)
    }
    // fmt.Println("power cnt: ", cnt)
    // unit.dump()
    cnt <<= 1
    unit = unit.multiply(unit)
    k >>= 1
  }
  return result
}

func main() {
  var n int
  var k int64
  fmt.Scanf("%d %d", &n, &k)
  m := NewMatrix(n)
  for i := 0; i < n; i++ {
    for j := 0; j < n; j++ {
      fmt.Scanf("%d", &m[i][j])
    }
  }
  m = m.pow(k)
  var result int64
  for i := 0; i < n; i++ {
    for j := 0; j < n; j++ {
      result += m[i][j]
    }
  }
  fmt.Println(result % MOD)
}

Measured memory_bytes: 4776
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T, class T2> void smin(T& a, T2 val) {if (a > val) a = val;}template<class T, class T2> void smax(T& a, T2 val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];

int32_t main(){_
   
   cin >> n;

   int ptr = 8;
   for (int i = 400; i < 2000; i += 200)
   {
      if (n >= i and n < i + 200){
         cout<<ptr;
         exit(0);
      }
      --ptr;
   }

   return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int n;
  string s;
  cin >> n >> s;
  vector<vector<int>> x(10);
  rep(i, n) x[s[i]-'0'].push_back(i);

  int ans = 0;

  for(int i = 0; i < 1000; ++i) {
    int now = -1;
    stringstream ss;
    bool ok = true;
    ss << setw(3) << setfill('0') << i;
    auto t = ss.str();
    for(auto c : t) {
      if(upper_bound(ALL(x[c-'0']), now) == x[c-'0'].end()) {
        ok = false;
        break;
      }

      now = *upper_bound(ALL(x[c-'0']), now);
    }
    if(ok) ++ans;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3736
#include <iostream>
#include <string.h>
#include <set>
#include <map>
#include <unordered_map>
#include <vector>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned ll
#define db double
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PII pair<int, int>

int n,m,x;
unordered_map<int,int> cnt;
multiset<int> sp;
multiset<int> alone;
vector<int> v;

int main() {
    scanf("%d%d",&n,&m);
    for (int i=0;i<n;i++) {
        scanf("%d",&x);
        if (++cnt[x]==2) {
            cnt[x]=0;
            sp.insert(x%m);

        }
    }
    for (auto& entry : cnt) {
        if (entry.second>0) v.pb(entry.first%m);
    }
    for (int i=0;i<v.size();i++) {
        alone.insert(v[i]);
    }
    int cnt=sp.size();
    for (int i=0;i<v.size();i++) {
        auto iter=alone.find(v[i]);
        if (iter!=alone.end()) {
            int val=v[i];
            alone.erase(iter);
            auto iter1=alone.find((m-val)%m);
            bool found=false;
            if (iter1!=alone.end()) {
                cnt++;
                alone.erase(iter1);
                found=true;
            }
            if (!found) {
                auto iter2=sp.find((m-val)%m);
                iter1=alone.find(val);
                if (iter2!=sp.end()&&iter1!=alone.end()) {
                    cnt++;
                    sp.erase(iter2);
                    alone.erase(iter1);
                }
            }
        }
    }
    printf("%d\n",cnt);
}

Measured memory_bytes: 9380
package main

import (
	"fmt"
)

func returnPair(s string) (p string) {
	switch s {
	case "A":
		p = "T"
	case "T":
		p = "A"
	case "C":
		p = "G"
	case "G":
		p = "C"
	}
	return
}

func main() {
	var s string
	fmt.Scan(&s)
	fmt.Println(returnPair(s))
}


Measured memory_bytes: 512
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
int a,b;
int main(){
	cin>>a>>b;
	if(a+b==15){
		cout<<"+";
	}
	else if(a*b==15) cout<<"*";
	else cout<<"x";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int H, W; cin >> H >> W;
    char a;
    for(int i = 0; i < H+2; i++) {
        for(int j = 0; j < W+2; j++) {
            if(i==0||i==H+1||j==0||j==W+1) {
                cout << "#";
                continue;
            }
            cin >> a;
            cout << a;
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数


int main()
{
  int a, b ;
  cin >> a >> b ;
  if(a>0 && b>0){
    cout <<"Positive"<<endl ;
  }
  else if(a<=0 && b>=0){
    cout <<"Zero"<<endl ;
  }
  else{
    int c = (-a)-(-b)+1 ;
    if(c%2==0){
      cout <<"Positive"<<endl ;
    }
    else{
      cout <<"Negative"<<endl ;
    }
  }

  return 0 ;
}




Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

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

func minUint(a, b uint) uint {
	if a < b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minUint64(a, b uint64) uint64 {
	if a < b {
		return a
	}
	return b
}

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

func maxUint(a, b uint) uint {
	if a < b {
		return b
	}
	return a
}
func maxInt64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxUint64(a, b uint64) uint64 {
	if a < b {
		return b
	}
	return a
}

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

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()

	n := readInt()
	_ = readInt()
	w := readInt()
	a := make([]int, n)
	for i := range a {
		a[i] = readInt()
	}

	if n == 1 {
		println(absInt(a[0] - w))
		return
	}

	x := absInt(a[n-1] - w)
	y := absInt(a[n-2] - a[n-1])
	println(maxInt(x, y))
}


Measured memory_bytes: 640
import sys
input = sys.stdin.readline
sys.setrecursionlimit(900000)

n, q = map(int, input().split())

#print(n,q)
edge = []
for i in range(n-1):
    a = list(map(int, input().split()))
    edge.append(a)

add_list = []
for i in range(q):
    p = list(map(int, input().split()))
    add_list.append(p)

#print(edge,add_list)


dir_edge = [[] for i in range(n)]

for e in edge:
    dir_edge[e[0]-1].append(e[1]-1)
    dir_edge[e[1]-1].append(e[0]-1)
#print(dir_edge)


ans = [0]*n
for v in add_list:
    ans[v[0]-1] += v[1]
#print(add_value)


def dfs(index, parent):
    if parent != -1:
        ans[index] += ans[parent]
    for i in dir_edge[index]:
        if (parent != i):
            dfs(i,index)

dfs(0, -1)
print(*ans)


Measured memory_bytes: 312792
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
#include <set>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
using P = pair<int, int>;
inline P operator+(const P &A, const P &B) {return make_pair(A.first+B.first, A.second+B.second);}
inline P operator-(const P &A, const P &B) {return make_pair(A.first-B.first, A.second-B.second);}

int main() {
    int n;
    while(cin >> n, n){
        vector<P> v(n);
        set<P> m;
        for (int i = 0; i < n; ++i) {
            int a, b;
            scanf("%d %d", &a, &b);
            v[i] = make_pair(a, b);
            m.insert(make_pair(a, b));

        }
        int ans = 0;
        for (int i = 0; i < n; ++i) {
            for (int j = i+1; j < n; ++j) {
                P p = v[i], q = v[j];
                P x(p.second-q.second, q.first-p.first);
                if((m.count(p+x) && m.count(q+x))||(m.count(p-x) && m.count(q-x))) {
                    ans = max(ans, (p.second - q.second) * (p.second - q.second) + (p.first - q.first) * (p.first - q.first));
                }
            }
        }
        cout << ans << "\n";
    }
    return 0;
}



Measured memory_bytes: 3408
#include <bits/stdc++.h>
#define fly ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define ll long long
#define pb push_back
#define inf 100000000000

const ll mod = 1e9+7;
using namespace std;


int main(int argc, char const *argv[]) {
  fly;
  ll n,m;
  cin >> n >> m;
  string g[n+1];
  for(int i = 0;i<n;i++){
    cin >> g[i];
  }
  ll dp[n+2][m+2] {inf};
  for(int i = 0;i<n;i++){
    for(int j = 0;j<m;j++){
      if(i == 0 && j == 0 && g[i][j] == '.'){
        dp[i][j] = 1;
        continue;
      }else{
        dp[i][j] = 0;
      }
      if(g[i][j] == '#')continue;
      if(i-1>=0)dp[i][j] += dp[i-1][j];
      if(j-1>=0)dp[i][j] += dp[i][j-1];
      dp[i][j]%=mod;
    }
  }
  cout << dp[n-1][m-1] << endl;
  return 0;
}


Measured memory_bytes: 12492
unittest
{
	assert( [ "3", "0 1 3", "1 0 2", "3 2 0" ].parse.expand.solve == 3 );
	assert( [ "3", "0 1 3", "1 0 1", "3 1 0" ].parse.expand.solve == -1 );
	assert( [ "5", "0 21 18 11 28", "21 0 13 10 26", "18 13 0 23 13", "11 10 23 0 17", "28 26 13 17 0" ].parse.expand.solve == 82 );
	assert( [ "3", "0 1000000000 1000000000", "1000000000 0 1000000000", "1000000000 1000000000 0" ].parse.expand.solve == 3000000000 );
}



import std.algorithm;
import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	auto ass = new long[][]( n, n );
	foreach( ref as; ass )
	{
		input.popFront;
		as = input.front.split.to!( long[] );
	}
	return tuple( ass );
}

auto solve( long[][] ass )
{
	auto ans = 0L;
	auto dss = new long[][]( ass.length, ass[ 0 ].length );
	foreach( i, ref ds; dss )
	{
		ds[] = long.max;
		ds[ i ] = 0;
	}
	
	// 小さい順に辺を追加する
	auto queue = heapify!( ( a, b ) => b[ 0 ] < a[ 0 ] )( new Tuple!( long, long, long )[ ass.length * ( ass.length - 1 ) / 2 ], 0 );
	for( auto u = 0L; u < ass.length; u++ )
	{
		for( auto v = u + 1; v < ass[ u ].length; v++ )
		{
			queue.insert( tuple( ass[ u ][ v ], u, v ) );
		}
	}
	while( !queue.empty )
	{
		auto a = queue.front[ 0 ];
		auto u = queue.front[ 1 ];
		auto v = queue.front[ 2 ];
		queue.popFront;
		
		if( dss[ u ][ v ] <= a ) continue;		// 辺を追加しても最短経路が変わらない場合は追加しない
		ans += a;
		dss[ u ][ v ] = a;
		dss[ v ][ u ] = a;
		
		// ワーシャルフロイド法（中継点固定）で最短経路を計算
		warshallfloyd( dss, u );
		warshallfloyd( dss, v );
	}
	
	// 表Aと最短経路が一致するか判定
	foreach( as, ds; lockstep( ass, dss ) )
	{
		if( as != ds ) return -1;
	}
	return ans;
}

// 正負の重み付きグラフの全二点間最短経路探索（ワーシャルフロイド法）
auto warshallfloyd( ref long[][] dss, long p )
{
	foreach( f; 0L .. dss.length )
	{
		foreach( t; 0L .. dss.length )
		{
			if( dss[ f ][ p ] == long.max || dss[ p ][ t ] == long.max ) continue;
			dss[ f ][ t ] = min( dss[ f ][ t ], dss[ f ][ p ] + dss[ p ][ t ] );
		}
	}
	return dss;
}


Measured memory_bytes: 8188
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for(ll i = (ll)(n-1); i >= 0; i--)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rrepi(i,a,b) for(ll i=(ll)(b-1);i>=(ll)(a);i--)

#define all(x) (x).begin(),(x).end()

template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  vector<string>s(n);
  rep(i,n)cin>>s[i];
  map<string,ll>ma;
  rep(i,n)ma[s[i]]++;
  ll m=0;
  for(auto tp:ma){
    chmax(m,tp.second);
  }
  for(auto tp:ma){
    if(m==tp.second){
      cout<<tp.first<<endl;
    }
  }
  return 0;

}


Measured memory_bytes: 25472
#include <stdio.h>

main() {
    int a,b,c,x,y,z;
    scanf("%d%d%d",&a,&b,&c);
    x=a*10+b+c;
    y=a+b*10+c;
    z=a+b+c*10;
    printf("%d",x>y?(x>z?x:z):(y>z?y:z));
}

Measured memory_bytes: 128
package main

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

var a, b, c, d int
var input string

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	input := sc.Text()

	inputInt, _ := strconv.Atoi(input)
	a = inputInt / 1000
	b = inputInt / 100 % 10
	c = inputInt / 10 % 10
	d = inputInt / 1 % 10
	ints := []int{a, b, c, d}

	// forループによるbit全探索
	for i := 0; i < (1 << 3); i++ {
		answer := ""
		sum := ints[0]
		answer += strconv.FormatInt(int64(ints[0]), 10)
		for j := 0; j < 3; j++ {
			bit := 1 & (i >> byte(j))
			if bit == 1 {
				sum += ints[j+1]
				answer += "+" + strconv.FormatInt(int64(ints[j+1]), 10)
			} else {
				sum -= ints[j+1]
				answer += "-" + strconv.FormatInt(int64(ints[j+1]), 10)
			}
		}

		if sum == 7 {
			fmt.Println(answer + "=7")
			return
		}
	}
}


Measured memory_bytes: 640
import Control.Applicative

import Control.Monad
    (when)

type Problem = (Int, Int)

type Result = [String]

solve :: Problem -> Result

solve (h, w)
    = [['#' | _ <- [1..w]] | _ <- [1..h]]

input :: IO Problem

input
    = do
        [h, w] <- map read.words <$> getLine
        return (h, w)

output :: Result -> IO ()

output xs
    = putStrLn $ concat [x ++ "\n" | x <- xs]
    
main :: IO ()

main
    = do
        xs <- input
        when (xs /= (0, 0)) $ do
            output $ solve xs
            main

Measured memory_bytes: 4108
#include<bits/stdc++.h>
long long a,b,k;
int main()
{
    scanf("%lld%lld%lld",&k,&a,&b);
    if(k<=a)puts("1"),exit(0);
    else if(a<=b)puts("-1"),exit(0);
    else printf("%lld\n",(k-b-1)/(a-b)<<1|1),exit(0);
}

Measured memory_bytes: 256
from collections import deque

H, W = map(int, input().split())
A_arr = []
que = deque()
dist = [[-1 for i in range(W)] for i in range(H)]

for i in range(H):
    A_arr.append(list(input()))
    for j in range(W):
        if A_arr[i][j] == "#":
            que.append([i,j])
            dist[i][j] = 0

n_list = [[1, 0], [-1, 0], [0, 1], [0, -1]]

while 1:
    if len(que) == 0:
        break
    
    x, y = que.popleft()
    d = dist[x][y]
    for n in range(4):
        tmp = [x + n_list[n][0], y + n_list[n][1]]
        if tmp[0] < 0 or tmp[0] >= H:
            pass
        elif tmp[1] < 0 or tmp[1] >= W:
            pass
        elif dist[tmp[0]][tmp[1]] != -1:
            pass
        else:
            dist[tmp[0]][tmp[1]] = d + 1
            que.append([tmp[0], tmp[1]])


print(d)

Measured memory_bytes: 160092
fun main(args: Array<String>) {
    val A = readLine()!!.toInt()
    val B = readLine()!!.toInt()
    val l = listOf(A, B).sorted()

    if (l[0] != 1) {
        println(1)
    } else if (l[1] != 3) {
        println(3)
    } else {
        println(2)
    }
}


Measured memory_bytes: 35724
/*  ex6_2
    hangan2020 */

#include <stdio.h>
#include <string.h>
#define IS 102

int main(void){
    char eng_str[IS] = {};
    int len, inbetween_no;

  	//Input character string (including null)
    fgets(eng_str, IS, stdin);
    len = strlen(eng_str);
  
    inbetween_no = len - 3; // String length include null at the end of string (thus -3)
    
  	//Print out in the followning order
    printf("%c%d%c\n", eng_str[0], inbetween_no, eng_str[len - 2]);

    return 0;
}


Measured memory_bytes: 128
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    S = [input() for _ in [0]*n]
    s2 = []
    s3 = []
    for s in S:
        temp = [0, 0]
        m = 0
        now = 0
        for i in s.strip('\n'):
            if i == "(":
                now += 1
            else:
                now -= 1
            m = min(m, now)
        temp = [-m, (s.count("(")-s.count(")"))-m]
        if temp[0] < temp[1]:
            s2.append(temp)
        else:
            s3.append(temp)
    s2.sort(key=lambda x: (x[0]))
    s3.sort(key=lambda x: (-x[1]))
    cnt = 0
    for i, j in s2:
        cnt -= i
        if cnt < 0:
            print("No")
            return
        cnt += j
    for i, j in s3:
        cnt -= i
        if cnt < 0:
            print("No")
            return
        cnt += j
    if cnt != 0:
        print("No")
        return
    print("Yes")


main()


Measured memory_bytes: 175688
#include<iostream>
#include<algorithm>
#include<string>
#include<numeric>
#include<vector>
using namespace std;

int gcd(int a,int b){
  if (a%b==0) return b;
  else return gcd(b,a%b);
}

int main(){
  int n;
  cin >> n;
  int a[n];
  for (int i=0;i<n;i++){
    cin >> a[i];
  }
  int m_f[n];
  int m_b[n];
  m_f[0] = a[0];
  m_b[n-1] = a[n-1];
  for (int i=1;i<n;i++){
    m_f[i] = gcd(m_f[i-1],a[i]);
    m_b[n-i-1] = gcd(m_b[n-i],a[n-i-1]);
  }
  int ans = 1;
  ans = max(ans,m_f[n-2]);
  ans = max(ans,m_b[1]);
  for (int i=1;i<n-1;i++){
    ans = max(ans,gcd(m_f[i-1],m_b[i+1]));
  }

  cout << ans << endl;

  return 0;
}


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

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

    int v;

    int max = -10000000;
    int min = 10000000;
    long sum = 0;
    for (int i = 0; i < n; ++i) {
        std::cin >> v;
        if (max < v) {
            max = v;
        }
        if (v < min) {
            min = v;
        }

        sum += v;
    }

    std::cout << min << " " << max << " " << sum << std::endl;

    return 0;
}


Measured memory_bytes: 3108
c = 1
Answer = []

while c > 0:
    inp = input().split()
    n = int(inp[0])
    x = int(inp[1])
    c = n**2+x**2
    if c == 0:
        break

    flg = 0
    for i in range(1,min(int(x/3),n-1)):
        for j in range(i+1,min(int(x/2),n)):
            for k in range(j+1,n+1):
                if i+j+k == x:
                    flg += 1
    Answer.append(flg)

for l in range(0,len(Answer)):
    print(Answer[l])

Measured memory_bytes: 7712
my $S = <STDIN>;
chomp $S;
my $T = <STDIN>;
chomp $T;
my $len = length $S;
my $res = "Yes\n";
my %st = ();
my %ts = ();
for ($i=0; $i<$len; $i++) {
  $s = substr($S,$i,1);
  $t = substr($T,$i,1);
  if (exists $st{$s}){
#    print $s . "," . $st{$s} . "\n";
    if ($st{$s} ne $t) {
      $res = "No\n";
      last;
    }
  } else {
    $st{$s} = $t;
  }
  if (exists $ts{$t}){
#    print $t . "," . $ts{$t} . "\n";
    if ($ts{$t} ne $s) {
      $res = "No\n";
      last;
    }
  } else {
    $ts{$t} = $s;
  }
}
print $res;

Measured memory_bytes: 996
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
vector<int> to[200005];
int ans = 0;
class UnionFind
{
public:
    vector<int> Parent;
    UnionFind(int N)
    {
        Parent = vector<int>(N, -1);
    }
    int root(int A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = root(Parent[A]);
    }

    int size(int A)
    {
        return -Parent[root(A)];
    }
    bool connect(int A, int B)
    {
        A = root(A);
        B = root(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};
int main()
{
    int n,m;
    cin >> n >> m;
    vector<int> p(n);
    rep(i,n){
        cin >> p[i];
        p[i]--;
    }
    vector<int> x(m), y(m);
    UnionFind uf(n);
    rep(i,m){
        cin >> x[i] >> y[i];
        x[i]--;
        y[i]--;
        uf.connect(p[x[i]], p[y[i]]);
    }
    rep(i,n){
        if(uf.root(i) == uf.root(p[i])){
            ans++;
        }
    }
    cout << ans << endl;
 
}


Measured memory_bytes: 6528
# !入力
# グラフの構築
# クエリの入力
# Kからの各点のの距離をdfs
# クエリの処理
from collections import deque
n=int(input())
edge=[[]for _ in range(n)]
for i in range(n-1):
  a,b,c=map(int,input().split())
  edge[a-1].append((b-1,c))
  edge[b-1].append((a-1,c))
q,k=map(int,input().split())
dist=[0]*n
seen=[False]*n
todo=deque([k-1])
while todo:
  par=todo.pop()
  seen[par]=True
  for cld,cost in edge[par]:
    if dist[cld]==0:
      if seen[cld]==False:
        dist[cld]=dist[par]+cost
        seen[cld]=True
        todo.append(cld)

for i in range(q):
  x,y=map(int,input().split())
  print(dist[x-1]+dist[y-1])
  
  

Measured memory_bytes: 83252
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <functional>
using namespace std;

typedef long long ll;

vector<int> edg[100003];
ll a[100003];
bool checked[100003], used[100003];
priority_queue<ll> que1, que2;

int check(int pos) {
	checked[pos] = true;
	int ret = 1;
	for (int i : edg[pos]) {
		if (checked[i]) continue;
		ret += check(i);
	}
	return ret;
}

void func(int pos) {
	used[pos] = true;
	que1.push(-a[pos]);
	for (int i : edg[pos]) {
		if (used[i]) continue;
		func(i);
	}
}

int main() {
	int n, m; cin >> n >> m;
	for (int i = 0; i < n; ++i) cin >> a[i];
	for (int i = 0; i < m; ++i) {
		int x, y; cin >> x >> y;
		edg[x].push_back(y);
		edg[y].push_back(x);
	}
	if (check(0) == n) {
		cout << 0 << endl;
		return 0;
	}
	ll ans = 0;
	int cnt = 0;
	for (int i = 0; i < n; ++i) {
		if (used[i]) continue;
		func(i);
		ans += -que1.top();
		++cnt;
		que1.pop();
		while (!que1.empty()) {
			que2.push(que1.top());
			que1.pop();
		}
	}
	while (cnt < 2*(n - m - 1)) {
		if (que2.empty()) {
			cout << "Impossible" << endl;
			return 0;
		}
		ans += -que2.top();
		que2.pop();
		++cnt;
	}
	cout << ans << endl;
	return 0;
}


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

int main(){
  int a[100] = {};
  int n;
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  for(int i=n-1; i>=0; i--){
    cout << a[i];
    if(i!=0){
      cout << ' ';
    }
  }
  cout << endl;
  return 0;
}



Measured memory_bytes: 3068
using System;

class Prog{
  static void Main(string[] args){
    int n = int.Parse(Console.ReadLine());
    int[] ls = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
    double k = 0;
    for(int i = 0;i < n;i++){
      k += 1.0 / ls[i];
    }
    Console.WriteLine(1.0/k);
  }
}

Measured memory_bytes: 11092
#include<stdio.h>
int main(void)
{
	int x, y, z, i;
	i = 0;
	scanf("%d %d %d", &x, &y, &z);
	for (x;x < y + 1;x++)
	{
		if (z % x == 0)i++;
	}
	printf("%d\n", i);
	return 0;
}


Measured memory_bytes: 2100
# 定数
INF = float("inf")
MOD = int(1e9 + 7)
# # データ構造：上限付き整数
# class intmod:
#     def __init__(self, v):
#         self.v = v
#     def __add__(self, o):
#         self.v += o.v
#         self.v %= MOD
#     def __sub__(self, o):
#         self.v -= o.v
#     def __mul__(self, o):
#         self.v *= o.v
#         self.v %= MOD

# エントリーポイント
def main():
    N, M = map(int, input().split())
    A = set(int(input()) for _ in range(M))

    dp = [1] + [0] * N
    for n in range(1, N + 1):
        if n in A: continue
        if 1 < n:
            dp[n] = dp[n - 1] + dp[n - 2]
        else:
            dp[n] = dp[n - 1]
        dp[n] %= MOD
    print(dp[-1])

main()


Measured memory_bytes: 11880
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
int main(void){
  int K;
  cin >> K;
  if(K<10){
    cout << K << endl;
  } else {
    queue<int64_t> Q;
    for(int i=0;i<9;i++){
      Q.push(i+1);
    }
    for(int i=0;i<K-1;i++){
      int64_t f = Q.front();Q.pop();
      if(f%10L>0){Q.push(f*10L+f%10L-1);}
      Q.push(f*10L+f%10);
      if(f%10L<9){Q.push(f*10L+f%10L+1);}
    }
    cout << Q.front() << endl;
  }
}


Measured memory_bytes: 1792
a, b, c = map(int, input().split())
# print(a, b, c)
if a == b and a != c:
    print(2)
elif a == c and a != b:
    print(2)
elif a == b and a == c:
    print(1)
elif b == c and b != a:
    print(2)
else:
    print(3)

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

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    rep(i, N) cin >> H[i];

    int c   = 0;
    int ans = 0;
    rep(i, N) {
        if (i == 0) continue;
        if (H[i - 1] >= H[i]) {
            c++;
            ans = max(ans, c);
        }
        else {
            c = 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
import collections
N=int(input())
A=list(map(int,input().split()))
s=sum(A)
Q=int(input())
d=collections.Counter(A)
for i in range(Q):
  B,C=map(int,input().split())
  s += d[B]*C - d[B]*B
  print(s)
  if C in d:
    d[C]+=d[B]
  else:
    d[C]=d[B]
  d[B]=0

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

std::vector<int> divisor(int n){
        std::vector<int> ret;
        for(int i=1; i*i<=n; i++){
                if(n%i == 0){
                        ret.push_back(i);
                        if(i*i != n) ret.push_back(n/i);
                }
        }
        std::sort(ret.begin(), ret.end());
        return ret;
}

int main(){
	int n, ans = 0;
	scanf("%d", &n);
	for(int i=1; i<=n; i+=2){
		ans += (divisor(i).size() == 8);
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,b;
    cin >> n >> a >> b;
    if((b-a)%2==0){
        cout << "Alice" << endl;
    }else{
        cout << "Borys" << endl;
    }

    return 0;
}

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

vector<pair<LL, int> > memo[3];

LL solve(set<int> use_idx, LL cost){
    if(use_idx.size() == 3) {
        return cost;
    }

    LL ans = INF;
    REP(i, memo[use_idx.size()].size()){
        LL score = memo[use_idx.size()][i].first;
        int idx = memo[use_idx.size()][i].second;
        if(use_idx.count(idx) == 1) continue;

        use_idx.insert(idx);
        ans = min(ans, solve(use_idx, cost + score));
        use_idx.erase(idx);
    }

    return ans;
}

int main(){
    int N, C;
    cin >> N >> C;
    int D[C][C];
    REP(i, C) REP(j, C) cin >> D[i][j];

    int c[N][N];
    REP(i, N) REP(j, N) {
        cin >> c[i][j];
        c[i][j]--;
    }

    LL costs[3][C];
    REP(i, 3) REP(j, C) costs[i][j] = 0;

    REP(i, N) {
        REP(j, N) {
            REP(k, C){
                costs[(i+j)%3][k] += D[c[i][j]][k];
            }
        }
    }

    REP(i, 3) {
        vector<pair<LL, int> > tmp;
        REP(j, C) tmp.PB(MP(costs[i][j], j));
        sort(ALL(tmp));
        REP(j, min(6, (int)tmp.size())) memo[i].PB(tmp[j]);
    }

    set<int> use_idx;
    LL ans = solve(use_idx, 0);
    cout << ans << endl;
}

Measured memory_bytes: 1280
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
using namespace std;
#define DEBUG(x) cout<<#x<<"="<<x<<endl
#define DEBUG2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
typedef long long ll;
class Solver{
public:
    static const int MAXN=1e5+10;
    static const ll MOD=1e9+7;
    int N,K;
    ll fact[MAXN];
    ll rfact[MAXN];
    ll A[MAXN];
    ll qpow(ll n,ll k){
        ll a=n,r=1;
        while(k){
            if(k&1)r=(r*a)%MOD;
            a=(a*a)%MOD;
            k>>=1;
        }
        return r;
    }
    void calFact(){
        fact[0]=1;
        rfact[0]=1;
        for(int u=1;u<MAXN;u++){
            fact[u]=(fact[u-1]*u)%MOD;
            rfact[u]=qpow(fact[u],MOD-2);
        }
    }
    inline ll C(ll n,ll k){
        return fact[n]*rfact[k]%MOD*rfact[n-k]%MOD;
    }
    void test(){
        calFact();
        cout<<qpow(2,MOD-2)<<"\n";
        cout<<C(1,1);
    }
    void solve(){
        ios::sync_with_stdio(false);
        cin.tie(0);
        calFact();
        cin>>N>>K;
        for(int u=0;u<N;u++)
            cin>>A[u];
        sort(A,A+N);
        ll maxSum=0;
        for(int u=K-1;u<N;u++){
            if(u==K-1)maxSum=(maxSum+A[u])%MOD;
            else {
                maxSum=(maxSum+A[u]*C(u,K-1)%MOD)%MOD;
            }
        }
        ll minSum=0;
        for(int u=N-K;u>=0;u--){
            if(u==N-K)minSum=(minSum+A[u])%MOD;
            else {
                minSum=(minSum+A[u]*C(N-u-1,K-1)%MOD)%MOD;
            }
        }
        cout<<(maxSum-minSum+MOD)%MOD;
    }
};
int main()
{
    // freopen("in.txt","r",stdin);
    (new Solver())->solve();
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;

int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  
  (a+b)%2==0 ? cout << abs(a-b)/2+min(a,b) : cout <<"IMPOSSIBLE";
}

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

struct node{
	int val,pri;
	node *l,*r;
	node():l(nullptr),r(nullptr){}
	node(int a,int b):val(a),pri(b),l(nullptr),r(nullptr){}
};

struct treap{
	node *root;
	treap(){ root=nullptr; }

	node* right(node *t){
		node* s = t->l;
		t->l = s->r;
		s->r = t;
		return s;
	}
	node* left(node *t){
		node* s = t->r;
		t->r = s->l;
		s->l = t;
		return s;
	}
	node* insert(node *t,int key,int priority){
		if(t==nullptr) return new node(key,priority);
		if(t->val==key) return t;
		if(key<t->val){
			t->l = insert(t->l,key,priority);
			if(t->pri < t->l->pri)t = right(t);
		}
		else{
			t->r=insert(t->r,key,priority);
			if(t->pri < t->r->pri)t = left(t);
		}
		return t;
	}
	void insert(int key,int priority){
		root = insert(root,key,priority);
	}
	node* delet(node *t,int key){
		if(t==nullptr)return nullptr;
		if(key<t->val)t->l=delet(t->l,key);
		else if(key>t->val)t->r=delet(t->r,key);
		else return _delet(t,key);
		return t;
	}
	node* _delet(node *t,int key){
		if(t->l==nullptr && t->r==nullptr) return nullptr;
		else if(t->l==nullptr)t=left(t);
		else if(t->r==nullptr)t=right(t);
		else{
			if(t->l->pri > t->r->pri) t= right(t);
			else t= left(t);
		}
		return delet(t,key);
	}
	void delet(int key){
		root=delet(root,key);
	}
	node* find(node *t,int key){
		if(t==nullptr)return nullptr;
		if(key < t->val)return find(t->l,key);
		if(key > t->val)return find(t->r,key);
		return t;
	}
	void print(node *t,int x=1){
		if(t==nullptr)return;
		if(x==1)cout<<' '<<(t->val);
		if(t->l!=nullptr)print(t->l,x);
		if(x==2)cout<<' '<<(t->val);
		if(t->r!=nullptr)print(t->r,x);
		if(x==3)cout<<' '<<(t->val);
		if(t==root)cout<<endl;
	}
};

int main(){
	treap T;
	int n,a,b;
	cin>>n;
	while(n--){
		string s;
		cin>>s;
		if(s=="insert"){
			cin>>a>>b;
			T.insert(a,b);
		}
		if(s=="find"){
			cin>>a;
			cout<<(T.find(T.root,a)==nullptr?"no":"yes")<<endl;
		}
		if(s=="delete"){
			cin>>a;
			T.delet(a);
		}
		if(s=="print"){
			T.print(T.root,2);
			T.print(T.root,1);
		}
	}
}



Measured memory_bytes: 9424
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;
#define rep(i,N) for(int (i)=0;(i)<(N);(i)++)


int main() {
	int r; cin >> r;
	cout << 3 *r*r << endl;


}

Measured memory_bytes: 256
import numpy as np
N = int(input())
V = list(map(int, input().strip().split()))
V = np.array(V)
C = list(map(int, input().strip().split()))
C = np.array(C)
B = 0
i = 0
while i <= N - 1:
    A = V[i] - C[i]
    i += 1
    if A > 0:
        B = B + A
print(B)

Measured memory_bytes: 13296
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  string s;
  cin >> s;

  if(s == "A"){
    cout << "T" << endl;
  }else if(s == "T"){
    cout << "A\n";
  }else if(s == "C"){
    cout << "G\n";
  }else{
    cout << "C\n";
  }
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,-1,0,1,1,-1,1,-1,0};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
vl ans;
void dfs(ll t){
    if(t>3234566667)return ;
    ll p=t%10;
    t*=10;
    rep(i,3){
        if(i-1+p<0)continue;
        if(i-1+p>9)continue;
        ans.pb(t+p+i-1);
        dfs(t+p+i-1);
    }
}
int main(){
    ll k;cin >> k;
    rep(i,9){
        ans.pb(i+1);
        dfs(i+1);
    }
    sort(all(ans));
   cout << ans[k-1] <<endl;
}   

Measured memory_bytes: 7444
#include<iostream>
using namespace std;
int main(void)
{
    int n;
    cin >> n;
    for(int i=1;i<=9;i++)
    {
        if(n%i==0)
        {
            if(1<=n/i && n/i<=9)
            {
                cout << "Yes";
                return 0;
            }
        }
    }
    cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int N, L;
	int a[200];
	int sum = 0;
	scanf("%d%d", &N, &L);
	for (int i = 0; i < N; i++) {
		a[i] = L + i;
	}
	
	if (L >= 0) {
		a[0] = 0;
		for(int i=0;i<N;i++){
			sum += a[i];
		}
	}else if (L <= -1) {

		if (N >L * (-1)) {

			for (int i = 0; i < N; i++) {
				sum += a[i];
			}
		}
		else if (N <= L * (-1)) {
			a[N-1 ] = 0;
			for (int i = 0; i < N; i++) {
				sum += a[i];
			}
		}
		
	}


	printf("%d", sum);


	





	return 0;

}

Measured memory_bytes: 128
#include<stdio.h>
int main()
{
  char i[100000];
  int j,count=0;
  scanf("%s",i);
  for(j=1;j<=strlen(i);j++)
  if(i[j]==i[j-1]&&i[j]=='0'){
    i[j]='1';
    count++;}
    else if(i[j]==i[j-1]&&i[j]=='1'){
    i[j]='0';
   count++;}
  printf("%d",count);
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include<stack>
#include<sstream>
#include<iomanip>
typedef long long ll;

#define pi 3.14159265358979323846
#define VI vector<int>
#define VLL vector<long long>
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()

using namespace std;

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}

template<typename T>
T finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}

/*char r[4];
int yaju[4];
char op[3];
int sum = 0;
scanf("%s", r);
for (int i = 0;i < 4;i++) {
	yaju[i] = r[i] - '0';
}
*/
int main() {
	string a, b, c;cin >> a >> b >> c;
	int A = a.size()+1;
	int B = b.size()+1;
	int C = c.size()+1;
	int ta =0, tb =0, tc=0;
	bool oka = true, okb = false, okc = false;
	while (1) {
		if (ta == A) { cout << "A" << endl; break; }
		if (tb == B) { cout << "B" << endl;break; }
		if (tc == C) { cout << "C" << endl;break; }
		if (oka) {
			if (a[ta] == 'a') { oka = true, okb = false, okc = false; }
			else if (a[ta] == 'b') { oka = false, okb = true, okc = false; }
			else if (a[ta] == 'c') { oka = false, okb = false, okc = true; }
			ta++;
		}
		else if (okb) {
			if (b[tb] == 'a') { oka = true, okb = false, okc = false; }
			else if (b[tb] == 'b'){oka = false, okb = true, okc = false;}
		    else if (b[tb] == 'c'){oka = false, okb = false, okc = true;}
			tb++;
		}
		else if (okc) {
			if (c[tc] == 'a') { oka = true, okb = false, okc = false; }
			else if (c[tc] == 'b') { oka = false, okb = true, okc = false; }
			else if (c[tc] == 'c') { oka = false, okb = false, okc = true; }
			tc++;
		}
	}
}

Measured memory_bytes: 256
import sys
def input():return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = 0

    for i in range(N-1):
        if A[i] >= 2:
            ans += A[i]//2
        if A[i]%2 == 1 and A[i+1] >= 1:
            ans += 1
            A[i+1] -= 1
    
    ans += A[N-1]//2
    print(ans)
if __name__ == "__main__":
    main()

Measured memory_bytes: 13060
import java.util.*;

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

		String t = scan.next();
		if(t.compareTo("2019/04/30") > 0) {
			System.out.println("TBD");
		}else{
			System.out.println("Heisei");
		}
	}
}


Measured memory_bytes: 21204
#include<stdio.h>
#include<math.h>
 
typedef struct {
  double x;
  double y;
}p;
 
int kock(int n, p p1, p p2){
  if(n==0) return 0;
   
  p s,t,u;
   
  s.x = ( 2*p1.x + 1*p2.x )/3;
  s.y = ( 2*p1.y + 1*p2.y )/3;
  t.x = ( 1*p1.x + 2*p2.x )/3;
  t.y = ( 1*p1.y + 2*p2.y )/3;
  u.x = ( t.x - s.x ) * 0.5 - ( t.y - s.y ) * (sqrt(3.0)/2.0) + s.x;
  u.y = ( t.x - s.x ) * (sqrt(3.0)/2.0) + ( t.y - s.y ) * 0.5 + s.y;
   
   
  kock(n-1,p1,s);
  printf("%lf %lf\n",s.x,s.y);
  kock(n-1,s,u);
  printf("%lf %lf\n",u.x,u.y);
  kock(n-1,u,t);
  printf("%lf %lf\n",t.x,t.y);
  kock(n-1,t,p2);
  
}
 
int main(){
   
  int n;
  p p1 = {0,0},p2 = {100,0};
   
   
  scanf("%d",&n);
   
  printf("%lf %lf\n",p1.x,p1.y);
  kock(n,p1,p2);
  printf("%lf %lf\n",p2.x,p2.y);
   
  return 0;
}

Measured memory_bytes: 636
//In The Name of Beauty
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef map<ll,ll> mllll;
#define IB std::ios::sync_with_stdio(0);
#define pb(x) push_back(x);
#define mp(x,y) make_pair(x,y)
#define pll pair<ll,ll>
#define F first
#define S second
#define trvall(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define MAXN (ll)1e5 + 8
#define INF  (ll)1e12 + 8
ll const delta = 1000000007;

int main()
{
    IB;
    cin.tie(0);
    cout.tie(0);
    ll n , m;
    cin >> n >> m;
    string s , t;
    cin >> s >> t;
    if(s[0] != t[0])return cout << -1,0;
    ll g = __gcd(n,m);
    ll p = n * m / g;
    for(ll i = 1;i < n;i++)
    {
        ll pl = (i * (p / n)) + 1;
        if((pl - 1) % (p / m) != 0)continue;
        ll f = (pl - 1) / (p / m);
        if(s[i] != t[f])return cout << -1,0;
    }
    cout << p;
    return 0;
}
//Written by M_H_H_7


Measured memory_bytes: 640