akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>


#define rep(i,p,q) for(int i = p;i < q;++i)
#define ll long long

using namespace std;


int main(void) {
	ll n, d;
	cin >> n >> d;
	vector<vector<ll>> point = vector<vector<ll>>(n);
	rep(i, 0, n) {
		rep(j, 0, d) {
			ll x;
			cin >> x;
			point[i].push_back(x);
		}
	}

	vector<ll> dbl = vector<ll>();
	for (int i = 0; i * i < 40 * 40 * 10; i++) {
		dbl.push_back(i* i);
	}

	ll ans = 0;
	rep(i, 0, n) {
		rep(j, i + 1, n) {
			ll length = 0;
			rep(k, 0, d) {
				ll l = point[i][k] - point[j][k];
				length += l * l;
			}
			if (find(dbl.begin(), dbl.end(), length) != dbl.end()) ans++;
		}
	}
	cout << ans << endl;
}


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

#define INF 1 << 29

typedef long long int ll;
using namespace std;
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)

ll n,a,b,c,d;
ll mod = 1e9 + 7;
ll fac[1005];
ll invf[1005];
ll dp[1005][1005];

ll f(ll a,ll x){//a^x
  ll res = 1;
  while(x > 0){
    if(x&1) res = res * a % mod;
    a = a * a % mod;
    x >>= 1;
  }
  return res;
}

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

ll P(ll n, ll r){
  return fac[n] * invf[n-r] % mod;
}

int main(){
  cin >> n>>a>>b>>c>>d;
  fac[0] = 1;
  invf[0] = 1;
  FOR(i,1,n+1){
    fac[i] = i * fac[i-1] % mod;
    invf[i] = inv(fac[i]);
  }

  dp[a-1][0] = 1;
  FOR(i,a,b+1){
    REP(j,n+1){
      dp[i][j] = dp[i-1][j];
      ll inv_fac_i_k = inv(f(fac[i],c));
      FOR(k,c,min(d+1,j/i+1)){
        ll x = k*i;
        dp[i][j] = (dp[i][j] + dp[i-1][j-x] * P(n-j+x,x) % mod * inv_fac_i_k % mod * invf[k] % mod ) % mod;
        inv_fac_i_k = inv_fac_i_k * invf[i] % mod;
      }
    }
  }
  cout << dp[b][n] % mod << endl;
}




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

int main()
{
    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    int count[100007]{0};
    for(int i = 0; i < n - 1; i++){
        count[i + 1] = count[i];
        if(s[i] == 'A'){
            if(s[i + 1] == 'C'){
                count[i + 1]++;
            }
        }
    }
    int l[100007], r[100007];
    for(int i = 0; i < q; i++){
        cin >> l[i] >> r[i];
        l[i]--;
        r[i]--;
        cout << count[r[i]] - count[l[i]] << endl;
    }
}

Measured memory_bytes: 2176
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <numeric>
#include <algorithm>
//#include <iomanip> : 表示桁数

#define pi 3.14159265358979323846
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

//string ans = "Yes";
int ans = 0;
string S;
int main() {
	cin >> S;
	if (S == "SUN") ans = 7;
	else if (S == "MON") ans = 6;
	else if (S == "TUE") ans = 5;
	else if (S == "WED") ans = 4;
	else if (S == "THU") ans = 3;
	else if (S == "FRI") ans = 2;
	else if (S == "SAT") ans = 1;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  char mas[100][101];
  int h,w,i,j,t,loop;
  while(1){
  cin >> h >> w;
  if(h==0 && w==0){
    break;
  }
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      cin >> mas[i][j];
    }
  }
  i=0;
  j=0;
  t=0;
  loop=0;
  while(1){
    t++;
    if(t>10201){
      loop++;
      break;
    }
    if(mas[i][j]=='<'){
      j--;
    }
    else if(mas[i][j]=='^'){
      i--;
    }
    else if(mas[i][j]=='v'){
      i++;
    }
    else if(mas[i][j]=='>'){
      j++;
    }
    if(mas[i][j]=='.'){
      break;
    }
  }
  if(loop!=0){
    cout << "LOOP" << endl;
  }
  else{
  cout << j << " " << i << endl;
  }
  }
  return (0);
}

Measured memory_bytes: 1168
import java.lang.Math.*
fun main(args: Array<String>?): Unit {
    while(true){
        val (r, n) = readLine()!!.trim().split(' ').map(String::toInt)
        if (r == 0 && n == 0) return
        val height = IntArray(41){0}
        repeat(n){
            val (xl, xr, h) = readLine()!!.trim().split(' ').map(String::toInt)
            for (x in xl until xr) {
                height[x + 20] = max(h, height[x + 20])
            }
        }
        var last = Double.MAX_VALUE
        for (x in 0 .. 20) last = min(last, lastTime(x, height[x + 20], r))
        for (x in -20 until 0) last = min(last, lastTime(abs(x + 1), height[x + 20], r))
        println("%.10f".format(last))
    }
}

fun lastTime(distance: Int, height: Int, radius: Int): Double {
    return if (radius <= distance) Double.MAX_VALUE else radius - (sqrt(radius * radius * 1.0 - distance * distance) - height)
}


