akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  ll a; double b; cin >> a >> b;

  ll nb = b * 100.001;
  // cout << nb << endl;
  ll ans = a * nb;
  // cout << ans << endl;
  ans /= 100;
  cout << ans << endl;
}


Measured memory_bytes: 3728
#include<stdio.h>
int main(){
int x,y,temp;
for(;;){
scanf("%d%d",&x,&y);
if(x>y){
temp = y;
y = x;
x = temp;
}
if((x==0)&&(y==0)) break;
printf("%d %d\n",x,y);
}
return 0;
}

Measured memory_bytes: 600
L,A,B,M=map(int,input().split())
K=19
gap=[-1 for k in range(K)]
for k in range(K):
    tmp=10**k-A
    if tmp%B==0:
        gap[k]=-1+tmp//B
    else:
        gap[k]=tmp//B
    gap[k]=min(L-1,gap[k])
    gap[k]=max(-1,gap[k])
num=[0 for k in range(K)]
for k in range(1,K):
    #k-1,k
    num[k]=-gap[k-1]+gap[k]
def matrix(d):
    return [[pow(10,d,M),1,0],[0,1,B],[0,0,1]]
def mattime(P,Q):
    R=[[0,0,0],[0,0,0],[0,0,0]]
    for i in range(3):
        for j in range(3):
            for k in range(3):
                R[i][j]+=P[i][k]*Q[k][j]
                R[i][j]%=M
    return R
def matexp(P,n):
    if n==0:
        return [[1,0,0],[0,1,0],[0,0,1]]
    elif n%2==0:
        return matexp(mattime(P,P),n//2)
    else:
        return mattime(P,matexp(mattime(P,P),n//2))
Mat=[[1,0,0],[0,1,0],[0,0,1]]
for d in range(1,K):
    Mat=mattime(matexp(matrix(d),num[d]),Mat)
print((A*Mat[0][1]+Mat[0][2])%M)


Measured memory_bytes: 39280
from collections import defaultdict
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
plus = [A[i] + i for i in range(N)]
minus = [A[i] - i for i in range(N)]
cnt = defaultdict(int)
ans = 0
for i in range(N):
    ans += cnt[-minus[i]]
    cnt[plus[i]] += 1
print(ans)


Measured memory_bytes: 146176
while True:
    n, l, r = map(int, input().split())
    if (n | l | r) == 0:
        break

    A = []

    for i in range(n):
        A.append(int(input()))

    ans = 0

    for y in range(l, r + 1):

        a = 0

        for i in range(n):
            if y % A[i] == 0:
                a = i + 1
                break

        if a != 0 and a % 2 == 1:
            ans += 1

        if a == 0 and n % 2 == 0:
            ans += 1

    print(ans)



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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;
typedef vector<pp> vpp;
typedef unsigned int i64;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define all(e) (e).begin(), (e).end()
#define pb push_back

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

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


template <typename T>
void printV(vector<T> A) {
  if (A.empty()) cerr << "EMTPY\n";
  else { 
    cerr << "[";
    for (int i = 0; i < A.size() -1 ; ++i) {
      cerr << A[i] << ", ";
    }
    if (A.size()) cerr << A.back() << "]\n";
  }
}


template <typename T>
void printVV(vector<vector<T>> A) {
  cerr << "[";
  for (auto v : A) {
    printV<T>(v);
  }
  cerr << "]";
}

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&& ...args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

int main(int argc, char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k; cin >> n >> k;
  cout << min(n % k, abs(n % k - k)) << endl;

  return 0;
}



Measured memory_bytes: 3520
# coding: utf-8
# Your code here!

n,m,k = map(int,input().split())
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        #または、quit(),os.exit()をして止める。
x=[[0] * (m+1) for i in range(2**n)] 
#print(listA)
for i in range(2 ** n):
    for j in range(n):
        if((i >> j) & 1 ):
            for l in range(m+1):
                x[i][l] += listA[j][l]
            
#print(x)
#print(list(range(1,m+1)))
cnt = 10**10
t = [k] * (m+1)
#print(t)
f = 0
for i in x:
    #print(i)
    u = 0
    for j in range(1, m+1):
        #print(1)
        if i[j] < t[j]:
            u = 1
    if u != 1:
        if cnt >= i[0]:
            cnt = i[0]
            f = 1
    #print(cnt)    
if f != 0:
    print(cnt)
else:
    print(-1)


                
     

Measured memory_bytes: 11124
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] h = new int[N];
        int counter = 0;

        while (sc.hasNextInt()) {
            h[counter] = sc.nextInt();
            counter++;
        }

        int[] dp = new int[N];

        for (int i = 0; i < N; i++) {
            dp[i] = Integer.MAX_VALUE;
        }

        dp[0] = 0;

        for (int i = 0; i < N; i++) {
            for (int j = 1; j <= K; j++) {
                if (i + j < N) {
                    dp[i + j] = Math.min(dp[i + j], dp[i] + Math.abs(h[i] - h[i + j]));
                }
            }
        }

        System.out.println(dp[N - 1]);

    }
}


