akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int map[2020][2020];
int a[1005],b[1005],c[1005],d[1005];
typedef struct p{
	int x,y;
}P;
P q[8080],sq[8080],cp;
int qn,sqn;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int comp(const void *p,const void *q){
	return *(int *)p-*(int *)q;
}
int compress(int *v1,int *v2,int n){
	int i,j,k,nv[2020];
	int f[2][1010];
	for(i=0;i<n;i++){
		nv[i]  =v1[i];
		nv[i+n]=v2[i];
	}
	qsort(nv,n*2,sizeof(int),comp);
	k=n*2;
	for(i=0;i<k-1;){
		if(nv[i]==nv[i+1]){
			for(j=i+1;j<k-1;j++)
				nv[j]=nv[j+1];
			k--;
		}else{
			i++;
		}
	}
	//for(i=0;i<k;i++)printf("%2d:%d\n",i,nv[i]);
	memset(f,0,sizeof(f));
	for(i=0;i<k;i++){
		for(j=0;j<n;j++){
			if(v1[j]==nv[i] && f[0][j]==0){
				v1[j]=i+1;
				f[0][j]=1;
			}
			if(v2[j]==nv[i] && f[1][j]==0){
				v2[j]=i+1;
				f[1][j]=1;
			}
		}
	}
	return k;
}

int main(){
	int i,j,k,s,t,w,h,n,ans;
	while(1){
		scanf("%d%d",&w,&h);
		if(w==0)break;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d%d%d%d",&a[i],&b[i],&c[i],&d[i]);
			a[i]++;b[i]++;c[i]++;d[i]++;
		}
		a[n]=1;b[n]=1;c[n]=w+1;d[n]=h+1;
		n++;
		w=compress(a,c,n);
		h=compress(b,d,n);
		w++;h++;
		memset(map,0,sizeof(map));
		for(i=0;i<w;i++)map[0][i]=map[h-1][i]=1;
		for(i=0;i<h;i++)map[i][0]=map[i][w-1]=1;
		//printf("n:%d\n",n);
		for(i=0;i<n-1;i++){
			//printf("%d %d %d %d\n",a[i],b[i],c[i],d[i]);
			for(k=b[i];k<d[i];k++){
				for(j=a[i];j<c[i];j++){
					map[k][j]=1;
					//printf("(%d %d)\n",j,k);
				}
			}
		}
		//for(i=0;i<h;i++)for(j=0;j<w;j++)printf("%d%s",map[i][j],(j==w-1)?"\n":"");
		ans=0;
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if(map[i][j]==0){
					q[0]=(P){j,i};
					map[i][j]=1;
					qn=1;
					ans++;
					while(qn!=0){
						sqn=0;
						for(s=0;s<qn;s++){
							for(t=0;t<4;t++){
								cp=(P){q[s].x+dx[t],q[s].y+dy[t]};
								if(map[cp.y][cp.x]==0){
									sq[sqn++]=cp;
									map[cp.y][cp.x]=1;
								}
							}
						}
						memcpy(q,sq,sizeof(P)*sqn);
						qn=sqn;
					}
				}
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

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

#define y1 as214
#define ii pair < int , int >
#define iii pair < int , ii >
#define iv pair < ii , ii >

#define fi first
#define se second
#define fr front()
#define pb push_back
#define t top()

#define FOR(i , x , n) for(int i = x ; i <= n ; ++i)
#define REP(i , n) for(int i = 0 ; i < n ; ++i)
#define FORD(i , x , n) for(int i = x ; i >= n ; --i)

#define ll long long
#define oo 1e17
#define int long long

const int N = 22;
int n , mod = 1e9 + 7;
int a[N][N] , dp[N][(1 << N)];
vector < int > g[N];

main()
{
    //freopen("O.inp","r",stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    FOR(i , 1 , n)
        FOR(j , 1 , n)
            cin >> a[i][j];
    FOR(i , 1 , n)
        if(a[1][i] == 1)
            dp[1][(1 << (i - 1))] = 1;
    REP(j , (1 << n))
    {
        int cnt = 0;
        REP(k , n)
            if((j >> k) & 1 == 1)
                cnt++;
        g[cnt].pb(j);
    }
    FOR(i , 2 , n)
    {
        REP(s , g[i].size())
        {
            int j = g[i][s];
            REP(k , n)
                if(((j >> k) & 1) == 1 && a[i][k + 1] == 1)
                    dp[i][j] = (dp[i][j] + dp[i - 1][j ^ (1 << k)]) % mod;
        }
    }
    cout << dp[n][(1 << n) - 1];
}


Measured memory_bytes: 320672
#include<iostream>

using namespace std;

#define MAX 100

int main(){

	int M,N;
	int choco[MAX][MAX];
	int cnt=0;
	int min,max;

	cin>>M>>N;

	for(int i=0;i<M;i++){
		for(int j=0;j<N;j++){
			cin>>choco[i][j];
		}
	}

	for(int i=1;i<M;i++){
		for(int j=0;j<N;j++){
			if(choco[i][j]==0) choco[i][j]=1;
			else choco[i][j]=0;
		}
	}

	for(int i=0;i<M;i++){
		min=0,max=N-1;
		for(int j=0;j<N;j++){
			if(choco[i][min]==1){
				cnt++;
				if(min!=max){
					if(choco[i][min+1]==0) choco[i][min+1]=1;
					else choco[i][min+1]=0;
					min++;
				}
			}
			else if(choco[i][max]==1){
				cnt++;
				if(min!=max){
					if(choco[i][max-1]==0) choco[i][max-1]=1;
					else choco[i][max-1]=0;
					max--;
				}
			}
			else{
				if(min!=max){
					if(choco[i][min+1]==0) choco[i][min+1]=1;
					else choco[i][min+1]=0;
					min++;
				}
			}
		}
	}

	cout<<cnt<<endl;

	return 0;
}

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

using namespace std;

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

int main(){
  int n, k;
  cin >> n >> k;
  vector<bool> r(n, true);
  REP(i, k){
    int x;
    cin >> x;
    REP(j, x){
      int y;
      cin >> y;
      --y;
      r[y] = false;
    }
  }
  int res = 0;
  REP(i, n) if(r[i]) ++res;
  cout << res << endl;
  return 0;
}

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

int main()
{
    int sx,sy,tx,ty;
    cin >> sx  >> sy >> tx >> ty;

    int dx = tx - sx;
    int dy = ty - sy;

    cout << string(dy,'U') << string(dx,'R');
    cout << string(dy,'D') << string(dx,'L');
    
    cout << 'L' << string(dy+1,'U') << string(dx+1,'R') << 'D';
    cout << 'R' << string(dy+1,'D') << string(dx+1,'L') << 'U' << endl;
    return 0;
}

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

#define fi first
#define se second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int(v.size())
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= (m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (m); --i)

template<class T, class U> void chmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> void chmin(T &a, U b) { if (b < a) a = b; }

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

constexpr ll MOD = 1000000007;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int n, a, b; cin >> n >> a >> b;

  cout << min(a*n, b) << endl;
  
  return (0);
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
inline long long mod(long long n,long long m){return(n%m+m)%m;}
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n; cin>>n;
    map<int,int> p;
    rep(i,n){
        int x; cin>>x;
        p[x-1]=i;
    }
    rep(i,n){
        cout<<30000*(i+1)<<(i==n-1?"\n":" ");
    }
    rep(i,n){
        cout<<30000*(n+1-i)+p[i]<<(i==n-1?"\n":" ");
    }
    return 0;
}


