akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdbool.h>
int main(void){
    // Your code here!
    int i, j, n;
    char mark;
    char marks[4]={'S', 'H', 'C', 'D'};
    int num;
    bool cards[4][13]={false};
    
    scanf("%d ", &n);
    for(i=0;i<n;i++){
        scanf("%c %d ", &mark, &num);
        for(j=0;j<4;j++){
            if(mark==marks[j]){
                cards[j][num-1]=true;
                break;
            }
        }
    }
    for(i=0;i<4;i++){
        for(j=0;j<13;j++){
            if(!cards[i][j]){
                printf("%c %d\n", marks[i], j+1);
            }
        }
        
    }
    return 0;
}



Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sidha(i,a,b) for(int i=a;i<b;i++)
#define vi vector<int> 
#define pb push_back
#define st string
#define pairi pair<int,int>
#define INF 1000000007
 
 
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);const ll mod =1000000007;
    ll n;cin >> n;
    vector<ll>a(n);
    sidha(i,0,n) cin >>a.at(i);
    ll ans =0;
    ll b = 0;
    sidha(i,0,n){
        ans = (ans+a.at(i) * b)%mod;
        b = (b+a.at(i))%mod;
    }
    cout << ans << endl;
	return 0;
}

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

int main() {
    int a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    vector<int> p = {a,b,c,d,e};
    vector<int> q(5);
    vector<int> r(5);
    rep(i,5){
        q[i] = p[i]+(10-p[i]%10)%10;
    }
    rep(i,5){
        rep(j,5){
            if(i==j) r[i] += p[j];
            else r[i] += q[j];
        }
    }

    int ans = r[0];
    for(int i = 1; i < 5; i++) ans = min(ans,r[i]);

    cout << ans << endl;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
a = [input() for w in range(h)]

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1

n = []
for j in range(w):
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m

for k in range(h):
    print("".join(u[k] for u in n))


Measured memory_bytes: 3060
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
#define tget(a,b) get<a>(b)
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int MOD = 1e9 + 7;
ll dp[100005];
ll po[100005];
ll N;
int main(void) {
	cin >> N;
	FOR(i, 0, N)cin >> po[i];
	dp[1] = abs(po[0] - po[1]);
	FOR(i, 2, N) {
		dp[i] = min(dp[i - 1] + abs(po[i - 1] - po[i]), dp[i - 2] + abs(po[i - 2] - po[i]));
	}
	ct(dp[N - 1]);
	return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<cstring>
#include<set>
#include<vector>
#include<queue>
#include<cmath>
#include<memory.h>
#include<ctime>
#include<cstdio>
#include<map>
#include<stack>

using namespace std;

int main()
{
	int n,m;
	string s;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>s;
		cout<<s<<endl;
		cout<<s<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

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

int main(){
    int x, y;
    cin >> x >> y;
    cout << x + y / 2 << endl;
}



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

int main()
{
	int n,b;
	cin>>n;
	if(n%1000!=0)
	b=n/1000+1;
	 else
	b=n/1000;
	
	b=b*1000;
	cout<<(b-n)<<endl;
	 
	return 0;
	
}

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

int main(){
    int n, m;
    cin >> n;
    vector<int> t;
    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        t.push_back(x);
    }
    cin >> m;
    int sum = accumulate(t.begin(), t.end(), 0);

    for(int i = 0; i < m; i++)
    {
        int p, x;
        cin >> p >> x;
        cout << sum + x - t[p - 1] << "\n";
    }
    
}

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

using namespace std;

int main() 
{
    int W,H,x,y;
    cin >> W >> H >> x >> y;
    double ans = (double) W*1.0*H/2;
    
	int line = (W == x*2 && H == y*2) ? 1 : 0;
    cout << setprecision(10) << ans << " " << line;
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <limits.h>

int main(){
	int n,z,i,R[200000],max=INT_MIN,min=INT_MAX;
	scanf("%d",&n);
	for(i=0 ; i<n ; i++)
		scanf("%d",&R[i]);
	for(i=0 ; i<n ; i++){
		if(max<R[i]-min) max=R[i]-min;
		if(min>R[i]) min=R[i];
	}
	z=max;
	printf("%d\n",z);
	return 0;
}



Measured memory_bytes: 2636
#include <cstdio>
#include <cmath>

int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    int count_b_digit = 0;
    int c = b;
    for(int i = 1;; i++){
        if(c / 10 >= 0){
            count_b_digit++;
            c = (c - c % 10) / 10;
        }
        if(c == 0){
            break;
        }
    }
    int d = a * pow(10,count_b_digit) + b;
    int e = sqrt(d);
    if(e * e == d){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 128
n=input()
m=len(n)

A={chr(i):0 for i in range(97,97+26)}
B={chr(i):0 for i in range(97,97+26)}

cnt=0
for i in range(m):
    A[n[i]] +=1
for i in range(m):
    B[n[i]] +=1
    cnt +=A[n[i]]-B[n[i]]
print(m*(m-1)//2-cnt+1)

Measured memory_bytes: 73520
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n;
  cin >> n;
  vector <ii> v(n);
  vector <ii> pt(n);
  for(int i = 0; i < n; i++){
    cin >> v[i].first >> v[i].second;
    pt[i].first = v[i].first - v[i].second;
    pt[i].second = v[i].first + v[i].second;
  }
  sort(all(pt), [](ii a, ii b){
    return a.second < b.second;
  });
  int res = 0;
  int lst = 2 * (-mod);
  for(int i = 0; i < int(pt.size()); i++){
    //cout << x << " " << y << endl;
    if(pt[i].first >= lst){
      res++;
      lst = pt[i].second;
    }
  }
  cout << res;
}

Measured memory_bytes: 1792
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predictive-commoning")
// #pragma GCC option("D_GLIBCXX_PARALLEL","openmp")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000               // 2e9
#define LLINF 2000000000000000000ll  // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

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

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

void solve() {
  int N;
  cin >> N;
  vector<bool> p(N + 1, true);
  p[0] = p[1] = false;
  for (int i = 2; i * i <= N; i++) {
    if (!p[i]) continue;
    for (int j = i * 2; j <= N; j += i) { p[j] = false; }
  }
  vector<int> ps;
  for (int i = 0; i <= N; i++) {
    if (p[i]) ps.push_back(i);
  }
  // dmp(ps);
  vector<int> cnt(ps.size(), 0);
  for (int i = 0; i < ps.size(); i++) {
    int k = N;
    while (k) {
      cnt[i] += k / ps[i];
      k /= ps[i];
    }
  }
  ll ans = 0ll;
  function<void(int, int, int)> dfs = [&](int i, int prod, int select) {
    if (prod > 75 || select > 3) return;
    if (i == ps.size()) {
      if (prod == 75) ans++;
      return;
    }
    dfs(i + 1, prod, select);
    for (int j = 1; j <= cnt[i]; j++) {
      dfs(i + 1, prod * (j + 1), select + 1);
    }
  };
  dfs(0, 1, 0);
  cout << ans << endl;
  return;
}

signed main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();

  // int t; cin >> t;
  // for(int i=1;i<=t;i++){
  //   cout << "Case #" << i << ": ";
  //   solve();
  // }
  return 0;
}


Measured memory_bytes: 256
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
      print(i,j,n-i-j)
      sys.exit()
print("-1 -1 -1")


Measured memory_bytes: 65312
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll mod=1e9+7;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}




int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n-1;i++){
        int a;
        cin>>a;
        v.push_back(a);
    }
    vector<int>res(n);
    for(int i=0;i<n-1;i++){
        if(i==0){
            res[i]=v[i];
            res[i+1]=v[i];
            continue;
        }
        res[i]=min(res[i],v[i]);
        res[i+1]=v[i];
    }
    ll ans=0;
    for(int i=0;i<res.size();i++){
        ans+=res[i];
    }
    cout<<ans<<endl;
    return 0;
    }


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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = --end(s); i != begin(s); --i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.size(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr T mins(T& a, Args... args) { return a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr T maxs(T& a, Args... args) { return a = max<T>({ a,args... }); }
template<typename A, size_t N, typename T>
void fillArray(A(&array)[N], const T& val) { std::fill((T*)array, (T*)(array + N), val); }


int h, a;
void solve() {
    cin >> h >> a;
    cout << (h + a - 1) / a << endn;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout << flush;
    return 0;
}


Measured memory_bytes: 256
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<(n);i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll
// #define MAX 
#define INF (int)1e18

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}


signed main()
{
	fio
	inp(n) inp(m) inp(s)
	vector<vector<pair<int,int>>> conn(n);
	vector<pair<int,int>> tcost(m);
	fo(i,m)
	{
		inp(u) inp(v) inp(ai) inp(bi)
		u--,v--;
		tcost[i]={ai,bi};
		conn[u].pb({v,i});
		conn[v].pb({u,i});
	}
	vector<pair<int,int>> ecost(n);
	fo(i,n)
	{
		inp(c) inp(d)
		ecost[i]={c,d};
	}
	
	
	int MAX=50*n+1;
	s=min(s,MAX-1);
	vector<vector<int>> dist(n,vector<int>(MAX,INF));
	priority_queue<pair<int,pair<int,int>>,vector<pair<int,pair<int,int>>>,greater<pair<int,pair<int,int>>>> pq;
	dist[0][s]=0;
	pq.push({0,{0,s}});
	
	while(pq.size())
	{
		int ver=pq.top().S.F;
		int coins=pq.top().S.S;
		int d=pq.top().F;
		pq.pop();
		
		// cerr<<ver<<' '<<coins<<" = "<<d<<endl;
		
		if(dist[ver][coins]!=d)
			continue;
		
		for(pair<int,int> i:conn[ver])
		{
			if(tcost[i.S].F<=coins && dist[i.F][coins-tcost[i.S].F]>d+tcost[i.S].S)
			{
				dist[i.F][coins-tcost[i.S].F]=d+tcost[i.S].S;
				pq.push({d+tcost[i.S].S,{i.F,coins-tcost[i.S].F}});
			}
		}
		
		coins=min(coins+ecost[ver].F,MAX-1);
		if(dist[ver][coins]>d+ecost[ver].S)
		{
			dist[ver][coins]=d+ecost[ver].S;
			pq.push({dist[ver][coins],{ver,coins}});
		}
	}
	
	for(int i=1;i<n;i++)
	{
		int ans=INF;
		fo(j,MAX)
		{
			ans=min(ans,dist[i][j]);
		}
		cout<<ans<<'\n';
	}
	cout<<'\n';
	printclock;
}

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

int main() {
    string s;
    cin >> s;
    int ans = 0;
    rep(i,s.size()/2){
        int j = s.size() - i - 1;
        if(s[i] != s[j]) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;



public class Main{

	public static void main(String[] args){


		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		scan.nextLine();

		Map<Integer, Integer> map = new LinkedHashMap<>(N);

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

	   		int t = scan.nextInt();
			int x = scan.nextInt();
			int y = scan.nextInt();
			int point = x+y;

			map.put(t,point);

	       }

    	int flagk =0;
    	int flagv =0;

    	int count =0;


	    for (Map.Entry<Integer, Integer> entry : map.entrySet()) {

	       // System.out.println(entry.getKey() + " : " + entry.getValue());
	    	int key = entry.getKey().intValue();
	    	int val = entry.getValue().intValue();

	    	//System.out.println("process: key" + key + "val" + val);


	    	if ( (key>=val) && (key%2==val%2) && ( Math.abs(key-flagk) >=Math.abs(val-flagv) ) ) {
	    		flagk = key;
	    		flagv = val;
	    	}
	    	else {
	    		System.out.println("No");
	    		//System.out.println("key" + (key-flagk) + "val" + Math.abs(val-flagv));
	    		//System.out.println("key" + key + "val" + val);
	    		break;
	    	}

	    	++count;
	    	if (count ==N) {
	    		System.out.println("Yes");
	    	}

	    }

	}
}



Measured memory_bytes: 101060
#define debug 0
#define test 0
#define CPLUS 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#if CPLUS
#include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <iterator>
#include <unordered_map>
using namespace std;
#endif

long long fun(int n, int a, int b)
{
	if (n == 1) {
		if (a == b)
			return 1;
		return 0;
	}
	if (a > b)
		return 0;
	else {
		return (long long)(b - a)*(n - 2) + 1;
	}
	//if (n < 1 || a < 1 || b<1 || a>b)
	//	return 0;
	//if (n == 1) {
	//	if (a == b)
	//		return 1;
	//	else
	//		return 0;
	//}
	//if (n == 2)
	//	return 1;
	//long long mi = (n - 1)*a + b;
	//long long ma = (n - 1)*b + a;
	//return ma - mi + 1;
}

int main(void)
{
#if debug
	freopen("in.txt", "r", stdin);
#endif
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	printf("%lld\n", fun(n, a, b));
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

using Pi = pair<int, int>;
using ll = long long;
const int INF = 1 << 28;

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

void get() {}

template <class Head, class... Tail>
void get(Head& head, Tail&... tail) {
  cin >> head;
  get(tail...);
}

template <class T>
void getv(vector<T>& vec) {
  for (int i = 0; i < vec.size(); ++i)
    cin >> vec[i];
}

int main() {
  int A, B, C, D;
  get(A, B, C, D);
  print(max(A * B, C * D));
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	private void solve() {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int[] H = new int[N];
		for(int i=0; i<N; i++) {
			H[i] = in.nextInt();
		}
		
		int right = H[N-1];
		for(int i = N-2; i>=0; i--) {
			if(H[i]>right+1) {
				System.out.println("No");
				return;
			}else if(H[i]<right) {
				right = H[i];
			}
		}
		System.out.println("Yes");
	}
	
	public static void main(String[] args) {
		new Main().solve();
	}
}

Measured memory_bytes: 48004
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>

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

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

int k,x,y,nowx=0,nowy=0;

struct r2{int x,y;};
vector<r2> ans;

void move(int x,int y){
  nowx+=x;nowy+=y;
  ans.push_back({nowx,nowy});
}

//main
signed main(){
  cin>>k>>x>>y;

  if(!(k&1)&&((x+y)&1)){
    cout<<-1<<endl;
    return 0;
  }
  if(abs(x)+abs(y)==k){
    cout<<1<<endl<<x<<" "<<y<<endl;
    return 0;
  }

  int X=abs(x),Y=abs(y);
  if(X>Y)swap(X,Y);

  int sousai=-1;
  for(int j=k*2;sousai<0;j+=k)
    if((j-(X+Y))%2==0)sousai=(j-(X+Y))/2;

  if(sousai){
    while(sousai>=k){
      move(0,-k);
      sousai-=k;
    }
    move(-sousai,k-sousai);
  }

  while(nowx+k<=X)move(k,0);
  while(nowy+k<=Y)move(0,k);
  if(nowx!=X||nowy!=Y)ans.push_back({X,Y});

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

  for(auto p:ans){
    int ansx=p.x,ansy=p.y;
    if(abs(x)>abs(y))swap(ansx,ansy);
    if(x<0)ansx*=-1;
    if(y<0)ansy*=-1;
    cout<<ansx<<" "<<ansy<<endl;
  }
}


Measured memory_bytes: 3952
#include<bits/stdc++.h>
using namespace std;
void reverseStr(string& str) 
{ 
    int n = str.length(); 
  
    // Swap character starting from two 
    // corners 
    for (int i = 0; i < n / 2; i++) 
        swap(str[i], str[n - i - 1]); 
} 
int main(){
  string s,t;
  cin >> s >> t;
  int LCS[(int)s.size()+1][(int)t.size()+1];
  string res;
  for(int i=0;i<(int)s.size()+1;i++){
    for(int j=0;j<(int)t.size()+1;j++){
      if(i==0 || j==0) LCS[i][j]=0;
      else{
        if(s[i-1]==t[j-1]){
          LCS[i][j] = 1+LCS[i-1][j-1];
          
        }
        else LCS[i][j]=max(LCS[i-1][j],LCS[i][j-1]);
        
      }
    
    }
  }
    int i,j;
    i = s.size();
    j= t.size();
    int counter = 0;
    int val_1,val_2,val_3,val_4;
    while(i>0 && j>0){
      val_1 = LCS[i][j];
      val_2 = LCS[i][j-1];
      val_3 = LCS[i-1][j];
      //val_4 = LCS[i-1][j-1];
      if(val_2==val_1 ){
        j--;
        
        
      }
      else if(val_3==val_1 ){
        i--;
        
        
      }
      else{
        
        res.push_back(s[i-1]);
        counter++;
        i--;
        j--;
        
      }
    
    }
  reverseStr(res);
  cout <<res ;
  return 0;
    
}

Measured memory_bytes: 38756
#include <stdio.h>
int main(void)
{int A,B,C,D,x,y,K,S,Y,Z,k,l,i,tmp;
	long long int N,M;
	scanf("%lld%lld",&N,&M);
	if(M<=2*N){
		printf("%lld",M/2);}
		else{
			printf("%lld",N+(M-2*N)/4);}
			
	


	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long ll;

int main() {
    int n, x[55], y[55];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
    
    vector<pair<int, int>> v;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            v.emplace_back(x[i] - x[j], y[i] - y[j]);
            v.emplace_back(-x[i] + x[j], -y[i] + y[j]);
        }
    }
    
    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }
    
    sort(v.begin(), v.end());
    
    int tmp = 1, mx = 1;
    for (int i = 0; i < v.size() - 1; i++) {
        if (v[i].first == v[i + 1].first && v[i].second == v[i + 1].second) tmp++;
        else tmp = 1;
        mx = max(mx, tmp);
    }
    
    cout << n - mx << endl;
    
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  int num1,num2,num3,sum;
  char str[16];
  
  fgets(str,sizeof(str),stdin);
  sscanf(str,"%d%d%d",&num1,&num2,&num3);
  
  sum = num1+num2+num3;
  
  if(sum<=21)
  {
    puts("win");
  }else
  {
    puts("bust");
  }
  
  return 0;
}

Measured memory_bytes: 128
import sys
from collections import deque
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
n, m = map(int, input().split())
memo = [1 for _ in range(n)]
E = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    E[x-1].append(y-1)
    E[y-1].append(x-1)
def dfs(cur, pre):
    stack = deque([[cur, pre]])
    while stack:
        cur, pre = stack.pop()
        memo[cur] = 0
        for e in E[cur]:
            if e != pre and memo[e]:
                stack.append([e, cur])
ans = 0
for i in range(n):
    if memo[i]:
        dfs(i, -1)
        ans += 1
print(ans)


Measured memory_bytes: 67120
#include <stdio.h>

int main(void)
{
  int k, n;
  scanf("%d %d", &k, &n);
  int a[n], i;
  i = 0;
  while (i < n)
  {
    scanf("%d", &a[i]);
    i++;
  }
  
  i = 0;
  int min = k;
  int dis_i = 0;
  while (i < n)
  {
    if (i >= 1 && i + 1 < n)
    {
      // left
      dis_i = 0;
      dis_i = k - (a[i] - a[i - 1]);
      if (min > dis_i)
      {
        min = dis_i;
      }
      // right
      dis_i = 0;
      dis_i = k - (a[i + 1] - a[i]);
      if (min > dis_i)
      {
        min = dis_i;
      }
    }
    else if (i == 0)
    {
      // left
      dis_i = 0;
      dis_i = k - (a[i + 1] - a[i]);
      if (min > dis_i)
      {
        min = dis_i;
      }
      // right
      dis_i = 0;
      dis_i = a[n - 1] - a[i];
      if (min > dis_i)
      {
        min = dis_i;
      }
    }
    else if (i == n - 1)
    {
      // left
      dis_i = 0;
      dis_i = a[i] - a[0];
      if (min > dis_i)
      {
        min = dis_i;
      }
      // right
      dis_i = 0;
      dis_i = (k - a[i]) + a[i - 1];
      if (min > dis_i)
      {
        min = dis_i;
      }
    }
    i++;
  }
  printf("%d", min);
  return 0;
}

Measured memory_bytes: 896
using System;

namespace _096c
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] HW = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            string[,] s = new string[HW[0]+2,HW[1]+2];
            for(int j = 0; j < HW[1]+1;j++){
                s[0,j] = "."; 
                s[HW[0]+1,j] = ".";
            }
            for(int i = 0; i < HW[0]+1;i++){
                s[i,0] = ".";
                s[i,HW[1]+1] = ".";
            }

            for(int i = 1; i <= HW[0]; i ++){
                char[] temp_S = Console.ReadLine().ToCharArray();
                // Console.WriteLine(temp_S[0]);
                for(int j = 1; j <= HW[1]; j++){
                    s[i,j] = temp_S[j-1].ToString();
                }
            }
            bool res = true;
            for(int i = 1; i <= HW[0]; i ++){
                for(int j = 1; j <= HW[1]; j++){
                    if(s[i,j]=="#"){
                        if(s[i-1,j] == "#" || s[i,j-1]=="#" || s[i,j+1]=="#" || s[i+1,j]=="#"){

                        }else{
                            res = false;
                            break;
                        }
                    }
                }
            }
            Console.WriteLine(res?"Yes":"No");
        }
    }
}