Measured memory_bytes: 55476
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
using Graph = vector<vector<int> >;
using GraphC = vector<vector<char> >;
const int INF = 1000000000;
typedef pair<int, int> P;
const int MAX_N = 200000;
const int MAX_L = 100000000;
const int MAX_SQRT_B = 10000;
typedef int64_t ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int N;

int main() {
	cin >> N;
	vector<int> a(3 * N);
	rep(i, 3 * N) {
		cin >> a.at(i);
	}

	sort(a.begin(), a.end());
	ll ans = 0;
	for (int i = N; i < 3*N; i+=2)
	{
		ans += a.at(i);
	}
	cout << ans << endl;
}

Measured memory_bytes: 4228
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
int main()
{
    ft
    ll t,i,j,n,m,l,r;
    cin>>n>>m;
    (n==m)? cout<<"Yes\n": cout<<"No\n";
    return 0;
}

Measured memory_bytes: 3648
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(){
  long long n;
  cin >> n;
  if(n % 2) cout << 0 << endl;
  else{
    long long t = 0;
    while(n >= 1){
      n /= 5;
      t += n / 2;
    }
    cout << t << endl;
  }
}


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

const int MAXN = 1005;
const int MAXV = MAXN * (MAXN - 1) / 2;
int id[MAXN][MAXN];

int toId(int i, int j){
    if(i > j) swap(i, j);
    return id[i][j];
}

vector<vector<int>> A;
vector<int> to[MAXV];
int N, dp[MAXV];
bool visited[MAXV], calculated[MAXV];

int dfs(int v){
    if(visited[v]){
        if(!calculated[v]) return -1;
        return dp[v];
    }
    visited[v] = true;
    dp[v] = 1;
    for(auto u: to[v]){
        int res = dfs(u);
        if(res == -1) return -1;
        dp[v] = max(dp[v],  res + 1);
    }
    calculated[v] = true;
    return dp[v];
}

int main(){
    cin >> N;
    A.assign(N, vector<int>(N-1));
    rep(i, N) rep(j, N-1) cin >> A[i][j], A[i][j]--;

    int V = 0;
    rep(i, N) rep(j, N) if(i < j) id[i][j] = V, V++;

    rep(i, N){
        rep(j, N - 1) A[i][j] = toId(i, A[i][j]);
        rep(j, N - 2) to[A[i][j]].push_back(A[i][j+1]);
    }

    int ans = 0;
    rep(i, V){
        int res = dfs(i);
        if(res == -1){
            puts("-1");
            return 0;
        }
        ans = max(ans, res);
    }
    cout << ans << endl;
}

Measured memory_bytes: 38528
#include <iostream>
#include <algorithm>
#include <string>

long long n;
long long dfs(std::string in, bool a, bool b, bool c) {
	if (std::stoll(in) > n)
		return 0;

	long long ans = 0;
	if (a&&b&&c)
		++ans;
	ans += dfs(in + "7", true, b, c);
	ans += dfs(in + "5", a, true, c);
	ans += dfs(in + "3", a, b, true);
	return ans;
}

int main() {
	std::cin >> n;
	long long ans = 0;
	ans += dfs("7", true, false, false);
	ans += dfs("5", false, true, false);
	ans += dfs("3", false, false, true);
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007

using namespace std;

int main()
{
#ifdef WIN32
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    string s;
    cin >> s;
    int c = 0, ans = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'R')
            c++;
        else
        {
            ans = max(ans, c);
            c = 0;
        }
    }
    ans = max(c, ans);
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int H, W; cin >> H >> W;
	int a = 0;
	for (int i = 0; i < H*W; i++){
		char c; cin >> c;
		if (c == '#')++a;
	}
	cout << ((a == H + W - 1) ? "P" : "Imp") << "ossible\n";
}

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

int n , a[100001] , s;

int main(){
	cin>>n;
	for(int i = 0 ; i < n; i++){
		cin>>a[i];
	}
	if(a[0] > 0){
		s += a[0];
	}
	else s -= a[0];
	for(int i = 0; i < n; i++){
		s += abs(a[i] - a[i + 1]);
	}
//	if(a[n - 1] > 0){
//		s += a[n - 1];
//	}
//	else s -= a[n - 1];
//	cout<<s<<endl;
	for(int i = 0 ; i < n; i++){
		cout<<abs(s - abs(a[i] - a[i - 1]) - abs(a[i] - a[i + 1]) + abs(a[i - 1] - a[i + 1]))<<endl;
	}
}

Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;

int power(int a,int b){
    int res=1;
    while(b){
        if(b%2)res*=a;
        a*=a;
        b/=2;
    }
    return res;
}

int main(){
    int n;cin>>n;
    vector<int> v={3,5,7,11,13},ans;
    ans.push_back(135);
    ans.push_back(189);
    for(int i=0;i<5;i++)for(int j=i+1;j<5;j++)for(int k=j+1;k<5;k++){
        if(v[i]*v[j]*v[k]<=200)ans.push_back(v[i]*v[j]*v[k]);
    
    }
    
    int a=0;
    //for(int i=0;i<ans.size();i++)cout<<ans[i]<<endl;
    for(int i=1;i<=n;i++){
        if(find(ans.begin(),ans.end(),i)!=ans.end())a++;
    }
    cout<<a;
}

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

