akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1000000007; 
const int INF = 1000000000; //1e9
const int NIL = -1;
const long long LINF = 1000000000000000000; // 1e18
const double EPS = 1E-10;

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




int main(){
    int N, A; std::cin >> N;
    long long ans(0), sum(0);
    for(int i(0); i < N; ++i){
        std::cin >> A;
        if(A) sum += A;
        else{
            ans += sum / 2;
            sum = 0;
        }
    }
    ans += sum / 2;
    std::cout << ans << std::endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int tag[2000005],n;
void print()
{
    for(int j=0;j<n-1;j++)
        cout<<tag[j]<<' ';
    cout<<tag[n-1]<<endl;
}
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>tag[i];
    print();
    for(int i=1;i<n;i++)
    {
        int key=tag[i],j=i-1;
        while(key<tag[j]&&j>=0)
            tag[j+1]=tag[j--];
        tag[j+1]=key;
        print();
    }
}

Measured memory_bytes: 3084
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    int a, b;
    cin >> a >> b;
    cout << a * b << " " << 2 * (a + b) << endl;
    return 0;
}

Measured memory_bytes: 1164
package main

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

func main() {
	sc := NewScanner()
	K := sc.NextInt()
	s := 0
	for i := 1; i <= K; i++ {
		for j := 1; j <= K; j++ {
			for k := 1; k <= K; k++ {
				s += gcd(gcd(i, j), k)
			}
		}
	}
	fmt.Println(s)
}
func gcd(a, b int) int {
	for b > 0 {
		a, b = b, a%b
	}
	return a
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 1776
#include<bits/stdc++.h>
using namespace std;
#define itn int

int main(){
    long long n;
    cin >> n;
    
    int a[] = {0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120};
    
    long long ans = 0;
    map<long long,int> mp;
    for(long long i = 2;i * i <= n;i++){
        if(n % i != 0)continue;
        n /= i;
        
        int ex = 1;
        while(n % i == 0){
            n /= i;
            ex++;
        }
        mp[i] += ex;
        
        int l = 1;
        while(mp[i] >= l){
            mp[i] -= l;
            l++;
        }
        ans += l-1;
    }
    if(n > 1){
        mp[n]++;
        for(int j = 0;j < 15;j++){
            if(a[j] <= mp[n] && mp[n] < a[j+1]){
                ans += j;
                mp[n] -= a[j];
                break;
            }
        }
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 3584
#include <stdio.h>
#include <algorithm>

int main(void)
{
	char c[3];
	int n, i;
	int a[4];
	
	for (i = 0; i < 4; i++){
		a[i] = 0;
	}
	
	while (scanf("%d,%s", &n, c) != EOF){
		
		if (c[0] == 'A' && c[1] == 'B'){
			a[2]++;
		}
		
		else if (c[0] == 'A'){
			a[0]++;
		}
		else if (c[0] == 'B'){
			a[1]++;
		}
		if (c[0] == 'O'){
			a[3]++;
		}
		
	}
	
	for (i = 0; i < 4; i++){
		printf("%d\n", a[i]);
	}
	
	return (0);
}

Measured memory_bytes: 1024
//#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);
    ll n;
    cin >> n;
    vll a(n);
    ll sum = 0;
    REP(i,n){
        cin >> a[i];
        sum += a[i];
    }
    ll ans = LLINF;
    ll t = 0;
    REP(i,n-1){
        t+= a[i];
        ll t2 = sum-t;
        ans = min(ans,abs(t2-t));
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.Stream;

class Main{

	private void solve(){
		int a=gInt(),b=gInt();
		if(a%b==0) {
			System.out.println(-1);
		}else {
			System.out.println(a);
		}
	}

	public static void main(String[] $){
		new Main().solve();
	}

	static Scanner s=new Scanner(System.in);


	static int gInt(){
		return s.nextInt();
	}
	static long gLong(){
		return s.nextLong();
	}
	static long gDouble(){
		return s.nextLong();
	}


	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

	static class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{

		int to,cur,d;

		Range(int from,int to,int d){
			this.cur=from-d;
			this.to=to;
			this.d=d;
		}

		Range(int n){
			this(0,n-1,1);
		}

		@Override
		public Iterator<Integer> iterator(){
			return this;
		}

		@Override
		public boolean hasNext(){
			return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
		}

		@Override
		public int nextInt(){
			return cur+=d;
		}
	}


	static IntStream REPS(int v){
		return IntStream.range(0,v);
	}

	static IntStream REPS(int l,int r){
		return IntStream.rangeClosed(l,r);
	}


	static IntStream ints(int n){
		return REPS(n).map(i->gInt());
	}

	static Stream<String> strs(int n){
		return REPS(n).mapToObj(i->s.next());
	}

}

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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int N, M; cin >> N >> M;
	vector<int> P(M);
	vector<int> Y(M);
	vector<vector<pair<int, int>>> v(N);

	REP(i,M){
		cin >> P[i] >> Y[i];
		v[P[i] - 1].push_back(make_pair(Y[i], i));
	}
	
	REP(i,N){
		SORT(v[i]);
		REP(j,v[i].size()){
			Y[v[i][j].second] = j + 1;
		}
	}

	REP(i,M){
		cout << setfill('0') << setw(6) << right << P[i] << setfill('0') << setw(6) << right << Y[i] << endl;

	}



	return 0;

}


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

int main() {
  int K;
  cin >> K;
  int sum = 0;

  for (int a=1; a<=K; a++) {
    for (int b=1; b<=K; b++) {
      for (int c=1; c<=K; c++) {
        int m = min(min(a, b), c);
        int gcd = 0;
        for (int i=1; i<=m; i++) {
          if (a%i == 0 && b%i == 0 && c%i == 0) {
            gcd = i;
          }
        }
        sum += gcd;
      }
    }
  }
  
  cout << sum << endl;

}


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

int main() {
	const int H = 4,S = 3,F = 10;
	int hall[H][S][F] = {0};
	int n;
	cin >> n;
	while (n--) {
		int b,f,r,v;
		cin >> b >> f >> r >> v;
		hall[b-1][f-1][r-1] += v;
	}
	for (int h = 0;h != H;++h) {
		for (int s = 0;s != S;++s) {
			for (int f = 0;f != F;++f) {
				cout << " " << hall[h][s][f];
			}
			cout << endl;
		}
		if (h != H - 1) {
			for (int sh = 0;sh != 20;++sh) {
				cout << "#";
			}
			cout << endl;
		}
	}
}

Measured memory_bytes: 3084
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan=new Scanner(System.in);
while(true){
int A=scan.nextInt();
int B=scan.nextInt();
if(A==0&&B==0)
break;
for(int a=0;a<A;a++){
for(int b=0;b<B;b++){
	if(a==0||a==A-1||b==0||b==B-1)
System.out.print("#");
	else
		System.out.print(".");
}
System.out.println();
}
System.out.println();
}
}
}

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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; }

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  string s;
  cin >> s;
  vector<vector<int>> ind(26);
  rep(i, 26){
    ind[i].push_back(0);
  }

  rep(i, s.length()){
    ind[s[i]-'a'].push_back(i+1);
  }

  int ans = 1000;

  rep(i, 26){
    if(ind[i].size()==1) continue;

    int max_val = -1;
    rep(j, ind[i].size()-1){
      chmax(max_val, ind[i][j+1] - ind[i][j]-1);
    }

    chmin(ans, max(max_val, int(s.length() - ind[i][ind[i].size()-1])));

  }

  cout << ans << endl;




  return 0;
}


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