Measured memory_bytes: 34824
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define LLINF (1LL<<60)
#define INF (1<<30)
#define F first
#define S second
int main(void){
    int masu[105][105]={{0}};
    int n,w,h;
    long long ans=0;
    cin>>w>>h>>n;
    for(int i=0;i<n;i++){
        long long x,y,a;
        cin>>x>>y>>a;
        a--;
        if(a==0LL){
           for(int i=0;i<h;i++){
               for(int j=0;j<x;j++){
                   masu[i][j]=1;
               }
           } 
        }
        if(a==1LL){
            
           for(int i=0;i<h;i++){
               for(int j=x;j<w;j++){
                   masu[i][j]=1;
               }
           } 
        }
        if(a==2LL){
           for(int i=0;i<y;i++){
               for(int j=0;j<w;j++){
                   masu[i][j]=1;
               }
           } 
        }
        if(a==3LL){
           for(int i=y;i<h;i++){
               for(int j=0;j<w;j++){
                   masu[i][j]=1;
               }
           } 
        }
    }
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(masu[i][j]==0) ans++;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
score = sum(b)
for i in range(len(a)-1):
    if a[i]+1 == a[i+1]:
        score += c[a[i]-1]
print(score)


Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(i=0;i<n;i++)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max(a,b)-min(a,b))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1; rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
void initialize(){
  
}
void swap(ll *p,ll *q){
  ll tmp;
  tmp = *p;
  *p = *q;
  *q = tmp;
}
int main(void){
  initialize();
  ll a,b,c,result=0;
  char s[LIMIT1];

  scanf("%lld %lld %lld",&a,&b,&c);
  swap(&a,&b);
  swap(&a,&c);
  printf("%lld %lld %lld",a,b,c);

  return 0;
}



Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;

// Inserted snippets: io, root
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
// End snippets

ll bm(ll b, ll p, ll m) {
	ll r = 1;
	for (; p; p >>= 1, b = b * b % m) if (p & 1) r = r * b % m;
	return r;
}

ll longmod(string s, ll m) {
	ll r = 0;
	for (char c : s) {
		r = (r * 2 + c - '0') % m;
	}
	return r;
}

ll f(ll x) {
	if (x == 0) return 0;
	return 1 + f(x % __builtin_popcountll(x));
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	int n; read(n);
	string s; read(s);
	int bc = count(all(s), '1');

	map<int, int> init;
	for (int i = bc - 1; i <= bc + 1; i++) if (i > 0)
		init[i] = longmod(s, i);

	for (int i = 0; i < n; i++) {
		int c1 = bc - int(s[i] == '1') + int(s[i] == '0');
		int rv = init[c1];
		if (c1 == 0) {
			write(0); continue;
		}
		if (s[i] == '1') {
			// subtract
			rv -= bm(2, n - 1 - i, c1);
		} else {
			rv += bm(2, n - 1 - i, c1);
		}
		rv = (rv % c1 + c1) % c1;
		cout << 1 + f(rv) << endl;
	}
}


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

using namespace std;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

typedef long long  ll;
#define endl '\n'


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


const int MOD = 1000000007;

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

int n;


void Input() {

    cin >> n;
}

void Solve() {


    int l = n / 100;
    int r = n % 100;

    if(l >= 1 && l <= 12) {

        if(r >= 1 && r <= 12) {

            cout << "AMBIGUOUS" << endl;

        }
        else cout << "MMYY" << endl;
    }
    else {

        if(r >= 1 && r <= 12) {

            cout << "YYMM" << endl;
        }
        else cout << "NA" << endl;
    }

}

int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);
  Input();
  Solve();
  return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n;
    cin>>n;
    ll ans=0;
    for(int i=2;i<=sqrt(n);i++)
    {
        ll p = i;
        while(n%p==0)
        {
            n/=p;
            p*=i;
            ans++;
        }
        while(n%i==0)
            n/=i;
    }
    if(n!=1) ans++;
    cout<<ans<<endl;
}

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

int n;
int a[200010];

int partition(int p,int r){
  for(int i = p; i < r; i++){
    if(a[i] <= a[r]) swap(a[p++],a[i]);
  }
  swap(a[p],a[r]);
  return p;
}


signed main(){

  cin >> n;
  for(int i = 0; i < n; i++) cin >> a[i];

  int p = partition(0,n-1);
  for(int i = 0; i < n; i++){
    if(i) cout << " ";
    if(i == p) cout << "[" << a[i] << "]";
    else cout << a[i];
  }
  cout << endl;

  return 0;
}



Measured memory_bytes: 3412
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  vector<long long> a(n+1),b(n);
  for(int i = 0; i < n+1; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    cin >> b[i];
  }
  long long monster = 0;
  for(int i = 0; i < n; i++){
    if(a[i] + a[i+1] <= b[i]){//オーバーキル                                    
      monster += (a[i]+a[i+1]);
      a[i+1] = 0;
    }
 
    else if(a[i] <= b[i]){//i番目のモンスターを全滅させる                       
      monster += b[i];
      a[i+1] -= b[i] - a[i];
    }
 
    else{
      monster += b[i];
    }
  }
    cout << monster << endl;
    return 0;
}

