akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;};

ll ans[555][555];

int main(){

    ll N;
    cin >> N;
    for(ll i = 1; i <= 9; i++){
        for(ll j = 1; j < 555; ){
            vector<ll>A, B;
            for(ll k = 0; k < (1 << (i - 1)) && j < 555; k++, j++)A.push_back(j);
            for(ll k = 0; k < (1 << (i - 1)) && j < 555; k++, j++)B.push_back(j);
            for(ll k = 0; k < A.size(); k++){
                for(ll l = 0; l < B.size(); l++){
                    ans[A[k]][B[l]] = i;
                }
            }

        }
    }
    for(ll i = 1; i < N; i++){
        for(ll j = i + 1; j <= N; j++){
            cout << ans[i][j];
            if(j == N)cout << endl;
            else cout << " ";
        }
    }

    return 0;
}

Measured memory_bytes: 2816
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//
constexpr ll MOD = 1e9 + 7;
/*/
const ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
inline bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
inline bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll i, o, t, j;
  cin >> i >> o >> t >> j;
  ll l, s, z;
  cin >> l >> s >> z;
  ll ans = o;
  if(i && j && l){
    ll cnt = (i&1) + (j&1) + (l&1);
    if(cnt >= 2){
      ans += 3;
      i--;
      j--;
      l--;
    }
    ans += (i/2)*2;
    ans += (j/2)*2;
    ans += (l/2)*2;
  }else{
    ans += (i/2)*2;
    ans += (j/2)*2;
    ans += (l/2)*2;
  }
  print(ans);
}


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


int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if(a+b > c+d) cout << "Left\n";
    else if(a+b == c+d) cout << "Balanced\n";
    else cout << "Right\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int N=1000005;
const int mo=998244353;
int n,a[N],mu[N];
ll S[N];
int main(){
	scanf("%d",&n);
	For(i,1,n) scanf("%d",&a[i]),S[a[i]]+=a[i];
	For(i,1,N-1) For(j,2,(N-1)/i) S[i]+=S[i*j];
	mu[1]=1;
	For(i,1,N-1) For(j,2,(N-1)/i) mu[i*j]-=mu[i];
	int ans=0;
	For(i,1,N-1) For(j,1,(N-1)/i) if (mu[j]){
		int val=1ll*i*j*j*mu[j]%mo;
		int vval=S[i*j]/j/i%mo;
		//if (val&&vval) printf("%d %d %d %d %d\n",i,j,val,vval,ans);
		ans=(ans+1ll*val*vval%mo*vval)%mo;
	}
	For(i,1,n) ans=(ans+mo-a[i])%mo;
	ans=1ll*ans*(mo+1)/2%mo;
	ans=(ans+mo)%mo;
	printf("%d\n",ans);
}
/*
For(i,1,1000000)
For(j,1,1000000)
mu[j]*j^2*v1[i]*v2[i]
*/

Measured memory_bytes: 14592
N=int(input())
L=[]

for i in range(N):
  A,B = map(int, input().split())
  L.append([A,B])

L.sort(key=lambda x:x[1])

t = 0
for a,b in L:
   t += a
   if (t>b):
      break;

print('Yes' if (t<=b) else 'No')

Measured memory_bytes: 38044
package main

import "fmt"

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)

	ans := 0
	for i := 0; i <= n/r; i++ {
		for j := 0; j <= n/g; j++ {
			s := n - (r*i + g*j)
			if s >= 0 && s%b == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U> inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U> inline void cmin(T& a, U b) { if (a > b) a = b; }
constexpr char el = '\n';
template<class T, class U> ostream &operator<<(ostream &os, const pair<T, U>& p) { os << p.first << " " << p.second; return os; }
template<class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<class T> ostream &operator<<(ostream &os, const vector< T > &v) { rep(i, v.size()) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }
template<class T> istream &operator>>(istream &is, vector< T > &v) { for(T &in : v) is >> in; return is; }
struct IoSetup {
  IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); }
} io_setup;
#line 2 "a.cpp"