Measured memory_bytes: 1536
package main

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

func uppperBound(a []int, x int) int {
	return sort.Search(len(a), func(i int) bool { return a[i] > x })
}

func scan(n int, s *bufio.Scanner) []int {
	buf := make([]int, n)
	for i := range buf {
		s.Scan()
		v, _ := strconv.Atoi(s.Text())
		buf[i] = v
	}
	return buf
}

func main() {
	var n int
	fmt.Scan(&n)
	s := bufio.NewScanner(os.Stdin)
	s.Split(bufio.ScanWords)
	a := scan(n, s)
	b := scan(n, s)
	c := scan(n, s)
	sort.Ints(a)
	sort.Ints(c)
	var ans int64
	for _, e := range b {
		j := sort.SearchInts(a, e)
		k := uppperBound(c, e)
		ans += int64(j) * int64(n-k)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 6016
#include <stdio.h>
int main()
{
    double L[10];
    double V1, V2;
    double meet_pos, railway_lenth;
    int cnt, input_cnt;
    int result[50];
    
    input_cnt = 0;
    /*Input and process*/
    while(scanf("%lf,", &L[0]) != EOF){
    	for(cnt = 1; cnt < 10; cnt++)
			scanf("%lf,", &L[cnt]);
		scanf("%lf,%lf", &V1, &V2);
    	/*Calculate meet position*/
    	for(cnt = 0, railway_lenth = 0; cnt < 10; cnt++)
			railway_lenth += L[cnt];
    	meet_pos = railway_lenth * V1 / (V1 + V2);
    	for(cnt = 0, railway_lenth = 0; railway_lenth < meet_pos; cnt++)
			railway_lenth += L[cnt];
    	result[input_cnt++] = cnt;
    }
    /*Output*/
    for(cnt = 0; cnt < input_cnt; cnt++)
		printf("%d\n", result[cnt]);
    
    return 0;
} 

Measured memory_bytes: 624
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef vector<int> VI;
typedef vector<ll> VLL;

int main(){
    string s;
    cin >> s;
    int size = s.size();
    int min = abs(753-stoi(s.substr(0,3)));
    for(int i=1; i<size-2; ++i){
        int tmp = abs(753-stoi(s.substr(i,3)));
        if(tmp < min) min = tmp;
    }

    cout << min << endl;
    return 0;
}

Measured memory_bytes: 256
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########

t,x = mi()
print(t/x)

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

int main(void)
{
  int n;
  cin >> n;
  vector<int> data(n);
  for(int i = 0; i < n - 1; i++)
  {
    int num;
    cin >> num;
    num = num - 1;
    data[num]++;
  }
  for(int i = 0; i < n; i++)
  {
    cout << data[i] << endl;
  }
}

Measured memory_bytes: 4060
#include <iostream>
#include<cstdio>
#include <cctype>
using namespace std;

int main(){

    char ch;
    while (true){
        scanf("%c", &ch);
        
        if (isalpha(ch)){
            if (islower(ch)){
                printf("%c", toupper(ch));
            }
            else if (isupper(ch)){
                printf("%c", tolower(ch));
            }
        }
        else{
            printf("%c", ch);
        }
        if(ch =='\n') break;
    }
}


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

long long int n;
long double d[3000],dres=0;

int main() {
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>d[i];
    }
    sort(d,d+n);
    dres=(d[0]+d[1])/2.0;
    for(int i=2;i<n;i++){
        dres=(dres+d[i])/2.0;
    }
    cout<<dres<<endl;
    
} 


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))

