akhauriyash/Code-Regression huggingface dataset:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
int main(){
    int a;
    string s;
    cin >> a >> s;
    if(a>=3200){
        cout << s << endl;
    }
    else{
        cout << "red" << endl;
    }
}

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

int x,y;

signed main() {
    cin >> x >> y;
    if (abs(x-y) <= 1) cout << "Brown" << endl;
    else cout << "Alice" << endl;
}


Measured memory_bytes: 256
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
//
// #include <immintrin.h>
// #include <emmintrin.h>

#include <bits/stdc++.h>
#pragma GCC optimize("O2")
#define vi vector<int>
#define vpii vector<pii>
#define pii pair<int, int >
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define LL long long
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define all(x) (x).begin(), (x).end()
#define aal(x,n) (x+1), (x+1+n)
#define sz(x) ((int)(x).size())
#define mod(x) ((x)%MOD)
#define eb emplace_back
#define o(X) (1<<(X))
#define oL(X) (1LL<<(X))
#define ppt(x) __builtin_popcount(x)
using namespace std;
const int INF=0x3f3f3f3f,N=1e6+5,MOD=1e9+7;
const LL INF_LL=0x3f3f3f3f3f3f3f3fLL;
template<typename T>
inline int getplc(T x,int y) { return (x>>y)&1; }
template<typename T>
T square(T x) {return x*x;}
LL qpow(LL a,LL b=MOD-2,LL _MOD=MOD){
  LL res=1;
  for(;b;b>>=1,a=a*a%_MOD){
    if(b&1)res=res*a%_MOD;
  }
  return res;
}
template <typename T>
T Smax(T x) { return x; }
template<typename T, typename... Args>
T Smax(T a, Args... args) { return max(a, Smax(args...)); }
template <typename T>
T Smin(T x) { return x; }
template<typename T, typename... Args>
T Smin(T a, Args... args) { return min(a, Smin(args...)); }
template <typename T>
#define errorl(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); errl(_it, args); }
void errl(istream_iterator<string> it) {}
template<typename T, typename... Args>
void errl(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  errl(++it, args...);
}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr<<endl;}
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << " # ";
  err(++it, args...);
}


void Solve() {
  int n, x, t;
  cin >> n >> x >> t;
  int ans = ((n + x - 1) / x) * t;
  cout << ans << endl;
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("in.txt","r",stdin);
//  freopen("o1.txt","w",stdout);
#endif
  ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
  Solve();
  return 0;
}