int main() {
  ll k, a, b;
  cin >> k >> a >> b;

  rep3(i, a, b+1) {
    if (i%k == 0) {
      cout << "OK" << el;
      return 0;
    }
  }
  cout << "NG" << el;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;

int main() {
ll k,n;
cin >> k >> n;
ll a[n];
ll ma=mINF;
ll temp=mINF;
REP(i,n) {
  cin >> a[i];
  if(i>=1) temp=abs(a[i]-a[i-1]);
  ma=max(ma,temp);
}
ma=max(ma,abs(a[0]+k-a[n-1]));
cout << k-ma << endl;

return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char const *argv[]) {
  int a,b,k;
  cin>>a>>b>>k;
  int count=0;
  for(int i=max(a,b);i>=1;i--){
    if(a%i==0&&b%i==0){
      count++;
      if(count==k){
        cout<<i<<endl;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 998244353 //1000000007 // //100000000
#define INF 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

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

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    ll n;
    cin >> n;
    if(n < 4) ANS(1);
    for(ll i = n; i >= 1; i--)
    {
        for(ll j = 2; j < i; j++){
            ll k = i;
            while(k%j == 0) k /= j; //cout << k << " ";
            if(k == 1) ANS(i);
        }
    }
}
main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


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

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


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
//typedef vector<unsigned int>vec;
typedef vector<ll>vec;
typedef vector<vec> mat;
typedef vector<vector<int>> Graph;

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
//const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S;
    cin >> N >> S;
    if(N % 2 == 1) cout << "No" << endl;
    else{
        if(S.substr(0,N/2) == S.substr(N/2, N/2)) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int i,j,n,m,k,a[50],b[50],c[50],d[50];
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
  for(i=0;i<m;i++)scanf("%d%d",&c[i],&d[i]);
  for(i=0;i<n;i++){
    int r=4e8;
    for(j=0;j<m;j++){
      if(r>abs(a[i]-c[j])+abs(b[i]-d[j])){
        r=abs(a[i]-c[j])+abs(b[i]-d[j]);
        k=j;
      }
    }
    printf("%d\n",k+1);
  }
  return 0;
}

Measured memory_bytes: 128
/*input
*/
#include <bits/stdc++.h>
using namespace std;
 
#define all(a) (a).begin(), (a).end()
#define ff first
#define ss second
#define pb push_back
 
using ll = long long;
using pii = pair<int, int>;

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n;
    string s; cin >> s;
    vector<vector<int>> dp(n + 2, vector<int>(n + 2));
    int ans = 0;
    for (int i = n - 1; i >= 0; --i) {
    	for (int j = n - 1; j >= 0; --j) {
    		if (s[i] == s[j]) {
    			dp[i][j] = dp[i + 1][j + 1] + 1;
    		} else {
    			dp[i][j] = 0;
    		}
    		if (j > i) ans = max(ans, min(j - i, dp[i][j]));
    	}
    }
    cout << ans << "\n";
}

Measured memory_bytes: 98304
#include <stdio.h>
int n;
int i;
long a;
long b;
long max = -1000000;
long min = 1000000;
long sum = 0;

main(){
 scanf("%d",&n);
 for(i= 0; i<n; i++){
 	scanf(" %ld",&a);
 	if(a > max){
 		max= a;
 	}if(a < min){
 		min =a;
 	}
 	sum += a;
 	}
 printf("%ld %ld %ld\n",min,max,sum);
 return 0;
}

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

vector<int> G[100001];
int d[100001][3];
bool seen[100001][3];

signed main(){
    int N, M; cin >> N >> M;
    REP( i, M ){
        int from, to; cin >> from >> to;
        from--, to--;
        G[from].push_back( to );
    }

    int s, t; cin >> s >> t;
    s--, t--;

    fill( d[0], d[100001], INF );
    d[s][0] = 0;
    queue<P> que;
    que.emplace( s, 0 );
    seen[s][0] = true;
    while( !que.empty() ){
        P p = que.front(); que.pop();
        int v = p.first;
        int id1 = p.second;
        int id2 = ( p.second + 1 ) % 3;
        for( auto nv : G[v] ){
            if( seen[nv][id2] ) continue;
            chmin( d[nv][id2], d[v][id1] + 1 );
            que.emplace( nv, id2 );
            seen[nv][id2] = true;
        }
    }

    if( d[t][0] != INF ) cout << d[t][0] / 3 << endl;
    else cout << -1 << endl;

}



Measured memory_bytes: 8320
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define _GLIBCXX_DEBUG
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
const ll INF = 9223372036854775807;

int main() {
  int A, B, C;cin >> A >> B >> C;
  cout << min (A+B, min(B+C,A+C)) << endl;
}

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

using namespace std;

struct random_class {
	struct xorshift {
		using result_type = unsigned int;
		result_type x=123456789u,y=362436069u,z=521288629u,w;
		static constexpr result_type min() {return 0u;}
		static constexpr result_type max() {return UINT_MAX;}
		xorshift(result_type a) : w(a) {}
		result_type operator()() {
			result_type t;
			t = x ^ (x << 11);
			x = y; y = z; z = w;
			return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
		}
	};
	random_device rd;
	xorshift xor128;
	random_class() : rd(), xor128(rd()) {}
	random_class(unsigned int seed) : rd(), xor128(seed) {}
	double make_random(double min_v, double max_v) { return uniform_real_distribution<double>(min_v, max_v)(xor128);}
};

random_class R;

template<class T>
struct Treap {
	struct node {
		T val;
		double pri;
		node *lch, *rch;
		int cnt;
		node(T v) : val(v), lch(nullptr), rch(nullptr), cnt(1) {
			pri = R.make_random(DBL_MIN, DBL_MAX);
		}
	};
	node* top;
	Treap(node* t = nullptr) : top(t) {}
	node* update(node* n) {
		n->cnt = count(n->lch) + count(n->rch) + 1;
		return n;
	}
	inline int count(node* n) {
		return !n ? 0 : n->cnt;
	}
	node* merge(node* l, node* r) {
		if (!l || !r) return !l ? r : l;
		if (l->pri > r->pri) {
			l->rch = merge(l->rch, r);
			return update(l);
		} else {
			r->lch = merge(l, r->lch);
			return update(r);
		}
	}
	pair<node*, node*> split(node* t, int k) {
		if (!t) return make_pair(nullptr, nullptr);
		if (k <= count(t->lch)) {
			pair<node*, node*> s = split(t->lch, k);
			t->lch = s.second;
			return make_pair(s.first, update(t));
		} else {
			pair<node*, node*> s = split(t->rch, k - count(t->lch) - 1);
			t->rch = s.first;
			return make_pair(update(t), s.second);
		}
	}
	void insert(const T&& val) {
		int pos = 0;
		node* n = top;
		while (n) {
			if (val < n->val) n = n->lch;
			else pos += count(n->lch) + 1, n = n->rch;
		}
		auto t = split(top, pos);
		n = merge(t.first, new node(val));
		top = merge(n, t.second);
	}
	void insert(const T& val) { insert((T&&) val);}
	const T& at(int idx) {
		assert(0 <= idx && idx < size());
		node* n = top;
		for (int sz = count(n->lch) + 1; sz != idx + 1; sz = count(n->lch) + 1) {
			if (sz <= idx) idx -= sz, n = n->rch;
			else n = n->lch;
		}
		return n->val;
	}
	inline const int size() {
		return count(top);
	}
};

int main() {
	Treap<int> T;
	int N;
	cin >> N;
	vector<int> v;
	for (int i = 0; i < N; i++) {
		int t; cin >> t;
		t -= i;
		T.insert(t);
		v.push_back(t);
	}
	int b = T.at(N / 2);
	long long res = 0;
	for (auto x : v) {
		res += abs(x - b);
	}
	cout << res << endl;
}

Measured memory_bytes: 10356
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST
{
    static void Main()
    {
        new Sol();//.Solve();
    }
}

class Sol
{
    public Sol()
    {
        int N = Convert.ToInt32(Console.ReadLine());
        string[] lst = Console.ReadLine().Split(' ');
        int[] ary = new int[100002];
        int max=-1;
        for (int i = 0; i < N; i++) {
           int a = Convert.ToInt32(lst[i]);
           ary[a]++;
           ary[a + 1]++;
           ary[a + 2]++;
        }

        for (int i = 0; i < 100002; i++) {
            max = Math.Max(max, ary[i]);
        }

        Console.WriteLine(max);
    }
}

Measured memory_bytes: 16992
#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 100;
char s[MAXN + 5];
int cnt1[26], cnt2[26];
int main() {
	int N;
	scanf("%d%s", &N, s);
	for(int i=0;i<N;i++)
		cnt1[s[i]-'a']++;
	int ans = 0, res = 0;
	for(int i=0;i<N-1;i++) {
		cnt2[s[i]-'a']++;
		if( cnt2[s[i]-'a'] == 1 ) ans++;
		if( cnt2[s[i]-'a'] == cnt1[s[i]-'a'] ) ans--;
		res = max(res, ans);
	}
	printf("%d\n", res);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>d(n);
    for(int i=0;i<n;i++)cin>>d[i];
    int ans=0;
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++)ans += d[i]*d[j];

    }
    cout << ans <<endl;
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
/* REPmacro */
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define REPR(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
 
/*alias*/
#define ALL(x) (x).begin(),(x).end()
//#define SZ(x) ((int)(x).size())
//#define F first
//#define S second
#define PB push_back
#define MP make_pair 
 
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
 
/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
/* func */
int gcd(int a,int b){return b?gcd(b,a%b):a;}
 
/*struct*/
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;
 
 
/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
 
//#define int long long
 
signed main()
{
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	
	string t;
	cin >> t;
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	
	if (s < t) cout << "Yes"s << endl;
	else cout << "No"s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	LL;
typedef vector<LL> 		VL;
typedef unsigned long long int ULL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//Works for forward as well as backward iteration

#define gu getchar
#define pu putchar
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
//# define M_PI           3.14159265358979323846264338327950288

#define DRT() int t; si(t); while(t--)

#define PlUSWRAP(index,n) index = (index+1)%n		//index++; if(index>=n) index=0
#define MINUSWRAP(index,n) index = (index + n -1)%n 	//index--; if(index<0) index=n-1
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)	//Round off d to nearest integer

#define FLUSHN while(gu()!='\n')
#define FLUSHS while(gu()!=' ')

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

// set_name.find_by_order(k) It returns to an iterator to the kth element (counting from zero) in the set in O(logn) time
// set_name.order_of_key(k) It returns to the number of items that are strictly smaller than our item k in O(logn) time.
struct pt
{
	LL x,y,h;
};
int main() {
	#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
	#endif
	srand(chrono::steady_clock::now().time_since_epoch().count());
	off;
	LL n;
	cin>>n;
	vector< pt > arr;
	rep(i,0,n){
		pt p;
		cin>>p.x;
		cin>>p.y;
		cin>>p.h;
		arr.PB(p);
	}
	LL cx, cy, h;
	for(LL i=0;i<=100;i++){
		for(LL j=0;j<=100;j++){
			// check if we get consistent h
			LL ok = 1;
			LL miniH = INT_MAX;
			LL curr = -1;
			rep(k,0,n){
				LL a = abs(i - arr[k].x) + abs(j - arr[k].y);
				if(arr[k].h == 0){
					miniH = min(miniH, a);
				}
				else{
					LL h = a + arr[k].h;
					if(curr == -1)
						curr = h;
					else{
						if(curr != h)
							ok = 0;
					}
				}
			}
			if(curr == -1)
				ok = 0;
			if(curr > miniH)
				ok = 0;
			if(ok){
				cout<<i<<" "<<j<<" "<<curr;
				return 0;
			}
		}
	}
  	return 0;
}

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

int main() {

    string w; cin >> w;

    int x[26] = {}; // { 0,0,0, ... , 0 }
    for( char c : w ) {
	x[c-'a']++;
    }

    for( int i=0; i<26; i++) {
	if( x[i]%2 == 1 ) {
	    cout << "No" << endl;
	    return 0;
	}
    }
    cout << "Yes" << endl;

}


Measured memory_bytes: 256
#C
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(a,K+1):
        for c in range(b,K+1):
            if a != b and b != c and a != c:
                ans += 6*gcd(gcd(a,b),c)
            elif a == b or b == c or a == c:
                if a == b and b == c:
                    ans += gcd(gcd(a,b),c)
                else:
                    ans += 3*gcd(gcd(a,b),c)
print(ans)

Measured memory_bytes: 9244
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
typedef pair<int,int> pii;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
//next_permutation(ALL(p));
//typedef priority_queue<int> pque;//これは大きい順
//typedef priority_queue<int, vector<int>, greater<int>> pque;//これは小さい順
//factorizeは、素因数分解用の関数

int main(){
	int n;
	cin >> n;
	std::vector<int> a(n+1);
	std::vector<int> b(n);
	rep(i,n+1) cin >> a[i];
	rep(i,n) cin >> b[i];

	ll ans = 0;
	rep(i,n+1) ans += (ll)(a[i]);

	rep(i,n){
		int x = min(a[i], b[i]);
		a[i] -= x;
		b[i] -= x;
		a[i+1] -= min(a[i+1], b[i]);
	}

	ll sum = 0;
	rep(i,n+1) sum += (ll)a[i];

	cout << ans - sum << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>

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

  std::vector<intmax_t> a(n);
  for (auto& ai: a) scanf("%jd", &ai);

  intmax_t res = 0;
  std::map<intmax_t, intmax_t> count;
  for (size_t i = 0; i < n; ++i) {
    intmax_t ii = i;
    res += count[ii - a[i]];
    ++count[ii + a[i]];
  }

  printf("%jd\n", res);
}


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

int main() {
  int data[30];
  data[0] = 1;
  data[1] = 2;
  data[2] = 4;
  for(int i = 3; i < 30; i++) {
    data[i] = data[i-3] + data[i-2] + data[i-1];
  }
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;

    cout << ( (data[n-1]+10)/10 -1 )/ 365 + 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 0
def main():
    n = int(input())
    score = [[], []]
    minus = float("inf")
    for _ in range(n):
        s = int(input())
        if s % 10 == 0:
            score[1].append(s)
        else:
            score[0].append(s)
            minus = min(minus, s)
    answer = sum(score[0])
    if answer % 10 == 0:
        answer -= minus
    answer += sum(score[1])
    print(max(answer, 0))


if __name__ == '__main__':
    main()



Measured memory_bytes: 3064
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int r;  cin >> r;
    cout << 3 * r * r << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<math.h>

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)

typedef long long i64;
typedef pair<i64,i64> P;


int a, b;

int main(){
	cin >> a >> b;
	
	cout << max(0, a - b*2) << endl;
	
	return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] h = new int[n];

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

		//配列h小さい順にソートする。
		Arrays.sort(h);

		//配列hの要素のうち小さいものn-k個の合計値を求める。
		long sum = 0;
		for (int i = 0; i < n - k; i++) {
			sum += h[i];
		}

		System.out.println(sum);
	}

}


Measured memory_bytes: 60160
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
 
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl
 
#define ld double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
 
#define INF 1000000000000000000

ll n;
vector<ll> ed[100001];
pair<ll, ll> ans[100001];
ll mod = 1000000007;

void DFS(ll src, ll par)
{   
    ans[src] = mp(1,1);
    rep(i,ed[src].size())
    {
        if(ed[src][i]!=par)
        {
            DFS(ed[src][i],src);
            pair<ll, ll> x = ans[ed[src][i]];

            ans[src].ff = ((ans[src].ff%mod) * ((x.ff)+(x.ss)))%mod;
            ans[src].ss = ((ans[src].ss%mod) * (x.ff)%mod)%mod;
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    cin >> n;

    rep(i,n-1)
    {
        ll x,y;
        cin >> x >> y;
        ed[x].pb(y);
        ed[y].pb(x);
    }

    DFS(1,0);

    ll answ = ans[1].ff%mod + ans[1].ss%mod;
    answ = answ%mod;

    cout << answ << endl;
}

Measured memory_bytes: 12800
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a > b){
            System.out.println("a > b");
        }else if(a < b){
            System.out.println("a < b");
        }else{
            System.out.println("a == b");
        }
    }
}