using namespace std;
using ll = long long;

int main() {
    int n;
    cin>>n;
    vector<int> a(n);
    int ex=0;
    for(int i = 0;i < n;++i) {
        cin>>a[i];
        ex=(ex^a[i]);
    }
    for(int i = 0;i < n;++i) {
        cout<<(ex^a[i]);
        if(i==n-1)cout<<endl;
        else cout<<" ";
    }
    return 0;
}


Measured memory_bytes: 4048
#include<bits/stdc++.h>
using namespace std;
signed main(){
  string s,t;
  cin>>s>>t;
  vector<string> v;
  for(int i=0;i+t.size()-1<s.size();++i){
    bool match=true;
    for(int j=0;j<t.size();++j){
      if(t[j]!=s[i+j]&&s[i+j]!='?'){match=false;break;}
    }
    if(match){
      string u(s);
      for(int j=0;j<t.size();++j)u[i+j]=t[j];
      for(int j=0;j<u.size();++j)if(u[j]=='?')u[j]='a';
      v.push_back(u);
    }
  }
  if(v.empty())return cout<<"UNRESTORABLE\n",0;
  sort(v.begin(),v.end());
  cout<<v[0];
}

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

int main(){

int a,b,soma=0;

ios::sync_with_stdio(false);

cin >> a >> b;

for(int i=0;i<2;i++){

    if (a>b){soma+=a;a--;}
    else{soma+=b;b--;}


}

cout << soma << endl;


return 0;
}


Measured memory_bytes: 256
N = int(input())
S = [list(input()) for i in range(N)]

ans = 0
flg = False
for a in range(N):
    S2 = S[a:] + S[:a]
    for i in range(N):
        for j in range(N):
            if S2[i][j] != S2[j][i]:
                flg = True
                break
        if flg:
            flg = False
            break
    else:
        ans += 1

print(ans * N)

Measured memory_bytes: 44764
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <map>
#include <set>
using namespace std;

int main() {

    int n;
    string s, tmp;
    map<string, bool> MP;

    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> s;
        if (s == "insert") {
            cin >> tmp;
            MP[tmp] = true;
        } else if (s == "find") {
            cin >> tmp;
            cout << (MP[tmp] ? "yes" : "no") << endl;
        }
    }


    return 0;
}


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

using namespace std;

int n;
int a[101];

int cal(int x)
{
	int ans = 0;
	for (int i=1;i<=n;i++)
		ans += (a[i] - x)*(a[i] - x);
	return ans;	
}

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

	cin >> n;
	for (int i=1;i<=n;i++)
		cin >> a[i];
	int sum = accumulate(a+1,a+1+n,0);
	int x1 = sum/2;
	int x2 = x1 + 1;
	cerr << x1 << ' ' << x2 << '\n';
	int res = 1e9;
	for (int i=1;i<=100;i++)
		res = min(res,cal(i));
	cout << res;
}

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

using namespace std;

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

const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1000000000000000000L;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int ddx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[] = {0, 1, 1, 1, 0, -1, -1, -1};

int extgcd(int a, int b, int& x, int&y) {
    int d = a;
    if(b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }else {
        x = 1;
        y = 0;
    }
    return d;
}

int inv(int a) {
    int x, y;
    extgcd(a, MOD, x, y);
    return (x + MOD) % MOD;
}

int main() {
    ll n;
    cin >> n;
    cout << n * (n - 1) / 2 << endl;
}


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

int main(){
int N;
  cin >> N;
  vector<int> a(N);
  for(int i = 0;i <N;i++)
    cin >> a.at(i);
  vector<int> x(0);
  
  for(int T =0;T<N;T++){
    int a1 = 0;
    int a2 = 0;
   for(int i =0;i<T;i++)
     a1 += a.at(i);
    
   for(int j =T;j<N;j++)
     a2 += a.at(j);
    
    int sa = max(a1,a2) - min(a1,a2);
    x.push_back(sa);
  }

 sort(x.begin(),x.end());
  cout << x.at(0) << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int x,s=400,t=599,m=8,r;
  cin>>x;
  for(int i=0;i<9;i++)
  {
    if(x>=s && x<=t)
    {
      r=m;
      break;
    }
    else
    {
      s=t+1;t=t+200;
      m--;
    }
  }
  cout<<r;
  return 0;
}

Measured memory_bytes: 3584
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;

//The Two Men of the Japanese Alps
public class Main{

	int INF = 1<<29;
//	double[][] dist;
	Map<Integer, Double>[] map;
	
	double calc(double x1, double y1, double x2, double y2){
		return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	}
	