int main(){
  int n; cin>>n;
  vector<int> city(n+1),city2(n+1),hero(n),hero2(n);
  long long ans=0,ans2=0;
  for(int i=0;i<n+1;i++){
    cin>>city[i];
    city2[i]=city[i];
  }
  for(int i=0;i<n;i++){
    cin>>hero[i];
    hero2[i]=hero[i];
  }
  for(int i=0;i<n;i++){
    if(hero2[i]>=city2[i]){
      ans2+=city2[i];
      hero2[i]-=city2[i];
      if(hero2[i]>city2[i+1]){
        ans2+=city2[i+1];
        city2[i+1]=0;
      }else{
        ans2+=hero2[i];
        city2[i+1]-=hero2[i];
      }
    }else{
      ans2+=hero2[i];
      city2[i]-=hero2[i];
    }
  }
  cout<<max(ans,ans2)<<endl;
}

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

int main() {
#ifdef LOCAL_DEFINE
	// freopen("data.in", "rt", stdin);
	// freopen("data.out", "w", stdout);
	auto _start = chrono::high_resolution_clock::now();
#endif

	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	const int md = 1e9 + 7;
	auto add = [&](int &a, int b) {
		a += b;
		if (a >= md) a -= md;
	};
	auto sub = [&](int &a, int b) {
		a -= b;
		if (a < 0) a += md;
	};
	vector<vector<int>> dp(n + 1, vector<int>(k + 1));
	vector<int> pre(k + 2);
	dp[0][0] = 1;
	for (int i = 0; i < n; i++) {
		fill(pre.begin(), pre.end(), 0);
		for (int j = 0; j <= k; j++) {
			add(pre[j + 1], pre[j]);
			add(pre[j + 1], dp[i][j]);
		}
		for (int j = 0; j <= k; j++) {
			add(dp[i + 1][j], (pre[j + 1] - pre[max(0, j - a[i])] + md) % md);
		}
	}
	cout << dp[n][k] << '\n';

#ifdef LOCAL_DEFINE
	auto _end = chrono::high_resolution_clock::now();
	cerr << "elapsed time: " << chrono::duration<double, milli>(_end - _start).count() << " ms\n";
#endif
	return 0;
}

Measured memory_bytes: 40192
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <string>
#include <string.h>