Measured memory_bytes: 26356
# include <iostream>
# include <cstdio>
using namespace std;
const int N = 2e5 + 12;
const int inf = 0x3f3f3f3f;
int n;
int main()
{
  scanf("%d",&n);
  if(n >= 1000)puts("ABD");
  else puts("ABC");
}

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

#define int int64_t

using namespace std;

#define MAX 1005
#define MOD 1000000007

int h, w, dp[MAX][MAX];
char s[MAX][MAX];

int f(int i, int j)
{
    if (i == h || j == w || s[i][j] == '#')
        return 0;
    if (dp[i][j] != -1)
        return dp[i][j];
    if (i == h - 1 && j == w - 1)
        return 1;
    return dp[i][j] = (f(i + 1, j) % MOD + f(i, j + 1) % MOD) % MOD;
}

signed main()
{
    scanf("%lld %lld", &h, &w);
    for (int i = 0; i < h; i++)
        scanf("%s", s[i]);
    for (int i = 0; i <= h; i++)
        for (int j = 0; j <= w; j++)
            dp[i][j] = -1;
    printf("%lld\n", f(0, 0));
}


Measured memory_bytes: 9216
x, n = map(int, input().split())

nums = list(map(int, input().split()))

n = -1
m = 999
for num in range(-1, 102):
    if num in nums:
        continue
    elif m != min(m, abs(num - x)):
        n = num
        m = min(m, abs(num - x))