	@SuppressWarnings("unchecked")
	void run(){
		Scanner sc = new Scanner(System.in);
		int[] xs = new int[100], ys = new int[100], y = new int[6000];
		double[] x = new double[6000];
//		dist = new double[2500][2500];
		for(;;){
			int n = sc.nextInt();
			if(n==0)break;
			Set<Integer> yset = new HashSet<Integer>();
//			int[] xs = new int[n], ys = new int[n];
			for(int i=0;i<n;i++){
				xs[i] = sc.nextInt();
				yset.add(ys[i]=sc.nextInt());
			}
			int[] Y = new int[yset.size()];
			int id = 0;
			for(int yy:yset)Y[id++]=yy;
			Arrays.sort(Y);
			id = 0;
//			int[] y = new int[6000];
			for(int i=0;i+1<n;i++){
				if(ys[i]==ys[i+1]){
					x[id] = xs[i];
					y[id++] = ys[i];
				}
				else if(ys[i]<ys[i+1]){
					for(int j=0;j<Y.length&&Y[j]<ys[i+1];j++){
						if(Y[j]<ys[i])continue;
						x[id] = (xs[i+1]-xs[i])*(Y[j]-ys[i]+0.)/(ys[i+1]-ys[i]) + xs[i];
						y[id++] = Y[j];
					}
				}
				else{
					for(int j=Y.length-1;j>=0&&Y[j]>ys[i+1];j--){
						if(Y[j]>ys[i])continue;
						x[id] = (xs[i+1]-xs[i])*(Y[j]-ys[i]+0.)/(ys[i+1]-ys[i]) + xs[i];
						y[id++] = Y[j];
					}
				}
			}
			x[id] = xs[n-1];
			y[id++] = 0;
//			for(int i=0;i<id;i++)for(int j=0;j<id;j++)dist[i][j]=INF;
//			dist = new double[id][id];
//			for(double[]d:dist)Arrays.fill(d, INF);
//			dist[0][id-1] = 0;
			map = new Map[id];
			for(int i=0;i<id;i++)map[i]=new HashMap<Integer, Double>();
			map[0].put(id-1, 0.);
			PriorityQueue<int[]> q = new PriorityQueue<int[]>(id, new Comparator<int[]>() {
				public int compare(int[] o1, int[] o2) {
					return (int)Math.signum(map[o1[0]].get(o1[1]) - map[o2[0]].get(o2[1]));
				}
			});
			q.add(new int[]{0, id-1});
			double res = INF;
			while(!q.isEmpty()){
				int[] V = q.poll();
				int i = V[0], j = V[1];
				if(i==j){
					res = Math.min(res, map[i].get(j)); continue;
				}
				for(int di=-1;di<=1;di++){
					int ni = i+di;
					if(ni<0 || id<=ni)continue;
					for(int dj=-1;dj<=1;dj++){
						int nj = j+dj;
						if(nj<0 || id<=nj || nj < ni || y[ni]!=y[nj])continue;
						double w = map[i].get(j) + calc(x[i], y[i], x[ni], y[ni]) + calc(x[j], y[j], x[nj], y[nj]);
						if(!map[ni].containsKey(nj) || w < map[ni].get(nj)){
							map[ni].put(nj, w);
							q.add(new int[]{ni, nj});
						}
					}
				}
			}
			System.out.println(res);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 17000
use std::cmp;
use std::fmt::Debug;
use std::str::FromStr;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim()
        .split_whitespace()
        .map(|c| T::from_str(c).unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_as_string() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main() {
    let n: usize = read_as_vec()[0];
    let mut d: Vec<(u64, u64)> = vec![];
    for _ in 0..n {
        let line = read_as_vec::<u64>();
        d.push((line[0], line[1]));
    }

    for i in 0..n - 2 {
        if d[i].0 == d[i].1 && d[i + 1].0 == d[i + 1].1 && d[i + 2].0 == d[i + 2].1 {
            println!("Yes");
            return;
        }
    }
    println!("No");
}


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

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

  if (S == "ABC")
    cout << "ARC" << endl;
  else
    cout << "ABC" << endl;

  return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <map>
#include<vector>
#include<cstring>
using namespace std;

int n;
int k[1010];
string s[1010];
vector<int> g[1010];

void dfs(int v, int d){
  for(int i=0;i<d;i++)cout << ".";
  cout << s[v-1] << endl;
  for(int i=0;i<g[v].size();i++){
    dfs(g[v][i],d+1);
  }
}

int main (void){
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> k[i] >> s[i];
    g[k[i]].push_back(i+1);
  }
  dfs(1,0);
  return 0; 
}

Measured memory_bytes: 1424
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


x = ni()


def is_prime(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0:
        return False
    for i in range(3, int(x**0.5) + 1, 2):
        if x % i == 0:
            return False
    return True


for ans in range(x, 10**5 + 4):
    if is_prime(ans):
        print(ans)
        break


Measured memory_bytes: 3444
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]

ends = [[[], []] for _ in range(n+1)]
for i, (a, b) in enumerate(ab, start = 1):
    ends[a][0].append(i)
    ends[b][1].append(i)
# for e in ends: print(e)

ans = 0
orders = set([])
for start, end in ends:
    if len(end) > 0:
        rm_bridge = False
        for e in end:
            if e in orders:
                orders.remove(e)
                rm_bridge = True
        if rm_bridge:
            orders = set([])
        ans += int(rm_bridge)
    if len(start) > 0:
        for s in start:
            orders.add(s)
    # print(orders)
print(ans)

Measured memory_bytes: 58844
#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll mod= 1e9 + 7;


int main(){
  ll x,k,d;
  cin >> x >>k >>d;
  x=abs(x);
  if(x/d>k){cout << x-k*d << endl;}
  else{
    ll al=x%d;
    ll re=k-(x-al)/d;//remain count
    if((re+2)%2==0){cout << al << endl;}else{cout << d-al <<endl;}
  }
}

Measured memory_bytes: 3632
n,k=map(int,input().split())
import numpy as np
h=np.array(input().split(),np.int64)
if n<3:
  print(abs(h[0]-h[1]))
  exit()
dp=np.zeros(n)
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
  j=max(0,i-k)
  dp[i]=np.min(dp[j:i]+np.abs(h[i]-h[j:i]))
  #dp[i]=min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(k+1,i+1))])
print(int(dp[-1]))


Measured memory_bytes: 22304
fun main() = Thread(null, ::aising2020b, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun aising2020b() {
    readLine()
    val aList = readLine()!!.split(' ').map { it.toInt() }

    val answer = aList.withIndex().count { (index, value) -> index % 2 == 0 && value % 2 == 1 }

    println(answer)
}


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

#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}

template<typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	print_tuple<Cdr...>(os,t);
	os<<(sizeof...(Cdr)?",":"")<<get<sizeof...(Cdr)>(t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C,typename=decltype(begin(C()))>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int main()
{
	#ifndef _GLIBCXX_DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	constexpr char endl='\n';
	#endif
	
	for(int s,d,m;cin>>s>>d>>m && s|d|m;){
		vvi w(s),p(s);
		rep(i,s){
			int k; cin>>k;
			w[i].resize(k); p[i].resize(k);
			rep(j,k) cin>>w[i][j]>>p[i][j];
		}
		vi f(d);
		rep(i,d) cin>>f[i];
		
		vi dp(m+1);
		for(int i:f)
			rep(j,p[i].size()) peri(k,p[i][j],m+1)
				dp[k]=max(dp[k],dp[k-p[i][j]]+w[i][j]);
		int res=max_element(all(dp))-begin(dp);
		cout<<dp[res]<<' '<<res<<endl;
	}
}

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

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

    int H[N] = {0};
    int maxCnt = 0;
    int count = 0;
    for (int i = 1; i < N + 1; i++) {
        cin >> H[i];
        if (H[i] <= H[i - 1]) {
            count++;
        }
        else {
            if (maxCnt < count) {
                maxCnt = count;
            }
            count = 0;
        }
    }
    if (maxCnt < count) {
        maxCnt = count;
    }

    cout << maxCnt << endl;

    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	int ans=0;
	cin >>n;
	Vi a(n);
	rep(i,n){
		cin>>a[i];
		if(i%2==0 and a[i]%2==1){
			ans++;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3596
n = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    enemy = A[i]+A[i+1]
    if enemy-B[i] >= 0:
        ans += B[i]
        if A[i]<B[i]: A[i+1] -= B[i]-A[i]
    else:
        ans += enemy
        A[i+1] = 0
print(ans)


Measured memory_bytes: 18624
#include <vector>
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>

using namespace std;


int main(void){
  
  string S,T,ans="Yes";

  cin >> S >> T;

  for(int i =0; i<S.length();i++){
    if(S[i]!=T[i]){
      ans="No";
      break;
    }
  }
 
  cout << ans << endl;
 
  return 0;
}




Measured memory_bytes: 3624
/**
 *      purpose : ABC 119 B
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <iostream>
#include <fstream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cctype>
#include <cstring>
#include <chrono>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = int64_t;
using pii = pair<int, int>;
using pll = pair<int64_t, int64_t>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define print(x) cout << (x) << '\n'
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define fi first
#define se second

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n; cin >> n;
  double x[n]; string y[n];
  rep(i, n) cin >> x[i] >> y[i];

  double ans = 0.0;

  rep(i, n){
    if (y[i] == "JPY") ans += x[i];
    else ans += 380000.0 * x[i];
  }
  cout << setprecision(15) << ans << '\n';
  
  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 = long long;
using P = pair<int,int>;

int main(){
    ll a, b, memo;
    cin >> a >> b;
    b++;
    vector<ll> n(42);
    vector<ll> an(42);
    vector<ll> bn(42);
    rep(i, 42){
        n.at(i) = 0;
        an.at(i) = 0;
        bn.at(i) = 0;
    }
    rep(i, 42){
        memo = pow(2, i);
        an.at(i) = a/(memo*2)*memo + max(a%(memo*2)-memo, 0LL);
        bn.at(i) = b/(memo*2)*memo + max(b%(memo*2)-memo, 0LL);
        if((bn.at(i) - an.at(i))%2 == 1) n.at(i) = 1;
    }
    ll ans = 0;
    rep(i, 42){
        if(n.at(i) == 1) ans += pow(2, i);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    N = int(input_raw[0])
    min_s = sys.maxint
    for i in range(1, N):
        A = str(i)
        A = A.zfill(6)
        B = str(N - i)
        B = B.zfill(6)
        s = 0
        for j in range(6):
            s += int(A[j]) + int(B[j])
        min_s = min(s, min_s)

    print min_s
if __name__ == '__main__':
    main()


Measured memory_bytes: 6000
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, int> PL;
constexpr int mod = 1e9 + 7;
constexpr int INF = 2e9;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int sum = 0;
  rep(i,n) cin >> a[i], sum ^= a[i];
  
  for (int i = 0; i < n; i++) {
    cout << (sum ^ a[i]) << " ";
  }
  cout << endl;
  return 0;
} 

Measured memory_bytes: 3980
n=int(input())
a=list(map(int,input().split()))
l=[0]
r=[0]
ans=0
from  fractions import gcd
for i in range(n-1):
    l.append(gcd(l[i],a[i]))
    r.append(gcd(r[i],a[-1-i]))
for i in range(n):
    ans=max(ans,gcd(l[i],r[-1-i]))

print(ans)


Measured memory_bytes: 93792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1001001001
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repX(i, n ,x) for (int i = x; i < (int)(n); i++)
#define repBack(i, n) for (int i = n; i >= 0; i--)
#define dup(x,y) (((x)+(y)-1)/(y))

int main() {
    int N,K;
    cin >> N >> K;
    vector<bool> sunuke(N,false);
    rep(i,K){
        int d;
        cin >> d;
        rep(j,d){
            int A;
            cin >> A;
            sunuke[--A] = true;
        }
    }
    int ans = 0;
    rep(i,N){
        if(!sunuke[i])ans ++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3628
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long K = sc.nextLong();
		long mod = 1000000007;

		for(int i = 1; i <= K; i++) {
			if(N - K + 1 >= i) {
				System.out.println((conv(N - K + 1, i, mod) * conv(K - 1, i - 1, mod)) % mod);
			} else {
				System.out.println(0);
			}
		}
	}

	public static long conv(long m, long n, long mod) {
		long num = 1;
		for(int i = (int)n + 1; i <= (int)m; i++) {
			num = num * i % mod;
		}

		long num2 = 1;
		for(int i = 1; i <= m - n; i++) {
			num2 = num2 * i % mod;
		}

		BigInteger big2 = new BigInteger(String.valueOf(num2));
		BigInteger modb = new BigInteger(String.valueOf(mod));
		long ans = num * Long.parseLong(big2.modInverse(modb).toString()) % mod;
		return ans;
	}
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

LL dp[32][2];
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  LL N, K;
  cin >> N >> K;
  vector<PLL> xs(N);
  REP(i,N){
	cin >> xs[i];
  }

  LL ans = 0;
  for(int j=32;j>=0;--j){
	LL b = 1ll << j;
	if(!(K&b)) continue;
	SORT(xs);
	xs.erase(lower_bound(ALL(xs), MP(K+1,0ll)), end(xs));
	LL sum = 0;
	for(auto& x: xs){
	  if(x.FF < b){
		sum += x.SS;
	  }
	  else{
		x.FF ^= b;
	  }
	}
	K ^= b;
	maxi(ans, sum);
  }

  LL sum = 0;
  for(auto& x: xs) if(x.FF == 0) sum += x.SS;
  maxi(ans, sum);

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1920
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    *line, k = [int(sys.stdin.readline().rstrip()) for _ in range(6)]
    print(':(' if max(line) - min(line) > k else 'Yay!')


if __name__ == '__main__':
    main()


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

int main() {
  int w,a,b;
  cin >> w >> a >> b;
  if( a <= b ){
    if( a+w <= b ){
      cout << abs( a+w - b ) << endl;
    }else if( a+w > b ){
      cout << 0 << endl;
    }
  }else{
    if( b+w <= a ){
      cout << abs( b+w - a ) << endl;
    }else if( b+w > a ){
      cout << 0 << endl;
    }
  }
  
  return 0;
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        System.out.println((a * b) + " " + (a * 2 + b * 2));
        scanner.close();
    }
}



Measured memory_bytes: 26008
n, m = map(int, input().split())
a = [[0 for i in range(m)] for j in range(n)]
b = [0 for i in  range(m)]
c = [0 for i in range(n)]
for i in range(n):
    a[i] = list(map(int, input().split()))
for j in range(m):
    b[j] = int(input())
for i in range(n):
    for j in range(m):
        c[i] += a[i][j] * b[j]
for i in range(n):
    print (c[i])



Measured memory_bytes: 5968
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<cstring>
#include<sstream>
using namespace std;

typedef long long ll;
int cnt0[100010],cnt1[100010];
int main() {
  int N,K; cin >> N >> K;
  string s; cin >> s;
  s = '2' + s;
  vector<int> A;
  
  for ( int i = 1; i < s.length(); i++ ) {
    if ( s[i] == '0') {
      cnt0[i] = cnt0[i-1]+1;
    } else if ( s[i] == '1' ) {
      cnt1[i] = cnt1[i-1]+1;
    }
  }

  for ( int i = 1; i < s.length(); i++ ) {
    if ( cnt0[i] > 0 && cnt0[i+1] == 0 ) A.push_back(-1*cnt0[i]);
    else if ( cnt1[i] > 0 && cnt1[i+1] == 0 ) A.push_back(cnt1[i]);
  }

  int count = 0;
  for ( int i = 0; i < A.size(); i++ ) {
    if ( A[i] < 0 ) count++;
  }
  
  if ( count <= K ) {
    cout << N << endl;
    return 0;
  }
  int ans = 0;
  int cnt = 0;
  int l = 0,r = 0;
  int sum = 0;
    while(1) {
      if ( r == A.size() || l == A.size() ) break;      
      while(1) {
	
	if ( A[r] > 0 && cnt <= K) {
	  sum += A[r++];
	  if ( cnt == K || r == A.size() ) break;
	} else if ( A[r] < 0 && cnt < K ) {
	  sum += abs(A[r++]);
	  cnt++;
	  if ( r == A.size() ) break;
	}
      }

      if ( cnt == K ) ans = max(sum,ans);
      
      while( cnt == K ) {
	if ( l == A.size() ) break;
	if ( A[l] < 0 ) {
	  sum += A[l++];
	  cnt--;
	}else if ( A[l] > 0 ) sum -= A[l++];
      }
      
    }

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


Measured memory_bytes: 1784
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
struct T{
	ll first,second,third;
};
typedef double db;
string c[1001];
const ll INF = 0xffffffffff;
P s[10],g[10];
ll vx[4]={1,0,-1,0};
ll vy[4]={0,1,0,-1};
ll n,h,w;
bool visited[1001][1001];

ll bfs(ll sx,ll sy,ll gx,ll gy){
	queue<T> q;
	while(!q.empty()) q.pop();
	q.push((T){sx,sy,0});
	visited[sy][sx]=1;
	while(1){
		T t=q.front();
		q.pop();
		if(t.first==gx&&t.second==gy) return t.third;
		for(ll i=0;i<4;i++){
			ll nx=t.first+vx[i];
			ll ny=t.second+vy[i];
			if(0<=nx&&nx<w&&0<=ny&&ny<h&&c[ny][nx]=='.'&&!visited[ny][nx]){
				q.push((T){nx,ny,t.third+1});
				visited[ny][nx]=1;
			}
		}
	}
}


int main()
{
	scanf("%lld%lld%lld",&h,&w,&n);
	for(ll i=0;i<h;i++) cin>>c[i];
	for(ll i=0;i<h;i++) for(ll j=0;j<w;j++){
		if(c[i][j]=='S'){
			s[0]=P(i,j);// y x
			c[i][j]='.';
		}
		if('1'<=c[i][j]&&c[i][j]<='9'){
			s[c[i][j]-'0']=P(i,j);
			g[c[i][j]-'0'-1]=P(i,j);
			c[i][j]='.';
		}
	}
	ll ans=0;
	for(ll i=0;i<n;i++){
		fill(visited[0],visited[1000],0);
		ans+=bfs(s[i].second,s[i].first,g[i].second,g[i].first);
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 5076
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rrep(i, n, g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define len(x) (int)(x).size()
#define dup(x, y) (((x) + (y)-1) / (y))
#define pb push_back
#define Field(T) vector<vector<T>>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> num = {a, b, c};
  sort(all(num));
  if (num[0] == 5 && num[1] == 5 && num[2] == 7) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}

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

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
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int v = sc.nextInt();
		int b = sc.nextInt();
		int w = sc.nextInt();
		int t = sc.nextInt();
		sc.close();

		if (w >= v) {
			System.out.println("NO");
			return;
		}

		int d = Math.abs(a - b);
		if ((long) (v - w) * t >= d) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}


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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;

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

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

int main() {
  string s;
  cin >> s;
  int ans = INT_MAX;
  rep(i, 0, s.size() - 2) {
    int tmp = 0;
    int n1 = (int) (s[i] - '0');
    int n2 = (int) (s[i+1] - '0');
    int n3 = (int) (s[i+2] - '0');
    tmp = n1 * 100 + n2 * 10 + n3;
    ans = min(ans, abs(tmp - 753));
  }

  cout << ans << endl;
};


Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1005
#define inf 1e9
#define eps 1e-10
using namespace std;

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

int b[50],x[maxn],y[maxn],cnt;
char ans[50];

int main()
{
	int n=read(),f=0;
	for(int i=1;i<=n;i++) x[i]=read(),y[i]=read();
	int tmp=abs(x[1]+y[1])%2;
	for(int i=2;i<=n;i++) if(abs(x[i]+y[i])%2!=tmp) f=1;
	if(f==1) {puts("-1"); return 0;}
	if(tmp==0) b[++cnt]=1;
	for(int i=0;i<=30;i++) b[++cnt]=(1<<i);
	cout<<cnt<<endl;
	for(int i=1;i<=cnt;i++) printf("%d ",b[i]); puts("");
	for(int i=1;i<=n;i++)
	{
		int nx=-x[i],ny=-y[i],tx,ty;
		for(int j=cnt;j>=1;j--)
		{
			if(abs(nx)>abs(ny))
			{
				if(nx>0) nx-=b[j],ans[j]='L';
				else nx+=b[j],ans[j]='R';
			}
			else
			{
				if(ny>0) ny-=b[j],ans[j]='D';
				else ny+=b[j],ans[j]='U';
			}
		}
		//cout<<nx<<" "<<ny<<endl;
		for(int j=1;j<=cnt;j++) printf("%c",ans[j]); puts("");
	}
	return 0;
}

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

int main(){
  int N,K,i=0,A=1;
  cin>>N>>K;
  while(i<N){
    if(A<K)
      A*=2;
    else
      A+=K;
    i++;
  }
  cout<<A<<endl;
}
  


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;


bool f=false;

void dfs(int depth , int b , int c , int* a){
	if(depth==10) return;
	if(f) return;
	if(a[depth]>b) dfs(depth+1 , a[depth] , c , a);
	else if (a[depth]>c) dfs(depth+1 , b , a[depth] , a);
	else {
		f=true; 
		return;
	}
}


int main(){
	int a[10];
	int b[10],c[10];
	int n;
	cin >> n;
	for(int i=0;i<n ; ++i){
		for(int j=0;j<10;++j){
			cin >> a[j];
		}
		dfs(0 , 0 , 0 , a);
		cout << ( !f ? "YES" : "NO" ) << endl;
	}
	return 0; 
}

Measured memory_bytes: 1152
H, W = map(int, input().split())
C = [input() for i in range(H)]

import sys
sys.setrecursionlimit(500000)

itta = [[0] * W for i in range(H)]

def search(x, y, z):
    if y >= H or x >= W or x < 0 or y <  0:
        return
    elif C[y][x] == z:
        return
    elif itta[y][x] == 1:
        return
    elif C[y][x] == z:
        return
    else:
        itta[y][x] = 1
        
        if C[y][x] == '.':
            bw_count[0] += 1
        else:
            bw_count[1] += 1
        
        prez = C[y][x]
        
    search(x+1, y, prez)
    search(x-1, y, prez)
    search(x, y+1, prez)
    search(x, y-1, prez) 

ans = 0

for y in range(H):
    for x in range(W):
        if itta[y][x] ==1:
            pass
        else:
            bw_count = [0, 0]
            search(x, y, '-')
            
            ans += bw_count[0] * bw_count[1]  

print(ans)


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

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	//freopen("input.txt","r",stdin);
	int l1,r1,l2,r2;
	int a,b;
	cin>>a>>b;
	l1=ceil(a/0.08);
	double t;
	t=(a+1)/0.08;
	if(t*0.08==a+1)
	r1=t-1;
	else
	r1=floor((a+1)/0.08);
	
	l2=ceil(b/0.1);
	t=(b+1)/0.1;
	if(t*0.1==b+1)
	r2=t-1;
	else
	r2=floor((b+1)/0.1);
	bool flag=true;
	int ans;
	if(r1<l2 or r2<l1) flag=false;
	else if(l2>=l1 and r2<=r1) ans=l2;
	else if(l1>=l2 and r1<=r2) ans=l1;
	else ans=max(l1,l2);
	if(flag) cout<<ans<<endl;
	else cout<<-1<<endl;
	//cout<<l1<<" "<<r1<<" "<<l2<<" "<<r2;
	return 0;
}

Measured memory_bytes: 256
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[inline]
#[allow(dead_code)]
fn gcd(mut m: u64, mut n: u64) -> u64 {
    if m < n {
        std::mem::swap(&mut m, &mut n);
    }

    loop {
        let k = m % n;
        if k == 0 {
            return n;
        }

        m = n;
        n = k;
    }
}

#[inline]
#[allow(dead_code)]
fn lcm(m: u64, n: u64) -> u64 {
    m / gcd(m, n) * n
}

macro_rules! eprint(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = write!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! eprintln(
    ($($arg:tt)*) => { {
        use std::io::Write;
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

macro_rules! dbg {
    ($val:expr) => {
        // Use of `match` here is intentional because it affects the lifetimes
        // of temporaries - https://stackoverflow.com/a/48732525/1063961
        match $val {
            tmp => {
                eprintln!(
                    "[{}:{}] {} = {:#?}",
                    file!(),
                    line!(),
                    stringify!($val),
                    &tmp
                );
                tmp
            }
        }
    };
}

fn main() {
    input! {
        n: u64,
        m: u64,
    }

    let answer = if n == 1 && m == 1 {
        1
    } else if n == 1 {
        m - 2
    } else if m == 1 {
        n - 2
    } else {
        (n - 2) * (m - 2)
    };

    println!("{}", answer);
}


Measured memory_bytes: 4352