akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>

using namespace std;

int a[100000];
int b[100000];
int c[100000];
int par[100000];

int find(int x) {
    if (par[x] == x) return x;
    return par[x] = find(par[x]);
}

void unite(int x, int y) {
    x = find(x);
    y = find(y);
    
    if (x == y) return;
    
    par[x] = y;
}

int main() {
    int n, q, cnt = 0, i;
    long long m;
    
    scanf("%d %lld %d", &n, &m, &q);
    
    for (i = 0; i < q; i++) scanf("%d %d %d", &a[i], &b[i], &c[i]);
    
    for (i = 0; i < n; i++) par[i] = i;
    
    for (i = 0; i < q; i++) {
        if (c[i] == 1) continue;
        
        unite(a[i], b[i]);
    }
    
    for (i = 0; i < q; i++) {
        if (c[i] == 0) continue;
        
        if (m == n - 1 || find(a[i]) == find(b[i])) {
            puts("No");
            
            return 0;
        }
    }
    
    for (i = 0; i < n; i++) {
        if (par[i] == i) cnt++;
    }
    
    if (m == n - 1 || (cnt > 2 && n + (long long)cnt * (cnt - 3) / 2 >= m)) {
        puts("Yes");
    } else {
        puts("No");
    }
    
    return 0;
}


Measured memory_bytes: 1664
package main

import "fmt"

func main() {
	// Code for B - NarrowRectanglesEasy
	var W, a, b int
	fmt.Scanf("%d %d %d", &W, &a, &b)

	if a+W < b {
		fmt.Println(b - (a + W))
	} else if b+W < a {
		fmt.Println(a - (b + W))
	} else {
		fmt.Println("0")
	}
}


Measured memory_bytes: 1832
#include <bits/stdc++.h>
#include <iostream>
#include <ctime>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)

int main()
{
    ios::sync_with_stdio(false); cin.tie(nullptr); 
    int l; cin >> l;
    int n = 0;
    vector<tuple<int,int,int>> v;
    
    int k = l;
    while( k > 1 )
    {
        k = k / 2;
        n++;
    }

    k = l;
    int t = n;
    while( k > 1 )
    {
        int nextk = k / 2;
        v.emplace_back(t - 1, t, nextk);
        v.emplace_back(t - 1, t, 0);
        if( k % 2 == 1 )
        {
            v.emplace_back(0, t, k - 1);
        }
        t--;
        k = nextk;
    }

    cout << n + 1 << " " << v.size() << endl;
    vecrep(itr, v)
    {
        cout <<  get<0>(*itr) + 1 << " " <<  get<1>(*itr) + 1 << " " <<  get<2>(*itr) << endl;
    }

    
}

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



using namespace std;


int main(void)
{
    int a1, a2;
    cin >> a1 >> a2;

    if(a1 < 10 && a2 < 10 && a1 > 0 && a1 > 0){
        cout << a1*a2 << endl;
    }else{
        cout << -1 << endl;
    }

    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <utility>

#define inf 1000000000

using namespace std;

int h, w;
int map[35][35];
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int dist[35][35];

void bfs()
{
  for(int x = 0; x < w; x++){
    for(int y = 0; y < h; y++){
      dist[x][y] = inf;
    }
  }
  dist[0][0] = 0;

  queue<pair<int, int> > Q;
  Q.push(make_pair(0, 0));

  int x, y, nx, ny;
  while(Q.size()){
    x = Q.front().first;
    y = Q.front().second;
    Q.pop();
    for(int i = 0; i < 4; i++){
      if(map[x][y] & (1<<i)){
        continue;
      }
      nx = x + dx[i], ny = y + dy[i];
      if(nx < 0 || nx >= w ||  ny < 0 || ny >= h) continue;
      if(dist[nx][ny] < inf) continue;
      dist[nx][ny] = dist[x][y] + 1;
      Q.push(make_pair(nx, ny));
    }
  }


}

int main(void)
{
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0) break;

    for(int x = 0; x < w; x++){
      for(int y = 0; y < h; y++){
        map[x][y] = 0;
      }
    }

    for(int y = 0; y < h; y++){
      int t;
      for(int x = 0; x < w-1; x++){
        cin >> t;
        if(t == 1) map[x][y] |= (1<<0), map[x+1][y] |= (1<<2);
      }
      if(y != h-1){
        for(int x = 0; x < w; x++){
          cin >> t;
          if(t == 1) map[x][y] |= (1<<3), map[x][y+1] |= (1<<1);
        }
      }
    }

    bfs();

    if(dist[w-1][h-1] >= inf) dist[w-1][h-1] = -1;
    cout << dist[w-1][h-1]+1 << endl;
  }

  return 0;
}



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

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;
const ll INF = 1LL << 60;

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


vector<int> g[N];
bool viss[N];
int vis[N];

// Normal DFS
void dfs(int curr, int par)
{
  for(auto x: g[curr])
    if(x != par)
      dfs(x, curr);
}

// DFS with visiting status
void dfs1(int curr, int par)
{
  viss[curr] = 1;
  for(auto x: g[curr])
    if(!viss[x])
      dfs1(x, curr);
}