Measured memory_bytes: 1792
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.PriorityQueue;

public class Main{
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(isr);
		String string;
		int n, point, flag = 0;
		
		while(!(string = reader.readLine()).equals("0")){
			if(flag == 0) flag = 1;
			else System.out.println();
			PriorityQueue<Pair> que = new PriorityQueue<Pair>();
			n = Integer.valueOf(string);
			
			for(int i = 0; i < n; i++){
				string = reader.readLine();
				point = Integer.valueOf(string.split(" ")[1]) * 3 + 
						Integer.valueOf(string.split(" ")[3]);
				que.add(new Pair(i, point, string.split(" ")[0]));
			}
			while(!que.isEmpty()){
				Pair pair = que.poll();
				System.out.println(pair.b + "," + pair.a);
			}
		}
		reader.close();
	}
}

class Pair implements Comparable<Pair>{
	int f;
	int a;
	String b;
	Pair(int f, int a, String b){
		this.f = f;
		this.a = a;
		this.b = b;
	}
	@Override
	public int compareTo(Pair o) {
		return a == o.a ? f - o.f : o.a - a;
	}
}

Measured memory_bytes: 24504
#include<bits/stdc++.h>
using namespace std;
typedef vector <int> vi;
typedef set <int> se;
#define endl "\n"
#define for(i,a,b) for(auto i = a;i<b;i++)
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define ll long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int MOD = 1e9+7;
ll mod(ll x){
return ((x%MOD+MOD)%MOD);
}
ll add(ll a,ll b){
return mod(mod(a)+mod(b));
}
ll mul(ll a,ll b){
return mod(mod(a)*mod(b));
}
ll sub(ll a,ll b){
return mod(mod(a)-mod(b));
}

ll dp[2001];

int rec(ll s){
    if(s==0) return 1ll;
    if(s==1 or s==2) return 0ll;
    if(s>=3 and s<=5) return 1ll;
    if(dp[s]!=-1) return dp[s];
    ll total = 0;
    for(i,3,s+1)
        if(s-i>=0) 
            total = add(total,rec(s-i));
    return dp[s] = total;
    
}

void solve(){
ll n;
cin>>n;
memset(dp,-1,sizeof(dp));
dp[0] = 1;
cout<<rec(n)<<endl;

}
 
 
int main()
{

solve();
 
return 0;
}


Measured memory_bytes: 3644
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
3 4
...#
.#..
....
---+/
/+---test
5 2
..
#.
..
.#
..
---+/
/+---test
5 5
..#..
.....
#...#
.....
..#..
---+/
/+---test
20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
---+/

enum MOD = 1000000007;

void main(string[] args) {
  long H, W;
  readf(" %d %d ", &H, &W);

  auto empty = new bool[][](H);
  foreach (ref row; empty) {
    row = readln.chomp.map!(c => c == '.').array;
  }

  auto dp = new long[][](H, W);
  dp[0][0] = 1;
  foreach (y; 0..H) foreach (x; 0..W) {
    if (!empty[y][x]) continue;

    if (y) dp[y][x] = (dp[y][x] + dp[y-1][x])%MOD;
    if (x) dp[y][x] = (dp[y][x] + dp[y][x-1])%MOD;
  }
  dp[$-1][$-1].writeln;
}


Measured memory_bytes: 13948
// ------------------------------------
// Date:2018/ 3/15
// Problem:ARC 062 AtCoderAndRockPaper d.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int INF = 1000000001;
static const int MAX_N = 101010;

string s;
int N;
// dp[num]
int memo[MAX_N];

void solve(int pCnt, int num)
{
  if (num == N) return;
  if (num == 0) {
    if (s[num] == 'p') {
      memo[num] = -1;
    } else {
      memo[num] = 0;
    }
    solve(0, 1);
  } else {
    if (s[num] == 'p') {
      if (pCnt ==  num - pCnt) {
	// グーしか出せない
	memo[num + 1] = memo[num] - 1;
      } else {
	memo[num + 1] = max(memo[num], memo[num] - 1);
	if (memo[num + 1] == memo[num]) pCnt++;
      }
    } else {
      if (pCnt == num - pCnt) {
	// グーしか出せない
	memo[num + 1] = memo[num];
      } else {
	memo[num + 1] = max(memo[num], memo[num] + 1);
	if (memo[num + 1] == memo[num] + 1) pCnt++;
      }
    }
    solve(pCnt, num + 1);
  }
}

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

  fill_n(memo, MAX_N, 0);
  cin >> s;
  N = s.size();

  solve(0, 0);
  int ans = memo[N];
  /*
  REP(i, N + 1) {
    printf("memo[%d] = %d\n", i, memo[i]);
  }
  */
  cout << ans << endl;
  
  return 0;
}