Measured memory_bytes: 11192
program example
	implicit none
    
    integer N,A(3,3),i,j,k,count
    integer,allocatable :: b(:)
    
    do i=1,3
    	read(*,*) A(i,1:3)
    end do
    
    read(*,*) N
    
    allocate (b(N))
    
    do i=1,N
    	read(*,*) b(i)
    end do
    
    do i=1,3
    	count=0
    	do j=1,3
        	do k=1,N
            	if(A(i,j)==b(k)) then
                	count=count+1
                end if
            end do
        end do
        if (count==3) then
        	write(*,*) "Yes"
         	goto 1
    	end if       
    end do

    do i=1,3
    	count=0
    	do j=1,3
        	do k=1,N
            	if(A(j,i)==b(k)) then
                	count=count+1
                end if
            end do
        end do
        if (count==3) then
        	write(*,*) "Yes"
         	goto 1
    	end if       
    end do
    
    count=0
    
    do i=1,3
    	do j=1,N
    		if(A(i,i)==b(j)) then
            	count=count+1
            end if
        end do
    end do
    
    if (count==3) then
    	write(*,*) "Yes"
        goto 1
    end if
    
    count=0
    
    do i=1,N
    	if(A(1,3)==b(i)) then
        	count=count+1
        end if

    	if(A(2,2)==b(i)) then
        	count=count+1
        end if

    	if(A(3,1)==b(i)) then
        	count=count+1
        end if
    end do
    
    if (count==3) then
    	write(*,*) "Yes"
        goto 1
    end if
    
    write(*,*) "No"
    
    