using namespace std;

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

    for (char c='a'; c<='z'; ++c) {
        if (s.find(c) == string::npos) {
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef unsigned long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
const int i_INF = 2147483647;

int main() {
  int n;
  int sum=0;
  cin>>n;
  vector<int> p(n);
  rep(i,0,n)cin>>p[i];
  sort(p.begin(),p.end());
  rep(i,0,n){
    if(i<n-1)sum+=p[i];
    else sum+=p[i]/2;
  }
  cout<<sum<<endl;
}

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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if ( a+b == c+d){
    cout << "Balanced" << endl;
  } else if (a+b > c+d){
    cout << "Left" << endl;
  } else {
    cout << "Right" << endl;
  }
  

}

Measured memory_bytes: 256
//Catchharsh
#include<bits/stdc++.h>
#define ll long long int 
#define ld long double
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define see(x) cout<<#x<<" = "<<x<<endl
const ll MOD = 1e9+7;
const ll INF = 1011111111;
const ll LLINF = 1000111000111000111LL;
const ld EPS = 1e-10;
const ld PI = 3.14159265358979323;
using namespace std;
ll power (ll base,ll exponent)
{
    ll ans=1;
    //base%=MOD;
    //exponent%=(MOD-1);
    while(exponent!=0)
    {
      if(exponent&1) ans=(1LL*ans*base);
      base=(1LL*base*base);
      exponent>>=1;
    }
    return ans;
}

int32_t main()
{   
     IOS;
     
     ll n,m,i,j,k;
     ll ans=0;
     cin>>n>>m;
     ll sum=0;
     ll a[n];
     for(i=0;i<n;i++) cin>>a[i],sum+=a[i];
     for(i=0;i<n;i++)
     {
       if(a[i]*4*m<sum) ;
       else ans++;
     }     
     if(ans>=m) cout<<"Yes";
     else cout<<"No";
     cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';             
}

Measured memory_bytes: 384
#include <iostream>

#define NOT_FOUND 99999

using namespace std;

int n, q, tmp;
int s[10010];

int linerSearch(int input){
    s[n] = input;
    int i = 0;
    while(s[i] != input){
        i++;
    }
    if(i == n){
        return NOT_FOUND;
    }else{
        return i;
    }
}

int main(){
    cin >> n;
    int answer = 0;
    for(int i = 0; i < n; i++){
        cin >> s[i];
    }
    cin >> q;
    for(int i = 0; i < q; i++){
        cin >> tmp;
        if(linerSearch(tmp) != NOT_FOUND) answer++;
    }
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 3108
#include <bits/stdc++.h>
using namespace std; 
int main() {
	int a,b;
	cin>>a>>b;
	cout<<(a+b-1)/b<<endl;
	
    //freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
    return 0; 
}/*
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define Unique(v) sort(all(v));v.erase(unique(all(v)),v.end());
#define sz(v) (int)v.size()
#define int long long
using namespace std;
typedef vector<int> vi;
#define y1 abacaba
#define left sefude
#define db(x) cerr << #x <<" == "<<x << endl;
#define db2(x,y) cerr<<#x <<" == "<<x<<", "<<#y<<" == "<<y<<endl;
#define db3(x,y,z) cerr << #x<<" == "<<x<<", "<<#y<<" == "<<y<<", "<<#z<<" == "<<z<<endl; 
#define prl cerr<<"called: "<< __LINE__<<endl;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
inline ll mod(ll n, ll m ){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll a,ll b,ll m){
    if(b==0LL) return 1LL;
    if(b==1LL) return mod(a,m);
    ll k = mod(exp(a,b/2,m),m);
    if(b&1LL){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

const int N = 200100;
vi g[N];
bool vis[N];
int tam=0;
void dfs(int v){
  vis[v] = 1;tam++;
  for(int to : g[v])if(!vis[to])dfs(to);
}
int32_t main(){
  fastio;
  int n,m;
  cin>>n>>m;
  for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    g[a].pb(b);
    g[b].pb(a);
  }
  int res=0;
  for(int i=1;i<=n;i++){
    if(!vis[i]){
      tam=0;
      dfs(i);
      res = max(res,tam);
    }
  }
  cout << res << endl;
  // math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}

Measured memory_bytes: 20876
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n, d;
  cin >> n >> d;
  int x[n][d];
  int ans = 0;
  REP(i, n) REP(j, d) { cin >> x[i][j]; }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; ++j) {
      ll dist = 0;
      REP(k, d) { dist += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]); }
      for (int i = 1; i <= 10000; ++i) {
        if (dist == 1ll * i * i) ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
void main(){
	int a, b;
	readf("%d %d", &a, &b);
	if(a<10 && b<10) writeln(a*b);
	else writeln(-1);
}
import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}


Measured memory_bytes: 2824
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = getInt(sc);
		int d = getInt(sc);
		int[][] points = new int[n][d];

		for (int i = 0; i < n; i++) {
			points[i] = getIntArray(sc);
		}

		int count = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (isInteger(getDistance(points[i], points[j]))) {
					count++;
				}
			}
		}
		System.out.println(count);
	}

	private static boolean isInteger(double distance) {

		return (int) distance == distance;
	}

	private static double getDistance(int[] is, int[] is2) {
		int distanceSquare = 0;
		for (int i = 0; i < is.length; i++) {
			distanceSquare += Math.pow(is[i] - is2[i], 2);
		}
		return Math.sqrt(distanceSquare);
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をintで返却
	 *
	 * @return
	 */
	public static int getInt(Scanner sc) {

		return Integer.parseInt(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をStringで返却
	 *
	 * @return
	 */
	public static String getString(Scanner sc) {

		return sc.next();
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をint配列で返却
	 *
	 * @return
	 */
	public static int[] getIntArray(Scanner sc) {
		String line = "";
		// 直前にnext()を実行していると改行コードだけ取ってしまうのでその対策
		while (line.equals("")) {
			line = sc.nextLine();
		}

		String[] strArray = line.split(" ");
		int[] intArray = new int[strArray.length];
		for (int i = 0; i < strArray.length; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}

}


Measured memory_bytes: 23252
h, w = map(int, input().split())
A = [input() for _ in range(h)]

A = [A[i] for i in range(h) if any(x == '#' for x in A[i])] 
h = len(A)
ans = [[] for i in range(h)]
for i in range(w):
    if any(x[i] == '#' for x in A):
        for j, x in enumerate(A):
            ans[j].append(x[i])
print(*[''.join(row) for row in ans], sep='\n')


Measured memory_bytes: 3188
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

S, T = input().split()

print(T + S)


Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
using namespace std;


int main(){
  int a,b,index;
  int INDEX[200];
  vector< vector<int> > vec;
  map<int,bool> exist;
  vec.clear();
  vec.reserve(200);
  exist.clear();
  index = 0;

  while(cin >> a >> b){
    if(!(a|b)){
      //cout << "-----------" << endl;
      bool OK=true;
      for(int i=0;i<index;i++){
	//cout << "INDEX[i] = " << INDEX[i] << ", size = " << vec[INDEX[i]].size() << endl;
	if(INDEX[i] == 1 || INDEX[i] == 2){
	  if(vec[INDEX[i]].size()%2 != 0)continue;
	  else {
	    OK = false;
	    break;
	  }
	}
	else{
	  if(vec[INDEX[i]].size()%2 == 0)continue;
	  else {
	    OK = false;
	    break;
	  }
	}
      }
      if(OK)cout << "OK" << endl;
      else cout << "NG" << endl;
  

      vec.reserve(200);
      exist.clear();
      for(int j=0;j<index;j++){
	vec[INDEX[j]].clear();
	INDEX[j] = 0;
      }
      index=0;
      continue;
    }
    vec[a].push_back(b);
    vec[b].push_back(a);
    if(!exist[a]){
      INDEX[index] = a;
      index++;
      exist.insert(map<int,bool>::value_type(a,true));
    }    
    if(!exist[b]){
      INDEX[index] = b;
      index++;
      exist[b] = true;
    }
  }
  return 0;
}

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

namespace AtCoder.Abc
{
    class A_alphabet_171
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            string s = Console.ReadLine();
            char result = s[0];

            if (result >= 'a' && result <= 'z')//Regex.IsMatch(s, "[a-z]"))
            {
                result = 'a';
            }
            else
            {
                result = 'A';
            }



            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 25804
/* 
 * Author: pawanmsr
 */

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

// Macro //
#define X first
#define Y second
#define pii pair<int,int>
#define pll pair<ll,ll>

// Global //
int n, m;

// Functions //

// Main //
int main(int argc, char const *argv[])
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    
    /* code */
    cin >> n >> m;
    int sum = 0;
    vector<int> a(m);
    for(int i=0; i<m; i++) cin >> a[i];
    for(int i=0; i<m; i++) sum+=a[i];
    cout << max(-1, n-sum) << endl;
    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>

using namespace std;
using namespace __gnu_pbds;

#define endl '\n'

typedef long long ll;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int maxn = 2e5 + 5;
const ll mod = 1e9 + 7;

ll f[maxn];

ll mod_exp(ll a, ll b){
	if(b == 0)
		return 1ll;
	if(b % 2 == 0){
		ll t = mod_exp(a, b / 2) % mod;
		return t * t % mod;
	}
	return a * mod_exp(a, b - 1) % mod;
}

ll inv(ll x){
	return mod_exp(x, mod - 2) % mod;
}

ll n_k(int n, int k){
	if(k > n)
		return 0ll;
	ll num = f[n];
	ll den = f[k] * f[n - k] % mod;
	den = inv(den);
	return num * den % mod;
}

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

	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	
	f[0] = 1ll;
	for(int i = 1; i < maxn; i++)
		f[i] = (f[i - 1] * 1ll * i) % mod;
	
	
	int n, k;
	cin >> n >> k;
	
	vector<ll> v(n);
	
	for(int i = 0; i < n; i++)
		cin >> v[i];
	
	sort(v.rbegin(), v.rend());
	
	ll s1 = 0, s2 = 0;
	
	for(int i = 0; i < n; i++){
		
		int rem = n - i - 1;
		ll cnt = n_k(rem, k - 1);
		cnt = (cnt * (v[i] + mod) % mod) % mod;
		s1 = (s1 + cnt) % mod;
		
	}
	
	sort(v.begin(), v.end());
	
	for(int i = 0; i < n; i++){
		
		int rem = n - i - 1;
		ll cnt = n_k(rem, k - 1);
		cnt = (cnt * (v[i] + mod) % mod) % mod;
		s2 = (s2 + cnt) % mod;
		
	}
	
	cout << (s1 + mod - s2) % mod << endl;

	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

#define rep(i,a,b) for(int i=a;i<b;i++)

const int inf = 1001001000;
const int mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int digitsum(int i){
    int t = i;
    int ret = 0;
    while(t){
        ret += t%10;
        t /= 10;
    }
    return ret;
}

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    int ans = 0;
    rep(i,1,n+1){
        int ds = digitsum(i);
        if(a <= ds && ds <= b){
            ans += i;
        }
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define MAX 10000
#define NIL -1

struct Node{
  /*
  p is parent
  l is left
  r is right
  */
  int p, l, r;
};

struct Node T[MAX];
int n;

void preOrder(int );
void inOrder(int );
void postOrder(int );


int main(){
  int i, d, v, l, r;
  scanf("%d", &n);
  for(i = 0 ; i < n ; i++) T[i].p = NIL;

  for( i = 0 ; i < n ; i++){
    scanf("%d", &v);
    scanf("%d", &l);
    scanf("%d", &r);
    T[v].l = l;
    T[v].r = r;
    //親の設定
    if(l != NIL ) T[l].p = v;
    if(r != NIL ) T[r].p = v;
  }
for( i = 0 ; i < n ; i++){
    if( T[i].p == NIL ) d = i;
  }

  printf("Preorder\n");
  preOrder(d);
  printf("\n");
  printf("Inorder\n");
  inOrder(d);
  printf("\n");
  printf("Postorder\n");
  postOrder(d);
  printf("\n");

  return 0;
}


void preOrder(int u){
  if( u == NIL ) return;
  printf(" %d", u);
  preOrder(T[u].l);
  preOrder(T[u].r);
}

void inOrder(int u){
  if( u == NIL) return;
  inOrder(T[u].l);
  printf(" %d", u);
  inOrder(T[u].r);
}

void postOrder(int u){
  if( u == NIL ) return;
  postOrder(T[u].l);
  postOrder(T[u].r);
  printf(" %d", u);
}



Measured memory_bytes: 2092
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    a=sorted([random.randint(0,5) for _ in range(n)])[::-1]
    return n,a

show_flg=False
show_flg=True

n=I()
ans=0
c=[[] for i in range(n)]
for i in range(n):
    a=I()
    for j in range(a):
        x,y=LI()
        x-=1
        c[i].append((x,y))

for bit in range(2**n):
    t=[1 if (bit>>i)&1 else 0 for i in range(n)]
    flg=True    
    for i in range(n):
        if t[i]==1:
            for x,y in c[i]:
                if t[x]!=y:
                    flg=False
    if flg:
        ans=max(ans,sum(t))
    
print(ans)


Measured memory_bytes: 44760
#include<stdio.h>
#include<iostream>
using namespace std;
int main (){
    int a,b,c,d,x;
    string s;
    cin >> a >> b >> c >> d;
    x = (a + b) - (c + d);
    s = ( x > 0) ? "Left" :
        ( x == 0) ? "Balanced" :"Right";
    cout << s << endl;
    return 0;
}


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

int main() {

  string S;
  cin >> S;
  
  if (S.at(0) == S.at(1) && S.at(1) != S.at(2) && S.at(2) == S.at(3)) {
    cout << "Yes" << endl;
  }
  else if (S.at(0) == S.at(2) && S.at(2) != S.at(1) && S.at(1) == S.at(3)) {
    cout << "Yes" << endl;
  }
  else if (S.at(0) == S.at(3) && S.at(0) != S.at(2) && S.at(1) == S.at(2)) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

//def
#define debug(x) cout << #x << ": " << x << '\n'
#define out(x) cout << x << '\n'
#define repeat(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define revrepeat(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define foreach(e, v) for (auto &e : v)
#define all(x) (x).begin(), (x).end()
#define CYES cout << "Yes" << endl
#define CNO cout << "No" << endl
#define SPC(x) cout << fixed << setprecision(x)
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;
typedef vector<vector<ll>> vll;
typedef pair<int, int> P;
constexpr int MOD = 1e9 + 7;
constexpr int INF = __INT_MAX__;               // 2^31 - 1
constexpr long long INFLL = __LONG_LONG_MAX__; // 2^61 - 1
constexpr int MAX_N = 1e5 + 5;
constexpr double PI = acos(-1);

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

    int a, b, c, d;
    cin >> a >> b >> c >> d;

    int cnt = 0;
    while (a > 0 and c > 0) {
        if (cnt % 2 == 0) {
            c -= b;
        } else {
            a -= d;
        }
        cnt++;
    }

    if (cnt % 2 == 0)
        CNO;
    else
        CYES;

    return 0;
}


Measured memory_bytes: 3592
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
using namespace std;

int main(void) {
  int X, n, lon = 0;
  ;
  cin >> X >> n;
  int l[X];
  for (int i = 0; i < X; i++) {
    cin >> l[i];
  }
  sort(l, l + X, greater<int>());
  for (int j = 0; j < n; j++) {
    lon += l[j];
  }
  cout << lon << endl;
  return 0;
}


Measured memory_bytes: 256
S = gets.chomp
T = gets.chomp

t_table = {}
s_table = {}

S.chars.each_with_index do |c, i|
  if t_table[c] && t_table[c] != T[i] || s_table[T[i]] && s_table[T[i]] != c
    puts 'No'
    exit
  end
  t_table[c] = T[i]
  s_table[T[i]] = c
end

puts 'Yes'


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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = (x << 3) + (x << 1) + (c ^ 48), c = nc;
  return x;
  #undef nc
}

typedef long long ll;
const int maxn = 105;
char G[maxn][maxn];
int n, m, dp[maxn][maxn];

int vis[maxn][maxn], path[maxn][maxn], use[maxn][maxn];

int main() {
  cin >> n >> m;
  rep(i, 1, n) {
    scanf("%s", G[i] + 1);
  }
  rep(i, 1, n) rep(j, 1, m) if (i > 1 || j > 1) {
    memset(vis, 0, sizeof vis);
    memset(path, 0, sizeof path);
    memset(use, 0, sizeof use);
    dp[i][j] = 1e9;
    vis[i][j] = G[i][j] == '.';
    path[i][j] = G[i][j] == '#';
    per(p, i, 1) per(q, j, 1) if (vis[p][q]) {
      chkmin(dp[i][j], dp[p][q]);
      if (p > 1 && G[p - 1][q] == '.') vis[p - 1][q] = 1;
      if (q > 1 && G[p][q - 1] == '.') vis[p][q - 1] = 1;
    }
    per(p, i, 1) per(q, j, 1) if (vis[p][q] || path[p][q]) {
      chkmin(dp[i][j], dp[p][q] + 1);
      if (p > 1 && G[p - 1][q] == '#') path[p - 1][q] = 1;
      if (q > 1 && G[p][q - 1] == '#') path[p][q - 1] = 1;
    }
    per(p, i, 1) per(q, j, 1) if (path[p][q] || use[p][q]) {
      chkmin(dp[i][j], dp[p][q] + 1);
      if (p > 1 && G[p - 1][q] == '.') use[p - 1][q] = 1;
      if (q > 1 && G[p][q - 1] == '.') use[p][q - 1] = 1;
    }
  }
  printf("%d\n", dp[n][m]);
  return 0;
}

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

using namespace std;

const long long mx = 1e18;

int main() {
  int n;
  long long ans = 1;
  bool ng = false;
  cin >> n;
  rep(i, n){
    long long a;
    cin >> a;
    if(a == 0){
      cout << 0 << endl;
      return 0;
    }
 
    if(ans > (mx / a)){
      ng = true;
    }
    ans *= a;
  }
  
  if(ng) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}
  

Measured memory_bytes: 3668
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <unordered_map>

using namespace std;

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

typedef long long LL;
typedef vector<int> VI;

int main() {
  int64_t n;
  cin >> n;
  vector<string> s(n);
  unordered_map<string, int64_t> mp;
  for (int64_t i = 0; i < n; i++) {
    cin >> s[i];
    sort(s[i].begin(), s[i].end());
    if (mp.find(s[i]) != mp.end()) {
      mp[s[i]] = mp[s[i]] + 1;
    } else {
      mp.insert(make_pair(s[i], 1));
    }
  }
  int64_t ans = 0;
  for (auto h : mp) {
    ans += h.second * (h.second-1) / 2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 17700
#include <stdio.h>

//#include <iostream>
//#include <vector>
//#include <string.h>

#pragma warning (push)
#pragma warning (disable : 4996)
#pragma warning (disable : 6031)
#define mod 1000000007;

//using namespace std;

int main()
{
    char S[3];

    scanf("%s", S);
    
    if (S[0] == S[1] && S[1] == S[2]) {
        printf("No");
    }
    else {
        printf("Yes");
    }
}

#pragma warning (pop)

Measured memory_bytes: 128
import math
s = input().split()
a = int(s[0])
b = int(s[1])
x = int(s[2])

if x < a*a*b/2.0:
    y = (2*x)/(a*b)
    print(round(90-math.degrees(math.atan(y/b)), 10))
else:
    y = 2*b-((2*x)/(a*a))
    print(round(math.degrees(math.atan(y/a)), 10))

Measured memory_bytes: 3064
#include <vector>
#include <algorithm>
#include <iostream>
#include <chrono>
#include<bitset>
#include<deque>
#include <map>
#include<string>
#define vint vector<int>
#define vint2 vector<vint>
#define vchar vector<char>
#define vchar2 vector<vchar> 
#define vchar3 vector<vchar2> 
#define pr pair<int,int>
#define vpr vector<pr>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
typedef  long long int ll;
using namespace std;
//CHAR_BIT	ビット フィールドではない最小変数のビット数。	8
//SCHAR_MIN	signed char 型変数の最小値。	–128
//SCHAR_MAX	signed char 型変数の最大値。	127
//UCHAR_MAX	unsigned char 型変数の最大値。	255 (0xff)
//CHAR_MIN	char 型変数の最小値。 - 128、 / J オプション使用時は 0
//CHAR_MAX	char 型変数の最大値。	127、 / J オプション使用時は 255
//MB_LEN_MAX	多文字定数の最大バイト数。	5
//SHRT_MIN	short 型変数の最小値。	–32768
//SHRT_MAX	short 型変数の最大値。	32767
//USHRT_MAX	unsigned short 型変数の最大値。	65535 (0xffff)
//INT_MIN	int 型変数の最小値。	–2147483647 – 1
//INT_MAX	int 型変数の最大値。	2147483647
//UINT_MAX	unsigned int 型変数の最大値。	4294967295 (0xffffffff)
//LONG_MIN	long 型変数の最小値。	–2147483647 – 1
//LONG_MAX	long 型変数の最大値。	2147483647
//ULONG_MAX	unsigned long 型変数の最大値。	4294967295 (0xffffffff)


int a[300000];
int main(){
	int n;
	cin >> n;
	//cerr << n << endl;
	string str;
	cin >> str;

	//cerr << str<< endl;
	int tmp=0;
	int ret = 0;
	FOR(i, 0, str.length() - 1){
		if (str[i] == 'W'){ tmp++;  }
		a[i + 1] = tmp;
		cerr << "i:" << i<<"\tc:"<<str[i] << "\ttmp:"<<tmp << endl;
	}
	ret = tmp;
	cerr << ret << endl;
	tmp = 0;
	for (int i = str.length() - 1; i > 0; i--){
		int x=a[i-1];
		if (str[i] == 'E'){ tmp++;  }
		x += tmp;
		ret = min(x, ret);
		cerr << ret << endl;
	}


	cout << ret << endl;
}



Measured memory_bytes: 1796
#include <stdio.h>

int main(void)
{
        int a,b,c,s=0;

        scanf("%d%d%d",&a,&b,&c);

        if(a==b) s++;
        if(a==c) s++;
        if(b==c) s++;

        if(s==1) printf("Yes\n");
        else printf("No\n");
        return 0;
}


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

int main() {
    int n; cin >> n;
    if (n == 1) cout << "1\n0\n";
    else if (n == 2) cout << "2\n0\n11\n";
    else {
        cout << n-1 << endl;
        for (int i = 0; i < n-1; i++) cout << "0" << string(i, '1') << "0\n";
    }
}



Measured memory_bytes: 3156
#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

int main(void){
    int N;
    scanf("%d",&N);

    //A[1]~A[N]にダムの水量を格納する
    int* A;
    NEW(A,N+1);
    for(int i=1;i<=N;i++){
        scanf("%d",&A[i]);
    }

    //B[1]~B[N]に、山の水量を格納する
    int* B;
    NEW(B,N+1);

    //山1には2xだけ降った
    int x=0;
    for(int i=1;i<=N;i++){
        if(i%2==1) x+=A[i];
        else x-=A[i];
    }
    //本当はこうだけど、打ち消されるので省略
    //x=x/2;
    //B[1]=2*x;
    B[1]=x;

    for(int i=2;i<=N;i++){
        B[i]=2*(A[i-1]-B[i-1]/2);
    }

    for(int i=1;i<=N;i++){
        printf("%d ",B[i]);
    }
    printf("\n");

    return 0;
}

Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n];
	for(int i=0; i<n; i++){
		cin>>a[i];
	}
	sort(a, a+n);
	int n2 = a[n/2-1];
	int n1 = a[n/2];
	int dif = n1 - n2;
	cout<<dif<<endl;
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

class A {
    static StreamWriter Out = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    static void Main(string[] args) {
        string S;
        Input(out S);
        string T;
        Input(out T);
        for(int i = 0; i < S.Length; i++) {
            S = S[S.Length - 1] + S.Substring(0, S.Length - 1);
            if(S.Equals(T)) {
                Console.WriteLine("Yes");
                return;
            }
        }
        Console.WriteLine("No");
        Out.Flush();
    }
    static T ChangeT<T>(string s) => (T)Convert.ChangeType(s, typeof(T));
    static void Input<A>(out A a) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
    }
    static void Input<A, B>(out A a, out B b) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
    }
    static void Input<A, B, C>(out A a, out B b, out C c) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
    }
    static void Input<A, B, C, D>(out A a, out B b, out C c, out D d) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
    }
    static void Input<A, B, C, D, E>(out A a, out B b, out C c, out D d, out E e) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
    }
    static void Input<A, B, C, D, E, F>(out A a, out B b, out C c, out D d, out E e, out F f) {
        var words = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries);
        a = ChangeT<A>(words[0]);
        b = ChangeT<B>(words[1]);
        c = ChangeT<C>(words[2]);
        d = ChangeT<D>(words[3]);
        e = ChangeT<E>(words[4]);
        f = ChangeT<F>(words[5]);
    }
    static void InputArray<T>(out T[] array) {
        array = Console.ReadLine().Split(new[] { ' ' }, options: StringSplitOptions.RemoveEmptyEntries).Select(s => ChangeT<T>(s)).ToArray();
    }
    static void Print(string s) => Out.WriteLine(s);
    static void Print(params string[] s) => Out.WriteLine(string.Join(" ", s));
    static void Print<T>(IEnumerable<T> e) => Out.WriteLine(string.Join(" ", e));
}

Measured memory_bytes: 11220
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forN(i, n) for(int i = 0; i <n ; ++i)
#define endl "\n"
#define noob (main)
typedef long long ll;
using namespace  std;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const int N = 2e5 +5 ;
int n,A[25],B[25],C[25];

int noob(){
    fastIO;
    cin>>n;
    for(int i = 1 ; i<=n; i++){
        cin>>A[i];
    }
    for(int i = 1 ; i<=n; i++){
        cin>>B[i];
    }
    for(int i = 1 ; i<n; i++){
        cin>>C[i];
    }
    int ans = 0;
    for(int i = 1 ; i<=n;i++){
        ans+=B[A[i]];
        if(i>1){
            if(A[i]-A[i-1]==1){
                ans+=C[A[i-1]];
            }
        }
    }
    cout<<ans;
}



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

int main() {
  long long A, N;
  cin >> A >> N;
  long long S = 0;
  for (int i = 0; i < N; ++i) {
    long long a; cin >> a; S+= a;
  }
  if (S >= A) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
    

    string s;
    cin >> s;
    ll n = s.length();
    char state = 'X';
    ll memo = 0;
    ll ans = 0;
    for(ll i=n-1;i>=0;i--){
//        cout << "No. " << i+1 << " state: " << state << " memo: " << memo << " score: " << ans << endl;
        if(state == 'X'){
            if(s[i] == 'A'){
                continue;
            }
            else if(s[i] == 'B'){
                state = 'B';
            }else{
                state = 'C';
            }
        }else if(state == 'B'){
            if(s[i] == 'A'){
                ans += memo;
                state = 'B';
            }
            else if(s[i] == 'B'){
                memo = 0;
                state = 'B';
            }else{
                state = 'C';
            }
        }else{
            if(s[i] == 'A'){
                memo = 0;
                state = 'X';
            }
            else if(s[i] == 'B'){
                memo++;
                state = 'B';
            }else{
                memo = 0;
                state = 'C';
            }
        }
    }
    cout << ans << endl;
}

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

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

    vector<int64_t> b(n);
    bool bl = true;
    int64_t ans = 0;
    rep(i,n){
        int64_t ai = a[i];
        int64_t bi = 0;
        while(ai%2 == 0){
            ai /= 2;
            bi++;
        }
        b[i] = bi;
        if(i > 0 && b[i-1] != b[i]){
            bl = false;
            break;
        }
    }
    int64_t lcma = a[n-1];
    if(bl){
        bool bl2 = true;
        rep(i,n-1){
            int64_t ai = a[i]; 
            lcma = ai/__gcd(ai,lcma)*lcma;
            if(lcma > 2*m){
                bl2 = false;
                break;
            }
        }
        if(bl2){
            lcma /= 2;
            ans = (m/lcma+1)/2;
            if(ans < 0) ans = 0;
        }
    }
    cout << ans << endl;
    //cout << lcma << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<string>
#include<vector>
#include<cstdio>
#include<cstring>
#include<map>
#include<set>
#include<fstream>
#include<sstream>
#include<queue>
#include<iterator>
#include<stack>
using namespace std;

int n,q,k;
long long d[100001];
vector<pair<int,int> >g[1000001];
#define inf (long long)1e18
void dfs(int x,int pre){
	for(int i=0;i<g[x].size();i++){
		int to=g[x][i].second,cost=g[x][i].first;
		if(to==pre)continue;
		if(d[to]>d[x]+cost){
			d[to]=d[x]+cost;
			dfs(to,x);
		}
	}
}

int main(){
	cin>>n;
	d[n]=inf;
	for(int i=1;i<n;i++){
		int a,b,c;
		cin>>a>>b>>c;
		d[i]=inf;
		g[a].push_back({c,b});
		g[b].push_back({c,a});
	}
	cin>>q>>k;
	d[k]=0;
	dfs(k,-1);
	for(int i=0;i<q;i++){
		int s,e;
		cin>>s>>e;
		cout<<d[s]+d[e]<<endl;
	}



  return 0;
}


Measured memory_bytes: 35456