Measured memory_bytes: 896
s=list(input())
q=int(input())
sc=0
lhs=[]
rhs=[]
for _ in range(q):
  query=input()
  if query=="1":
    sc+=1
  else:
    t,f,c=query.split()
    if f=="1":
      if sc%2==0:
        lhs.append(c)
      else:
        rhs.append(c)
    else:
      if sc%2==0:
        rhs.append(c)
      else:
        lhs.append(c)

lhs.reverse()
s=lhs+s+rhs
if sc%2!=0:
  s.reverse()
print("".join(s))

Measured memory_bytes: 9892
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
void pr(){ln;}
template<Z A,Z...B>void pr(const A &a,const B&...b){cout<<a<<' ';pr(b...);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll a,b,k;
  cin >> k >> a >> b;
  REP(i,a,b+1) {
    if(i%k==0) {
      pr("OK");
      return;
    }
  }
  pr("NG");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;cin >> n >> m;
  vector<int> p(n);
  vector<bool> b(n);
  for(int i=0;i<m;i++){
    int a;
    string s;
    cin >> a >> s;
    a--;
    if(!b[a]){
      if(s=="WA"){
        p[a]++;
      }
      else{
        b[a]=true;
      }
    }
  }
  int ac=0,wa=0;
  for(int i=0;i<n;i++){
    if(b[i]){
      ac++;
      wa+=p[i];
    }
  }
  cout << ac << " " << wa << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std ;
int main()
{
   long long a , b , c , d , result ,result1 , result2 , result3 ;
   cin>>a>>b>>c>>d ;
   result = a * c ;
   result1 =  a * d ;
   result2 = b * c ;
   result3 = b *d ;
   if(result>=result1 && result>=result2 && result>=result3)
   {
      cout<<result<<endl ;
   }
   else if(result1>=result && result1>=result2 && result1>=result3)
   {
       cout<<result1<<endl ;
   }
   else if(result2>=result && result2>=result1 && result2>=result3)
   {
       cout<<result2<<endl ;
   }
   else if(result3>=result && result3>=result1 && result3>=result2)
   {
       cout<<result3<<endl ;
   }




   return 0 ;
}


Measured memory_bytes: 3616
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
const int N = (int)(1e6) + 5;
int ans[N];
int n;
int f(int k)
{
    k %= n;
    if (ans[k] != -1)
        return ans[k];
    cout << k << '\n';
    fflush(stdout);
    string how = "";
    cin>>how;
    if (how == "Vacant") exit(0);
    if (how == "Male")
        ans[k] = 0;
    else
        ans[k] = 1;
    return ans[k];
}
int main(void)
{
    cin>>n;
    memset(ans,-1,sizeof(ans));
    int answer = 0;
    for (int k = 1 << 20;k > 1;k /= 2)
        if (answer + k < n && f(answer + k) == f(answer))
            answer += k;
    cout << ((++answer) % n) << '\n';
    return 0;
}


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

int main()
{
  int N;
  cin >> N;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++)
  {
    cin >> A.at(i);
  }
  sort(A.begin(), A.end());
  long long int ans = 1;
  for (int i = 0; i < N; i++)
  {
    int64_t a = A.at(i), prev = ans;
    ans = prev * a;
    if (ans > 1000000000000000000 || __builtin_smulll_overflow(prev, a, &ans))
    {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 4028
#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d",&a,&b);
c=2*b+1;
  if(a%c==0){
  printf("%d",a/c);
  }
  
  
else{
d=a/c+1;
  printf("%d",d);}
return 0;
}

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

int my(int x) {
  for(int i = 0; i < 13; i++) {
     if((i * 10) + 1 <= x && x <= (i + 1) * 10) {
      return (i + 1) * 10;
       break;
     }
   }
}
 int main() {
 vector<int> vec(5);
   for(int i = 0; i < 5; i++) {
   cin >> vec.at(i);
   }
   
  int last = 100;
   int key;
   int res;
   if(vec.at(0) % 10 == 0 && vec.at(1) % 10 == 0 && vec.at(2) % 10 == 0 && vec.at(3) % 10 == 0 && vec.at(4) % 10 == 0) {
     res = vec.at(0) + vec.at(1) + vec.at(2) + vec.at(3) + vec.at(4);
   }
   else {
   for(int i = 0; i < 5; i++) {
   if(vec.at(i) % 10 != 0 && vec.at(i) % 10 < last) {
     last = vec.at(i) % 10;
       key = vec.at(i);
   }
   }
   
   res =  my(vec.at(0)) + my(vec.at(1)) + my(vec.at(2)) + my(vec.at(3)) + my(vec.at(4)) + key - my(key);
   }
   
   cout << res << endl;
   return 0;
 }
   
  

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

namespace AOJ
{
	class Program
	{
		static void Main(string[] args)
		{
			var s = Console.ReadLine();
			s = s.Split(new char[] { ' ', ',', '.' })
				.Where(w => (3 <= w.Length && w.Length <= 6))
				.Aggregate((r, t) => r += (" " + t));
			Console.WriteLine(s);
		}
	}
}

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

class MyClass
{
    public static void Main(string[] args)
    {
        var N = int.Parse(Console.ReadLine());
        var num = new int[N, 3];
        for (int i = 0; i < N; i++)
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            for (int j = 0; j < 3; j++)
            {
                num[i, j] = input[j];
            }
        }
        for (int k = 0; k < 3; k++)
        {
            var zero = new HashSet<int>();
            for (int i = 0; i < N; i++)
            {
                for (int j = i + 1; j < N; j++)
                {
                    if (num[i,k] == num[j,k])
                    {
                        zero.Add(i);
                        zero.Add(j);
                    }
                }
            }
            foreach (var item in zero)
            {
                num[item, k] = 0;
            }
        }
        for (int i = 0; i < N; i++)
        {
            var sum = 0;
            for (int j = 0; j < 3; j++)
            {
                sum += num[i, j];
            }
            Console.WriteLine(sum);
        }
    }
}


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

//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
typedef pair<int, int> P;
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = (1ll << 31) - 1;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
//typedef pair<int, int> P;
//typedef pair<double, double> P;

bool contain(set<string> &s, string a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
const int mod = 1000000007;
typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;

struct S {
    char direction;
    ll prev;
};

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

    stack<S> s;
    rep(i, n) {
        ll a;
        cin >> a;

        if (i == 0) {
            s.push({'n', a});
            continue;
        }

        if (s.top().direction == 'n') {
            if (s.top().prev < a) {
                s.top().direction = 'u';
                s.top().prev = a;
            } else if (s.top().prev > a) {
                s.top().direction = 'd';
                s.top().prev = a;
            }
            continue;
        }

        if (s.top().direction == 'u' && s.top().prev <= a) {
            s.top().prev = a;

            continue;
        }
        if (s.top().direction == 'd' && s.top().prev >= a) {
            s.top().prev = a;

            continue;
        }

        s.push({'n', a});

    }

    cout << s.size() << endl;


}




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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

// union find
struct unionFind{
    private:
        Vi data;
    public:
        unionFind(int size) : data(size,-1){}
        bool unionSet(int x,int y){
            x=root(x);y=root(y);
            if(x!=y){
                if(data[y]<data[x]){swap(x,y);}
                data[x]+=data[y]; data[y]=x;
            }
            return x!=y;
        }
        bool findSet(int x,int y){ return root(x)==root(y);}
        int root(int x){return ((data[x]<0)?x:(data[x]=root(data[x])));}
        int size(int x){return -data[root(x)];}
};

int main(){
    LL n,m;
    cin>>n>>m;

    Vi a(m),b(m);
    REP(i,m) cin>>a[i]>>b[i];

    Vll huben(m+1);
    huben[m] = n*(n-1)/2;
    unionFind island(n+1);
    REPD(i,m-1){
        if(island.findSet(a[i],b[i])){
            huben[i] = huben[i+1];
        }else{
            huben[i] = huben[i+1] - island.size(a[i]) * island.size(b[i]);
        }
        island.unionSet(a[i],b[i]);
    }

    REP(i,m){
        cout<<huben[i+1]<<endl;
    }

    return 0;
}

Measured memory_bytes: 3328
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
#include<stdio.h>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#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)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}

int main(){
    LL N;
    cin >> N;
    LL A[N];
    REP(i,N) cin >> A[i];
    bool exist=true;
    for(int i=N-2;i>=0;--i){
        if(A[i]>A[i+1]){
            A[i]--;
        }
    }
    
    for(int i=0;i<N-1;++i){
        if(A[i]>A[i+1]){
            exist=false;
            break;
        }
    }
    if(exist) cout << "Yes";
    else cout << "No";
        }

Measured memory_bytes: 1152
#include <iostream>

using namespace std;

const int N = 1e5 + 7;

int v[N], d[N];

int abs(int val) {
    return max(val, -val);
}

int main()
{
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; ++i)
        cin >> v[i];
    d[0] = 0;
    for (int i = 1; i < n; ++i) {
        d[i] = 1e9 + 7;
        for (int j = i; j >= 0 && i - j <= k; --j)
            d[i] = min(d[i], d[j] + abs(v[i] - v[j]));
    }
    cout << d[n - 1];
    return 0;
}