1 end program example

Measured memory_bytes: 256
N,Q = map(int,input().split())

S = input()

X = [list(map(int,input().split())) for _ in range(Q)]

count = [0]*len(S)
for i in range(1,len(S)):
	if S[i-1] == "A" and S[i] == "C":
		count[i] = count[i-1] + 1
	else:
		count[i] = count[i-1]
        
for j in range(Q):
	ans = count[X[j][1]-1]-count[X[j][0]-1]
	print(ans)

Measured memory_bytes: 30664
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pii pair<ll,ll>
using namespace std;
#define N 100007
#define pb push_back;
vector<ll> g[N];
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);

int main()
{
    FAST;
    ll n;
    cin>>n;
    ll i,j,k,l,cnt=0;
    for(i=1;i<=n;i++)
    {
        cnt=0;
        for(j=1;j<=100;j++)
        {
            for(k=1;k<=100;k++)
            {
                ll b=-(k+j);
                ll x=b*b-4*(k*k+j*j+k*j-i);
                if(x<0)
                {
                    continue;
                }
                ll sqrtt=sqrt(x);
                if(sqrtt*sqrtt==x)
                {
                    x=b+sqrtt;
                  //  cout<<j<<" "<<k<<" "<<x<<" "<<sqrtt<<" "<<i<<endl;
                    if(x%2==0&&(x/2)>=1)
                    {
                        cnt++;
                    }
                }
            }
        }
        cout<<cnt<<endl;
    }
}