// DFS with strongly connected component
void dfs2(int curr, int par, int num)
{
  vis[curr] = num;
  for(auto x: g[curr])
    if(vis[x] == 0)
      dfs2(x, curr, num);
}

// XOR from 0 to n
ll fxor(ll n)
{
  if(n < 0) return 0;
  if(n % 4 == 3) return 0;
  else if(n % 4 == 0) return n;
  else if(n % 4 == 1) return n^(n-1);
  else if(n%4 == 2) return n^(n-1)^(n-2);
}

// Power in logn with mod 1000000007
llt ppow(llt x, llt y)
{
  llt res = 1;
  while(y > 0){
    if(y&1)
      res = (res * x)%M;
    y = y >> 1;
    x = (x * x)%M;
  }
  return res;
}

// Factorial with dp
llt factdp[N];
llt fact(llt x)
{
  if(x == 0) return 1;
  if(x == 1) return 1;
  if(factdp[x] != -1) return factdp[x];
  return factdp[x] = (x*fact(x-1))%M;
}

// String return to base b
string ansConv ="";
void convert10tob(llt N, int b)
{
     if (N == 0)
        return;
     int x = N % b;
     N /= b;
     if (x < 0)
        N += 1;
     convert10tob(N, b);
     ansConv += to_string(x);
     return;
}

// Convert string to num wiht base b
llt convertstrtob(string a, int b)
{
  llt aa = 0;
  llt mul = 1;
  for(int i=a.length()-1; i>=0; i--)
  {
    int curr = a[i] - '0';
    aa += (curr * mul);
    mul *= b;
  }
  return aa;
}

// Union Find algo with array
// Find()
int findpar(int curr, int arr[])
{
  while(arr[curr] != curr) curr = arr[curr];
  return curr;
}
// Union()
void Union(int b, int spa, int arr[])
{
  while(arr[b] != b)
  {
    int c = arr[b];
    arr[b] = spa;
    b = c;
  }
  arr[b] = spa;
}

// Main Code
int arr[N];
bool v[N];
int main()
{
  int n;
  cin>>n;
  repn(i, 1, n) cin>>arr[i];
  int co = 0;
  int curr = 1;
  v[curr] = 1;
  while(curr != 2)
  {
    curr = arr[curr];
    co++;
    if(v[curr] == 1)
    {
      puts("-1");
      return 0;
    }
    v[curr] = 1;
  }
  cout<<co<<endl;
  return 0;
}