Measured memory_bytes: 1024
<?php


fscanf(STDIN, "%d", $n);

$monster = explode(" ", trim(fgets(STDIN)));

$hero = explode(" ", trim(fgets(STDIN)));

$hero_rest = 0;
$sum = 0;
for($i=$n;$i>0;$i--) {
    if ($hero_rest < $monster[$i]) {
        $sum += $hero_rest;
        $monster[$i] -= $hero_rest;
    } else {
        $sum += $monster[$i];
        $monster[$i] = 0;
    }

    $hero_rest = $hero[$i - 1];
    if ($hero_rest < $monster[$i]) {
        $sum += $hero_rest;
        $hero_rest = 0;
    } else {
        $sum += $monster[$i];
        $hero_rest = $hero_rest - $monster[$i];
    }
}

if ($hero_rest < $monster[0]) {
    $sum += $hero_rest;
} else {
    $sum += $monster[0];
}
echo $sum;

Measured memory_bytes: 20980
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,i,j;
	cin>>n>>k;
	int h[n];
	for (i=0;i<n;i++)
	cin>>h[i];
	int dp[n];
	dp[0]=0;
	for (i=1;i<n;i++)
	{
		int ans=INT_MAX;
		for (j=i-1;j>=i-k&&j>=0;j--)
		{
			ans=min(ans,dp[j]+abs(h[j]-h[i]));
		}
		dp[i]=ans;
	}
	cout<<dp[n-1];
}