print(n)

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

#define lli long long int

int main(){
    int n;
    cin>>n;
    vector<int>v(n),t(n,0);

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

    lli s=0;
    for(int i=1;i<n;i++){
        t[i]=max(v[i-1], t[i-1]);
    }

    for(int i=0;i<n;i++){
        if(t[i]-v[i]>0) s+=t[i]-v[i];
    }

    cout<<s<<"\n";
    return 0;
}

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

using namespace std;
using ll = long long;
int main() {
    int n;
    cin>>n;
    vector<ll> a(n);
    int mc=0;
    ll sum=0;
    ll mina=10000000009;
    for(int i = 0;i < n;++i) {
        cin>>a[i];
        if(a[i]<0)++mc;
        sum+=abs(a[i]);
        mina=min(mina,abs(a[i]));
    }

    if(mc%2==0){
        cout<<sum<<endl;
    }
    else cout<<sum-2*mina<<endl;


    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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 (b<a) { a=b; return 1; } return 0; }

void dfs(VVI &es, VI &l, VI &d, VI &a, int n, int pos) {
    auto it = lower_bound(all(l), a[pos]);
    int idx = distance(l.begin(), it);
    int prev = *it;
    d[pos] = idx;
    *it = a[pos];
    for (int dst: es[pos]) {
        if (d[dst] > -1) continue;
        dfs(es,l,d,a,n,dst);
    }
    *it = prev;
}