Measured memory_bytes: 3640
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N,Y;
	cin >> N >> Y;
	Y /= 1000;
	//10,5,1をN個使ってYを作る
	for(int A=0;A<=N;++A){
		for(int B=0;B+A<=N;++B){
			int C = N-(A+B);
			int res = 10*A+5*B+C;
			if( res == Y ){
				cout << A << " " << B << " " << C << endl;
				return;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a[100005],n,m,t;
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=1;i<=n;i++){
        t=__gcd(t,a[i]);
    }
    for(int i=1;i<=n;i++){
        if((a[i]/t)%2==0){
            cout<<0<<endl;
            return 0;
        }
    }
    long long sum=a[1];
    for(int i=2;i<=n;i++){
        sum=(sum*a[i])/__gcd(sum,a[i]);
        if(sum>2*m){
            cout<<0<<endl;
            return 0;
        }
    }
    sum/=2;
    cout<<(m-sum)/(sum*2)+1<<endl;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

int main()
{
    int n,x;
    scanf(" %d %d", &n, &x);
    vector<int> a(n);
    rep(i,n) scanf(" %d", &a[i]);

    ll ans=0;
    for(int i=1; i<n; ++i)
    {
        if(a[i-1]+a[i]>x)
        {
            if(a[i-1]<x)
            {
                ans+=a[i]-(x-a[i-1]);
                a[i]=x-a[i-1];
            }
            else
            {
                ans+=a[i];
                a[i]=0;
            }
        }
    }
    for(int i=n-1; i>0; --i)
    {
        if(a[i-1]+a[i]>x)
        {
            if(a[i]<x)
            {
                ans+=a[i-1]-(x-a[i]);
                a[i-1]=x-a[i];
            }
            else
            {
                ans+=a[i-1];
                a[i-1]=0;
            }
        }
    }

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


Measured memory_bytes: 640
#include<iostream> 
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath> 
#include<algorithm>
#define ll long long 
using namespace std;
const int maxn=10000010,  inf=1e9;
int n, K, m;
ll a[maxn]; int cnt=0;
ll mi[20];

template<typename T>
inline void read(T &k)
{
	int f=1; k=0; char c=getchar();
	while(c<'0' || c>'9') c=='-'&&(f=-1), c=getchar();
	while(c<='9' && c>='0') k=k*10+c-'0', c=getchar();
	k*=f;
}

inline int calc(ll x)
{
	int ans=0;
	while(x)
	{
		ans+=x%10;
		x/=10;
	}
	return ans;
}

bool check(ll x)
{
	ll ans=x; int cnt=0;
	while (ans%10==9) ans/=10, cnt++;
	if (ans==0) return 1;
	return calc(x+mi[cnt])*x<=calc(x)*(x+mi[cnt]);
}

int main()
{
	read(n); 
	mi[0]=1; for (int i=1;i<=16;i++) mi[i]=mi[i-1]*10;
	for (int i=1;i<=9;i++) a[++cnt]=i;
	for (int i=1;i<=14;i++)
	{
		ll b=mi[i]-1;
		for(int j=1;;j++)
		{
			ll c=b+j*mi[i];
			if (c>1e15) break;
			if (check(c)) a[++cnt]=c;
			else break;
		}
	}
	sort(a+1, a+1+cnt); 
	cnt=unique(a+1, a+1+cnt)-a-1;
	for (int i=1;i<=n;i++) printf("%lld\n", a[i]);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799;


int n;
ll ans = 1;
ll num[1001];

void fact(int k){
  for(int i = 2; i <= sqrt(k) + 1; i++){
    if(k%i == 0){
      num[i]++;
      k /= i;
      i--;
    }
  }
  num[k]++;
}

int main(){
  cin >> n;
  for(int i = 2; i <= n; i++){
    fact(i);
  }
  for(int i = 2; i <= n; i++){
    ans = ans * (num[i] + 1) % MOD;
  }
  cout << ans <<endl;
}
    

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ss = br.readLine().trim().split("\\s+");
        int mod = (int)Math.pow(10, 9) + 7;
        int n = Integer.parseInt(ss[0]);
        int m = Integer.parseInt(ss[1]);
        char[][] matrix = new char[n][m];
        long[][] dp = new long[n][m];
        for (int i=0; i<n; i++) {
            String s = br.readLine().trim();
            for (int j=0; j<m; j++) {
                matrix[i][j] = s.charAt(j);
            }
        }
        dp[0][0] = 1;
        for (int i=1; i<m; i++) {
            if (matrix[0][i] == '.') {
                dp[0][i] = 1;
            } else {
                break;
            }
        }
        for (int i=1; i<n; i++) {
            if (matrix[i][0] == '.') {
                dp[i][0] = 1;
            } else {
                break;
            }
        }
        for (int i=1; i<n; i++) {
            for (int j=1; j<m; j++) {
                if (matrix[i][j] == '#') {
                    dp[i][j] = 0;
                } else {
                    dp[i][j] = ((dp[i-1][j]%mod) + (dp[i][j-1]%mod)) % mod;
                }
            }
        }
        System.out.println(dp[n-1][m-1]);
    }
}

Measured memory_bytes: 37124
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	string S;
	ll K;
	cin >> S >> K;
	ll ans = 0;
	bool flag = true;
	for (int i = 0; i < S.size()-1; i++) {
		if (S[i] != S[i + 1]) {
			flag = false;
		}
	}
	if (flag) {
		if (S.size() % 2 == 0) {
			ans += S.size() / 2 * K;
		}
		else {
			ans += (S.size() / 2) * ((K + 1) / 2);
			ans += (S.size() / 2 + 1) * (K / 2);
		}
		cout << ans << endl;
		return 0;
	}
	for (int i = 0; i < S.size() - 1; i++) {
		if (S[i] == S[i + 1]) {
			S[i + 1] = 'A';
			ans += K;
		}
	}
	S += S;
	for (int i = S.size() / 2 - 1; i < S.size() - 1; i++) {
		if (S[i] != S[i + 1] && (S[i] != 'A' && S[i + 1] != 'A')) break;
		if (S[i + 1] == 'A') {
			ans -= K - 1;
			S[i + 1] = S[i];
		}
	}
	for (int i = 0; i < S.size() - 1; i++) {
		if (S[i] == S[i + 1]) {
			S[i + 1] = 'A';
			ans += K - 1;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    int n,i,j;

    scanf("%d",&n);
    for(i=1;i<10;i++){
        for(j=1;j<10;j++){
            if(i*j==n){
                printf("Yes\n");
                i=100;
                break;
            }
        }
    }
    if(i<100)
        printf("No\n");
    return 0;
}

Measured memory_bytes: 128
N=int(input())
X=[int(x) for x in input().split()]
Y=[[i,X[i],0] for i in range(N)]
Y.sort(key=lambda x: x[1])
B=Y[N//2][1]
for i in range(N):
  if Y[i][1]==B:
    B=Y[N//2-1][1]
  Y[i][2]=B
Y.sort(key=lambda x : x[0])
for i in range(N):
  print(Y[i][2])

Measured memory_bytes: 43840
#include <stdio.h>

#define N 44

int fibonacci(int);

int F[N];

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

  printf("%d\n", fibonacci(n));

  return 0;
}

int fibonacci(int n){
  int i;

  F[0] = 1;
  F[1] = 1;

  for(i = 2; i <= n; i++)
    F[i] = F[i-2] + F[i-1];

  return F[n];
}

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

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

const int N = 2e5 + 10; 
int n, m, a[N], cnt[N], p[N], tot;  

void add(int x) {
    int l = x - cnt[x]++; 
    if(l > 0 && ++p[l] == 1) 
        --tot; 
}
void rem(int x) {
    int l = x - --cnt[x]; 
    if(l > 0 && --p[l] == 0) 
        ++tot;
}

int main(int argc, char const *argv[]) {
    scanf("%d %d", &n, &m);
    for(int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
        add(a[i]); 
    } tot += n;  
    while(m--) {
        int x, y; 
        scanf("%d %d", &x, &y);
        rem(a[x]); a[x] = y; add(a[x]); 
        printf("%d\n", tot); 
    }
}


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

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

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

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

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


void solve(long long X){
    LL n = 100;
    for(int i=1; true; i++) {
        n = n * 1.01;
        if (n >= X) {
            cout << i << endl;
            return;
        }
    }
}

int main(){
    long long X;
    scanf("%lld",&X);
    solve(X);
    return 0;
}



Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210000;
vector<int>eds[MAXN];
int n,x,y;
pair<int, int>go[MAXN];
int ad[MAXN];
void dfs1(int v, int p, pair<int, int> mx)
{
	if (mx.second < v)
		mx.second = v;
	if (mx.second > mx.first)
		swap(mx.second, mx.first);
	go[v] = mx;
	for(int i=0;i<eds[v].size();i++)
	{
        int u=eds[v][i];
		if (u == p)
			continue;
		dfs1(u, v, mx);
	}
}
int ans[MAXN];
void dfs3(int v, int p, int cur)
{
	cur += ad[v];
	ans[v] = cur;
	for(int i=0;i<eds[v].size();i++)
	{
	    int u=eds[v][i];
		if (u == p)
			continue;
		dfs3(u, v, cur);
	}
}
vector<int> vv;
void dfs2(int v, int p)
{
	vv.push_back(v);
	if (v == 0)
		++ad[0];
	else {
		int l = 0;
		int r = vv.size() - 1;
		while (r - l > 1) {
			int m = (r + l) >> 1;
			int x = vv[m];
			int fl = 0;
			if (go[x].first != x)
            {
				if (go[x].first == go[v].first)
					fl = 1;
			}
			else
			{
				if (go[x] == go[v])
					fl = 1;
			}
			if (fl)
				r = m;
			else
				l = m;
		}
		++ad[vv[r]];
	}
	for(int i=0;i<eds[v].size();i++)
	{
	    int u=eds[v][i];
		if (u == p)
			continue;
		dfs2(u, v);
	}
	vv.pop_back();
}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<n;i++)
    {
        scanf("%d%d",&x,&y);
        x--;y--;
        eds[x].push_back(y);
        eds[y].push_back(x);
    }
    dfs1(0,-1,make_pair(-1,-1));
    dfs2(0,-1);
    dfs3(0,-1,0);
    for(int i=1;i<n;i++)
        printf(i==n-1?"%d\n":"%d ",ans[i]-1);
}


Measured memory_bytes: 31736
#include <stdio.h>

int main(void){
	
	int a,b,ans;
	int i,j;
	
	scanf("%d %d",&a,&b);
	
	if(a==0){
		if(b<=1911){    //??????
			ans=b-1868+1;
			printf("M%d\n",ans);
			
		}else if(b<=1925){   //??§??£
			ans=b-1912+1;
			printf("T%d\n",ans);
			
		}else if(b<=1988){   //??????
			ans=b-1926+1;
			printf("S%d\n",ans);
			
		}else if(b<=2016){   //??????
			ans=b-1989+1;
			printf("H%d\n",ans);
		}
	}
	if(a==1){
		ans=1868+b-1;
		printf("%d\n",ans);
	}
	if(a==2){
		ans=1912+b-1;
		printf("%d\n",ans);
	}
	if(a==3){
		ans=1926+b-1;
		printf("%d\n",ans);
		
	}
	if(a==4){
		ans=1989+b-1;
		
		printf("%d\n",ans);
	}
		
	return 0;
}
	

Measured memory_bytes: 2760
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>

using namespace std;

int main()
{
	int a, b, aq, ar, bq, br, a1, a2, a21, b1, b2, b21, ans;

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

	aq=a/100; ar=a%100; a1=a/10000; a2=a/1000-10*a1; a21=10*a2+a1;
	bq=b/100; br=b%100; b1=b/10000; b2=b/1000-10*b1; b21=10*b2+b1;

	if(ar<=a21 && br>=b21){
		ans=bq-aq+1;
	}else if(ar> a21 && br>=b21){
		ans=bq-aq;
	}else if(ar<= a21 && br<b21){
		ans=bq-aq;
	}else{
		ans=bq-aq-1;
	}

	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 128
import math
a=int(input());b=int(input());c=int(input());d=int(input());e=int(input())

N=math.ceil(a/10)*10+math.ceil(b/10)*10+math.ceil(c/10)*10+math.ceil(d/10)*10+math.ceil(e/10)*10
X=[a%10,b%10,c%10,d%10,e%10]
n=0
while(n!=5):
  if X[n]==0:
    X[n]=10
  n+=1

else:
  print(N-(10-min(X)))

Measured memory_bytes: 3064
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def main():
    N, K = map(int, input().split())
    S = list(input())

    rev = False
    rev_count = 0
    for i in range(1,N):
        if S[i] == S[i-1]:
            rev = False
        else:
            if not rev and rev_count < K:
                rev_count += 1
                rev = True

            if rev:
                S[i] = 'L' if S[i] == 'R' else 'R'


    ans = 0
    for i in range(1,N):
        if S[i] == S[i-1]:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3956
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include<iostream>
using namespace std;


int main()
{
	int n;
	double m = 0, sgm = 0, bun, hyou;
	double s[1000];

	while (1){
		cin >> n;
		if (n == 0){
			break;
		}

		for (int i = 0; i < n; i++){
			cin >> s[i];
			m = m + s[i];
		}
		m = m / (double)n;

		for (int i = 0; i < n; i++){
			sgm = sgm + ((s[i] - m)*(s[i] - m));
		}
		bun = sgm / (double)n;
		hyou = sqrt(bun);

		cout << fixed << setprecision(8) << hyou << endl;

		m = 0;
		sgm = 0;
	}
	
	return 0;
}


Measured memory_bytes: 3216
#include <stdio.h>
int main(void){
    int r, c, i, j;
    int a[101][101] = {0};
    scanf("%d %d", &r, &c);
    for(i = 0; i < r; i++){
        for(j = 0; j < c; j++){
            scanf(" %d", &a[i][j]);
             a[i][c]+= a[i][j];
        }
    }
    for(i = 0; i < c+1; i++){
        for(j=0;j<r;j++){
            a[r][i] += a[j][i];
        }
    }
    for(i=0;i<r+1;i++){
        for(j=0;j<c+1;j++){
            if(j != c){
                printf("%d ", a[i][j]);
            }else{
                printf("%d\n", a[i][j]);
            }
        }
    }
}


Measured memory_bytes: 2024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char c;
  cin >> c;
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
    cout << "vowel" << endl;
  }
  else cout << "consonant" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int H, W; cin >> H >> W;
    vector<vector<char>> a(H,vector<char> (W));
    vector<int> cnth(H,-1);
    vector<int> cntw(W,-1);
    for(int i = 0; i < H; i++)
    {
      	for(int j = 0; j < W; j++)
        {
          	cin >> a.at(i).at(j);
        }
    }
    for(int i = 0; i < H; i++)
    {
        for(int j = 0; j < W; j++)
        {
            if(a.at(i).at(j) == '#')
            {
                cnth.at(i) = i;
                break;
            }
    }   }
    for(int i = 0; i < W; i++)
    {
        for(int j = 0; j < H; j++)
        {
            if(a.at(j).at(i) == '#')
            {
                cntw.at(i) = i;
                break;
            }
        }
    }
    for(int i = 0; i < H; i++)
    {
        for(int j = 0; j < W; j++)
        {
            if(cnth.at(i) != -1 && cntw.at(j) != -1)
            {
            	cout << a.at(cnth.at(i)).at(cntw.at(j));
            }
        }
        for(int j = 0; j < W; j++)
        {
          	if(cnth.at(i) != -1 && cntw.at(j) != -1)
            {
                cout << endl;
                break;
            }
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<ll> ods;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

void solve(ll t)
{
    // cout<<"Case #"<<t<<":\n";
    ll r;
    cin>>r;
    ld PI=3.141592653589793;
    ld ans=2*PI*r;
    cout<<fixed<<setprecision(20)<<ans<<endl;
}

int main()
{
    IOS;
    ll t;
    // cin>>t;
    t=1;
    ll tt=1;
    while(t--)
    {
        solve(tt);
        tt++;
    }
}     


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

int K, A, B;
ll b = 1, y = 0;
ll ans = 0;
ll hit;

ll circ() {
	int k = K;
	while (k > 0) {
		if (k >= 2) {
			if (b < A) {
				b++;
				k--;
			}
			else {
				y++;
				b -= A;
				k--;

				b += y * B;
				y--;
				k--;
			}
		}
		else {
			b++;
			k--;
		}
	}
	return b;
}

int main() {
	cin >> K >> A >> B;
	hit = 1 + K;
	ans = max(circ(), hit);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
	int n;cin>>n;
	map<string,int> mp;
	string s;
	while(n){
		cin>>s;
		mp[s]++;
		n--;
	}

	cout<<mp.size()<<"\n";
}

Measured memory_bytes: 19180
package main
import (
  "fmt"
  "os"
)
func main() {
  var s string
  fmt.Scan(&s)
  var n int = len(s)
  for i:=0;i<n-1;i++ {
    if s[i:i+1] == s[i+1:i+2] {
      fmt.Println(i+1,i+2)
      os.Exit(0)
    }
  }
  for i:=0;i<n-2;i++ {
    if s[i:i+1] == s[i+2:i+3] {
      fmt.Println(i+1,i+3)
      os.Exit(0)
    }
  }
  fmt.Println(-1,-1)
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fast std::ios::sync_with_stdio(false);cin.tie(0); cout.tie(0);

 //string ans="";
/*ll solve(ll n )
 {
     if(n<12)
        return n;
     if(mp[n]==0)
            mp[n]=max(solve(n/2)+solve(n/3)+solve(n/4),n);
     return mp[n];
        
 }
*/

int main()
{
   
    fast;
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll a,b;
        cin>>a>>b;
      string s;cin>>s;
      if(s.length()!=a+b+1)
        cout<<"No\n";
      else if(s[a]!='-')
        cout<<"No\n";
     else {
         ll i,f=0;
         for( i=0;i<a;i++)
         {if(s[i]>='0'&&s[i]<='9')
             continue;
             else
                {f=1;break;}
         }
         for(i=a+1;i<a+b+1;i++)
         {if(s[i]>='0'&&s[i]<='9')
             continue;
             else
                {f=1;break;}
         }
         if(f)
            cout<<"No\n";
         else
            cout<<"Yes\n";
     }    
      
    }
}

Measured memory_bytes: 3628
import sys
input = sys.stdin.readline

N,K=map(int,input().split())
A=list(map(int,input().split()))

# Segment tree(1-indexed,再帰を使わないもの,最小値を求める)

seg_el=1<<(N.bit_length())# Segment treeの台の要素数
SEG=[1<<30]*(2*seg_el)# 1-indexedなので、要素数2*seg_el.Segment treeの初期値で初期化

for i in range(N):# Aを対応する箇所へupdate
    SEG[i+seg_el]=A[i]

for i in range(seg_el-1,0,-1):# 親の部分もupdate
    SEG[i]=min(SEG[i*2],SEG[i*2+1])

def update(n,x,seg_el):# A[n]をxへ更新（反映）
    i=n+seg_el
    SEG[i]=x
    i>>=1# 子ノードへ
    
    while i!=0:
        SEG[i]=min(SEG[i*2],SEG[i*2+1])
        i>>=1
        
def getvalues(l,r):# 区間[l,r)に関するminを調べる
    L=l+seg_el
    R=r+seg_el
    ANS=1<<30

    while L<R:
        if L & 1:
            ANS=min(ANS , SEG[L])
            L+=1

        if R & 1:
            R-=1
            ANS=min(ANS , SEG[R])
        L>>=1
        R>>=1

    return ANS

SEG2=[1<<30]*(2*seg_el)# 1-indexedなので、要素数2*seg_el.Segment treeの初期値で初期化

for i in range(N):# Aを対応する箇所へupdate
    SEG2[i+seg_el]=A[i]

for i in range(seg_el-1,0,-1):# 親の部分もupdate
    SEG2[i]=max(SEG2[i*2],SEG2[i*2+1])

def update2(n,x,seg_el):# A[n]をxへ更新（反映）
    i=n+seg_el
    SEG2[i]=x
    i>>=1# 子ノードへ
    
    while i!=0:
        SEG2[i]=max(SEG2[i*2],SEG2[i*2+1])
        i>>=1
        
def getvalues2(l,r):# 区間[l,r)に関するmaxを調べる
    L=l+seg_el
    R=r+seg_el
    ANS=-1

    while L<R:
        if L & 1:
            ANS=max(ANS , SEG2[L])
            L+=1

        if R & 1:
            R-=1
            ANS=max(ANS , SEG2[R])
        L>>=1
        R>>=1

    return ANS

# UnionFind

Group=[i for i in range(N-K+1)]# グループ分け.Group[i]=jのときiとjは同じグループ

def find(x):# find(a)=find(b)のとき同じグループ
    if Group[x]==-1:
        return -1
    
    while Group[x] != x:
        x=Group[x]
    return x

def Union(x,y):  # xとyが同じグループになるよう更新
    if find(x) != find(y):
        Group[find(y)]=Group[find(x)]=min(find(y),find(x))

count=0
for i in range(1,N):
    if A[i]>A[i-1]:
        count+=1
    else:
        count=0
    if count>=K-1:
        Group[i-K+1]=-1
    

for i in range(N-K):
    if A[i]<getvalues(i+1,i+K)<getvalues2(i+1,i+K)<A[i+K]:
        Union(i,i+1)

B=[find(x) for x in range(N-K+1)]
#print(B)
print(len(set(B)))


Measured memory_bytes: 113460
s=input()
if s == 'SUN':
  print('7')
elif s == 'MON':
  print('6') 
elif s == 'TUE':
  print('5') 
elif s == 'WED':
  print('4')
elif s == 'THU':
  print('3')
elif s == 'FRI':
  print('2')
else:
  print('1') 

Measured memory_bytes: 2940
/**
 * Created by hiramekun at 14:58 on 2019-08-26.
 */
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using P = pair<ll, ll>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}


template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template<class T>
ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */
// 約数列挙
vector<ll> divisor(ll n) {
    vector<ll> res;
    for (ll i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            res.emplace_back(i);
            if (i != n / i) res.emplace_back(n / i);
        }
    }
    return res;
}

void solve() {
    ll n, k;
    cin >> n >> k;
    vl a(n);
    cin >> a;

    vl divs = divisor(accumulate(all(a), 0LL));

    ll ans = 0;
    each(e, divs) {
        vl mods(n);
        rep(i, n) mods[i] = a[i] % e;
        sort(all(mods));

        vl minus(n + 1);
        rep(i, n) minus[i + 1] = minus[i] + mods[i];

        vl plus(n + 1);
        repr(i, n) plus[i] = plus[i + 1] + e - mods[i];

        for (ll i = 0; i <= n; ++i) {
            if (max(plus[i], minus[i]) <= k) ans = max(ans, e);
        }
    }
    cout << ans << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

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

  int ans = 100000;
  int S = s.length();
  int T = t.length();
  rep(i, S - T + 1) {
    int cnt = 0;
    rep(j, T) {
      if (s[i + j] != t[j]) cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}


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

signed main(void)
{
	int n, m, ans;
	map<string, int> mp;

	cin >> n;
	rep(i, n)
	{
		string s;
		cin >> s;
		mp[s]++;
	}
	cin >> m;
	rep(i, m)
	{
		string t;
		cin >> t;
		mp[t]--;
	}
	ans = 0;
	for(auto p : mp)
	{
		ans = max(ans, p.second);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
<?php
$str = trim(fgets(STDIN));
  $arr = ["Sunny","Cloudy","Rainy"];
  if($str==$arr[0]) {
    echo $arr[1];
  }
  elseif($str==$arr[1]) {
  	echo $arr[2];
  }
  else {
   echo $arr[0];
  }

Measured memory_bytes: 4604
#include <math.h>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define PI 3.14159265358979323846264338327950L
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

int main() {
  int N, M, X;

  cin >> N >> M >> X;
  vector<vector<int> > A(N, vector<int>(M));
  vector<int> C(N);
  rep(i, N) {
    int p;
    cin >> p;
    C.at(i) = p;
    rep(j, M) {
      int q;
      cin >> q;
      A.at(i).at(j) = q;
    }
  }
  bool ans = false;
  int ans_p = 100000000;

  for (int bit = 0; bit < (1 << N); ++bit) {
    vector<int> S;
    vector<int> result(M, 0);
    int sum = 0;

    for (int i = 0; i < N; ++i) {
      if (bit & (1 << i)) {
        S.push_back(i);
      }
    }
    for (int i = 0; i < (int)S.size(); ++i) {
      rep(j, M) { result.at(j) += A.at(S[i]).at(j); }

      sum += C[S[i]];
    }

    bool test = true;
    rep(i, M) {
      if (result.at(i) < X) {
        test = false;
        break;
      }
    }
    if (test) {
      ans = true;
      ans_p = min(ans_p, sum);
    }
  }

  if (ans) {
    cout << ans_p << endl;
  } else {
    cout << -1 << endl;
  }
}


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

namespace AtCoders {
	class Program {
		static void Main(string[] args) {
			var inputArray = retreiveStringArray();
			var inputCount = 2;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			var S = inputArray[0];
			var T = inputArray[1];

			var input= retreiveLongArray();
			var A = input[0];
			var B = input[1];

			var U = retreiveStringArray()[0];

			if (S==U) {
				A--;
			}
			else {
				B--;
			}
			




			//答えの出力
			var ans = A + " " + B;
			Console.WriteLine(ans);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}


		/// <summary>
		/// 2組みずつの入力データ(数値)からTuppleListを作成する
		/// </summary>
		/// <param name="N"></param>
		/// <returns></returns>
		private static List<Tuple<long, long>> createLongTuppleList(long N) {
			var inpList = new List<Tuple<long, long>>();

			for (int i = 0; i < N; i++) {
				var inp = retreiveLongArray();
				var item1 = inp[0];
				var item2 = inp[1];
				inpList.Add(new Tuple<long, long>(item1, item2));
			}
			return inpList;
		}
	}
}


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

import bisect


M = 4472


def generate_triangle_numbers(max_idx=M):
    assert max_idx >= 0
    for i in range(max_idx + 1):
        yield i * (i + 1) // 2


def decompose(n):
    tris = list(generate_triangle_numbers())
    # T[i - 1] < n <= T[i]
    i = bisect.bisect_left(tris, n)
    t = tris[i]
    if t == n:
        return list(range(1, i + 1))
    else:
        for j in range(1, i):
            if t - j == n:
                return list(range(1, j)) + list(range(j + 1, i + 1))


def main():
    xs = decompose(int(input()))
    print(*xs, sep="\n")


if __name__ == '__main__':
    main()


Measured memory_bytes: 3700
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(ll i=0;i<(n);++i)
#define Fr(i,n) for(long long i=1;i<=(n);++i)
#define ifr(i,n) for(long long i=(n)-1;i>=0;--i)
#define iFr(i,n) for(long long i=(n);i>0;--i)
using Graph = vector<vector<int>>;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int a,b,c;
  cin>>a>>b;
  int arr[a]={};
  fr(i,b){
    int x,y;
    cin>>x>>y;
    ++arr[x-1];
    ++arr[y-1];
  }
  fr(i,a){
    cout<<arr[i]<<"\n";
  }
}  

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

m = [0]*n
m[0] = sum(a)

for i in range((n-1)//2):
	m[0] -= 2*(a[1+i*2])

for i in range(1,n):
	m[i] = 2*a[i-1] - m[i-1]

print(' '.join(map(str, m)))

Measured memory_bytes: 19100
n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(n)]

def check():
    res = 0
    for i in range(q):
        ra, rb, rc, rd = req[i]
        if a[rb - 1] - a[ra - 1] == rc:
            res += rd
    return res

def set_a(idx: int, au: int):
    ans = 0
    for i in range(au, m + 1):
        a[idx] = i
        if idx + 1 < n:
            ans = max(set_a(idx + 1, i), ans)
        else:
            ans = max(check(), ans)
    return ans

print(set_a(0, 1))


Measured memory_bytes: 72812
import math

Q = int(input())
li = []
M = 0
for index in range(Q):
	l, r = map(int, input().split())
	li.append((l, r))
	M = max([M, l, r])

primes = list(range(M+1))
primes[0] = 0
primes[1] = 0
cut_root = math.sqrt(M+1)
for prime in primes:
	if prime > cut_root:
		break
	if prime == 0:
		continue
	for non_prime in range(2 * prime, M, prime):
		primes[non_prime] = 0
similar_2017 = [0 for _ in range(M+1)]
similar_2017[3] = 1
for i in range(5, M+1, 4):
	if primes[i] != 0:
		if primes[(i+1)//2] != 0:
			similar_2017[i] = 1
similar_sum = [0 for _ in range(M+1)]
for i in range(1,M+1):
	if similar_2017[i] == 1:
		similar_sum[i] = similar_sum[i-1] + 1
	else:
		similar_sum[i] = similar_sum[i-1]

for l, r in li:
	print(similar_sum[r] - similar_sum[l-1])

Measured memory_bytes: 22856
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var s = o.a(1);
  if(s[0] === "S")return "Cloudy";
  if(s[0] === "C")return "Rainy";
  return "Sunny";
}

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

int main() {
  int N; cin >> N;
  
  vector<int> t(N+1, 0), x(N+1, 0), y(N+1, 0);
  for (int i = 1; i < N+1; i++) cin >> t[i] >> x[i] >> y[i];
  
  bool can = true;
  for (int i = 0; i < N; i++) {
    int dt = t[i+1]-t[i];
    int dist = abs(x[i+1]-x[i]) + abs(y[i+1]-y[i]);
    if (dt < dist) can = false;
    if (dist % 2 != dt % 2) can = false;
  }
  
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
}
     
  

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

typedef pair<int,int> pii;
typedef vector<int> vec;
typedef unordered_map<int,int> hash;
#define long long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define sz(x) (int)x.size()
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define fill(a,v) memset(a,v,sizeof(a))
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define INF 0x3f3f3f3f//infinity for integers
#define JJ ios_base::sync_with_stdio(0); cin.tie(0)//input fast
#define MOD 1000000007


int main()
{
	JJ;
	string str; cin>>str;
	int n=str.length();
	long sum=0;
	for(int i=0;i<n;i++){
		sum+=(str[i]-'0');
		sum%=9;
	}
	if(sum%9==0){
		cout<<"Yes"<<endl;
		
	}
	else
		cout<<"No"<<endl;


	return 0;
}


Measured memory_bytes: 3736
#include <stdio.h>
int main(void){
    int A,B,C,R;
    
    scanf("%d %d %d",&A,&B,&C);
    
    R=B/A;
    
    if(R<C){
        printf("%d",R);
    }
    else{
        printf("%d",C);
    }
    return 0;
}


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

const int INF=1e9;
struct edge{int to,cap,rev;};
vector<edge>G[1001];
bool used[1001];

int N;
void add_edge(int from,int to,int cap){
    G[from].push_back((edge){to,cap,G[to].size()});
    G[to].push_back((edge){from,0,G[from].size()-1});
}

int dfs(int s,int t,int f){
    if(s==t)return f;
    used[s]=true;
    for(int i=0;i<G[s].size();i++){
        edge &e=G[s][i];
        if(used[e.to]||e.cap==0)continue;
        int _f=dfs(e.to,t,min(f,e.cap));
        if(_f){
            e.cap-=_f;
            G[e.to][e.rev].cap+=_f;
            return _f;
        }
    }
    return 0;
}

int max_flow(int s,int t){
    int flow=0;
    while(true){
        fill_n(used,N+1,false);
        int f=dfs(s,t,INF);
        if(f)flow+=f;
        else return flow;
    }
}

int main(){
    cin>>N;
    for(int i=1;i<N;i++){
        int a;
        cin>>a;
        if(a)add_edge(i,N,INF);
    }

    for(int i=0;i<N-1;i++){
        int a,b,c;
        cin>>a>>b>>c;
        add_edge(a,b,c);
        add_edge(b,a,c);
    }

    cout<<max_flow(0,N)<<endl;
    return 0;
}

Measured memory_bytes: 1336
#include<stdio.h>
#define FOR(n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRS(s) printf("%s\n",s)
int asc(const void *b, const void *a) {
  return *(int *)a - *(int *)b;
}

int main() {
  int n;
  scanf("%d",&n);
  int a[n],b[n];
  FOR(n){
    scanf("%d",&a[i]);
    b[i]=a[i];
  }
  qsort(a, sizeof(a) / sizeof(int), sizeof(int), asc);
  FOR(n){
    if(b[i]==a[0]){
      PRN(a[1]);
    }else{
      PRN(a[0]);
    }
  }
  return 0;
}

Measured memory_bytes: 3120
n = int(input())
num = [0]*10000

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x**2 + y**2 + z**2 + x*y + y*z + z*x - 1
            if a <= 9999:
                num[a] += 1

num = num[:n]

for i in num:
    print(i)


Measured memory_bytes: 9436
while true
        input = STDIN.gets.split(' ')

        case input[1]
        when '+'
                puts input[0].to_i + input[2].to_i
        when '-'
                puts input[0].to_i - input[2].to_i
        when '*'
                puts input[0].to_i * input[2].to_i
        when '/'
                puts input[0].to_i / input[2].to_i
        else
                break
        end

end

Measured memory_bytes: 6096
#include<iostream>
using namespace std;
#define MAX 2000000

int H=0,A[MAX+1];

void print()
{

    cout << "H:" << H <<endl;
    for(int i=1;i<=H;i++)
    {
        cout << A[i] << " ";
    }
    cout << endl;
}

void maxHeapify(int i)
{
    int l,r,largest;
    l=2*i;
    r=2*i+1;

    if(l<=H && A[l]>A[i])largest=l;
    else largest =i;
    if(r<=H && A[r]>A[largest])largest=r;

    if(largest!=i)
    {
        swap(A[i],A[largest]);
        maxHeapify(largest);
    }
}

void insertkey(int key)
{
    H++;
    A[H]=key;
    //cout << "insert" << A[H] << endl;
    int i=H;
    while(i>1 && A[i/2]<A[i])
    {
        swap(A[i],A[i/2]);
        i=i/2;
    }
}

int extractMax()
{
    if(H<1) return -1;
    int maxValue=A[1];
    A[1]=A[H];
    H--;
    maxHeapify(1);
    return maxValue;
}

int main()
{
    char com[100];
    int key;
    cin >> com;
    while(!(com[0]=='e' && com[1]=='n'))
    {
        if(com[0]=='i')
        {
            cin >> key;
            insertkey(key);
            //print();
        }else{
            cout << extractMax() << endl;
        }

        cin >> com ;
    }

    return 0;
}




Measured memory_bytes: 6996
//According to all known laws of aviation, there is no way that a bee should be able to fly.
//Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway.
//Because bees don't care what humans think is impossible.
#include <bits/stdc++.h>
#define FAST_IO  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define endl "\n"
using namespace std ;
using bigint = long long int ;
using vi = vector<int> ;
using vll = vector<long long int> ;

int main(){
    int H , W ; cin >> H >> W ;
    char S[H+1][W+1] ;
    for( int i = 0 ; i < H ; i++ ){
        string str ; cin >> str ;
        for( int j = 0 ; j < W ; j++ )
            S[i][j] = str[j] ;
    }
    int left[2001][2001] = { 0 } , right[2001][2001] = { 0 } , up[2001][2001] = { 0 } , down[2001][2001] = { 0 } ;
   for(int i=0; i<H; i++){
      for(int j=0; j<W; j++){
        if(S[i][j]=='.'){
          if(j==0){
            left[i][j] = 1;
          }else{
            left[i][j] = left[i][j-1] + 1;
          }
        }
      }
    }
     for(int i=0; i<H; i++){
      for(int j=W-1; j>=0; j--){
        if(S[i][j]=='.'){
          if(j==W-1){
            right[i][j] = 1;
          }else{
            right[i][j] = right[i][j+1] + 1;
          }
        }
     
      }
     }
     for(int i=0; i<W; i++){
      for(int j=H-1; j>=0; j--){
        if(S[j][i]=='.'){
          if(j==H-1){
            down[j][i] = 1;
          }else{
            down[j][i] = down[j+1][i] + 1;
          }
        }
        
      }
    }
    for(int i=0; i<W; i++){
      for(int j=0; j<H; j++){
        if(S[j][i]=='.'){
          if(j==0){
            up[j][i] = 1;
          }else{
            up[j][i] = up[j-1][i] + 1;
          }
        }
        
      }
    }
    
    int ans = 0 ;
    for( int i = 0 ; i < H ; i++ ){
        for( int j = 0 ; j < W ; j++ ){
            if( S[i][j] != '#' ){
                int T = left[i][j] + right[i][j] + down[i][j] + up[i][j] - 3  ;
                ans = max( ans , T ) ;
            }
        }
    }
    cout << ans << endl ;
    return 0 ;
}


Measured memory_bytes: 70084
#include<vector>
#include<list>
#include<map>
#include<set>
#include<iostream>


using namespace std;

void solve(){
	int x,t,r;
	cin >> x >> t;
	r = x - t;
	if(r < 0){
		cout << "0" << endl;
	}else{
		cout << r << endl;
	}
}

int main(){
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/foreach.hpp>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
#define _GLIBCXX_DEBUG
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
vector<long> Primelist;
//template functions
/////////////////////////
void Prinit(){
long PR=10000001;
vector<long> P(PR,0);
for(long i=2;i*i<PR;i++){
    if(P.at(i)==0){
        long j=i;
      j+=i;
        while(j<PR){
            P.at(j)=1;
             j+=i;         
        }
    }
}

for(long i=2;i*i<PR;i++){//Primelist.size()=446
    if(P.at(i)==0){
        Primelist.push_back(i);
    }
}
}

void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

long strtolong(string str){
istringstream ss;
ss=istringstream(str);
long num;
ss>>num;
return num;
}

long chartolong(char ch){
long num;
num=ch-'0';
return num;
}

long Max2(long a,long b){
if(a>b){
    return a;
}else{
    return b;
}
}

long Min2(long a,long b){
if(a>b){
    return b;
}else{
    return a;
}
}


string longtostr(long N){
    string str;
    str=to_string(N);
    return str;
}









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


//Answer


int main() {
long N;//now現存燃料
cin>>N;
vector<long> a(3*N);
typedef pair<long,long> P;
vector<P> sum(N+1);
vector<long> ans(N+1);
priority_queue<long, vector<long>, greater<long>> PQa;
priority_queue<long> PQb;
long suma=0,sumb=0;

for(long i=0;i<3*N;i++){
cin>>a.at(i);
if(i<N){
PQa.push(a.at(i));
suma+=a.at(i);
}
if(i>=2*N){
PQb.push(a.at(i));
sumb+=a.at(i);
}
}

sum.at(0).first=suma;
sum.at(N).second=sumb;

for(long i=0;i<N;i++){
PQa.push(a.at(N+i));
PQb.push(a.at(2*N-1-i));
long min=PQa.top();
long max=PQb.top();
PQa.pop();
PQb.pop();
sum.at(i+1).first=sum.at(i).first+(a.at(N+i)-min);
sum.at(N-1-i).second=sum.at(N-i).second+a.at(2*N-i-1)-max;
  //cout<<sum.at(N-1-i).second<<endl<<a.at(2*N-i-1)<<endl<<max<<endl;
}

for(long i=0;i<N+1;i++){
    ans.at(i)=sum.at(i).first-sum.at(i).second;
}

sort(ans.begin(),ans.end());
reverse(ans.begin(),ans.end());

cout<<ans.at(0)<<endl;
/*for(long i=0;i<N+1;i++){
    cout<<sum.at(i).first<<endl<<sum.at(i).second<<endl;
}*/

}






Measured memory_bytes: 244724
// Code by : h_mm 

#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ull unsigned long long
#define ll long long
#define test ll t; cin>>t; while(t--)
using namespace std;

int main(void) {
    string s, t;
    cin>>s>>t;
    int ans = INT_MAX;
    for(int i=0; i<=s.length()-t.length(); i++) {
        int cost = 0;
        // cout<<i<<" "<<s[i]<<endl;
        for(int j=0; j<t.length(); j++) {
            // cout<<t[j]<<" "<<s[i+j]<<"      ";
            if(t[j] != s[j+i]) {
                cost++;
            }
        }
        // cout<<"cost is : "<<cost<<endl;
        if(cost<ans) {
            ans = cost;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N,K;
ll A[100005],B[100005];

int main(){
  cin>>N>>K;
  for(int i=0;i<N;i++)cin>>A[i]>>B[i];

  ll maxm=1;
  while( maxm<K )maxm*=2;


  if( __builtin_popcountll( K+1LL ) == 1 ){
    ll ans=0;
    for(int i=0;i<N;i++)
      if(A[i]<=K)ans+=B[i];
    cout<<ans<<endl;
    return 0;
  }

  ll ans=0;
  for(int j=0;j<N;j++){
    if( (K|A[j]) == K ){
      ans+=B[j];
    }
  }
  
  for(int i=1;i<60;i++){
    if( (K>>i & 1)==0 )continue;
    ll X=K-(1LL<<i);
    X|= ( (1LL<<i)-1 );

    ll sum=0;
    for(int j=0;j<N;j++){
      if( (X|A[j]) == X ){
        sum+=B[j];
      }
    }
    ans=max(ans,sum);
  }

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


Measured memory_bytes: 1792