Measured memory_bytes: 1024
P,L="+<"
p=print
r=range
p(6484,P,0,1,3,L,2,3,3)
for x in 0,1:
	p(P,x,3,x)
	for t in r(30):p(P,v:=x+4,v,v,P,v,3,6,*[P,6,6,6]*(29-t),L,6,x,T:=x*60+9+t,P,v,T,v)
for t in r(60):p(P,2,2,2);[p(P,8+t-s,69+s,5,L,3,5,6,P,2,6,2)for s in r(t)]

Measured memory_bytes: 9200
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using namespace std;

mp::cpp_int gcd(mp::cpp_int x, mp::cpp_int y)
{
    mp::cpp_int r;
    while((r = x % y) != 0) { x = y; y = r; }
    return y;
}

mp::cpp_int lcm(mp::cpp_int x, mp::cpp_int y) { return (x * y / gcd(x, y)); }

int main() {
    int N;
    cin >> N;
    mp::cpp_int number[N];
    for (int i = 0; i < N; ++i) {
        cin >> number[i];
    }
    mp::cpp_int ans = number[0];
    for (int i = 1; i < N; ++i) {
        ans = lcm(ans, number[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#include <sstream>
#include <string>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
using namespace std;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=100001;
bool vis[N];
vector <int> adj[N];
ll gcd(ll a, ll b) { if (a == 0) return b; return gcd(b % a, a); } 
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
// ll binaryNum[8];
// void decToBinary(ll n) 
// { 
//     // binaryNum[8];
//     rep(i,8){
//         binaryNum[i]=0;
//     }
//     int i = 0; 
//     while (n > 0) { 
//         binaryNum[i] = n % 2; 
//         n = n / 2; 
//         i++; 
//     } 
// } 
vl cnt;
vi prnt;
void dfs(ll u, ll parent){
    // vis[u]=true;
    ll a=0;
    if(adj[u].size()==1){
        // cout<<u<<' ';
        cnt[u]=1;
    }
    // cout<<u<<' ';
    for(int v:adj[u]){
        if(v!=parent){
            a++;
            prnt[v]=u;
            dfs(v, u);
            // cnt[u]+=cnt[v];
        }
    }
    if(u!=1){
        cnt[parent]+=cnt[u];
    }

}

void solve(){
    ll n;
    cin>>n;
    vl a(n);
    rep(i,n){
        cin>>a[i];
    }
    ll maxi = a[0];
    ll ans=0;
    loop(i,1,n-1){
        if(a[i]<maxi){
            ans += maxi-a[i];
        }
        else{
            maxi=a[i];
        }
    }
    cout<<ans<<'\n';


}


int main()
{
    // cout<<1<<endl;
    #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
    
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    // cin>>T;
    int t=0;
    while(t++<T)
    {
        // cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 7160
import kotlin.math.*

fun main() {
    val x = readLine()!!.split(" ").map { it.toInt() }
    val L = x[0]
    val R = x[1]
    val d = x[2]
    var ans=0
    for (i in L..R){
        if(i%d == 0){
            ans++
        }
    }
    print(ans)
}

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

int main() {
    long long n, m, q;
    std::cin >> n >> m >> q;
    
    std::vector<std::vector<long long>> b(n+2, std::vector<long long>(n+2)), ret(n+2, std::vector<long long>(n+2));
    std::vector<long long> r(n+2), c(n+2);
    for (auto i = 0; i < m; i++) {
        long long from, to;
        std::cin >> from >> to;
        b[from][to]++;
        r[from]++;
        c[to]++;
    }

    ret[1][n] = m;
    for (auto i = 2ll; i <= n; i++) {
        ret[i][n] = ret[i - 1][n] - r[i - 1];
    }
    for (auto j = n - 1; j >= 1; j--) {
        ret[1][j] = ret[1][j + 1] - c[j + 1];
    }

    for (auto i = 2ll; i <= n; i++) {
        for (auto j = n - 1; j >= i; j--) {
            ret[i][j] = ret[i - 1][j] + ret[i][j + 1] + b[i - 1][j + 1] - ret[i - 1][j + 1];
        }
    }

    for (; q--;) {
        long long from, to;
        std::cin >> from >> to;
        std::cout << ret[from][to] << std::endl;
    }

    return 0;
}

Measured memory_bytes: 4864
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

map <ll,int> p;
ll a[maxn],n,ans;

int main()
{
	n=read(); rep(i,1,n) a[i]=read(),p[a[i]]++; sort(a+1,a+n+1);
	per(i,n,1)
	{
		if(!p[a[i]]) continue;
		for(int x=31;x>=0;x--)
		{
			ll tmp=1ll<<x; tmp-=a[i]; if(tmp<=0) break;
			if(tmp==a[i]&&p[tmp]>=2) p[tmp]-=2,ans++;
			else if(tmp!=a[i]&&p[tmp]) p[tmp]--,p[a[i]]--,ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}


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

int main()
{
    vector<long long> ans(90);
    int n;
    cin >> n;
    ans[0] = 2;
    ans[1] = 1;

    for (int i = 2; i <= n; i++)
    {
        ans[i] = ans[i - 1] + ans[i - 2];
    }

    cout << ans[n] << endl;
}


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

using namespace std;


int main(void){
    string S,T;

    cin>>S;
    cin>>T;

    if(T.size()-S.size() == 1 && T.substr(0,T.size()-1) == S){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }




    return 0;
}



Measured memory_bytes: 3628
N = gets.to_i
A = gets.split.map &:to_i

a = A.group_by {|i| i }.map {|i, a| [i, a.size] }.to_h

puts(a.map {|i, n|
  if n>=i
    n-i
  else
    n
  end
}.inject(&:+))


Measured memory_bytes: 30340
#include <iostream>
#include <vector>
#include <cstdlib>

using namespace std;

//コスト最小化
const long long INF = 1LL << 60;
long long dp[100010];

//change minimum
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; }

int main(){
    int n,k; cin >> n >> k;
    int h[n];
    for(int i = 0; i < n; i++) cin >> h[i];
    for(int i = 0; i < 100010; i++) dp[i] = INF;
    dp[0] = 0;
    for(int i = 0; i < n; i++){
        for(int j = 1; j <= k; j++){
            if( i + j >= n ) break;
            chmin(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
        }
    }
    cout << dp[n-1] << endl;

    return 0;
}

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

struct BipartiteMatching {
    int n, timestamp;
    vector<vector<int>> graph;
    vector<int> alive, used, match;
    BipartiteMatching(int n) : \
        n(n), timestamp(0), graph(n), alive(n, 1), used(n, 0), match(n, -1) { }
    void add_edge(int u, int v) {
        graph[u].emplace_back(v);
        graph[v].emplace_back(u);
    }
    bool dfs(int idx) {
        used[idx] = timestamp;
        for (int to: graph[idx]) if (alive[to]) {
            int to_match = match[to];
            if (to_match == -1 || (used[to_match] != timestamp && dfs(to_match))) {
                match[idx] = to;
                match[to] = idx;
                return true;
            }
        }
        return false;
    }
    int bipartite_matching() {
        int ret = 0;
        for (int i = 0; i < n; i++) if (alive[i]) {
            if (match[i] == -1) ++timestamp, ret += dfs(i);
        }
        return ret;
    }
    friend ostream& operator<<(ostream& os, BipartiteMatching& bm) {
        for (int i = 0; i < bm.n; i++) if (i < bm.match[i]) {
            os << i << " - " << bm.match[i] << endl;
        }
        return os;
    }
};

int main() {
    int n; cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    vector<int> c(n), d(n);
    for (int i = 0; i < n; i++) cin >> c[i] >> d[i];
    BipartiteMatching bm(n + n);
    for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) {
        if (a[i] < c[j] && b[i] < d[j]) bm.add_edge(i, j + n);
    }
    cout << bm.bipartite_matching() << endl;
    return 0;
}

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

int main()
{
    int s1,s2,s3;
      int a;
    cin>>a;
    s1=a/100%10;
    s2=a/10%10;
    s3=a/1%10;
    std::cout << s1+s2+s3 << std::endl;
    
}


Measured memory_bytes: 3608
#include <cstdio>
#include <cctype>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

#define ll long long
#define reg register
#define rep(i, a, b) for (reg int i = (a), i##end = (b); i <= i##end; ++i)
#define dep(i, a, b) for (reg int i = (a), i##end = (b); i >= i##end; --i)

template <typename _typer> inline _typer read() {
	_typer init = 0;
	char ch = getchar(), k = 0;
	for ( ; !isdigit(ch); ch = getchar()) k = (ch == '-');
	for ( ; isdigit(ch); ch = getchar()) init = (init << 3) + (init << 1) + (ch ^ 48);
	return k ? -init : init;
}
const ll N = 100005, INF = 1e9;

/*******************************************************************************
 *
 *
 *
 ******************************************************************************/

int n, A[N];

int main() {
	n = read<int>();
	rep (i, 1, n) A[i] = read<int>();
	sort(A + 1, A + n + 1);
	if (n & 1) {
		puts("0");
		return 0;
	}
	int cur = n / 2;
	int Ans = A[cur + 1] - A[cur];
	cout << Ans << endl;
	return 0;
}



Measured memory_bytes: 640
#include<iostream>
#include <numeric>
using namespace std;
int gcd(int x,int y);  /* 最大公約数を宣言 */

int main(){
	int x, y, ans,  MaxDivisor;
	cin >> x >> y;

	MaxDivisor = gcd(x, y);  /* 最大公約数を求める */
	ans = x + y - (MaxDivisor - 1);

	cout << ans << endl;

	return 0;
}

int gcd(int x, int y){
	int r;
	if(x<y) swap(x,y);
	r = x % y;
	while(r!=0){
		x = y;
		y = r;
		r = x % y;
  }
  return y;
}



Measured memory_bytes: 3124
#include<bits/stdc++.h>
#define endl '\n'
#define INF (1 << 21)
typedef long long ll;
const int MOD = 1000000007;
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int ans = INF;
  int num;
  cin >> s;

  for(int i = 0;i < s.size() - 2;i++){
    string x;
    x += s[i]; x += s[i + 1]; x += s[i + 2];
    num = atoi(x.c_str());
    ans = min(ans, abs(753 - num));
  }

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



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define ss second
#define ff first
#define Mem(x,val) memset(x,val,sizeof x)
#define pb push_back
#define all(v) v.begin(),v.end()
#define unik(v)  v.erase(unique(v.begin(),v.end()),v.end())
#define cerr(x) cerr << __LINE__ << " th Line : " << #x << " = " << x << "\n"
using namespace std;
typedef pair<int, int> pii;
const ll mod = 998244353;
const int sz = 2*1e6 + 10, inf = 1e9 + 10;

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

	string s;
	cin>>s;
	for(char ch:s)
	{
		if(ch=='7')
		{
			puts("Yes");
			return 0;
		}
	}
	puts("No");

	return 0;
}

Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s;
		s = sc.next();
		sc.close();
		StringBuffer ans = new StringBuffer();
		for(int i = 0; i < s.length(); ++i) {
			if(i % 2 == 0)ans.append(s.charAt(i));
		}
		
		System.out.println(ans);
	}

}


Measured memory_bytes: 25632
#include <stdio.h>
#include <string.h>
char s[105];
int main() {
	int i;
	scanf("%s", s);

	int n = strlen(s);
	bool c = false;
	for (i = 0; i < n; i++) {
		if (s[i] == 'C')
			c = true;
		if (c)
			if (s[i] == 'F') {
				printf("Yes");
				return 0;
			}
	}
	printf("No");
	return 0;
}

Measured memory_bytes: 256
import collections

N = int(input())

word_list = []
for i in range(N):
    S = list(input())
    c = collections.Counter(sorted(S))
    count = c.values()
    words = c.keys()
    word_list.append(''.join(words)+str(count))

ans_dict = collections.Counter(word_list)
ans_count = list(ans_dict.values())
temp = [i for i in ans_count if i>1]
ans = int(sum([t*(t-1)/2 for t in temp]))
print(ans)

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

namespace AOJHelloWorld1
{
    class Program
    {
        static void Main(string[] args)
        {
            double r = double.Parse(Console.ReadLine());//円の半径
            double π = Math.PI;//円周率
            double S = r * r * π;//円の面積
            double L = 2 * r * π;//円の周

            Console.WriteLine(S+" "+L);
        }
    }
}



Measured memory_bytes: 17924
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<cctype>
#include<iomanip>
#include<limits>
#include<bitset>

using namespace std;
typedef long long int ll; typedef pair<int, int> P;
const ll mod = 1e9 + 7;
const int inf = 1e9 + 7;
const ll linf = 1LL << 60;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define REP(i,m,n) for(int i=(m);i<(int)n;i++)
#define all(a) (a).begin(),(a).end()
#define allg(a) (a).begin(),(a).end(),greater<>()
#define SUM(a) accumulate((a).begin(),(a).end(),0)
#define d10 std::setprecision(10)
#define d20 std::setprecision(20)
#define sz size()
using str = string;
const double PI = 3.14159265359;
ll gcd(ll a, ll b) { ll t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
int gcd(int a, int b) { int t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
ll recfact(ll start, ll n) {
	ll i;
	if (n <= 16) {
		ll r = start;
		for (i = start + 1; i < start + n; i++) r = r * i % mod;
		return r % mod;
	}
	i = n / 2;
	return recfact(start, i) % mod * recfact(start + i, n - i) % mod;
}
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}
ll fct(ll n) { return recfact(1, n); }
ll ncm(ll n, ll m) {
	if (n < m)return 0;
	ll x = (fct(n) % mod / (fct(m) * fct(n - m)) % mod) % mod;
	return x;
}
bool isincluded(char x, string str) {
	bool f = 0;
	for (size_t i = 0; i < str.size(); i++) {
		if (str.at(i) == x)f = 1;
	}
	return f;
}
int ctoi(char c) {
	if ('0' <= c && c <= '9') {
		return c - '0';
	}
	return 0;
}




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

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

int main(void){
  map<string, bool> dict;
  int n;
  
  cin >> n;
  for (int i = 0; i < n; i++) {
    char com[13], str[10];
    scanf("%s %s", com, str);
    if (com[0] == 'i') {
      dict[string(str)] = true;
    } else {
      if (dict[string(str)]) printf("yes\n");
      else printf("no\n");
    }
  }
  
  return 0;
}

Measured memory_bytes: 45492
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
int k = sc.nextInt();
int ans=0;
if(k%2==1){
    ans=k/2*(k/2+1);
}else{
    ans=k*k/4;
}
    out.println(ans);
}}

Measured memory_bytes: 22740