void dfs2(VVI &es, VI &d, int n, int pos, int prev = -1) {
    if (prev > -1) chmax(d[pos], d[prev]);
    for (int dst: es[pos]) {
        if (dst == prev) continue;
        dfs2(es,d,n,dst,pos);
    }
}

void solve() {
    int n;
    cin >> n;
    VI a(n);
    REP(i,0,n) cin >> a[i];
    VVI es(n);
    int u,v;
    REP(i,0,n-1) {
        cin >> u >> v;
        --u; --v;
        es[u].push_back(v);
        es[v].push_back(u);
    }
    set<int> s;
    REP(i,0,n) s.insert(a[i]);
    int cnt = 0;
    map<int, int> m;
    for (int v: s) m[v] = cnt++;
    REP(i,0,n) a[i] = m[a[i]];

    VI l(n+1,1<<30);
    l[0] = -1;
    VI d(n,-1);
    dfs(es, l,d,a,n,0);

    dfs2(es,d,n,0);

    REP(i,0,n) cout << d[i] << endl;
}

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

Measured memory_bytes: 44796
import sys,collections,random,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b,c,k = Is()
if abs(a-b) > 10**18:
    print("Unfair")
    exit()
if k%2==0:
    print(a-b)
else:
    print(b-a)

Measured memory_bytes: 4968
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    if(b==1){
        cout << 0 << endl;
    }else if(a==b){
        cout << 1 << endl;
    }else if((b-1)%(a-1) != 0){
        cout << (b-1)/(a-1) + 1 << endl;
    }else{
        cout << (b-1)/(a-1) << endl;
    }
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e9)
using namespace std;
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S;
    cin >> N >> S;
    rep(i,0,1<<2){
        char sw[100010];
        rep(j,0,2){
            if(i >> j & 1){
                sw[j] = 'S';
            }else{
                sw[j] = 'W';
            }
        }
        rep(j,1,N-1){
            if(S[j] == 'o' && sw[j] == 'S'){
                sw[j+1] = (sw[j-1] == 'S' ? 'S' : 'W');
            }else if(S[j] == 'o' && sw[j] == 'W'){
                sw[j+1] = (sw[j-1] == 'S' ? 'W' : 'S');
            }else if(S[j] == 'x' && sw[j] == 'S'){
                sw[j+1] = (sw[j-1] == 'S' ? 'W' : 'S');
            }else{
                sw[j+1] = (sw[j-1] == 'S' ? 'S' : 'W');
            }
        }
        int cnt = 0;
        if(S[N-1] == 'o' && sw[N-1] == 'S' && sw[N-2] == sw[0]){
            cnt++;
        }else if(S[N-1] == 'o' && sw[N-1] == 'W' && sw[N-2] != sw[0]){
            cnt++;
        }else if(S[N-1] == 'x' && sw[N-1] == 'S' && sw[N-2] != sw[0]){
            cnt++;
        }else if(S[N-1] == 'x' && sw[N-1] == 'W' && sw[N-2] == sw[0]){
            cnt++;
        }
        if(S[0] == 'o' && sw[0] == 'S' && sw[N-1] == sw[1]){
            cnt++;
        }else if(S[0] == 'o' && sw[0] == 'W' && sw[N-1] != sw[1]){
            cnt++;
        }else if(S[0] == 'x' && sw[0] == 'S' && sw[N-1] != sw[1]){
            cnt++;
        }else if(S[0] == 'x' && sw[0] == 'W' && sw[N-1] == sw[1]){
            cnt++;
        }
        if(cnt == 2){
            rep(i,0,N){
                cout << sw[i];
            }
            cout << endl;
            return 0;
        }


    }
    print(-1);
}