Measured memory_bytes: 15104
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n;
  bool f[1000000];  // 1000000以下の素数を調べよう！
  rrep(i, 2, 1000001) { f[i] = false; }
  rrep(i, 2, 1000001) {
    if (!f[i]) {
      for (int j = i + i; j <= 1000000; j += i) {
        f[j] = true;
      }
    }
  }
  f[2] = false;
  rrep(i, n, 1000001) {
    if (!f[i]) {
      Cout(i);
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 1280
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-06 17:16:38
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rev(x) greater<x>()
#define MOD 1000000007
#define INF 1000000000

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod) {
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod) {
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod) {
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

int gcd(int k, int l) {
    if (l > 0) return gcd(l, k%l);
    else return k;
}

struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n) {
        for (int i = 0; i < n; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int a, b, c, k;

int main()
{
    vector<int> a(3);
    for (int i = 0; i < 3; i++)
        cin >> a[i];
    int k;
    cin >> k;

    sort(all(a), rev(int));

    int ans = 0;
    ans += a[0]*pow(2, k);
    for (int i = 1; i < 3; i++)
        ans += a[i];

    cout << ans << endl;

    return 0;
}


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

using namespace std;

const int N=2e5+5,OO=0x3f3f3f3f,M=1e9+7;
int t,n,m,k;
vector<string>v;

int main() {
    cin>>n;
    cout<<n*(n+1)/2;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

int main()
{
    std::string in;
    std::cin >> in;

    for (int i = 0; i < in.size(); i++) {
        std::cout << in.at(in.size() - 1 - i);
    }
    std::cout << std::endl;

    return 0;
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

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

//重みある時
using Edge = pair<int,int>;
using Graph = vector<vector<Edge> >;

int main() {
    int n,ans;
    string s;
    cin >> n;
    cin >> s;
    ans = n;
    int ruiw[n+1],ruib[n+1];

    for (int i = 0; i < n+1; ++i) {
        ruiw[i] = 0,ruib[i] = 0;
    }

    for(int i = 0;i < n;i++){
        if(s[i] == '#'){
            ruib[i+1] = ruib[i] + 1;
            ruiw[i+1] = ruiw[i];
        }
        else{
            ruiw[i+1] = ruiw[i] + 1;
            ruib[i+1] = ruib[i];
        }
    }
    for (int i = 0; i <= n; ++i) {
        int tmp = ruib[i],tmp2 = ruiw[n] - ruiw[i];
        ans = min(ans,tmp+tmp2);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2180
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

int main() {
	long long int n,m,a,b,c;
	string str;
	long long int x[130]={};
	cout << fixed << setprecision(10);
	cin>>a>>b;
	if(a>=13){cout<<b;}
	else if(a<6){cout<<0;}
	else{cout<<b/2;}



	cout<<endl;
} 


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

int main() {
  ll n,ans = 5;
  vector<ll>data(5);
  cin >> n >> data[0] >> data[1] >> data[2] >> data[3] >> data[4];
  sort(data.begin(),data.end());
  ans += n/data[0]-1;
  if(n%data[0] != 0) ans++;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 2e2 + 10;
int a[N][N];
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n, m;
	cin >> n >> m;
	while (m--)
	{
		int x, y;
		cin >> x >> y;
		a[x][y] = a[y][x] = 1;
	}
	vector<int> v;
	for (int i = 1; i <= n; i++) v.push_back(i);
	int ans = 0;
	do
	{
		if (v[0] != 1) break;
		int flag = 1;
		for (int i = 0; i + 1 < v.size(); i++)
		{
			if (!a[v[i]][v[i + 1]])
			{
				flag = 0;
				break;
			}
		}
		ans += flag;
	} while (next_permutation(v.begin(), v.end()));
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define in(s) ll s; cin>>s
#define pr(r) cout<<r<<endl
#define prr(m,n) cout<<m<<" "<<n<<endl
#define prarr(a,i,n) fab(j,i,n) cout<<a[j]<<" "
#define wh(t) ll t; cin>>t; while(t--)
#define sz(u) u.size()
#define all(v) v.begin(),v.end()
#define arr(a,n) ll a[n]; fab(i,0,n) cin>>a[i]
#define showdp(d,n,m) fab(i,0,n){ fab(j,0,m) if(d[i][j]==-1 || d[i][j]>9) cout<<d[i][j]<<" "; else cout<<" "<<d[i][j]<<" "; cout<<endl; }
#define prs(u) cout<<u<<" "
#define fab(i,a,b) for(ll i=a;i<b;i++)
#define fba(i,b,a) for(ll i=b;i>=a;i--)
#define sup ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define MX 1000000007
#define MAX 10000007
#define endl "\n"
#define ll long long int
#define vl vector<ll>
#define vpl vector<pair<ll,ll>>
#define pl pair<ll,ll>
#define pll pair<ll,pl>
#define vvl vector<vl>
#define mxe(x,n) *max_element(x,x+n)
#define mne(x,n) *min_element(x,x+n)
#define mp make_pair
#define pb push_back
#define fs first
#define sd second
#define fr front()
#define bk back()
#define rr return
const ll N =(ll)3e5;
const ll inf =(ll)1e18+7;
const ll mod =(ll)1e9+7;
 
bool rsort1(const pair<ll,ll> &a,const pair<ll,ll> &b) { return (a.first > b.first);}
bool rsort2(const pair<ll,ll> &a,const pair<ll,ll> &b) { return (a.second>b.second);}
bool sort2(const pair<ll,ll> &a,const pair<ll,ll> &b){ return (a.second < b.second);}
 
bool isPrime(ll p)
{
    for(ll i=2;i*i<=p;i++)
        if(p%i==0)
            rr false;
    rr true;
}
 
void sieve(ll n,vl &v)
{
    v.pb(2);
    bool prime[n+1];
    memset(prime,true,sizeof(prime));
    for(ll i=3;i*i<=n;i+=2)
        if(prime[i])
            for(ll j=i;j*i<=n;j+=2)
                prime[j*i]=false;
        
    for(ll i=3;i<=n;i+=2)
        if(prime[i])
            v.pb(i);
}

ll phi(ll n)
{
    ll result=n;
    for(ll p=2;p*p<=n;p++)
    {
        if(n%p==0)
        {
            while(n%p==0)
                n/=p;
            result-=result/p;
        }
    }

    if(n>1)
        result-=result/n;
    return result;
}

ll nCr(ll n, ll k) 
{ 
    ll C[n + 1][k + 1]; 
    ll i, j;  
    for (i = 0; i <= n; i++) 
    { 
        for (j = 0; j <= min(i, k); j++) 
        { 
            if (j == 0 || j == i) 
                C[i][j] = 1;  
            else
                C[i][j] = C[i - 1][j - 1] + 
                          C[i - 1][j]; 
        } 
    }
    return C[n][k]; 
} 


int main()
{
	sup;
    
    ll n,k;
    cin>>n>>k;
    vl v(n);
    ll sum=0;
    fab(i,0,n)
    {
        cin>>v[i];
    }
    sort(all(v));
    fab(i,0,n-k)
        sum+=v[i];
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cctype>
#define len length()
#define sz size()
#define rng(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) rng(i, 0, n)
#define srt(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define vi(a, n) vector<int> a(n)
#define vs(a, n) vector<string> a(n)
#define vc(a, n) vector<char> a(n)
#define psb(a) push_back(a)
#define ppb pop_back()
#define erc(S, i) S.erase(S.begin() + i)
#define ers(S, i, j) S.erase(S.begin() + i, S.begin() + j)
#define sp(n) cout << setprecision(n) << fixed
#define fst(s) s.at(0)
#define lst(s) s.at(s.len - 1)
using namespace std;

int main(){
    int N, M;
    cin >> N;
    int T[N];
    rep(i,N) cin >> T[i];
    cin >> M;
    pair<int, int> tm[M];
    rep(i,M){
        cin >> tm[i].first;
        cin >> tm[i].second;
    }
    int sum = 0;
    rep(i,N) sum += T[i];
    int ans[M];
    rep(i, M){
        ans[i] = sum - T[tm[i].first - 1] + tm[i].second;
        cout << ans[i] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func slove(n int) int {
	if n % 2 == 1 {
		return 0
	}

	var res int
	n /= 2
	for 0 < n {
		res += n / 5
		n /= 5
	}
	return res
}

func main() {
	var n int
	fmt.Scan(&n)
	
	fmt.Println(slove(n))
}


Measured memory_bytes: 512
import sys
from collections import deque

input = sys.stdin.readline

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

sq = deque(S)
lst=[]
j=0

for i in range(K):
    j=0
    if not sq:break
    sq_1st = sq.popleft()
    sq_2nd = sq_1st
    lst.append(sq_1st)

    while sq:
        sq_3rd = sq.popleft()
        if sq_2nd!=sq_3rd:
            j+=1
            sq_2nd=sq_3rd
            if j==2:
                sq.appendleft(sq_3rd)
                break
        lst.append(sq_1st)

lst+=list(sq)             

def eval(N,S):
    total=0
    for i in range(1,N):
        if S[i]==S[i-1]:total+=1
    return total
  
print(eval(N,lst))
  


Measured memory_bytes: 6436
#define _CRT_SECURE_NO_WARNINGS

#define N (1<<17)
#define MODULO (1000000007)

#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <vector>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
using namespace std;

int x, cur, cnt;

int main()
{
	scanf("%d", &x);
	while (cur < x)
	{
		cur += (++cnt);
	}
	printf("%d\n", cnt);
	//system("pause");
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{

	long long n;
	cin >> n;

	int a[n];
	int b[n];
	//vector<int> vec;
	//long long index = 0;
	//long long count = n;

	int mi = INT_MAX;
	int ma = 0;
	int index1 = 0,index2 = 0;


	for(int i =0;i<n;i++)
	{
		cin >> a[i] >> b[i];
		if(a[i] > ma)
		{
			ma = a[i]; // highest or worst rank
			index1 = b[i];
		}
		if(a[i]<mi)
		{
			mi = a[i];
			index2 = b[i]; // lowest or best rank
		}

	}

	cout<< ma+index1 <<endl;

	return 0;
}


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
const ll zero=0;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}



int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0,buf1=0,buf2=0,buf3=0,buf4=0,sum=0;
  bool judge = true;
  ll n,k;cin>>n>>k;
  vector<ll> a,b;
  for(i=1;i*i<=n;i++){
    a.push_back(i);
    if(i*i!=n)b.push_back(i);
  }
  reverse(ALL(b));
  for(i=1;i*i<n;i++){
    a.push_back(n/b[i-1]);
  }
  ll s=a.size();
  ll dp[2][s];
  for(i=0;i<s;i++)dp[0][i]=a[i]; 
  for(i=1;i<k;i++){
    dp[i%2][0]=dp[!(i%2)][s-1];
    for(j=1;j<s;j++){
      qmod(buf,dp[!(i%2)][s-j-1],a[j]-a[j-1]);
      pmod(dp[i%2][j],buf,dp[i%2][j-1]);
    }
  }
  cout<<dp[(k-1)%2][s-1]<<endl;
  return 0;
}

Measured memory_bytes: 2168
#include <stdio.h>

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

    if(N>=64){
        printf("64\n");
    }else if(N>=32){
        printf("32\n");
    }else if(N>=16){
        printf("16\n");
    }else if(N>=8){
        printf("8\n");
    }else if(N>=4){
        printf("4\n");
    }else if(N>=2){
        printf("2\n");
    }else{
        printf("1\n");
    }
}

Measured memory_bytes: 128
#include<cstdio>
#include<iostream>
#include<cstring>
#define in inline
#define re register
using namespace std;
in long long read(){
	re long long t=0;
	re char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9'){
		t=(t<<3)+(t<<1)+(v^48);
		v=getchar();
	}
	return t;
}const long long M=1e9+7;  
inline long long ksm(re long long p,re long long b){
    long long ans=1;
    while(b){
        if(b&1){
          ans*=p;
            ans%=M;
        }
        p*=p;
        p%=M;
        b>>=1;
    }
    return ans;
}

long long cnt[62];
long long ans,n;
int main(){
	n=read();
	for(re long long i=1;i<=n;++i){
		long long num=0;
		long long tmp=read();
		while(num<=61){
			if(tmp&1)++cnt[num],ans=(ans+ksm(2,num)*(i-cnt[num]))%M;
			else ans=(ans+ksm(2,num)*cnt[num])%M;
			tmp>>=1;
			++num;
			
		}
	}
	printf("%lld",ans%M);
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {

	long long int N;
	long long int K;
	scanf("%lld %lld", &N, &K);
	
	long long int arr[N];
	for(int i=0; i<N; i++){
		scanf("%lld", &arr[i]);
	}
	
	for(long long int i=0, j=K; j<N; i++, j++){
		if(arr[j]>arr[i]){
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	}

    return 0;
}

Measured memory_bytes: 4716
#include<iostream>
using namespace std;
int main()
{
    long long x,t;
    cin>>x>>t;
    int a;
    if (x>t) a=x-t;
    else
    {
        if (x<t) a=0;
        else a=0;
    }
    cout<<a<<endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 504
#include<bits/stdc++.h>
#define endl '\n'
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define REP(i,a,b) for(int i=a;i<b;i++)
#define maxx 100005

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

bool ok[maxx];
int main(){
    FASTIO;
    int n,m,a,b,cnt=0;
    cin>>n>>m;
    int h[n+1];
    REP(i,1,n+1) cin>>h[i];
    memset(ok,1,sizeof(ok));
    REP(i,0,m){
      cin>>a>>b;
      if(h[a]<=h[b]) ok[a]=0;
      if(h[b]<=h[a]) ok[b]=0;
    }
    REP(i,1,n+1) if(ok[i]) cnt++;
    cout<<cnt;
    return 0;
}


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

void solve() {
    string s;
    int r = 0, ans = 0;
    cin >> s;
    for (int x = 0; x < 3; x++) {
        if(s[x] == 'R') r++;
        else r = 0;
        ans = max(ans, r);
    }
    cout << ans;
}

int main() { solve(); }

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

int main() {
    int h, w;
    cin >> h >> w;

    int cnt = 0;
    rep(i, h) rep(j, w) {
        char a;
        cin >> a;
        if (a == '#') cnt++;
    }

    if (cnt == h + w - 1)
        cout << "Possible" << endl;
    else
        cout << "Impossible" << endl;
    return 0;
}


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

row = [False]*h
col = [False]*w

for i in range(h):
    for j in range(w):
        if grid[i][j] == "#":
            row[i] = True
            col[j] = True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(grid[i][j],end="")
        print("")



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

signed main()
{
	int n,m;
	cin>>n>>m;
	int a[m+1],sum=0;
	
	for(int i=1; i<=m; i++)
		cin>>a[i];
	
	for(int i=1; i<=m; i++)
		sum+=a[i];
	
	if(n>=sum)
		cout<<n-sum<< endl;
	else
		cout<<-1<< endl;
	
	return 0;
}


Measured memory_bytes: 3644
while True:
    x=int(input())
    if x==0:
        break
    y=0
    for i in range(2,50):
        if x/i - i/2<0.1:
            break
        if i%2==0:
            if x/i-x//i==0.5:
                y+=1
        else:
            if x%i==0:
                y+=1
    print(y)


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

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  string s;
  cin >> s;
  if (s == "Sunny")
    cout << "Cloudy\n";
  else if (s == "Cloudy")
    cout << "Rainy\n";
  else
    cout << "Sunny\n";
  return 0;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()

S = S.replace("ABC", "#")

total = 0
for i in S:
	if i=="#":
		total += 1

print(total)

Measured memory_bytes: 59736
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        SetOut(new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        var N = FastIO.Int();
        var Q = FastIO.Int();
        var g = new List<int>[N];
        for (int i = 0; i < g.Length; i++) g[i] = new List<int>();
        for (int i = 0; i < N - 1; i++)
        {
            var a = FastIO.Int() - 1;
            var b = FastIO.Int() - 1;
            g[a].Add(b);
            g[b].Add(a);
        }

        var v = new int[N];
        for (int i = 0; i < Q; i++)
        {
            var p = FastIO.Int() - 1;
            var x = FastIO.Int();
            v[p] += x;
        }

        var o = new int[N];
        o[0] = v[0];
        DFS(0, -1, g, v, o);
        for (int i = 0; i < N; i++) WriteLine(o[i]);
        Out.Flush();
    }

    static void DFS(int v, int p, List<int>[] g, int[] a, int[] o)
    {
        if (p != -1) o[v] = a[v] + o[p];
        foreach (var u in g[v])
        {
            if (u == p) continue;
            DFS(u, v, g, a, o);
        }
    }
}

public static class FastIO
{
    static System.IO.Stream str = System.Console.OpenStandardInput();
    const int size = 1024;
    static byte[] buffer = new byte[size];
    static int ptr;
    static int len;

    static byte Read()
    {
        if (ptr == len)
        {
            len = str.Read(buffer, 0, size);
            if (len == 0) return 0;
            ptr = 0;
        }
        return buffer[ptr++];
    }

    public static int Int()
    {
        var c = Read();
        while (c < 0x21)
        {
            c = Read();
        }
        var n = false;
        if (c == '-')
        {
            n = true;
            c = Read();
        }
        var ret = 0;
        while (c > 0x20)
        {
            ret = ret * 10 + c - '0';
            c = Read();
        }
        return n ? -ret : ret;
    }

    public static long Long()
    {
        var c = Read();
        while (c < 0x21)
        {
            c = Read();
        }
        var n = false;
        if (c == '-')
        {
            n = true;
            c = Read();
        }
        var ret = 0L;
        while (c > 0x20)
        {
            ret = ret * 10 + c - '0';
            c = Read();
        }
        return n ? -ret : ret;
    }
}


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

const long long MOD = 998244353;

struct mint{
    long long v;

    mint() : v(0) {}
    mint(long long x){
        x = x % MOD;
        if(x < 0){ x += MOD; }
        v = x;
    }
    mint& operator+=(mint a){
        v += a.v;
        if(v >= MOD){ v -= MOD; }
        return *this;
    }
    mint& operator*=(mint a){
        v *= a.v;
        v %= MOD;
        return *this;
    }
    mint& operator-=(mint a){
        v -= a.v;
        if(v < 0){ v += MOD; }
        return *this;
    }
    mint& operator/=(mint a){
        return (*this) *= a.inv();
    }

    mint operator*(mint a) const{
        return mint(v) *= a;
    }

    mint operator+(mint a) const {
        return mint(v) += a;
    }

    mint operator-(mint a) const {
        return mint(v) -= a;
    }

    mint operator/(mint a) const {
        return mint(v) /= a;
    }

    mint pow(long long k) const {
        mint res(1),tmp(v);
        while(k){
            if(k&1) res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    mint inv(){return pow(MOD - 2); }

    static mint comb(long long n, int k){
        mint res(1);
        for(int i = 0; i < k; ++i){
            res *= mint(n - i);
            res /= mint(i + 1);
        }
        return res;
    }

    static mint factorial(long long n){
        mint res(1);
        for(int i = n; i > 1; --i){
            res *= mint(i);
        }
        return res;
    }

    bool operator<(const mint &a) const {
        return v < a.v;
    };
};

mint operator*(long long l, mint r){ return r * l; }

std::ostream& operator<<(std::ostream& stream, const mint& m){
    stream << m.v;
    return stream;
}


vector<pair<ll, ll>> xd;
vector<vector<ll>> net;
vector<bool> visited;

mint dfs(ll cur){
    visited.at(cur) = true;
    mint ret = 1;
    for(ll nxt : net.at(cur)){
        ret *= dfs(nxt);
    }
    ret += 1;
    return ret;
}

int main(){
    ll n;
    cin >> n;
    xd.resize(n);
    REP(i, n){
        cin >> xd.at(i).first >> xd.at(i).second;
    }
    sort(xd.begin(), xd.end());

    net.resize(n);
    vector<ll> tmp;
    for(ll i = n - 1; i >= 0; --i){
        const auto p = xd.at(i);
        while(!tmp.empty()){
            if(xd.at(tmp.back()).first < p.first + p.second){
                net.at(i).push_back(tmp.back());
                tmp.pop_back();
            }else{
                break;
            }
        }
        tmp.push_back(i);
    }

    visited.resize(n);
    std::fill(visited.begin(), visited.end(), false);
    mint ans = 1;
    REP(i, n){
        if(visited.at(i)){ continue; }
        ans *= dfs(i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 23680
#include<stdio.h>
int main(void)
{
    int a,b,c,d,i;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    while((a>0)&&(c>0)){
        c=c-b;
        if(c<=0){
            printf("Yes\n");
            return 0;
        }
        a=a-d;
        if(a<=0){
            printf("No\n");
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 1644
function main(input) {
    var a = input[0]-0;
    var b = input[1]-0;
    var c = input[2]-0;
    var d = input[3]-0;
    
    console.log(Math.min(a,b)+Math.min(c,d));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))


Measured memory_bytes: 7372
s = input()
ans = 'WA'

if s[0] == 'A':
    if s[2:-1].count('C') == 1:
        flag = 0
        for i in range(1,len(s)):
            if s[i].isupper():
                flag += 1
        if flag == 1:
            ans = 'AC'

print(ans)

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

int main()
{
    int n;
    cin >> n;
    ll mn = 1e18, mnn = 1e18;
    ll mx = -1e18, mxx = -1e18;
    while (n--)
    {
        ll x, y;
        cin >> x >> y;
        mn = min(mn, x + y);
        mx = max(mx, x + y);
        mnn = min(mnn, x - y);
        mxx = max(mxx, x - y);
    }
    cout << max(mx - mn, mxx - mnn);
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#include <vector>
#include <string>

using namespace std;

vector<string> split(const string &s, char delim) {
  vector<string> elems;
  string item;
  for (char ch: s) {
    if (ch == delim) {
      if (!item.empty()) {
        elems.push_back(item);
      }
      item.clear();
    }
    else {
      item += ch;
    }
  }
  if (!item.empty()) {
    elems.push_back(item);
  }
  return elems;
}

string to_str_with_zero(int i, int w) {
  ostringstream sout;
  sout << std::setfill('0') << std::setw(w) << i;
  string s = sout.str();
  return s;
}

int letter_to_int(char c) {
  return tolower(c) - 'a';
}

bool array_equal(vector<int> a1, vector<int>a2) {
  if (a1.size() != a2.size()) {
    return false;
  }
  for (int i=0; i<a1.size(); i++) {
    if (a1.at(i) != a2.at(i)) {
      return false;
    }
  }
  return true;
}

int gcd(int a, int b) {
  if (a == b) {
    return a;
  }
  else if (a > b) {
    return gcd(a - b, b);
  }
  else {
    return gcd(a, b - a);
  }
}

char int_to_char(int a) {
  if (a == -1) {
    return 'z';
  }
  else {
    return 'a' + a;
  }
}

long nCr(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

int main() {
  std::cout << std::setprecision(9);
  int n, k, q;
  cin >> n >> k >> q;

  vector<int> a_count(n);
  for(int i=0; i<q; i++) {
    int a;
    cin >> a;
    a_count.at(a - 1)++;
  }
  for(int i=0; i<n; i++) {
    if(q - a_count.at(i) >= k) {
      cout << "No" << endl;
    }
    else {
      cout << "Yes" << endl;
    }
  }
}

Measured memory_bytes: 3772
#include <cstdio>
#include <unordered_map>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
const int N = 2e7 + 1;
const int mod = 1e9 + 7;
struct node
{
    int fa;
    int sum[2];
}f[N];
int n, m;
long long ans;
bool a[401][401];
int b[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int getfa(int x)
{
    return f[x].fa == x ? x : f[x].fa = getfa(f[x].fa);
}
void combine(int x,int y)
{
    if (getfa(x) != getfa(y))
    {
        f[getfa(x)].sum[0] += f[getfa(y)].sum[0];
        f[getfa(x)].sum[1] += f[getfa(y)].sum[1];
        f[getfa(y)].sum[0] = f[getfa(y)].sum[1] = 0;
        f[getfa(y)].fa = getfa(x);
    }
}
int main()
{
    scanf("%d %d", &n, &m);
    for (int i =  1; i <= n ; i ++)
        for (int j = 1;  j <= m ; j ++)
        {
            char c;
            scanf(" %c", &c);
            if (c == '#') a[i][j] = 1;
        }
    for (int i = 1; i <= n; i ++)
        for (int j = 1; j <= m ; j ++)
            f[i * m + j - m].sum[a[i][j]] = 1, f[i * m + j - m].fa = i * m + j - m;
    for (int i = 1; i <= n ; i ++)
        for (int j = 1; j <= m ; j ++)
            for (int k = 0; k < 4; k ++)
            {
                int x = i + b[k][0];
                int y = j + b[k][1];
                if (x && y && x <= n && y <= m && a[i][j] != a[x][y])
                {
                    combine(i * m + j - m, x * m + y - m);
                }
            }
    for (int i = 1; i <= n * m ; i ++)
        if (getfa(i) == i){
            ans += (long long)f[i].sum[0] * f[i].sum[1];
        }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 2176
#include<iostream>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#define max(a, b) (a) > (b) ? (a) : (b)
#define debug(a) cout << "*" << a << "*" << endl
using namespace std;
typedef long long ll;
int n;
char ch[105];
int getnum(int x)
{
	int sum = 0;
	while (x)
	{
		if (x & 1)	sum++;
		x >>= 1;
	}
	return sum;
}
int get()
{
	int l[105], r[105], s, ans = 0;
	s = 0;
	for (int i = 0; i < n; i++)
	{
		s |= (1 << (ch[i] - 'a'));
		l[i] = s;
	}
	s = 0;
	for (int i = n - 1; i >= 0; i--)
	{
		s |= (1 << (ch[i] - 'a'));
		r[i] = s;
	}
	for (int i = 0; i < n - 1; i++)
	{
		ans = max(ans, getnum(l[i] & r[i + 1]));
	}
	return ans;
}
int main()
{
	while (~scanf("%d%s", &n, ch))
	{
		printf("%d\n", get());
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int a,b,c; cin>>a>>b>>c;
	if (a==c) cout<<b;
	else if (b==c) cout<<a;
	else if (a==b) cout<<c<<endl; 
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
static const int INF = 0x3f3f3f3f;
static const long long int INFL = 0x3f3f3f3f3f3f3f3fLL;
const long long int MOD = 1e9+7;
const long long int  mod = 998244353;


int main()
{
    string S, T;
    cin>>S;
    cin>>T;
    int n = S.size();
    int m = T.size();

    int ans = INT_MAX;
    for(int i=m-1;i<n;++i) {
        int j = i-m+1;
        int count = 0;
        for(int k=0; k<m; ++k) {
            if( S[k+j] != T[k])
                count++;
        }
        ans = min(ans, count);

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


Measured memory_bytes: 3624
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define rep(i, n) for(int i=0;i<(int)(n);i++)

int main(void){
	int m1, d1, m2, d2;
	scanf("%d%d%d%d",&m1, &d1, &m2, &d2);
	if(d1 > d2){
		printf("1\n");
		return 0;
	}
	else{
		printf("0\n");
	}
    return 0; 
}


Measured memory_bytes: 128
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class Read>void in(Read &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
ll n;
int main(){
	in(n);
    n--;
    printf("%lld\n",(n+1)*n/2);
	return 0;
}


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

int main() {
    ios_base::sync_with_stdio(false);	
    cin.tie(0);
	char word;
	cin >> word;
	if (word >= 'A' && word <= 'Z') cout << "A" << "\n";
	else cout << "a" << "\n";
	return 0;
}


Measured memory_bytes: 3628
a = gets.to_i
b = gets.to_i
c = gets.to_i
x = gets.to_i

cnt = 0
(a+1).times do |i|
  (b+1).times do |j|
    (c+1).times do |k|
      cnt += 1 if i*500+j*100+k*50 == x
    end
  end
end

puts cnt

Measured memory_bytes: 1788
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	f := make([][10]int, n)
	for i := 0; i < n; i++ {
		f[i] = [10]int{}
		for j := 0; j < 10; j++ {
			fmt.Scan(&f[i][j])
		}
	}
	p := make([][11]int, n)
	for i := 0; i < n; i++ {
		for j := 0; j < 11; j++ {
			fmt.Scan(&p[i][j])
		}
	}

	ans := -99999999999
	for bit := 1; bit < (1 << 10); bit++ {
		sum := 0
		for i := uint(0); i < uint(n); i++ {
			cnt := 0
			for j := 0; j < 10; j++ {
				if bit&(1<<uint(j)) > 0 && f[i][j] == 1 {
					cnt++
				}
			}
			sum += p[i][cnt]
		}
		if ans < sum {
			ans = sum
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 640
#include<cstdio>
#include<cstring>
#include<cstdlib>

typedef struct _tree {
    struct _tree *left, *right;
    int node;
} tree;

char *p;
bool analyze(tree *dst) {
    dst->left = dst->right = NULL;
    switch(*p) {
        case ')':
            p++;
            return false;
        case '(':
            dst->left = (tree*)malloc(sizeof(tree));
            p++;
            if(!analyze(dst->left)) dst->left = NULL;
            break;
    }
    p++;
    dst->node = 0;
    while('0' <= *p && *p <= '9')
        dst->node*=10, dst->node+=(*p-'0'), p++;
    p++;
    p++;

    dst->right = (tree*)malloc(sizeof(tree));
    if(!analyze(dst->right)) dst->right = NULL;
    p++;
    return true;
}

void print_tree(tree *tr) {
    printf("(");
    if(tr->left) print_tree(tr->left);
    printf(")");

    printf("[");
    printf("%d", tr->node);
    printf("]");

    printf("(");
    if(tr->right) print_tree(tr->right);
    printf(")");
}

void unite(tree *tr1, tree *tr2) {
    (tr1->left && tr2->left) ? unite(tr1->left, tr2->left),tr1->left : tr1->left = NULL;
    (tr1->right && tr2->right) ? unite(tr1->right, tr2->right),tr1->left : tr1->right = NULL;
    tr1->node += tr2->node;
}

int main(void) {
    char s[2000], t[2000];
    tree st, tt;

    scanf("%s%s",s,t);
    p = s;
    analyze(&st);
    p = t;
    analyze(&tt);

    unite(&st, &tt);

    print_tree(&st);
    puts("");
    return 0;
}

Measured memory_bytes: 2716
pa = [1]
atu = [1]

for i in range(50):
    pa.append(pa[i]*2+1)
    atu.append(atu[i]*2+3)
    
def f(n,x):
    if x == 1:
        if n == 0:
            return 1
        else:
            return 0
    elif 2 <= x <= atu[n-1]+1:
        return f(n-1,x-1)
    elif x == atu[n-1]+2:
        return pa[n-1]+1
    elif atu[n-1]+3 <= x <= 2*atu[n-1]+2:
        return pa[n-1]+f(n-1,x-atu[n-1]-2)+1
    elif x == 2*atu[n-1]+3:
        return 2*pa[n-1]+1
        
n ,x = map(int,input().split())
print(f(n,x))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <iomanip>
#define ll long long
using namespace std;
 
int main() {
  ll N, M, cnt;
  cin >> N >> M;
  ll A, B;
  vector<pair<ll, ll>> AB;
  for(ll i = 0; i < N; i++) {
    cin >> A >> B;
    AB.push_back(make_pair(A, B));
  }
  
  sort(AB.begin(), AB.end());
  
  for(ll i = 0; i < N; i++) {
    if(M > AB.at(i).second) {
      cnt += AB.at(i).first * AB.at(i).second;
      M -= AB.at(i).second;
    }
    else {
      cnt += AB.at(i).first * M;
      M = 0;      
    }
  }  
  cout << cnt << endl;
}


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

int main(){
  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  if(w < x + r or x - r < 0 or h < y + r or y - r < 0){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 3116
#include<stdio.h>
int main()
{
  int n=0,i=0,ans=1,k=0;
  int h[20]={};
  scanf("%d",&n);
  for( ;i<n;i++){
    scanf("%d",&h[i]);
  }  
  for(i=1;i<n;i++){
    for( ;k<=i;k++){      
      if(i==k){
        ++ans;
        break;
      }
      else if(h[i]<h[k]){
        break;
      }
    }
  }
  printf("%d",ans);
  return 0;
}        

Measured memory_bytes: 128
fun main(args: Array<String>) = println(run {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toInt() }
    val b = IntArray(n)
    a.forEachIndexed { i, x -> b[x-1] = i }
    b.joinToString(" ") { (it+1).toString() }
})

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	4 * MAX5;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;
const int N = 1e4;

ll vis[N]; vll adj[N];

// <------------- Declare Variables Here ------------> //

ll t = 1;
ll n, m, s, cnt = 1, sum, u, v;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	ld w,h,x,y;
	cin >> w >> h >> x >> y;
	cout<<(w*h)/2<<" ";
	if(x == w/2 && y == h/2) cout<<1;
	else cout<<0;
}

int main() {
	fastio; randomINT;
	//cin >> t;
	while (t--) {
		MAIN();
	}
	return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;

int main() {
  int x; cin >> x;
  if (x >= 30) cout << "Yes";
  else cout << "No";
}


Measured memory_bytes: 3640