Measured memory_bytes: 6008
import java.util.Scanner;

public class Main{
	static final int res = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] t = new int[n];
		int[] a = new int[n];
		long ans = 1;

		for(int i=0; i<n; i++){
			t[i] = sc.nextInt();
		}
		for(int i=0; i<n; i++){
			a[i] = sc.nextInt();
		}

		for(int i=0; i<n; i++){
			if(i==0){
				if(t[i]>a[i]){
					ans = 0;
					break;
				}
			}else if(i==n-1){
				if(a[i]>t[i]){
					ans = 0;
					break;
				}
			}else{
				if(t[i-1]<t[i] && a[i]==a[i+1]){
					if(a[i]<t[i]){
						ans = 0;
						break;
					}
				}else if(t[i-1]<t[i] && a[i]>a[i+1]){
					if(t[i]!=a[i]){
						ans = 0;
						break;
					}
				}else if(t[i-1]==t[i] && a[i]>a[i+1]){
					if(t[i]<a[i]){
						ans = 0;
						break;
					}
				}else{
					ans *= (Math.min(t[i], a[i])%res);
					ans %= res;
				}
			}
		}

		System.out.println(ans);
	}
}

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

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

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

    int max_profit = R[1] - R[0];
    int min_value = R[0];

    for ( int i = 1; i < n; i++ ) {
        if ( R[i] - min_value > max_profit ) {
            max_profit = R[i] - min_value;
        } 
        
        if ( R[i] < min_value ) {
            min_value = R[i];
        }
    }

    cout << max_profit << endl;

    return 0;
}