Measured memory_bytes: 720
#include<string>
#include<iostream>
#include<deque>
#include<cstdlib>
#include<algorithm>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
#define rep(i, x, n) for(i=x;(i)<(n);(i)++)

const int MOD = 1000000007;
const int infty = 1000000000;

int main() {
	int n, k;
	cin >> n >> k;
	deque<lli> dp(n, infty), nodes;
	int i;
	rep(i, 0, n) {
		lli temp;
		cin >> temp;
		nodes.push_back(temp);
	}
	rep(i, 0, n) {
		if (i == 0) {
			dp[i] = 0;
			continue;
		}
		int j;
		rep(j, 1, min(k + 1, i + 1)) {
			dp[i] = min(dp[i], dp[i - j] + abs(nodes[i] - nodes[i - j]));
		}
	}
	cout << dp[n - 1] << endl;
	return 0;
}

Measured memory_bytes: 5232
from math import radians, sin, cos, sqrt
A,B,H,M = map(int, input().split())
radM = radians(M * 6)
radH = radians((M/2) + H*30)
print(((float(A*cos(radH)-B*cos(radM))**2+float(A*sin(radH)-B*sin(radM))**2))**0.5)

Measured memory_bytes: 62632
import java.lang.Math
fun main(args: Array<String>) {
    val S = readLine()!!
    var c0 = 0
    var c1 = 0
    for (i in 0 until S.length) {
        if ((i % 2 == 0) == (S[i] == '1')) ++c0
        if ((i % 2 == 0) == (S[i] == '0')) ++c1
    }
    println(Math.min(c0, c1))
}

