akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

int main() {
  int a,b,k;
  cin>>a>>b>>k;
  vector<int> v;
  for(int i=1;i<=100;i++){
    if(a%i==0 && b%i==0) v.push_back(i);
  }
  sort(v.begin(),v.end(),greater<int>());
  cout<<v[k-1]<<endl;
  
  
  
}


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

const int mod = 1e9+7, maxn = 2000010;
int r1, c1, r2, c2;

ll pre[maxn];
ll inv[maxn];
ll prei[maxn];

void build(int n){
    pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
    for(int i = 2 ; i <= n ; i++){
        pre[i] = pre[i-1] * i % mod;
        // i 的逆元inv[i]= -(p/i) * inv[p%i] (mod p)
        inv[i] = mod - (mod / i * inv[mod % i]) % mod;
        prei[i] = prei[i-1] * inv[i] % mod;
    }
}

ll C(int n, int k){
   return pre[n] * prei[k] % mod * prei[n-k] % mod;
}

ll solve(int x, int y){
    if (x == 0 || y == 0) return 0;
    ll ret = 0;
    for (int i = 1; i <= y; i++){
        ret += C(x+i+1, i+1);
    }
    ret -= y;
    return ret % mod;
}

int main(){
    build(2000005);
    cin >> r1 >> c1 >> r2 >> c2;
    cout << (solve(r2, c2)-solve(r1-1, c2)-solve(r2, c1-1)+solve(r1-1, c1-1) + mod*2) % mod << "\n";
}

Measured memory_bytes: 47104
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int a[10010],ans=0,n;

int main()
{
    scanf("%d",&n);
    n*=2;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a+1,a+1+n);
    for(int i=1;i<=n;i+=2)
    {
        ans+=a[i];
    } 
    printf("%d\n",ans);
    return 0;
}

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

#define REP(i, n) for(int i=0; i<n; i++)
#define REPA(i, a, n) for(int i=a; i<n; i++)
#define REPE(i, a, n) for(int i=a; i<=n; i++)
#define SetArray(a, n) for(int array_i=0; array_i<n; array_i++) cin >> a[array_i]
#define print(x) cout << x
#define printw(x) cout << x << " "
#define println(x) cout << x << endl
#define printl() cout << endl
#define sqr(x) (x)*(x)
#define cube(x) (x)*(x)*(x)
typedef long long ll;
typedef unsigned int uint;
typedef vector<int> vi;

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

    int p[n];
    SetArray(p, n);

    sort(p, p+n);

    int a=0;
    REP(i, k){
        a += p[i];
    }
    println(a);

    return 0;
}




Measured memory_bytes: 3632
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
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; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, const vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
    os<<endl;
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, map<T,S> const&M){
    for(auto e:M){
        os<<e;
    }
    os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N,L;
    cin >> N >> L;
    vector<int64> A(N);
    REP(i,N) cin >> A[i];

    deque<int64> q;
    vector<int> ans;
    REP(i,N){
        if(not q.empty() and q.front() < i-L+1) q.pop_front();
        while(not q.empty() and A[q.back()]>A[i]){
            q.pop_back();
        }
        q.push_back(i);
        if(i+1>=L) ans.emplace_back(A[q.front()]);
    }
    cout << ans;


}


Measured memory_bytes: 14908
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
#include <stack>
#include <deque>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = (int)(a);(i) > (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, n) &((x)[0]), &((x)[n])
#define BRK(x) { (x); break; }
#define ADD(a, b) ((((a)%MOD)+((b)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define EPS (1e-20)
#define INF 2147483647
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using VLL = std::vector<llint>;
using MCI = std::map<char, int>;
using namespace std;


int n;
MCI cnt[60];


string solve(){
	MCI ansC = cnt[0];
	rep(i, 1, n)
		for(PII p : cnt[i])
			ansC[p.fi] = min(ansC[p.fi], p.se);
	string ans;
	for(PII p : ansC)
		rep(i, 0, p.se) ans.pb(p.fi);
	return ans;
}