Measured memory_bytes: 3884
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define fi first
#define se second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
int main()
{
    fast_io
    ll i,j,k,n,d,t,s;
    cin>>d>>t>>s;
    if(s*t>=d)
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;





    return 0;
}





Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
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;}
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a)  (a).begin(),(a).end()
//bitset<64>(x).count()
//fixed << setprecision(15) << 

int main (){
  int n, q, x, y;
  cin >> n >> q;
  bool check[n+1] = {false};
  vector<int> cost(n+1);
  vector<vector<int>> a(n+1,vector<int>(0));
  rep(i,n-1){
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  rep(i,n+1){
    cost[i] = 0;
  }
  rep(i, q){
    cin >> x >> y;
    cost[x] += y;
  }
  queue<int> que;
  que.push(1);
  check[1] = true;
  while(que.size()!=0){
    int tmp = que.front();
    if(check[tmp]==true){
      que.pop();
      rep(i, (a[tmp]).size()){
        if(!check[a[tmp][i]]){
          cost[a[tmp][i]] += cost[tmp];
          check[a[tmp][i]] = true;
          que.push(a[tmp][i]);
        }
      }
    } else {
      que.pop();
      que.push(tmp);
    }
  }
  for(int i=1;i<=n;i++)
    cout << cost[i] << " " ;
  cout << endl;
}


Measured memory_bytes: 16832
/************************************
/ AUTHOR : YATHARTH GOSWAMI         /  
/ ALIAS : hacker_yg                 /
/ INSTITUTE : IIT Kanpur            /
************************************/
//          TEMPLATE                //

#include <bits/stdc++.h>

#define ll long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define PI 3.14159265359

using namespace std;

/*ll powMod(ll a, ll y)
{
    ll ans = 1;
    
    while (y > 0) 
    { 
        if (y & 1) 
            ans = (ans*a) % MOD; 
  
        y = y>>1;
        a = (a*a) % MOD; 
    } 
    return ans;
}*/

/*ll modInv(ll a)
{
    return powMod(a, MOD-2);	
}*/

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int x, n;
    cin >> x >> n;
    map <int, int> m;
    vector <int> v(n);
    for (int &r : v) {
        cin >> r;
        m[r]++;
    }
    int minn = INT_MAX, ans = -1;
    for (int i = -100; i <= 200; i++) {
        if (!m[i]) {
            if (minn > abs(x-i)) {
                minn = abs(x-i);
                ans = i;
            }
        }
    }
    cout << ans << endl;
    return 0;
}




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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
//const ull mod = 1e9 + 7;
const ll mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

// debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

// conversion number to bit
string num2bit(ll num, ll len){
  string bit = "";
  REP(i, len){
    bit += char('0'+(num>>i & 1));
  }
  return bit;
}

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

    ll N, M;
    cin >> N >> M;
    vector<ll> cnt(N, 0);
    vector<bool> check(N, false);

    ll pena = 0;
    ll res = 0;
    REP(i, M){
    	ll p;
    	string S;
    	cin >> p >> S;
    	p--;
    	if(S=="WA"){
    		cnt[p]++;
    	}else{
    		if(!check[p]){
    			res++;
    			pena += cnt[p];
    			check[p] = true;
    		}
    	}
    }

    cout << res << " " << pena << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    sort(all(A));
    cout << A[A.size()-1] - A[0];
    cout << endl;
    return 0;
}




Measured memory_bytes: 256
n = gets.to_i
cnt = Array.new(50,0)
for i in 1..n
    for j in 2..49
        while i%j == 0
            i /= j
            cnt[j] += 1
        end
    end
end
a = Array.new(5,0)
cnt.each do |num|
    a[0] += 1 if num >= 2
    a[1] += 1 if num >= 4
    a[2] += 1 if num >= 14
    a[3] += 1 if num >= 24
    a[4] += 1 if num >= 74
end
ans = 0
ans += a[1]*(a[1]-1)/2*(a[0]-2) if a[0] >= 3 && a[1] >= 2
ans += a[2]*(a[1]-1) if a[2] >= 1 && a[1] >= 2
ans += a[3]*(a[0]-1) if a[3] >= 1 && a[0] >= 2
ans += a[4]
puts ans

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