Measured memory_bytes: 34304
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int A, B;
	cin >> A >> B;

	cout << (double)A / B << endl;

	return 0;
}

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

int main() { 
    int n, a[33] ={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cin >> n;
    cout << a[n-1] << '\n';

    return 0;
}


Measured memory_bytes: 256
N,K,Q=map(int,input().split())
A=[]
for _ in range(Q):
    A.append(int(input()))

p=K-Q
checklist=[p for i in range(N)]

for i in range(Q):
    num=A[i]-1
    checklist[num]+=1

for i in range(N):
    if checklist[i]<=0:
        print("No")
    else:
        print("Yes")

Measured memory_bytes: 10448
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <bitset>
#include <iterator>
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define mod 1000000007
using namespace std;
typedef long long int LL;

int main() {
    int n;
    string a, b, c;
    cin >> n >> a >> b >> c;

    int cnt = 0;
    rep(i, n) {
        if (a[i] == b[i] and b[i] == c[i]) {

        } else if (a[i] != b[i]  and b[i] != c[i] and c[i] != a[i]) {
            cnt += 2;
        } else {
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}


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

ll gcd(ll a, ll b){
  if(b==0) return a;
  return gcd(b,a%b);
}

ll lcm(ll a,ll b){
  ll n = gcd(a,b);
  return a/n*b;
}
 
int main() {
  int N;
  ll temp=1;
  cin>>N;
  ll T[N];
  for(int i=0;i<N;i++){
    cin>>T[i];
  }
  for(int i=0;i<N;i++){
    temp=lcm(temp,T[i]);
  }
  cout<<temp<<endl;
}
  

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
  char ch, C;
  for(;;){
  scanf("%c",&ch);
  if(ch == '\n'){
      break;
  }
  else if(ch == ' '){
      printf(" ");
  }
  else if('A' <= ch && ch <= 'Z'){
      C = ch + 32;
      printf("%c",C);
  }
  else if('a' <= ch && ch <= 'z'){
      C = ch - 32;
      printf("%c",C);
  }
  else{
      printf("%c",ch);
   
  }
  }
  printf("\n");
  return 0;
}


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

#define TASKNAME ""

using namespace std;

const int INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;

int main() {
    #ifdef MY
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen(TASKNAME".in", "r", stdin);
        //freopen(TASKNAME".out", "w", stdout);
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    #endif // MY
    ll n, m;
    cin >> n >> m;
    if (n > m) {
        swap(n, m);
    }
    if (n == 1) {
        cout << (m >= 2 ? m - 2 : 1);
        return 0;
    }
    if (n == 2) {
        cout << 0;
        return 0;
    }
    ll res = (n - 2) * (m - 2);
    cout << res;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
using namespace std;

char s[1000];

int main(){
	int n,l = 0,r = 0,ans = 0,all = 0;
	cin >> n;
	scanf("%s",s + 1);
	for(int i = 1;i <= n;i++){
		if(s[i] == ')'){
			l--;
			if(l < 0){
				ans++;
				l = 0;
			}
		}
		else l++;
	}
	for(int i = n;i >= 1;i--){
		if(s[i] == '('){
			r--;
			if(r < 0){
				all++;
				r = 0;
			}
		}
		else r++;
	}
		for(int i = 1;i <= ans;i++){
			cout << '(';
		}
	for(int i = 1;i <= n;i++){
		cout << s[i];
	}
		for(int i = 1;i <= all;i++){
			cout << ')';
		}
	cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>

using namespace std;
long long n,k,h;
int a[100+10];
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    for(int i=n;i>=n-k+1;i--)
    {
        h+=a[i];
    }
    cout<<h<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int N;
  cin >> N;
  vector<double> x(N);
  vector<string> u(N);
  rep(i,N) {
    cin >> x[i] >> u[i];
  }
  double ans = 0;
  rep(i,N) {
    if (u[i] == "JPY") ans += x[i];
    else ans += 380000.0 * x[i];
  }
  cout << ans << endl;
  return 0;
}

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

int main() { 
  string S;
  cin >> S;
  int C=0;
  for (int i=0; i<S.size()/2; i++) {
    if (S[i]!=S[S.size()-1-i]) {
      C++;
    }
  }
  cout << C << endl;
} 

Measured memory_bytes: 3640
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef double db;

#define fr first
#define sc second
#define pb push_back
#define rep(i,x) for(ll i=0;i<x;i++)
#define rep1(i,x) for(ll i=1;i<=x;i++)
#define rrep(i,x) for(ll i=x-1;i>=0;i--)
#define rrep1(i,x) for(ll i=x;i>0;i--)

ll N,M;
ll a,b,x;
ll imos[5002][5002];

int main()
{
	scanf("%lld%lld",&N,&M);
	ll H=N;
	ll W=N;
	rep(i,M){
		scanf("%lld%lld%lld",&a,&b,&x);
		a--;
		--b;
		x++;
		imos[a][b]++;
		imos[a][b+1]--;
		imos[a+x][b]--;
		imos[a+x+1][b+1]++;
		imos[a+x][b+x+1]++;
		imos[a+x+1][b+x+1]--;
	}
	rep(i,H+2) rep(j,W+2){
		if(i>0&&j>0){
			imos[i][j]+=imos[i-1][j-1];
		}
	}
	rep(i,H+2) rep(j,W+2){
		if(i>0){
			imos[i][j]+=imos[i-1][j];
		}
	}
	rep(i,H+2) rep(j,W+2){
		if(j>0){
			imos[i][j]+=imos[i][j-1];
		}
	}
	ll ans=0;
	rep(i,H) rep(j,i+1) if(imos[i][j]>0) ans++;
	cout<<ans<<endl;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0;}
template<class T>bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0;}

using ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

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

// Problem Specific Parameter:

int get_k(int a, int k) {
	int ret = 0;

	while (a >= k) {
		if (a % k == 0) {
			ret = (a / k);
			break;
		}

		int na = a - a / k - 1;

		if (a / k != na / k) {
			a = na;
			continue;
		}

		int num = 1;
		while (1) {
			const int tar = a - num * ((a / k) + 1);
			if ((tar / k) != (a / k)) break;
			na = tar, num *= 2;
		}

		a = na;
	}
	return ret;
}

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

	int ans = 0;

	rep(i, n) {
		int a, k;
		cin >> a >> k;
		ans ^= get_k(a, k);
	}

	if (ans != 0)
		puts("Takahashi");
	else
		puts("Aoki");

	return 0;
}

Measured memory_bytes: 256