signed main(){
	cin >> n;
	rep(i, 0, n){
		string S;
		cin >> S;
		rep(j, 0, 26) cnt[i]['a'+j] = 0;
		for(char c : S) cnt[i][c]++;
	}

	cout << solve() << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;

int main(void){
    long long n,m;
    cin >> n >> m;
    long long ans=1;
    long long a,b;
    for(a=1; a*a<=m; a++){
        if(m%a!=0)continue;
        if(a*n<=m)ans=max(a,ans);
        if(m/a*n<=m)ans=max(m/a,ans);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

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

if(a>b){
	printf("a > b\n");
}
if(a<b){
	printf("a < b\n");
}
if(a==b){
	printf("a == b\n");
}
	return 0;
}

Measured memory_bytes: 1008
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds; 
#define pb          push_back
#define ff          first
#define ss          second
#define ll          int64_t
#define ld          long double
#define mod         1000000007
#define mod2        998244353
#define inf         1000000000000007
#define pi          3.14159265358979323846
#define nl          cout<<"\n"
#define dbg(x)      cerr<<#x<<" = "<<x<<"\n"
#define all(v)      v.begin(),v.end()
#define forn(i,a,b) for(int64_t i=int64_t(a);i<int64_t(b);++i)
#define forb(i,a,b) for(int64_t i=int64_t(a);i>=int64_t(b);--i)
#define fastio()    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

template<typename T,typename U> static inline void amin(T &x,U y)   {if(y<x)x=y;}
template<typename T,typename U> static inline void amax(T &x,U y)   {if(x<y)x=y;}  

ll lcm(ll a,ll b)       {return (a*b)/__gcd(a,b);} 
ll count_digits(ll n)   {ll dig=floor(log10(n)+1);return dig;}
ll mpow(ll x,ll y,ll p) {ll r=1;x=x%p;while(y>0){if(y&1)r=(r*x)%p;y=y>>1;x=(x*x)%p;}return r;} 
string dec_bin_32(ll n) {string s;for(ll i=31;i>=0;i--){ll k=n>>i;s+=(k&1)?'1':'0';}return s;} 
string dec_bin_64(ll n) {string s;for(ll i=63;i>=0;i--){ll k=n>>i;s+=(k&1)?'1':'0';}return s;} 
ll mod_inv(ll a,ll m)   {ll m0=m,y=0,x=1;if(m==1)return 0;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;} 

//-------------------------------L_I_Erq34-------------------------------

int main()
{
	fastio();
	ll z,n,m,t,k,i,j,l,d,h,r;
	cin>>n>>k;
	ll a[n],dp[n];
	forn(i,0,n)
	{
		cin>>a[i];
		dp[i]=inf;
	}
	dp[0]=0;
	forn(i,0,n)
		forn(j,i+1,min(i+k+1,n))
			dp[j]=min(dp[j],dp[i]+abs(a[i]-a[j]));
	cout<<dp[n-1]<<"\n";
	cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9
#define f first
#define s second

typedef long long ll;

using namespace std;

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int a, b, ans = 0;

    cin >> a >> b;

    ans = max(a, b);

    if (a >= b) a--;
    else b--;

    ans += max(a, b);

    cout << ans;

    return 0;
}


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

int main(){
    int a,b;
    cin >> a >> b;
    int x = min(a,b);
  	int z = max(a,b);
    string y = "";
    rep(i,z){
        y += (int)x;
      	cout << (int)x;
    }
}

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

int main()
{
	int N, M;
	cin >> N >> M;
	vector<int> ans(N + 1);
	for (int i = 1; i <= N; i++) ans[i] = 0;

	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		ans[a]++;
		ans[b]++;
	}

	for (int i = 1; i <= N; i++) cout << ans[i] << endl;
}

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#pragma GCC optimize ("-O3")

using namespace std;

// #define DEBUG_IS_VALID

#ifdef DEBUG_IS_VALID
#define DEB 1 
#else
#define DEB 0
#endif
#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline bool chmax(T& a,T const& b){if(a>=b) return false; a=b; return true;}
template<class T> inline bool chmin(T& a,T const& b){if(a<=b) return false; a=b; return true;}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

const int mod=1e9+7,INF=1<<29;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<59; 

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N; ll M; cin >> N >> M;
  vl a(N),s(N+1);
  rep(i,N){
    cin >> a[i] ;
    a[i] %= M;
  }
  rep(i,N) s[i+1] = (s[i]+a[i])%M;
  map<ll,ll> mp;
  ll ans = 0;
  rep(i,N){
    mp[s[i]]++;
    ans += mp[s[i+1]];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5760
N=int(input())
w =0
x =0
y =0
z =0

for i in range(N):
    s =input()
    if s =='AC':
        w +=1
    elif s == 'WA':
        x +=1
    elif s == 'TLE':
        y +=1
    elif s == 'RE':
        z +=1

print ('AC x '+str(w))
print ('WA x '+str(x))
print ('TLE x '+str(y))
print ('RE x '+str(z))

Measured memory_bytes: 9128
n=int(input())
alist=[]
blist=[]
for i in range(n):
    a,b=map(int,input().split())
    alist.append(a)
    blist.append(b)
alist.sort()
blist.sort()
if n%2==1:
    num1=-1*(n//-2)-1
    print(blist[num1]-alist[num1]+1)
else:
    num1=n//2-1
    num2=num1+1
    print((blist[num2]+blist[num1])-(alist[num2]+alist[num1])+1)


Measured memory_bytes: 25512
n = int(input())
h = [int(i) for i in input().split()]
count = 0
c_list = [0]
try:
    for i in range(n-1):
        if h[i]>=h[i+1]:
            count +=1
        else:
            c_list.append(count)
            count= 0
except:
    a =1
print(max(max(c_list), count))

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

int main(){
	 int n; cin>>n;
	 string s; cin>>s;
	 int i = 0, j = n-1, ans = 0;
	 while(i<=j){
	 	while(i<n && s[i]!='W') i++;
	 	while(j>=0 && s[j]!='R') j--;
	 	if(i>j) break;
	 	swap(s[i],s[j]);
	 	ans++;
	 	i++; j--;
	 }
	 cout<<ans;
	 return 0;
}

Measured memory_bytes: 3748
#include<bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=(0);i<(n);i++)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define pb push_back
#define ff first
#define ss second
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<double> vd;
typedef vector<string> vs;
const int mod = (int)1e9+7;
int main(){
	int n,x,t;
	cin>>n>>x>>t;
	int ans =(n/x+(n%x?1:0))*t;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3612
#include<iostream>
#include<stdio.h>
#include<vector>//s1.erase(n)=文字列s1の、n文字目以降削除
#include<algorithm>//辞書順=next_permutation
#include<set>
#include<string>//char 小文字のほうが32大きい
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap=数値交換
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define str string
#define please return
#define AC 0
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
#define Pi 3.1415926535897932384626
#define nine 1000000000

using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

/*

 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */


int main(void) {


	int n;
	cin >> n;
	vint a(n, -1);
	int m;
	cin >> m;
	bool ans = true;
	rep(i, m) {
		int x, y;
		cin >> x >> y;
		if (a[x - 1] == -1 || a[x - 1] == y)a[x - 1] = y;
		else ans = false;
	}
	if (ans && n == 1) {
		if (a[0] < 0)cout << 0 << endl;
		else cout << a[0] << endl;
	}
	else if (ans && a[0] != 0) {
		rep(i, n) {
			if (i == 0 && a[i] <= 0)cout << 1;
			else if (a[i] < 0)cout << 0;
			else cout << a[i];
		}
		cout << endl;
	}
	else cout << -1 << endl;
	return 0;

	please AC;
}

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

int main(){
  int r, c;
  int q[110][110] = {0};
  cin >> r >> c;
  
  rep(i, r) {
    rep(j ,c) {
      cin >> q[i][j];
      q[r][j] += q[i][j];
      q[i][c] += q[i][j];
      q[r][c] += q[i][j];
    }
  }
  
  rep(i, r+1) {
    rep(j ,c+1) {
      if (j) cout << " ";
      cout << q[i][j] ;
    }
    cout << endl;
  }
  
  return 0;
}



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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)

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

int main(){

	ll a, b , c;cin >> a >> b >> c;
	if(a > b && a > c)cout << "A" << endl;
	if(b > a && b > c)cout << "B" << endl;
	if(c > a && c > b)cout << "C" << endl;

	return 0;
}



Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <cmath>
#include <bitset>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
using Int = long long;
using namespace std;
int main()
{
    char c; cin >> c;
    if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
        cout << "vowel" << endl;
    } else {
        cout << "consonant" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Text;
class Simple
{
    int H, W;
    string[] A;
    void Solve() {
        //input
        H = io.Int;
        W = io.Int;
        A = new string[H];
        for (int i = 0; i < H; ++i)
            A[i] = Console.ReadLine();
        //cal
        Func<int, int, bool> isSharp = (i, j) => A[i][j] == '#';
        Func<int, int, bool> isLeft = (i, j) => j == 0;
        Func<int, int, bool> isUpper = (i, j) => i == 0;
        Func<int, int, bool> isRight = (i, j) => j == W - 1;
        Func<int, int, bool> isBottom = (i, j) => i == H - 1;
        Func<int, int, int> left = (i, j) => isLeft(i, j) ? 0 : isSharp(i, j - 1) ? 1 : 0;
        Func<int, int, int> upper = (i, j) => isUpper(i, j) ? 0 : isSharp(i - 1, j) ? 1 : 0;
        Func<int, int, int> right = (i, j) => isRight(i, j) ? 0 : isSharp(i, j + 1) ? 1 : 0;
        Func<int, int, int> bottom = (i, j) => isBottom(i, j) ? 0 : isSharp(i + 1, j) ? 1 : 0;
        Func<int, int, int> counter = (i, j) => left(i, j) + upper(i, j) + right(i, j) + bottom(i, j);
        Func<int, int, bool> cntValid = (i, j) =>
            counter(i, j) == ((i == 0 && j == 0 || i == H - 1 && j == W - 1) ? 1 : 2);
        Func<int, int, bool> checker = (i, j) => {
            if (isLeft(i, j) && isUpper(i, j)) return true;
            if (isLeft(i, j)) return isSharp(i - 1, j);
            if (isUpper(i, j)) return isSharp(i, j - 1);
            return isSharp(i - 1, j) ^ isSharp(i, j - 1);
        };

        var flag = true;
        for (int i = 0; i < H; ++i) {
            for (int j = 0; j < W; ++j) {
                if (isSharp(i, j))
                    flag &= checker(i, j) && cntValid(i, j);
            }
        }
        //ret
        Console.WriteLine(flag ? "Possible" : "Impossible");
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    void Stream() {
        Solve();
        io.writeFlush();
    }
}
class SimpleIO
{
    string[] nextBuffer;
    int BufferCnt;
    char[] cs = new char[] { ' ' };
    StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    public SimpleIO() {
        nextBuffer = new string[0];
        BufferCnt = 0;
        Console.SetOut(sw);
    }
    public string Next() {
        if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        BufferCnt = 0;
        return nextBuffer[BufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void writeFlush() { Console.Out.Flush(); }
}


Measured memory_bytes: 13268
mod = 10**9 + 7

N,M = map(int,input().split())
S = input().split()
T = input().split()

dp = [[-1]*(M+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1,N+1):
    dp[i][0] = 1
for j in range(1,M+1):
    dp[0][j] = 1
for i in range(1,N+1):
    for j in range(1,M+1):
        if S[i-1] == T[j-1]:
            dp[i][j] = dp[i][j-1] + dp[i-1][j]
        else:
            dp[i][j] = dp[i][j-1] + dp[i-1][j] - dp[i-1][j-1]
        dp[i][j] %= mod

ans = dp[N][M]
print(ans)

Measured memory_bytes: 72540
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>
#include<random>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vi A(N);
    vi B, C;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if (i%2 == 0) B.push_back(A[i]);
        else C.push_back(A[i]);
    }
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());
    int b = 0, c = 0;
    ll ans = 0;
    for (int i = 0; i < N; i++) {
        if (b < B.size() && A[i] == B[b]) {
            b++;
            if (i%2 == 1) ans++;
        }
        if (c < C.size() && A[i] == C[c]) {
            c++;
            if (i%2 == 0) ans++;
        }
    }
    cout << ans/2 << endl;
    return 0;
}


Measured memory_bytes: 1276
#define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	vector<int> a;
	int n;
	for (; cin >> n;)
	{
		if (n == 0)
		{
			cout << a.back() << endl;
			a.pop_back();
		}
		else
		{
			a.push_back(n);
		}
	}
}


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

int main()
{
  string s, res="";
  cin>>s;
  for(int i = 0; i < s.size(); i++)
  {
    if(s[i] == '0')
      res += '0';
    else if(s[i] == '1')
      res += '1';
    else
    {
      if(res.size() != 0)
        res.pop_back();
    }
  }
  cout<<res<<"\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
  	using namespace std;
  	typedef long long int ll;
  	int main() {
  		// #ifndef ONLINE_JUDGE
  		// 	// for getting input from input.txt
  		// 	freopen("input.txt", "r", stdin);
  		// 	// for writing output to output.txt
  		// 	freopen("output.txt", "w", stdout);
  		// #endif
      string s,t;
      cin>>s>>t;
      for (int i = 0; i < s.length(); ++i)
      {
        if(s.at(i) != t.at(i)){
          cout<<"No"<<"\n";
          return 0;
        }
      }
      cout<<"Yes"<<"\n";
  	return 0;
}


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

typedef long long ll;
ll const mod = 1e9+7;

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

vector<vector<ll>> prod(vector<vector<ll>>& a, vector<vector<ll>>& b) {
    vector<vector<ll>> ret(a.size(),vector<ll>(b[0].size(),0));
    for (int i = 0;i < a.size();++i) for (int j = 0;j < b[0].size();++j) for (int k = 0;k < a[0].size();++k) {
        ret[i][j] += a[i][k]*b[k][j];
        ret[i][j] %= mod;
    }
    return ret;
}

int main() {
    int n;
    ll k;
    cin >> n >> k;
    vector<vector<ll>> a(n,vector<ll>(n)),b(n,vector<ll>(1,1));
    for (int i = 0;i < n;++i) for (int j = 0;j < n;++j) cin >> a[i][j];
    while (k) {
        if (k&1) b = prod(a,b);
        a = prod(a,a);
        k >>= 1;
    }
    ll ans = 0;
    for (int i = 0;i < n;++i) ans += b[i][0];
    cout << ans%mod << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int n;
	cin >> n;
	int oddc = 0;
	for (int i = 0, x; i < n; ++i) {
		cin >> x;
		if (x&1) oddc++;
	}
	oddc &= 1;
	cout << ((oddc && n > 1) ? "NO" : "YES");
}

Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T>
void print_container(T &container, string delim=" ") {
    bool first = true;
    for(auto &t: container){
        if(!first){
            cout << delim;
        }
        first = false;
        cout << t;
    }
    cout << endl;
}

int main() {
    int n;
    cin >> n;
    vector<pair<ll, ll>> data(n);
    REP(i, n){
        int a, b;
        cin >> a >> b;
        data[i] = {b, a};
    }
    sort(data.begin(), data.end());
    int now = 0;

    REP(i, n){
        if(now + data[i].second > data[i].first){
            cout << "No" << endl;
            return 0;
        }
        else{
            now += data[i].second;
        }
    }

    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3328
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int N;
  cin >> N;
  vector<P> xy(N);
  REP(i, N) {
    ll x, y;
    cin >> x >> y;
    xy[i].first = x;
    xy[i].second = y;
  }
  if (N == 1) {
    cout << 1 << endl;
    return 0;
  }
  map<P, int> mp;
  REP(i, N) REP(j, N) {
    if (i == j) continue;
    ll p = xy[i].first - xy[j].first;
    ll q = xy[i].second - xy[j].second;
    mp[P(p, q)]++;
  }
  int res = N;
  for (auto a : mp) {
    res = min(res, N - a.second);
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 384
n, k = map(int, input().split())
h = list(map(int, input().split())) + [0]

#dp[a][b][c]: aまで見てb個消していて消してない右端がcのときの最小値(ぜんぶ1-indexed)
dp = [[[10**12 for _ in range(n+1)] for _ in range(k+1)] for _ in range(n+1)]
dp[0][0][0] = 0

for a in range(n):
	for b in range(k+1):

		for c in range(a+1):
			#h[a]を消す場合
			if b < k:
				dp[a+1][b+1][c] = min(dp[a+1][b+1][c], dp[a][b][c])

			#h[a]を消さない場合
			dp[a+1][b][a+1] = min(dp[a+1][b][a+1], dp[a][b][c] + max(0, h[a] - h[c-1]))

print(min(dp[n][k]))

Measured memory_bytes: 260872
#include <cmath>
#include <vector>
#include <stdio.h>
#include <iostream>
using namespace std;

//-----------------------------------------
string hello(){ return "Hello World"; }
int add(int a, int b){ return a+b; }

int main() {
    // I/O format
    int N; cin >> N;
    int A, B;

    if(N==2){ cin >> A >> B; };

    if(N==1){
        string out = hello();
        cout << out << endl;
    
    }else if(N==2){
        int out = add(A, B);
        cout << out << endl;
    };

}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9
#define MOD 1000000007

using namespace std;
typedef long long int lli;
typedef long long ll;

int main() {
    int n,m;
    cin >> n >> m;
    vector<vector<bool>> a(n, vector<bool>(m, false));
    rep(i,n){
        int k;
        cin >> k;
        rep(j,k){
            int in;
            cin >> in;
            in--;
            a[i][in] = true;
        }
    }

    vector<bool> liked(m,true);
    rep(i,n){
        rep(j,m){
            if(!a[i][j]){
                liked[j] = false;
            }
        }
    }

    int ans = 0;
    rep(i,m){
        if(liked[i]) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from bisect import *

def judge(x):
    a = N-x
    b = x-bisect_left(A, X-(A[x]-X))+1
    
    return a<=b

def binary_search():
    l, r = bisect_left(A, X), N-1
    
    while l<=r:
        m = (l+r)//2
        
        if judge(m):
            r = m-1
        else:
            l = m+1
    
    return l

N, Q = map(int, input().split())
A = list(map(int, input().split()))
acc = [0]*(N+1)
eacc = [0]*(N+1)
oacc = [0]*(N+1)

for i in range(N):
    acc[i+1] = acc[i]+A[i]
    
    if i%2==0:
        eacc[i+1] = eacc[i]+A[i]
        oacc[i+1] = oacc[i]
    else:
        eacc[i+1] = eacc[i]
        oacc[i+1] = oacc[i]+A[i]

for _ in range(Q):
    X = int(input())
    border = binary_search()
    ans = acc[N]-acc[border]
    
    if N-2*(N-border)>=0:
        if (N-2*(N-border))%2==0:
            ans += oacc[N-2*(N-border)]
        else:
            ans += eacc[N-2*(N-border)]
    
    print(ans)

Measured memory_bytes: 84332
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
	int N;
	cin >> N;
	int count_AC = 0, count_WA = 0, count_TLE = 0, count_RE = 0;
	rep(i, N) {
		string x;
		cin >> x;
		if (x == "AC") count_AC++;
		if (x == "WA") count_WA++;
		if (x == "TLE") count_TLE++;
		if (x == "RE") count_RE++;
	}
	cout << "AC"
	     << " "
	     << "x"
	     << " " << count_AC << endl;
	cout << "WA"
	     << " "
	     << "x"
	     << " " << count_WA << endl;
	cout << "TLE"
	     << " "
	     << "x"
	     << " " << count_TLE << endl;
	cout << "RE"
	     << " "
	     << "x"
	     << " " << count_RE << endl;
}

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

using namespace std;

int main(){
    int r,g,b,n,p=0;

    cin >> r >> g >> b >> n;

    int n1, n2, n3;
    if(r==max(r,max(g,b))){
        n1 = r;
        if(g>b){
            n2 = g;
            n3 = b;
        }else{
            n2 = b;
            n3 = g;
        }
    }else if(g>b){
        n1 = g;
        if(r>b){
            n2 = r;
            n3 = b;
        }else{
            n2 = b;
            n3 = r;
        }
    }else{
        n1 = b;
        if(r>g){
            n2 = r;
            n3 = g;
        }else{
            n2 = g;
            n3 = r;
        } 
    }

    int tmp1,tmp2,tmp3;
    for(int i=n/n1;i>=0;i--){
        tmp1 = n - i*n1;
        for(int j=tmp1/n2;j>=0;j--){
            tmp2 = tmp1 - j*n2;
            if(tmp2%n3==0) p++;
        }
    }
    cout << p << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int n,m;
vector<int>v[10];
bool vis[10];
int ans;
void dfs(int x,int s)
{
	if(s==n)
	{
		ans++;
		return;
	}
	for(int i=0;i<v[x].size();i++)
	{
		int y=v[x][i];
		if(vis[y])continue;
		vis[y]=true;
		dfs(y,s+1);
		vis[y]=false;
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		v[x].push_back(y);
		v[y].push_back(x);
	}
	vis[1]=true;
	dfs(1,1);
	printf("%d",ans);
	return 0;
} 

Measured memory_bytes: 256
import scala.io.StdIn.readLine
 
object Main {
  def search(a:Array[Int],value:Int) = {
    def scan(l:Int,r:Int):Boolean = {
      val mid = (l+r)/2
      if(a(mid) == value) true
      else if(l>=r) false
      else if(a(mid)<value) scan(mid+1,r)
      else scan(l,mid-1)
    }
    scan(0,a.length-1)
  }
 
  def main(args:Array[String]) = {
    readLine
    val s = readLine.split(" ").map(_.toInt)
    readLine
    val t = readLine.split(" ").map(_.toInt)
    println(t.count(i=> search(s,i) ))
  }
}

Measured memory_bytes: 71924
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define pb(a) push_back(a)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

int main(){
  string S;
  cin >>S;
  int N=S.length();
  int _0_0=0,_0_1=0,_1_0=0,_1_1=0;
  REP(i,N){
    if(i%2==0){
      if(S[i]=='0'){
        _0_0++;
      }else{
        _0_1++;
      }
    }else{
      if(S[i]=='0'){
        _1_0++;
      }else{
        _1_1++;
      }
    }
  }
  int n1,n2;
  n1=_0_0+_1_1;
  n2=_0_1+_1_0;
  if(n1<n2){
    cout << n1 <<endl;
  }else{
    cout << n2 <<endl;
  }
}


Measured memory_bytes: 512
def modinv(a,m):
    return pow(a,m-2,m)

x,y = map(int,input().split())
if (x+y)%3 != 0 or 2*y-x < 0 or 2*x-y < 0:
    print(0)
else:
    a = (2*y-x)//3
    b = (2*x-y)//3
    ans = 1
    mod = 10**9+7
    for i in range(1,a+1):
        ans = ans*(i+b)*modinv(i,mod)%mod
    print(ans)


Measured memory_bytes: 40428
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int ll;
typedef vector<int > vecint;
typedef vector<string > vecstr;
int main()
{
  string o, e;
  cin >> o >> e;
  REP(i,e.size()){
    cout << o[i] << e[i];
  }
  if(o.size() != e.size()){
    cout << o[o.size() - 1] << endl;
  }else{
    cout << endl;
  }
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using i64=int_fast64_t;
using pii=pair<int,int>;
using pll=pair<i64,i64>;
template <class T> constexpr T inf=numeric_limits<T>::max() / (T)2;
template <class T> using heap=priority_queue<T>;
template <class T> using minheap=priority_queue<T,vector<T>,greater<T>>;
#define fir first
#define sec second
#define mkp make_pair
#define mkt make_tuple
#define emb emplace_back
#define emp emplace
#define all(v) begin(v),end(v)
namespace std {
    template <class T> void hash_combine(size_t &seed, T const &key) {
        seed ^= hash<T>()(key) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
    }
    template <class T, class U> struct hash<pair<T,U>> {
        size_t operator()(pair<T,U> const &pr) const
        {
            size_t seed = 0;
            hash_combine(seed,pr.first);
            hash_combine(seed,pr.second);
            return seed;
        }
    };
}
void ios_untie() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}
void file_setup() {
    if(!freopen("stderr.txt","wt",stderr)) {
        std::cerr << "Failed to open the stderr file\n";
        freopen("CON","wt",stderr);
    }
    if(!freopen("stdout.txt","wt",stdout)) {
        std::cerr << "Failed to open the stdout file\n";
        freopen("CON","wt",stdout);
    }
    if(!freopen("stdin.txt","rt",stdin)) {
        std::cerr << "Failed to open the stdin file.\n";
        freopen("CON","rt",stdin);
    }
}
template <class A, size_t N, class T> void init(A (&array)[N], const T &val) { fill((T*)array,(T*)(array + N),val); }
i64 binry(i64 ok, i64 ng, const function<bool(i64)> &f) {
    while(abs(ok-ng)>1) {
        i64 mid=(ok+ng)/2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}

string X,Y;
i64 A,E,S,R;
i64 dp[132][132];
int n,m;

void solve() {
    n=X.size();
    m=Y.size();
    i64 ans=inf<i64>;
    for(int i=0; i<n; ++i) {
        init(dp,inf<i64>);
        dp[0][0]=0;
        for(int x=0; x<=n; ++x) {
            for(int y=0; y<=m; ++y) {
                if(x<n) {
                    i64 hos=0;
                    if(n-i<=x) {
                        hos=R;
                    }
                    dp[x+1][y]=min(dp[x+1][y],dp[x][y]+E-hos);
                } 
                if(y<m) {
                    dp[x][y+1]=min(dp[x][y+1],dp[x][y]+A);
                }
                if(x<n && y<m) {
                    if(X[x]==Y[y]) dp[x+1][y+1]=min(dp[x][y],dp[x+1][y+1]);
                    else dp[x+1][y+1]=min(dp[x+1][y+1],dp[x][y]+S);
                }
            }
        }
        ans=min(ans,dp[n][m]+R*i);
        X=string(X.begin()+1,X.end())+X[0];
    }
    cout<<ans<<"\n";
}

signed main() {
    ios_untie();
#ifdef LOCAL
    file_setup();
#endif

    while(cin>>X, X!="#") {
        cin>>Y>>A>>E>>S>>R;
        solve();
    }
}


Measured memory_bytes: 3312
#include<stdio.h>
int main(){
	char s[7];
	scanf("%s",s);
	if(s[0]==s[1]&&s[2]==s[1]&&s[0]==s[2])printf("Yes\n");else
	
	if(s[3]==s[1]&&s[2]==s[1]&&s[3]==s[2])printf("Yes\n");else
	printf("No");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const long long MOD = 1000000007;
long long fac[MAXN], N, M;
int main() {
    fac[0] = 1;
    for(int i = 1; i < MAXN; ++i) fac[i] = (fac[i-1] * i) % MOD;

    cin >> N >> M;
    if (abs(N-M) > 1) return puts("0"), 0;
    long long ans = (fac[N]*fac[M]) % MOD;
    if (N == M) ans = (ans + ans) % MOD;
    cout << ans << endl;
}

Measured memory_bytes: 8064
a = int(input())
l = []
for i in range(a):
  l.append(input())
head = l[0][0]
c = 0
if len(l) != len(set(l)):
  print("No")
  exit
else:
  for i in l:
    if i[0] != head:
      print("No")
      break
    else:
      head = i[-1]
      c += 1
if c == a:
  print("Yes")
  
  
  

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

int main(){
    long long INF =pow(10,11);
    int A, B, Q;
    cin >> A >> B >> Q;
    vector<long long> s(A+2);
    vector<long long> t(B+2);
    s.at(0)=0;
    t.at(0)=0;
    for(int i=0; i<A; i++){
        cin >> s.at(i+1);
    }
    for(int i=0; i<B; i++){
        cin >> t.at(i+1);
    }
    s.at(A+1)=INF;
    t.at(B+1)=INF;

    sort(s.begin(),s.end());
    sort(t.begin(),t.end());

    for(int i=0; i<Q; i++){
        long long x;
        cin >> x;
        long long ns[2], nt[2];
        ns[0] = *lower_bound(s.begin(),s.end(),x);
        ns[1] = *(lower_bound(s.begin(),s.end(),x) -1);
        nt[0] = *lower_bound(t.begin(),t.end(),x);
        nt[1] = *(lower_bound(t.begin(),t.end(),x) -1);

        long long ans = INF;
        for(int i=0; i<2; i++){
            for(int j=0; j<2; j++){
                if(ns[i]!=0 && ns[i]!= INF && nt[j]!=0 && nt[j]!= INF){
                    ans = min(ans, abs(x-ns[i])+abs(ns[i]-nt[j]));
                    ans = min(ans, abs(x-nt[j]) +abs(nt[j]-ns[i]) );
                }
            }
        }
        cout << ans << endl;
    }
}

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

#define ll long long

ll n, x=0;
ll a[100005], b[100005];

int main() {
  cin >> n;
  for (int i = 0; i < n+1; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }

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


Measured memory_bytes: 1792
#include<iostream>
#include<string>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans=0;
  for(int i=0;i<s.length()/2;++i) {
    if(s[i]!=s[s.length()-1-i]) ++ans;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
//
//  main.swift
//  Atcoder
//
//  Created by Louis Joe Shen on 2020/7/17.
//  Copyright © 2020 Louise Joe Shen. All rights reserved.
//

import Foundation

var input = readLine()!.split(separator: " ")

var H = Int(input[0])!
var W = Int(input[1])!
var A = Int(input[2])!
var B = Int(input[3])!

var MOD : Int = 1000000000 + 7
var fac = [Int]()
func exgcd(a : Int,b : Int) -> [Int]{
    var ans = [0,0,0]
    
    if b == 0{
        ans[0] = a
        ans[1] = 1
        ans[2] = 0
        return ans
    }
    let delta = exgcd(a: b, b: a % b)
    
    ans[0] = delta[0]
    ans[1] = delta[2]
    ans[2] = delta[1] - (a / b) * delta[2]
    
    return ans
}
   
func inv(a : Int) -> Int{
    let ans = exgcd(a: a, b: MOD)
    
    return (ans[1] % MOD + MOD) % MOD
}

func C(r : Int,k : Int) -> Int{
    return fac[r] % MOD * inv(a: fac[k]) % MOD * inv(a: fac[r - k]) % MOD
}

fac.append(1)
for i in 1 ... 1000000 + 7{
    fac.append(i * fac[i - 1] % MOD)
}

var n = H - A
var ans = 0
for i in 1 ... n{
    ans += ((C(r: B + i - 2, k: i - 1) % MOD) * (C(r: W + H - B - i - 1, k: H - i) % MOD)) % MOD
    ans %= MOD
}

print(ans)


Measured memory_bytes: 21724
#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/range/algorithm.hpp>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
#define MOD 998244353

std::string operator*(std::string const& str, int n) {
  if (n < 1) return "";
  std::string result;
  result.reserve(str.length() * n);
  for (int i = 0; i < n; ++i) {
    result += str;
  }
  return result;
}
string makeloop(string x, int n, int i) {
  string a = x.substr(0, i);
  string b;
  rep(j, i) {
    if (a[j] == '0')
      b += '1';
    else
      b += '0';
  }
  string loop = ((a + b) * (n / i + 1)).substr(0, n);
  return loop;
}

int main() {
  int n;
  string x;
  cin >> n >> x;
  ll ans = 0;
  ll temp = 0;
  ll done = 0;
  vector<ll> num(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    int t = x[i - 1] - '0';
    temp = (temp * 2 + t) % MOD;
    if ((n % i != 0) || (n / i % 2 == 0)) continue;

    int dictcheck = 0;
    string loop = makeloop(x, n, i);
    if (x >= loop) {
      dictcheck = 1;
    }

    vector<int> divisor;
    rep(j, i - 1) {
      if (i % (j + 1) == 0) divisor.push_back(j + 1);
    }
    ll done = 0;
    for (auto& d : divisor) {
      done = (done + num[d]) % MOD;
    }
    ans = (ans + (MOD + temp + dictcheck - done) % MOD * 2 * i % MOD) % MOD;
    num[i] = (MOD + temp + dictcheck - done) % MOD;
  }

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

Measured memory_bytes: 4068
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define MAX 200004
#define B 100
#define dpb push_back
#define fi first
#define se second
typedef pair<int, int> P;
typedef long long ll;
const int inf = 1e9;
const ll INF = 1e16;
//__gcd(a,b), __builtin_popcount(a);

ll a[MAX], total;

int solve(ll m, int n){
	int r = 0, l1 = 1, l2 = 1;
	ll sum = 0;
	
	while(r < n){
		while(a[l1]-a[r] < m){
			if(a[l1] == INF)break;
			l1++;
		}
		while(a[l2]-a[l1] < m){
			if(a[l2] == INF)break;
			l2++;
		}
		if(a[l1] == INF || a[l2] == INF)return 1;
		
		if(total-(a[l2]-a[r]) >= m)return 0;
		else{
			r++;sum += a[r];
		}
	}
	
	return 1;
}

int main(){
	int n;
	scanf("%d", &n);
	fill(a, a+MAX, INF);
	rrep(i,n){
		scanf("%lld", &a[i]);
		a[n+i] = a[i];
	}
	for(int i = 2;i <= 2*n;i++){
		a[i] += a[i-1];
	}
	a[0] = 0;
	total = a[n];
	
	ll vl = 0, vr = INF;
	while(vr-vl > 1){
		ll mid = (vr+vl)/2;
		int f = solve(mid, n);
		if(f)vr = mid;
		else vl = mid;
	}
	printf("%lld\n", vl);
	return 0;
}

Measured memory_bytes: 4780
from collections import *
n=int(input())
s=input()
c=Counter(s)
for u in range(n-1):
    d=input()
    x=Counter(d)
    for i in c:
        c[i]=min(c[i],x[i])
r=''
for i in c:
    r+=i*c[i]
l=sorted(r)
print(''.join(l))


Measured memory_bytes: 68188
#include <cmath>
#include <cstdio>
#include <limits>
#include <tuple>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <string>
#include <array>
#include <iomanip>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = n-1; i >= 0; --i)
#define REP(i, s, n) for (int i = s; i< (int)(n); ++i)
#define RREP(i, s, n) for (int i = s; i >= 0; --i)
#define all(x) x.begin(), x.end()

using namespace std;
using ll = long long;
ll inf = ll(1e18);
using ll1d = vector<ll>;
using ll2d = vector<ll1d>;
using ll3d = vector<ll2d>;


struct Zahyos {
  ll bx;
  ll by;
  ll ax;
  ll ay;
};

struct keiro {
  ll x;
  ll y;
};

void solve(istream &ccin = cin, ostream &ccout = cout) {
  ll h, w;
  ccin >> h >> w;
  ll2d a(h, ll1d(w, 0));

  rep(i, h) {
    rep(j, w) {
      ccin >> a[i][j];
    }
  }
  vector<keiro> k;
  rep(i, h) {
    rep(j, w) {
      ll sj = i % 2 == 1 ? w - 1 - j : j;
      keiro kei{};
      kei.x = sj;
      kei.y = i;
      k.push_back(kei);
    }
  }

  ll k_l = k.size();

  bool isFirst = false;
  vector<Zahyos> vz;
  rep(i, k_l - 1) {
    if (a[k[i].y][k[i].x] % 2 == 1) {
      isFirst = !isFirst;

    }
    if (isFirst) {
      Zahyos z{};
      z.by = k[i].y + 1;
      z.bx = k[i].x + 1;
      z.ay = k[i + 1].y + 1;
      z.ax = k[i + 1].x + 1;
      vz.push_back(z);
    }
  }

  ccout << vz.size() << endl;
  rep(i, vz.size())
    ccout << vz[i].by << " " << vz[i].bx <<" "<< vz[i].ay <<" "<< vz[i].ax << endl;

}

int main() {
  ios::sync_with_stdio(false);
  solve();
  return 0;
}

Measured memory_bytes: 14316
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
typedef long long ll;

using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> X(N + 1), Xorig(N + 1);
	rep1(i, N) cin >> X[i];
	Xorig = X;
	sort(X.begin(), X.end());
	
	rep1(i, N)
	{
		if (Xorig[i]<=X[N/2])
		{
			co(X[N / 2 + 1]);
		}
		else
		{
			co(X[N / 2]);
		}
	}
	return 0;
}


Measured memory_bytes: 3712