const int N = 302;
int n, k, mod, c[N][N], f[N][N], g[N][N];

int main() {
  scanf("%d%d%d", &n, &k, &mod);
  c[0][0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
    }
  }
  for (int j = 1; j <= k + 1; j++) {
    f[1][j] = 1;
    g[1][j] = j;
  }
  for (int i = 2; i <= n + 1; i++) {
    for (int j = 1; j <= k + 1; j++) {
      for (int l = 1; l <= i - 1; l++) {
        f[i][j] = (f[i][j] + (long long) g[l][j - 1] * f[i - l][j] % mod * c[i - 2][l - 1]) % mod;
      }
      g[i][j] = (g[i][j - 1] + f[i][j]) % mod;
    }
  }
  printf("%d\n", f[n + 1][k + 1]);
}


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

int main(){
  int a,k=0;
  cin >> a;
  vector<int>b(a);
  for(int i=0;i<a;i++){
    cin >> b.at(i);
  }
  sort(b.begin(),b.end());
  for(int i=0;i<a-1;i++){
    k=k+b.at(i);
  }
  k=k+b.at(a-1)/2;
  cout <<k<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,m;
    cin >> n >> m;
    cout << (n == 1 ? 1 : n-2)*(m == 1 ? 1 : m-2);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P a, const P b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

// 2???????????????????????????????±???????
double dot(P a, P b) {
    return (a.X * b.X + a.Y * b.Y);
}

// 2???????????????????????????????±???????
double cross(P a, P b) {
    return (a.X * b.Y - a.Y * b.X);
}

int ccw(P a, P b, P c) {
    b -= a; c -= a;
    if( cross(b,c) > EPS ) return +1;
    if( cross(b,c) < -EPS ) return -1;
    if( dot(b,c) < 0 ) return +2;
    if( norm(b) < norm(c) ) return -2;
    return 0;
}

// ??´??? a1, a2 ??¨??´???b1, b2?????????????±???????
P crossp_ll(P a1, P a2, P b1, P b2) {
    double d1 = cross(b2-b1, b1-a1);
    double d2 = cross(b2-b1, a2-a1);
    if( EQ(d1,0) && EQ(d2,0) ) return a1; // same line
    if( EQ(d2,0) ) assert(false); // precondition not satisfied
    return a1 + d1 / d2 * (a2 - a1);
}

int main() {
    P a, b, c, d; 
    int q; cin >> q;
    rep(i,0,q) {
        cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y >> d.X >> d.Y;
        P ans = crossp_ll(a,b,c,d);
        printf("%.10f %.10f\n", ans.X, ans.Y);
    }
    return 0;
}

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

using namespace std;

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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N; cin >> N;
	vector<ll> a(N, 0LL), b(N, 0LL);
	rep (i, N){
		cin >> a[i];
	} // end rep
	rep (i, N){
		cin >> b[i];
	} // end rep

	ll cnt = 0LL;
	rep (i, N){
		if (a[i] > b[i]){
			ll k = a[i] - b[i];
			b[i] += k;
			cnt += k;
		} // end if
	} // end rep

	rep (i, N){
		if (a[i] < b[i]){
			ll k = (b[i] - a[i]) / 2LL;
			a[i] += 2LL * k;
			cnt -= k;
		} // end if
	} // end rep

	bool ok = (cnt <= 0LL);
	cout << (ok ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 384
import java.util.*

fun main(args: Array<String>) {
    val (cardCount, inputCount) = readLine()!!.split(" ").map { it.toInt() }
    val map = mutableMapOf<Int, MutableMap<Int, Boolean>>()
    val list = mutableListOf<Card>()
    for(i in 1..cardCount) {
        list.add(Card(i-1))
    }
    for(i in 1..inputCount) {
        val (a, b) = readLine()!!.split(" ").take(2).map { it.toInt() - 1 }
        listOf(a,b).forEach {
            if(!map.containsKey(it)) {
                map[it] = mutableMapOf()
            }
        }
        map[a]!![b] = true
        map[b]!![a] = true
    }
    var found = 0
    for( card in list) {
        if(card.flag) {
            continue
        }
        found++
        card.flag = true
        val queue = LinkedList<Card>()
        queue.add(card)
        while (queue.isNotEmpty()) {
            val target = queue.pop()
            map[target.id]?.let {
                it.keys.forEach {
                    if(!list[it].flag) {
                        list[it].flag = true
                        queue.add(list[it])
                    }
                }
            }
        }
    }
    println(found + list.count { !it.flag })
}

class Card(val id:Int) {
    var flag = false
}


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

int main() {
  string s;
  cin >> s;
  if (s == "AAA" || s == "BBB") cout << "No";
  else cout << "Yes";
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
import copy
n, m = map(int, input().split())
s = []
for i in range(m):#h:高さ
    s.append([int(i) for i in input().split()])
    #l2 = l[:]
t = s[:]
t.sort()
t.sort(key=lambda x:(x[0], x[1]))
co = 1
for i in range(m):
    if i != 0:
        if t[i][0] != t[i - 1][0]:
            co = 1
    if t[i][0] <10:
        moji1 = "00000" + str(t[i][0])
    elif t[i][0] <100:
        moji1 = "0000" + str(t[i][0])
    elif t[i][0] <1000:
        moji1 = "000" + str(t[i][0])
    elif t[i][0] <10000:
        moji1 = "00" + str(t[i][0])
    elif t[i][0] <100000:
        moji1 = "0" + str(t[i][0])
    else:
        moji1 = str(t[i][0])

    if co <10:
        moji2 = "00000" + str(co)
    elif co <100:
        moji2 = "0000" + str(co)
    elif co <1000:
        moji2 = "000" + str(co)
    elif co <10000:
        moji2 = "00" + str(co)
    elif co <100000:
        moji2 = "0" + str(co)
    else:
        moji2 = str(co)
    t[i].append(moji1 + moji2)
    co += 1

for i in range(m):
    print(s[i][2])



Measured memory_bytes: 30360
#include <stdio.h>

int main (void) {
  int a,b,number,digit;
  
  while (scanf("%d %d",&a,&b)==2) {
    digit = 0;
    number = a+b;
  
    while (number != 0) {
      number = number / 10;
      ++digit;
    }
  
    printf("%d\n",digit);
  }
  
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

string chars = "abcdefghij";
int N;

void dfs(string s, int i) { // s:文字列, i:使える文字数-1
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  
  for (int j = 0; j <= i+1; j++) {
    string t = s;
    t.push_back(chars.at(j));
    dfs(t, max(i, j));
    
    /*
    挙動をメモ
    > ""が入力
    
    >> for ループに入る
    >> j = 0, i = -1で1文字目
    >> t = ""とコピー
    >> t = "a"とpush_back
    >> dfs("a", 0)で返る
    
    	// 二文字目 = 0のループ
    	>>> forループに入る
    	>>> j = 0, i = 0で二文字目
    	>>> t = "a"とコピー
    	>>> t = "aa"と追加
    	>>> dfs("aa", 0)で返る
    
    		/// 三文字目 = 0のループ
    		>>>> for ループに入る
    		>>>> j = 0, i = 0で三文字目
    		>>>> t = "aa"とコピー
    		>>>> t = "aaa"と追加
    		>>>> dfs("aaa", 0)で返る
    
    			>>>>> s.size() == 3なので、for ループに入らず
    			>>>>> sを出力
    
    		/// 三文字目 = 1のループ
    		>>>> j = 1とインクリメントして
    		>>>> j = 1, i = 0で三文字目
    		>>>> t = "aa"とコピー
    		>>>> t = "aab"と追加
   			>>>> dfs("aab", 1)で返る
    
    			>>>>> s.size() == 3なので、for ループに入らず
    			>>>>> sを出力
    
    		>>>> j = 1, i = 0なので、j = i+1、jが増やせない
    		>>>> この階層のループは終了
    	
    
    	// 二文字目 = 1のループ
    	>>> j = 1とインクリメントして
    	>>> j = 1, i = 0で二文字目
    	>>> t = "a"とコピー
    	>>> t = "ab"と追加
    	>>> dfs("ab", 1)で返る
    
    		/// 三文字目 = 0のループ
    		>>>> for ループに入る
    		>>>> j = 0, i = 1で三文字目
    		>>>> t = "ab"とコピー
   	 		>>>> t = "aba"と追加
    		>>>> dfs("aba", 1)で返る
    
    			>>>>> s.size() == 3なので、for ループに入らず
    			>>>>> sを出力
    		
            /// 三文字目 = 1のループ
    		>>>> j = 0, i = 1なので、jをインクリメントして
    		>>>> j = 1, i = 1で三文字目
    		>>>> t = "ab"とコピー
    		>>>> t = "abb"と追加
    		>>>> dfs("abb", 1)で返る
    
    			>>>>> s.size() == 3なので、for ループに入らず
    			>>>>> sを出力
            
            /// 三文字目 = 2のループ
            >>>> j = 1, i = 1なので、jをインクリメントして
    		>>>> j = 2, i = 1で三文字目
    		>>>> t = "ab"とコピー
    		>>>> t = "abc"と追加
    		>>>> dfs("abc", 2)で返る
            	
                >>>>> s.size() == 3なので、for ループに入らず
    			>>>>> sを出力
    
   		 	>>>> j = 2, i = 1なので、jが増やせない
    		>>>> この階層のループは終了
        
        >>> j = 1, i = 0なので、jが増やせない
        >>> この階層のループは終了
    
    */
    
    /*
    s.push_back(chars.at(j));
    dfs(s, max(i, j));
    とすると、sが無限に長くなってしまいだめなようだ
    二文字目までの値が保存されて、ループしていかないのが原因
    
    */
  }
    
  
}

int main() {
  
  cin >> N;
  
  dfs("", -1);

}


Measured memory_bytes: 1536