l=[0,0,0]

mod=10**9+7

ans=1
for i in a:
  ans*=l.count(i)
  ans%=mod
  for j in range(3):
    if l[j]==i:
      l[j]+=1
      break

print(ans)

Measured memory_bytes: 20864
import numpy as np
def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

N = int(input())
A = sorted(map(int, input().split()))

n = A.pop()
m = getNearestValue(A, n/2)
print(n, m)

Measured memory_bytes: 38564
#include<iostream>

using namespace std;

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

    int ans = 0;
    for(int i=1;i<n;i++){
        int tmp = 0;
        bool alpha[26];
        for(int j=0;j<26;j++)alpha[j] = false;
        for(int j=0;j<i;j++)alpha[s[j]-'a'] = true;
        //for(int j=0;j<26;j++)cout << alpha[j];
        //cout << endl;
        for(int j=i;j<n;j++)if(alpha[s[j]-'a']){
            alpha[s[j]-'a'] = false;
            tmp++;
        }
        if(ans<tmp)ans = tmp;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
a,b=map(int, input().split())
ans=a*b
if a%3==0 or b%3==0:ans=0 
if a>2:ans=min(ans,a)
if b>2:ans=min(ans,b)
for i in range(1,a):
    m=max(abs(b*i-b//2*(a-i)),abs(b//2*(a-i)-(-(-b//2)*(a-i))),abs(b*i-(-(-b//2)*(a-i))))
    ans=min(m,ans)
for i in range(1,b):
    m=max(abs(a*i-a//2*(b-i)),abs(a//2*(b-i)-(-(-a//2)*(b-i))),abs(a*i-(-(-a//2)*(b-i))))
    ans=min(m,ans)
print(ans)

Measured memory_bytes: 3064
n=int(input())
x=[int(q) for q in input().split()]

dp=[0,abs(x[0]-x[1])]
for i in range(2,n):
    y=min(dp[i-2]+abs(x[i]-x[i-2]),dp[i-1]+abs(x[i-1]-x[i]))
    dp.append(y)
print(dp[-1])

Measured memory_bytes: 13928
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;


const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };
#include<unordered_map>
class HashVI {  // ???????????\??¢??°???????????§??????
public:
	
	size_t operator()(const vector<vector<int>> &x) const {
		const int C = 997;      // ?´???°
		size_t t = 0;
		for (int i = 0; i != x.size(); ++i) {
			for (int j = 0; j < x[i].size(); ++j) {
				t = t * C + x[i][j];
			}
		}
		return t;
	}
};
unordered_map<vector<vector<int>>, int, HashVI>mp;

int main() {
	vector<vector<int>>vs(2, vector<int>(4));
	vector<vector<int>>start{ { 0, 1, 2, 3 },{ 4,5,6,7 } };
	mp[start] = 0;
	queue<pair<vector<vector<int>>, int>>que;
	que.push(make_pair(start, 0));
	while (!que.empty()) {
		auto atop(que.front());
		que.pop();
		auto field(atop.first);
		pair<int, int>zero;
		for (int y = 0; y < 2; ++y) {
			for (int x = 0; x < 4; ++x) {
				if (field[y][x] == 0) {
					zero = make_pair(x, y);
				}
			}
		}
		int ans = 1e8;
		for (int way = 0; way < 4; ++way) {
			const int tx = zero.first + dx[way];
			const int ty = zero.second + dy[way];
			if (tx >= 0 && tx <= 3 && ty >= 0 && ty <= 1) {
				swap(field[ty][tx], field[zero.second][zero.first]);
				if (mp.find(field) == mp.end()) {
					que.push(make_pair(field, atop.second + 1));
					mp[field] = atop.second + 1;
				}
				swap(field[ty][tx], field[zero.second][zero.first]);
			}
		}
	}
	while (cin>>vs[0][0]) {
		for (int i = 0; i < 2; ++i) {
			for (int j = 0; j < 4; ++j) {
				if (i || j)cin >> vs[i][j];
			}
		}
		int ans = mp[vs];
		cout << ans << endl;
		
		
	}
	return 0;
}

Measured memory_bytes: 6868
#!/usr/bin/python3
 
cmdvar_numlist=input()
cmdvar_numlist_splited=cmdvar_numlist.split()

N,X,T=list(map(int,cmdvar_numlist_splited))

i=0

while N >0:
    N = N - X
    i+=1

ans=T * i
print(ans)

Measured memory_bytes: 9080
#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, m;
  cin >> n >> m;
  const int INF = 1e9;
  vector<int> dp(5000, INF);
  dp[0] = 0;
  REP(i, m) {
    int a, b;
    cin >> a >> b;
    int mask = 0;
    REP(j, b) {
      int c;
      cin >> c;
      mask |= 1 << (c - 1);
    }
    for (int bit = 0; bit < (1 << n); ++bit) {
      dp[bit | mask] = min(dp[bit | mask], dp[bit] + a);
    }
  }
  cout << (dp[(1 << n) - 1] == INF ? -1 : dp[(1 << n) - 1]) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


void solve(void)
{
  int X;
  cin>>X;

  int ANS = 1;
  for (int i = 1; i < X+1; i++)
  {
    ANS *= i;
    ANS %= MOD;
  }
  cout<<ANS<<endl;
  
  
  return; 
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
typedef long long ll;
ll dp[100005];
int main()
{
    ll n,i,j;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
    cin>>a[i];
    if(n==2)
    cout<<abs(a[0]-a[1]);
    else
    {
        for(i=1;i<n;i++)
        {
            ll x=abs(a[i]-a[i-1])+dp[i-1];
            ll y;
            if(i>1)
             y=abs(a[i]-a[i-2])+dp[i-2];
            else
             y=mod;
            //cout<<x<<" "<<y<<"    ";
            dp[i]=min(x,y);
        }
        cout<<dp[n-1];
    }
}

Measured memory_bytes: 5120
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 10, Q = 50;

int aa[Q], bb[Q], cc[Q], dd[Q], n, m, q;

int branch(int *xx, int k) {
	if (k == n) {
		int ans = 0;
		for (int i = 0; i < q; i++)
			if (xx[bb[i]] - xx[aa[i]] == cc[i])
				ans += dd[i];
		return ans;
	}
	int ans = 0;
	for (int x = k ? xx[k - 1] : 1; x <= m; x++) {
		xx[k] = x;
		ans = max(ans, branch(xx, k + 1));
	}
	return ans;
}

int xx[N];

int main() {
	cin >> n >> m >> q;
	for (int i = 0; i < q; i++) {
		int a, b, c, d; cin >> a >> b >> c >> d, a--, b--;
		aa[i] = a, bb[i] = b, cc[i] = c, dd[i] = d;
	}
	cout << branch(xx, 0) << '\n';
	return 0;
}


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

#define pb push_back

int p[100005];
vector<int> adj[100005];
bool visited[100005] = {};
vector<int> a,b,kek;

void dfs(int x) {
    if (visited[x]) return;
    visited[x] = true;
    a.push_back(p[x]);
    b.push_back(x);
    for (auto y : adj[x]) dfs(y);
}

int intersection(vector<int> c, vector<int> d){
    sort(c.begin(), c.end());
    sort(d.begin(), d.end());
    int ans = 0;
    int curd=0;
    for (int curc = 0; curc < c.size(); curc++) {
        if (curd >= d.size()) break;
        while (d[curd] < c[curc]) {
            curd++;
            if (curd>=d.size())break;
        }
        while (d[curd] == c[curc]) {
            ans++;
            curd++;
            if (curd>=d.size()) break;
        }
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    int n,m;
    cin >> n >> m;
    for (int i=1; i<=n; i++) cin >> p[i];
    int x,y;
    for (int i=0; i<m; i++) {
        cin >> x >> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    int cnt = 0;
    for (int i=1; i<=n; i++) {
        if (visited[i]) continue;
        dfs(i);
        cnt += intersection(a,b);
        a=kek;
        b=kek;
    }
    cout << cnt;
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
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;}
const int MOD = 1000000007;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    char c = 'R';
    int center = -1;
    int start = 0;
    vector<int> v(n, 0);
    FOR(i, 1, n) {
        if (c == 'R') {
            if (s[i] == 'R') {
                // 継続
            } else {
                center = i - 1;
            }
        } else {
            if (s[i] == 'R') {
                v[center] = (center + 1 + 1 - start) / 2 + (i - 1 - center) / 2;
                v[center + 1] = (center + 1 - start) / 2 + (i - 1 - center + 1) / 2;
                start = i;
            } else {
                // 継続
            }
        }
        c = s[i];
    }
    v[center] = (center + 1 + 1 - start) / 2 + (n - 1 - center) / 2;
    v[center + 1] = (center + 1 - start) / 2 + (n - 1 - center + 1) / 2;

    REP(i, n) {
        cout << v[i];
        if (i != n - 1) {
            cout << " ";
        } else {
            cout << endl;
        }
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 1005
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
const double PI = acos(-1.0);
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

const ll Mod = 1e9 + 7;
const int max_k = 105;
const int SQ = 112345;
ll dp[max_k][SQ];
ll ac[max_k][SQ];

int main()
{
    FASTIO
    /*
    //double start_time = clock();
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
//*/
    int T;
    //cin >> T;
    T = 1;
    for(int cs = 1; cs <= T; cs++){
      memset(dp, 0, sizeof dp);
      memset(ac, 0, sizeof ac);
      int n , k;
      cin >> n >> k;

      vector<int> v;
      v.push_back(0);
      for(int i = 1; i <= n; i++){
        v.push_back(i);
        if(i < n / i) v.push_back(n/i);
        else break;
      }
     // for(auto x: v) cerr << x << " ";
        //cerr << endl;
      sort(v.begin(), v.end());
      const int l = v.size() - 1;
      for(int i = 1; i <= l; i++){
        dp[1][i] = v[i] - v[i - 1];
        //cerr << dp[1][i] << " "<<v[i] << " "<<v[i - 1] << "\n";
        ac[1][i] = (ac[1][i - 1] + dp[1][i]) % Mod;
        //cerr << ac[1][i] << " -- "<<ac[1][i - 1] << " -- "<<dp[1][i] << "\n";
      }

      for(int i = 2; i <= k; i++){
        for(int j = 1; j <= l; j++){
            int lw = lower_bound(v.begin(), v.end(), n/v[j]) - v.begin();
            dp[i][j] = (v[j] - v[j - 1]) * ac[i - 1][lw] % Mod;
            ac[i][j] = (ac[i][j - 1] + dp[i][j]) % Mod;
        }
      }
      ll ans = ac[k][l];
      cout << ans << endl;
    }

    //double end_time = clock();
    //printf( "Time = %lf ms\n", ( (end_time - start_time) / CLOCKS_PER_SEC)*1000);
    return 0;
}

Measured memory_bytes: 184960
#include<stdio.h>
int main()
{
  int n,i,j,k;
  int sub[200][3],score[200][3],total[200]={0};

  scanf("%d",&n);

  for(i=0; i<n; i++){
    for(j=0; j<3; j++){
    scanf("%d",&sub[i][j]);
    score[i][j]=sub[i][j];
  }
  }

  for(i=0; i<3; i++){
    for(j=0; j<n; j++){
      for(k=j+1; k<n; k++){

	if(sub[j][i]==sub[k][i]){
	  score[j][i]=0;
	  score[k][i]=0;
	}
      }
    }
  }

  for(i=0; i<n; i++){
    for(j=0; j<3; j++){
      total[i]+=score[i][j];
    }

    printf("%d\n",total[i]);
  }

  return 0;
  
}

Measured memory_bytes: 600
#include <iostream>
using namespace std;
typedef long long ll;
ll mod=ll(1e9)+7;

int main(void){
    ll m,n;cin>>m>>n;
    ll tot=1;
    while(n!=1){
        if(n%2!=0){
            tot*=m;
            tot%=mod;
            n--;
        }
        else{
            m*=m;
            m%=mod;
            n/=2;
        }
    }
    tot*=m;
    tot%=mod;
    cout<<tot<<endl;
}



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

/* REPmacro */
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i)

/*alias*/
//#define ALL(x) (x).begin(),(x).end()
//#define SZ(x) ((int)(x).size())
//#define F first
//#define S second
#define PB push_back
#define MP make_pair 

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

/* func */
int gcd(int a,int b){return b?gcd(b,a%b):a;}

/*struct*/
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;


/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;

//#define int long long

signed main()
{
  string s;
  cin >> s;
  int topping = 0;
  if(s[0] == 'o') topping += 100;
  if(s[1] == 'o') topping += 100;
  if(s[2] == 'o') topping += 100;
  
 cout << 700 + topping <<  endl;
  return 0;
}

Measured memory_bytes: 256
'''
問題
http://code-festival-2017-qualb.contest.atcoder.jp/tasks/code_festival_2017_qualb_c
解説
https://img.atcoder.jp/code-festival-2017-qualb/editorial.pdf
参考
http://code-festival-2017-qualb.contest.atcoder.jp/submissions/1666106
'''
from sys import stdin, stdout
def readLine_int_list():return list(map(int, stdin.readline().split()))

def is_biparate(links):
    '''
    0=white,1=blackとする
    2部グラフなら黒に塗られている頂点の数を返す
    2部グラフでないなら-1を返す。
    '''
    
    colors = [-1] * n
    colors[0] = 0
    q = [(0, 0)]  #0=white, 1=blackとする
    visited = set()
    while q:
        v, c = q.pop()
        if v in visited:
            if colors[v] != c: #最初に塗られた色とは反対の色が塗られるなら
                return -1
            continue
        visited.add(v)
        colors[v] = c
        for u in links[v]:
            q.append((u, c ^ 1))  #0^1=1 1^1=0 vとは反対の色を塗る
    return sum(colors)  #1の数 = blackの数
 




n, m = readLine_int_list()
g = [set() for _ in range(n)]

def main():
    for _ in range(m):
        a, b = readLine_int_list()
        a -= 1
        b -= 1
        g[a].add(b)
        g[b].add(a)
    
    
    
    bp1 = is_biparate(g)
    if bp1 == -1:
        '''
        2部グラフではない場合
            結論：完全グラフになるまで辺を追加できる
            →why
                奇サイクル上のある点をvとする
                s → v → tが偶数長でも、 奇サイクルの他の頂点を余計に経由することで奇数長になる
                s → tが奇数長になれば線が引ける
                つまり、任意の頂点間において奇数長が存在することになる
            完全グラフの辺の数は、n * (n - 1) // 2
            これには元あった辺の数まで含まれているので、 -m する
        '''
        max_m = n * (n - 1) // 2
    else:
        '''
        2部グラフの場合
            結論:(blackの数*whiteの数)本、線ができる
            why
                奇数閉路が存在しない => 異なる色間は必ず奇数長、同色間は必ず偶数長 
                1. whiteとblackの間は奇数長のパスが存在する ->線が引ける
                2. 同じ色どうしには奇数長のパスは存在しない -> 線は引かれない
                black=3, white=2の時の線の引き方 = b*w
            b*wにはパスの長さが1つまりもともとのパスが含まれてるので、-m　する
        '''
        max_m = bp1 * (n - bp1)
        
    print(max_m - m)
    

if __name__ == "__main__":
    main()

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

using namespace std;

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pi >
#define pi pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define all(n) n.begin(), n.end()

#define FROMTO(var, from, to) for (register int var = (from), var##down = ((int)(to)) < ((int)(from));var##down ? (var >= (int)(to)) : (var <= (int)(to));var##down ? var-- : var++)
#define UPTO(var, from, to)   for (register int var = (from); var <= ((int)to); var++)
#define DOWNTO(var, from, to) for (register int var = (from); var >= ((int)to); var--)
#define FOR(var, to)          UPTO(var, 0, (to)-1)
#define DOWN(var, from)       DOWNTO(var, (from)-1, 0) 

#define INIT(var, val) FOR(i,countof(var)) var[i] = val
#define INPUT(var) FOR(i,countof(var)) cin >> var[i]
#define INPUT1(var) FOR(i,countof(var)) cin >> var[i], var[i]--

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)
#define QSORT(v,b) qsort(v,countof(v),sizeof(*v),b)

#define MOD 1000000007
#define INF ((1 << 30)-1)
#define LINF ((1LL << 62)-1)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

struct Comb {
    vector<vector<s64> > data;
    Comb(int n) { // O(n^2)
        data = vector<vector<s64> >(n+1,vector<s64>(n+1,1));
        UPTO(i,1,n) {
            FOR(j,i+1) {
                if (!j || j == i) data[i][j] = 1;
                else data[i][j] = data[i-1][j-1] + data[i-1][j];
            }
        }
    }
    
    s64 ncr(int n, int r) {
        return data[n][r];
    }
};

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

int int_less(const void *a, const void *b) {
  return (*((const int*)a) - *((const int*)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int*)b) - *((const int*)a));
}

int main() {
    int n = ri();int a[n];
	INPUT(a);
	SORT(a);
	s64 res = 0;
	FOR(i,n-1) res += a[i];
	res += a[n-1]/2;
	cout << res << endl;
    return 0;
}


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

int main(void){

    int N,M,X,Y; cin>>N>>M>>X>>Y;

    vector<int> xvec(N+1); xvec[0] = X;
    vector<int> yvec(M+1); yvec[0] = Y;
    for (int i = 0; i < N; ++i) {
        cin>>xvec[i+1];
    }
    for (int i = 0; i < M; ++i) {
        cin>>yvec[i+1];
    }

    int itx = *max_element(xvec.begin(), xvec.end());
    int ity = *min_element(yvec.begin(), yvec.end());

    if(itx < ity){
        cout<<"No War"<<endl;
    }else{
        cout<<"War"<<endl;
    }

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<vector<double>> posi(n+1, vector<double>(2));
    for(int i = 1; i<= n; i++){
        cin >> posi.at(i).at(0) >> posi.at(i).at(1);
    }

    vector<int> town(n);
    for(int i = 0; i< n; i++){
        town.at(i) = i+1;
    }

    
    double answer = 0;
    do{
        for(int i = 0; i< n - 1 ; i++){
            int st = town.at(i);
            int gl = town.at(i+1);
            int dx = posi.at(st).at(0) - posi.at(gl).at(0);
            int dy = posi.at(st).at(1) - posi.at(gl).at(1);
            double dist = sqrt(dx*dx + dy*dy);
            answer += dist;

        }
    }while(next_permutation(town.begin(),town.end()));
    
    double root = 1;
    for(int i = 2; i<= n; i++){
        root *= i;
    }

    answer /= root;

    cout << fixed << setprecision(10) << answer << endl;

}

Measured memory_bytes: 256
unittest
{
	assert( [ "4 2 5", "1 2 5 7" ].parse.expand.solve == 11 );
	assert( [ "7 1 100", "40 43 45 105 108 115 124" ].parse.expand.solve == 84 );
	assert( [ "7 1 2", "24 35 40 68 72 99 103" ].parse.expand.solve == 12 );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nab = input.front.split.to!( long[] );
	input.popFront;
	auto xs = input.front.split.to!( long[] );
	return tuple( nab[ 1 ], nab[ 2 ], xs );
}

auto solve( long a, long b, long[] xs )
{
	auto ans = 0L;
	for( auto i = 1L; i < xs.length; i++ )
	{
		ans += min( ( xs[ i ] - xs[ i - 1 ] ) * a, b );
	}
	return ans;
}


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

if N == 1:
  print(1)
elif N == 2:
  print(8)
elif N == 3:
  print(27)
elif N == 4:
  print(64)
elif N == 5:
  print(125)
elif N == 6:
  print(216)
elif N == 7:
  print(343)
elif N == 8:
  print(512)
elif N == 9:
  print(729)


Measured memory_bytes: 38384
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#include <bitset>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < (n); i++)

using namespace std;

void solve() {
  long N;
  cin >> N;
  unordered_map<string, long> mp;
  rep (i, N) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }
  long ret = 0;
  for (auto it: mp) ret += it.second * (it.second - 1) / 2;
  cout << ret << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


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

using namespace std;

typedef long long ll; 
typedef pair<int, int> pii;

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

int n, l;
int len[110000];

int main() {
	scanf("%d %d", &n, &l);

	for (int i = 0; i < n; i++) {
		scanf("%d", &len[i]);
	}

	for (int i = 0; i < n-1; i++) {
		if (len[i] + len[i+1] >= l) {
			printf("Possible\n");
			for (int j = 0; j < i; j++) printf("%d\n", j+1);
			for (int j = n-2; j > i; j--) printf("%d\n", j+1); 
			printf("%d\n", i+1);
			return 0;
		}
	}

	printf("Impossible\n");
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
#define BIG 1000000007
#define ll long long int

int main(){
  int n;
  string s,l,r;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s;
     set<string> S;
    for(int j=1;j<s.size();j++){
      for(int k=0;k<8;k++){
	l=s.substr(0,j);
	r=s.substr(j);
	if(k%2){
	  reverse(r.begin(),r.end());
	}
	if(k%4>1){
	  reverse(l.begin(),l.end());
	}
	if(k>3){
	  swap(r,l);
	}
	S.insert(l+r);
      }
    }
    cout<<S.size()<<endl;
  }
  return 0;
}



Measured memory_bytes: 3252
using System;

namespace Sample101
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split();
            var N = int.Parse(line[0]);
            var T = int.Parse(line[1]);

            var minimumCost = 1001;

            for (int i = 0; i < N; ++i)
            {
                var line2 = Console.ReadLine().Split();
                var cost = int.Parse(line2[0]);
                var time = int.Parse(line2[1]);

                if (time <= T)
                {
                    if (cost <= minimumCost)
                    {
                        minimumCost = cost;
                    }
                }
            }

            if (minimumCost == 1001)
            {
                Console.WriteLine("TLE");
            } else
            {
                Console.WriteLine(minimumCost);
            }
        }
    }
}

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

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int n;
ll a[252521];

int main(){
    scanf("%d",&n);
    REP(i,n)scanf("%lld",a+i);
    ll sum = accumulate(a,a+n,0ll);
    ll ans = 1ll<<60;
    ll acc = 0;
    REP(i,n-1){
        acc += a[i];
        ll llb = i+1, rlb = n-i-1;
        ll lsum = acc, rsum = sum - acc;
        if(lsum == rsum){
            ans = 0;
        }else{
            CHMIN(ans, abs(rsum-lsum));
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int ans = 1;
	int MOD = 1000000007;
	int N;
	cin >> N;
	vector<int>A(N);
	rep(i, N) {
		cin >> A[i];
	}
	sort(A);
	int c1 = 0;
	int c2 = 0;
	rep(i, N) {
		if (A[i] == i - i % 2 + 1) {
			c1++;
		}
	}
	rep(i, N) {
		if (A[i] == i + i % 2) {
			c2++;
		}
	}
	if (c1 == N && c2 == 0) {
		rep(i, N / 2) {
			ans *= 2;
			ans %= MOD;
		}
	}
	else if (c1 == 0 && c2 == N) {
		rep(i, (N - 1) / 2) {
			ans *= 2;
			ans %= MOD;
		}
	}
	else {
		cout << 0 << endl;
		return 0;
	}
	cout << ans << endl;
}




Measured memory_bytes: 640
#include <iostream>
using namespace std;
int main()
{
	int h, w;
	while(true)
	{
		cin >> h >> w;
		if(h==0&&w==0)
			break;
			
		for(int i =0; i < h; i++){
			for(int t=0; t < w; t++){
				cout << "#";
			}
			cout << endl;
		}
		cout << endl;
	}
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
typedef vector<int> vec;
typedef vector<int64> vec64;
#define db(x) cout << "> " << #x << ": " << x << "\n";
#define ss cout << " ";
#define ct(x) cout << x;
#define nn cout << "\n";
#define cts(x) cout << x << " ";
#define ctn(x) cout << x << "\n";
#define qr queries();
void solve();
void YN(bool b){if (b){ctn("YES");}else{ctn ("NO");}};
void yn(bool b){if (b){ctn("Yes");}else{ctn ("No");}};
void queries(){int n;cin >> n;while (n--)solve();}
// // // // // // // // // // // // // // // // // // // // // // 
/*                  TEMPLATE - VANILLA                         */
// // // // // // // // // // // // // // // // // // // // // //
int64 q, n;

void solve(){

    return;
}


int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    string rs = "";
    for (int i = 0; i < n; i++){
        rs += s[i];
        rs+=t[i];
    }
    ctn(rs);
    return 0;
}


Measured memory_bytes: 3636
from bisect import bisect_left, bisect_right, insort_left

a = []
q = int(input())
for i in range(q):
    a.append(list(input().split()))

S = {}
W = []

for i in range(q):
    if a[i][0] == '0':
        if not a[i][1] in S:
            insort_left(W,a[i][1])
        S[a[i][1]] = int(a[i][2])
    elif a[i][0] == '1':
        if a[i][1] in S:
            print(S[a[i][1]])
        else:
            print(0)
    elif a[i][0] == '2':
        if a[i][1] in S:
            S[a[i][1]] = 0
    else:
        L = bisect_left(W,a[i][1])
        R = bisect_right(W,a[i][2])
        for j in range(L,R):
            if S[W[j]] > 0:
                print(W[j],S[W[j]])


Measured memory_bytes: 75276
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
int main(){
	int a=gi(),b=gi(),c=gi();
	puts(a==b&&b==c?"Yes":"No");
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#define P 1300000
using namespace std;
bool prime[P];

int main() {
  prime[0] = prime[1] = 1;
  for(int i=2;i*i<=P;i++)
    if(prime[i] == 0)
      for(int j=2;j<=P/i;j++) prime[i*j] = 1;

  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;
    int cnt = n,cnt2 = n;
    while(prime[cnt] != 0) cnt++;
    while(prime[cnt2] != 0) cnt2--;

    cout << cnt-cnt2 <<endl;
  }

  return 0;
}

Measured memory_bytes: 2428
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

int main(){
    ll N;
    cin>>N;
    v a(N);
    rep(i,0,N)cin>>a[i];
    map<ll,ll> m;
    ll ans = 0,ansm=0;
    rep(i,0,N){
        if(a[i]<3200){
            m[a[i]/400]++;
        }
        else ansm++;
    }
    rep(i,0,8){
        if(m[i]>=1)ans++;
    }
    if(ans != 0)cout<<ans<<" "<<ans+ansm;
    else cout<<1<<" "<<ansm;
    return 0;
}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        ABC139d pro = new ABC139d(sc);
        out.println(pro.solve());

        out.flush();
    }

}

class ABC139d {

    private final long N;

    ABC139d(FastScanner sc) {
        N = sc.nextLong();
    }

    long solve() {
        return N * (N - 1) / 2;
    }
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

typedef long long ll;
typedef unsigned long long ull;

int main()
{
    ll N, K;
    cin >> N >> K;
    vector<array<ll, 2>> td(N);
    for(int i=0;i<N;i++){
        cin >> td[i][1] >> td[i][0];
    }
    sort(td.begin(), td.end(), greater<array<ll, 2>>());

    ll res = 0;
    ll vsum = 0;
    set<ll> kind;
    stack<ll> unused;
    for(int i=0; i<K; i++){
        auto t = td[i][1];
        auto d = td[i][0];
        vsum += d;;
        if(kind.count(t) > 0) unused.push(d);
        else kind.insert(t);
    }
    res = vsum + kind.size() * kind.size();
    for(int i=K; i<N; i++){
        auto t = td[i][1];
        auto d = td[i][0];
        if(kind.count(t) > 0) continue;
        kind.insert(t);
        vsum += d;
        if(unused.size()==0) break;
        vsum -= unused.top(); unused.pop();
        res = max(res, (ll)(vsum + kind.size() * kind.size()));
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 4992
#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> pi32;
typedef pair<ll, ll> pi64;
typedef vector<int> vi32;
typedef vector<ll> vi64;
const ll mod = 998244353;
const ll sz = 1e3 + 10, inf = 2 * 1e18 + 10;
const double pi = acos(-1.0);
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	double r; cin >> r;
	double ans = 2 * pi * r;
	cout << fixed << setprecision(20) << ans << '\n';

	return 0;
}

Measured memory_bytes: 3808
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printInt(a) printf("%d\n", a)
#define scanInt(a) scanf("%d", &a)
using namespace std;

int main() {
    int xs[5];
    rep(i, 5)
        cin >> xs[i];
    rep(i, 5) {
        if (!xs[i]) {
            printInt(i+1);
            break;
        }
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

#define mt make_tuple
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sqr(x) ((ll)(x) * (x))

int main()
{
    int n;
    cin >> n;
    vi v(n);
    for(auto &z : v)cin >> z;

    int sledeciBroj = 1;
    vector <pii> resenje;

    for(int i = 0; i < n; i++)
    {
        if(v[i] == sledeciBroj)
        {
            resenje.pb(mp(sledeciBroj, i));
            sledeciBroj++;
        }
    }

    if(resenje.size() == 0)
    {
        cout << "-1\n";
    }

    else if(resenje.size() == 1)
    {
        cout << n - 1 << '\n';
    }

    else
    {
        int staTrebaIzbaciti = resenje[0].se + (n - resenje[resenje.size()-1].se-1) + (resenje[resenje.size()-1].se-resenje[0].se-1)-(resenje.size()-2);
        cout << staTrebaIzbaciti << '\n';
    }

    return 0;
}


Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(void)
{
	string S;
	int i, len, ans;
	ans = 0;

	cin >> S;
	len = S.length();

	int tmp = 0;
	for (i = 0; i < len; i++) {
		switch (S[i]) {
		case 'A': tmp++; break;
		case 'C': tmp++; break;
		case 'G': tmp++; break;
		case 'T': tmp++; break;
		default: tmp = 0;
		}
		ans = max(tmp, ans);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:256000000")
#include<utility>
#include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) x.begin(), x.end()
#define mp make_pair
#define X first
#define Y second

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(NULL));

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

signed main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll a, p; cin >> a >> p;
	a *= 3;
	cout << (a + p) / 2 << endl;



	return 0;
}
/*

*/

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    bool b = false;
    int streak = 0;
    for (int i = 0; i < n; i++)
    {
        int num1, num2;
        cin >> num1 >> num2;
        if (num1 == num2) streak++;
        else streak = 0;
        if (streak >= 3) b = true;
    }
    if (b) cout << "Yes";
    else cout << "No";
    return 0;
}


Measured memory_bytes: 3636