akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp == 0) {
                System.out.println(i + 1);
            }
        }
    }
}

Measured memory_bytes: 35768
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    int sum = 0;
    if (A >= K) {
        cout << K << endl;
        return 0;
    }
    else {
        sum += A;
        K -= A;
        if (B >= K) {
            cout << sum << endl;
            return 0;
        }
        else {
            K -= B;
            sum -= K;
            cout << sum << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3620
n, m, x, y = gets.split.map(&:to_i)
x_arr = gets.split.map(&:to_i)
y_arr = gets.split.map(&:to_i)
x_res = []
y_res = []
((x+1)..y).each do |i|
  x_res << i if x_arr.max < i
  y_res << i if y_arr.min >= i
end
puts (x_res & y_res).empty? ? "War" : "No War"


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
// -----------------<fast IO>------------------
#define IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FLSH             fflush(stdout)
#define fileIO(name) \
    freopen(name".in", "r", stdin); \
    freopen(name".out", "w", stdout);
#define PRECISION(x)     cout << fixed << setprecision(x);
// -----------------<TypeDef Start>------------------
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
// -----------------<Constants>------------------
const int MAXN = 1000005;
const int SQRTN = 1003;
const int LOGN = 22;
const double PI=acos(-1);

const int INF=1e9;

int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
/*ll gcd(ll a,ll b)
{
    if(a==0)
    return(b);
    return(gcd(b%a,a));
}*/
// --------------------------------------------------</TEMPLATE>--------------------------------------------------


void solve()
{
    ll n;
    cin>>n;
    ll arr[n];
    for(ll i=0;i<n;i++)
        cin>>arr[i];
    ll s=0;
    for(ll i=0;i<n;i++)
        s+=arr[i];
    ll ans=0;
    for(ll i=0;i<n-1;i++)
    {
        s-=arr[i];
        ans=((ans)%MOD+((arr[i]%MOD)*(s%MOD))%MOD)%MOD;
    }
    cout<<ans<<endl;
}

int main()
{
    IOS
    ll t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return(0);
}


Measured memory_bytes: 5140
'use strict'
function Main(input) {
    input = input.trim().split(/\n/)[0]
    input = input.split(' ').map(s => parseInt(s))
    const A = input[0]
    const P = input[1]

    const kakera = 3 * A + P
    
    const result = Math.floor(kakera / 2)


    console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))

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

#define REP(i, n) for(int i=0;i<n;i++)
#define REPR(i, n) for(int i=n;i>0;i--)
#define FOR(i, j, n) for(int i=j;i<n;i++)
#define COUT(n) cout<<(n)<<"\n"

typedef long long ll;
const int INF = 1e9;

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

    int n; cin >> n;
    int a[n+1];
    FOR(i, 1, n+1) cin >> a[i];

    int b[n];
    FOR(i, 1, n+1) b[i] = 0;
    FOR(i, n/2 + 1, n + 1) b[i] = a[i];

    for (int i=n/2; i>=1; i--){
        int tmp = 0;
        for (int j = 2; j <= n/i; j++){
            tmp += b[i*j];
        }
        b[i] = (tmp%2==a[i]?0:1);
    }

    int su = 0; FOR(i, 1, n+1) su += b[i];
    COUT(su);
    FOR(i, 1, n+1){
        if(b[i]!=0) cout << i << " ";
    }

    COUT("");

    return 0;
} 

Measured memory_bytes: 2560
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
ll best[5005];
int main()
{
 ll n;
 cin>>n;
 ll k=(n*(n+1))/2;
 cout<<k<<endl;
    return 0;
}

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

using namespace std;

typedef long long llint;
typedef long double ld;
#define inf 1e18

priority_queue<llint,vector<llint>,greater<llint>> que;
priority_queue<llint> q;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int n;
string s;

void solve(){
	cin >> n;
	cin >> s;
	llint cntr=0;
	llint cntl=0;
	llint r=0,l=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='(')cntl++;
		else{
			if(cntl>0)cntl--;
			else r++;
		}
	}
	for(int i=n-1;i>=0;i--){
		if(s[i]==')')cntr++;
		else{
			if(cntr>0)cntr--;
			else l++;
		}
	}
	for(int i=0;i<r;i++)cout << '(';
	printf("%s",s.c_str());
	for(int i=0;i<l;i++)cout << ')';
	cout << endl;
}

int main(int argc, char *argv[]) {
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;
#define int long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define INF (long long)(1e18)
#define MOD (int)(1e9+7)
#define MAX_N 103
#define MAX_V 10
#define MAX_M 101
#define yn(f) (f?"Yes":"No")
#define YN(f) (f?"YES":"NO")
#define pro "はいプロ　世界一○○が上手　○○界のtourist　○○時代の終焉を告げる者　実質○○　○○するために生まれてきた男"

signed main(){
	cout<<fixed<<setprecision(7);
	int n = 0, m = 0;
	int a = 0, b = 0, c = 0, d = 0, e = 0;
	bool f = true, flag = true;
	string S[2];
	cin>>S[0]>>S[1];
	rep(i,S[0].size()){
		if(S[0][i] != S[1][S[1].size()-i-1]) f = false;
	}
	//cin>>n;
	
	//for(int i = 0; i < n; i++){
	//}
	
	// cout<<yn(f)<<endl;
	cout<<YN(f)<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;

using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

int main()
{
  long long N;
  scanf("%lld", &N);
  long long K;
  scanf("%lld", &K);
  std::string S;
  std::cin >> S;

  vector<int> v;
  if (S[0] == '0')
    v.push_back(0);
  for (int i = 0; i < S.size();)
  {
    int j = i;
    while (j < S.size() && S[i] == S[j])
      j++;
    v.push_back(j - i);
    i = j;
  }
  if (S[S.size() - 1] == '0')
    v.push_back(0);

  vector<int> num(v.size() + 1, 0);
  for (int i = 0; i < v.size(); ++i)
  {
    num[i + 1] = num[i] + v[i];
  }

  int ans = 0;
  for (int i = 0; i < num.size(); i += 2)
  {
    int j = 2 * K + 1 + i;
    if (j >= num.size())
      j = num.size() - 1;
    ans = max(ans, num[j] - num[i]);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1272
#include <stdio.h>
int main(void)
{
  int i,a,b,tem,ct=0,sq,flag=0;
  scanf("%d%d",&a,&b);
  tem=b;
  while(tem>0)
  {
    tem/=10;
    ct++;
  }
  sq=a;
  for(i=0;i<ct;i++)
  {
    sq*=10;
  }
  sq+=b;
  for(i=0;i<sq/2;i++)
  {
    if(i*i==sq)
    {
      flag=1;
      break;
    }
  }
  if(flag)
  {
    printf("Yes\n");
  }
  else
  {
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>

int main(void)
{
  char s[10];
  int l,f,i,a,b;
  
  scanf("%s",s);
  l=strlen(s);
  f=0;
  if(s[0]=='A') f++;
  a=0;
  for(i=2;i<l-1;i++){
    if(s[i]=='C') a++;
  }
  if(a==1) f++;
  for(i=0;i<l;i++){
    if(((s[i]>='a')&&(s[i]<='z'))||(s[i]=='A')||(s[i]=='C')) b++;
  }
  if(b==l) f++;
  if(f==3) printf("AC");
  else printf("WA");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,a,b,ans=0;
	cin>>n;
	vi v(100005);
	rep(i,n){
		cin>>a>>b;
		v[a]++;v[b+1]--;
	}
	v[0]++;
	range(i,1,v.size()){
		v[i]+=v[i-1];
		if(i<=v[i])chmax(ans,i-1);
	}
	cout<<ans<<endl;
}


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

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

    vector<pair<int,int>> v;

    for(int i=0;i<M;i++){
        int a,b;
        cin>>a>>b;
        v.push_back(make_pair(b,a));
    }

    sort(v.begin(),v.end());
    int ans=0;
    int a=0;
    for(int i=0;i<M;i++){
        if(v.at(i).second>=a) {
            ans++;
            a=v.at(i).first;
        }
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 1528
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = 0
for i in range(N):
  if A[i] <= B[i]:
    count += min(B[i], A[i] + A[i + 1])
    A[i + 1] = max(0, A[i + 1] + A[i] - B[i])
  else:
    count += min(B[i], A[i] + A[i + 1])
print(count)
    


Measured memory_bytes: 18476
// Last Change: 06/29/2019 21:57:20.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

const ll MOD = 1e9 + 7;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}

ll Pow(ll a, ll b) {
  ll ans = 1;
  for (int i = 0; i < b; ++i) {
    ans = (ans * a) % MOD;
  }
  return ans;
}
} // namespace NS

class Comb {
  vector<vector<ll>> v;

public:
  Comb(int n) {
    v.resize(n + 1);
    fill(v.begin(), v.end(), vector<ll>(n + 1, 0));
    for (ll i = 0; i < n + 1; ++i) {
      v[i][0] = v[i][i] = 1;
    }
    for (ll i = 1; i < n - 1; ++i) {
      for (ll j = 1; j < i; ++j) {
        v[i][j] = (v[i - 1][j - 1] + v[i - 1][j]) % MOD;
      }
    }
  }
  ll Get(int n, int k) {
    return v[n][k];
  }
};

int main() {
  ll N, K;
  cin >> N >> K;

  Comb comb(N);

  for (int i = 1; i <= K; ++i) {
    cout << (comb.Get(K - 1, i - 1) * comb.Get(N - K + 1, i)) % MOD << endl;
  }

  //NS::LoopUntilZeroInpput();
}


Measured memory_bytes: 31616
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using vec=vector<ll>;
using mat=vector<vec>;
#define For(i,a,b) for(ll i=a;i<b;i++)
#define bFor(i,a,b) for(ll i=a;i>=b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
#define endl "\n"
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
using datas=pair<ll,ll>;
using tdata=pair<ll,datas>;

ll N;
mat v;
ll search(ll now,vec& a){
  ll K,ans=1;
  K=v[now].size();
  vec b(N);
  a[now]++;
  rep(i,N){
    b[i]=a[i];
    if(b[i]==0)ans=0;
  }
  a[now]--;
  if(ans)return ans;
  rep(i,K){
    if(b[v[now][i]]==0){
      ans+=search(v[now][i],b);
    }
  }
  return ans;
}
int main(){
  ll K,s,g;
  cin>>N>>K;
  v.resize(N);
  vec a(N,0);
  rep(i,K){
    cin>>s>>g;
    s--;g--;
    v[s].push_back(g);
    v[g].push_back(s);
  }
 
  cout<<search(0,a)<<endl;
  return 0;
}

Measured memory_bytes: 256
import sys

p = ["A", "B", "C"]
p_dic = {"a": 0, "b": 1, "c": 2}

def card(cards, player):
  if len(cards[player]) == 0:
    print(p[player])
    sys.exit()
  else:
    x = cards[player][0]
    cards[player] = cards[player][1:]
    card(cards, p_dic[x])

cards = [input() for i in range(3)]
card(cards, 0)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int h,w,k;
cin>>h>>w>>k;
int ans=0;
vector<string>s(h);
rep(i,h) cin>>s.at(i);
rep(is,1<<h) rep(js,1<<w){
	int cnt=0;
  	rep(i,h)rep(j,w){
      	//すべて消えるとき
    	if(is>>i & 1) continue;
      	if(js>>j & 1) continue;
      	if(s.at(i).at(j)=='#') cnt++;
    }
  if(cnt==k) ans++;
}
  cout<<ans<<endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<58;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

ll Pow_mod(ll n,ll p){
	ll r=1;
	for(;p>0;p>>=1){
		if(p&1) r=(r*n)%mod;
		n=(n*n)%mod;
	}
	return r;
}

ll Div(ll n,ll m){
	return n*Pow_mod(m,mod-2)%mod;
}

ll n,d,k;

int main(){
	while(1){
		cin>>n>>d>>k;
		if(!n) break;
		ll res=0,A=d%mod,B=1;
		vl dp(n+1);
		dp[0]=1;
		for(int i=0;i<n;i++){
			vl s(n+2);
			for(int j=1;j<n+2;j++) s[j]=(s[j-1]+dp[j-1])%mod;
			for(int j=0;j<=n;j++){
				int I=j-k+1;
				dp[j]=(s[j]-s[(I>=0?I:0)]+mod)%mod;
			}
			(res+=dp[n]*Div(A,B))%=mod;
			(A*=(d-i-1)%mod)%=mod;
			(B*=i+2)%=mod;
		}
		cout<<res<<endl;
	}
}

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

const int N = 1e5 + 8;

int32_t main(){
  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);  
    string s;
    cin >> s;
    if(s == "Sunny") cout << "Cloudy";
    else if(s == "Cloudy") cout << "Rainy";
    else cout << "Sunny";

  return 0;
}




Measured memory_bytes: 3640
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;


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

	string s;
	cin >> s;
	cin >> N;
	bool a = false, b = false;
	int anum = 0;
	bool add = true;
	int box = 0;
	for (auto i : s) {
		if (i == '+') {
			add = true;
			anum += box;
			box = 0;
		}
		else if (i == '*') {
			add = false;
		}
		else {
			if (add) {
				box += i - '0';
			}
			else {
				box *= i - '0';
			}
		}
	}
	anum += box;
	if (anum == N)a = true;
	int bnum = 0;
	add = true;
	for (auto i : s) {
		if (i == '+')add = true;
		else if (i == '*')add = false;
		else {
			if (add) {
				bnum += i - '0';
			}
			else {
				bnum *= i - '0';
			}
		}
	}
	if (bnum == N)b = true;
	if (a&&b)cout << "U" << endl;
	else if (a)cout << "M" << endl;
	else if (b)cout << "L" << endl;
	else cout << "I" << endl;
}


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

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

  vector<int> B(N + 1);
  B[0] = B[N] = 1e5;
  for(int i = 1; i <= N - 1; i++){
    cin >> B[i];
  }

  int ans = 0;
  for(int i = 0; i < N; i++){
    ans += min(B[i], B[i + 1]);
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
/*
Author : N_o_o_B
Created : January 12 2020 17:30:23 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;


    char c;
    cin >> c;
    cout << char(c+1) << endl;


    time_taken();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
char a[110];
int main(){
	scanf("%s", a + 1);
	printf("%c%d%c\n", a[1], strlen(a + 1) - 2, a[strlen(a + 1)]);
	return 0;
} 

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define EB emplace_back
#define FI first
#define SE second

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

vector<vector<P>> v(111111);
ll ans[111111];
set<ll> s;

void dfs(int node, int color, int pre){
    int now = (color == 1 ? 2 : 1);
    REP(i, v[node].size()){
        int aite = v[node][i].FI;
        int id = v[node][i].SE;
        if(aite == pre)continue;

        ans[id] = now;
        s.insert(now);
        dfs(aite, now, node);
        now++;
        if(now == color)now++;
    }
}

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

    ll n;cin >> n;
    REP(i, n - 1){
        ll a, b;cin >> a >> b;
        a--;b--;
        v[a].EB(b, i);
        v[b].EB(a, i);
    }
    dfs(0, 0, -1);

    cout << s.size() << endl;
    REP(i, n-1)cout << ans[i] << "\n";

	return 0;
}


Measured memory_bytes: 11008
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_M = 100005;
int pena[MAX_M];
bool AC[MAX_M];

int main()
{
	int N,M,p;
	cin >> N >> M;
	string S;
	int ans = 0,ansp = 0;
	rep(i,M)
	{
		cin >> p >> S;
		if (S == "AC" && AC[p] == false)
		{
			ans++;
			AC[p] = true;
			ansp += pena[p];
		}
		else if (S == "WA" && AC[p] == false)
		{
			pena[p]++;
		}
	}
	cout << ans << " " << ansp << endl;
	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

int main()
{
    ll H, W, N;
    cin >> H >> W >> N;
    vector<ll> a(N);
    rep(i, N) { 
        cin >> a[i];
    }
    vector<vector<ll>> mat(H, vector<ll>(W, -1));
    ll cnt = 0;
    ll color = 1;
    ll x = 0; 
    ll y = 0;
    ll flag = 1;
    while(y != W) {
        if (cnt < a[color-1]) {
            mat[x][y] = color;
            cnt++;
        } else {
            color++;
            cnt = 0;
            mat[x][y] = color;
            cnt++;
        }

        x += flag;

        if (x == -1 || x == H) {
            flag *= -1;
            x += flag;
            y++;
        }
    }
    rep(i, H) {
        print(mat[i]);
    }
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1LL << 60;
#define LLINF 1e12
#define PI 3.14159265359
#define ALL(a) (a).begin(), (a).end()
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int dy8[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dx8[] = {0, 1, 0, -1, 1, 1, -1, -1};
int ny, nx;
typedef long long ll;
using namespace std;

int main(){
    int D; cin >> D;
    vector<int> c(26);
    REP(i,26) cin >> c[i];

    int s[D][26];
    REP(i,D) REP(j,26) cin >> s[i][j];

    //REP(i,D) cout << i%26 + 1 << endl; //最悪な例

    REP(i,D){
        int max = - 1LL << 30, hold = 2;
        REP(j,26) if(max<s[i][j]){
            max = s[i][j];
            hold = j;
            //cout << "max= " << max << " hold= " << hold << endl;
        }
        cout << hold + 1 << endl;
    }

    return 0;
}

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

const int MAX_N=100;

void print(int *A,int n){
  for(int j=0; j<n; j++){
    if(j==n-1) cout << A[j] << endl;
    else cout << A[j] << " ";
  }
}

int main(){
  int n;
  int A[MAX_N];
  int tmp;

  cin >> n;

  for(int i=0; i<n; i++){
    cin >> A[i];
  }

  print(A, n);
  for(int i=1; i<n; i++){
    tmp = A[i];
    int j=i-1;
    while(A[j]>tmp && j>=0){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = tmp;
    print(A, n);
  }
}



Measured memory_bytes: 3092
<?php
$n = fgets(STDIN);
$h = trim(fgets(STDIN));
$h = explode(' ', $h);
$now = $h[0];
$count = 1;
for ($i = 1; $i < $n; $i++) {
 if ($now <= $h[$i]) {
  $now = $h[$i];
  $count++;
 }
}
echo $count;


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

//ライブラリ始まり

//定数

//円周率
const double PI = 3.1415926535897932384;

//天井
const int INF = 1000000000; // = 10^9
const ll LINF = 1000000000000000; // = 10^15

//ABC文字列
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABC";
const string abc = "abcdefghijklmnopqrstuvwxyzabc";

//よくあるmodくん
const ll MOD = 1000000007; // = 10^9 + 7

//データ構造

//Union_Find木
struct UnionFind {
  vector<int> UF; // UF.at(i) : iの親の番号
  vector<int> SIZE; // SIZE.at(root(i)) : iと連結されてる要素の数
  UnionFind(int N) : UF(N), SIZE(N, 1) { // 最初は全てが根であるとして初期化
    for(int i = 0; i < N; i++) {
      UF.at(i) = i;
    }
  }
  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (UF.at(x) == x) {
      return x;
    }
    return UF.at(x) = root(UF.at(x));
  }
  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); // xの根をrx
    int ry = root(y); // yの根をry
    if (rx == ry) {
      return; // xとyの根が同じ(=同じ木にある)時はそのまま
    }
    // xとyの根が同じでない(=同じ木にない)時：小さい方の根を大きい方の根につける
    if (SIZE.at(rx) < SIZE.at(ry)) {
      UF.at(rx) = ry;
      SIZE.at(ry) += SIZE.at(rx);
      SIZE.at(rx) = 0;
    }
    else {
      UF.at(ry) = rx;
      SIZE.at(rx) += SIZE.at(ry);
      SIZE.at(ry) = 0;
    }
  }
  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
  int size(int x) { // xと連結されてる要素の数を返す
    return SIZE.at(root(x));
  }
};

//関数

//ctoi
int ctoi(char c){
  if (c == '0') {
    return 0;
  }
  if (c == '1') {
    return 1;
  } 
  if (c == '2') {
    return 2;
  } 
  if (c == '3') {
    return 3;
  }
  if (c == '4') {
    return 4;
  } 
  if (c == '5') {
    return 5;
  } 
  if (c == '6') {
    return 6;
  }
  if (c == '7') {
    return 7;
  } 
  if (c == '8') {
    return 8;
  } 
  if (c == '9') {
    return 9;
  }
  return -1;  
}

//素数判定
bool PN(int x) {
  if (x <= 1) {
    return false; // 1や0,-1は素数ではない
  }
  if (x == 2) {
    return true; // √2 + 1 > 2 なので下でやると 2 ％ 2 = 0 となり判定できない
  }
  for (int i = 2; i < sqrt(x) + 1; i++) {
    if (x % i == 0) {
      return false; // 割れたら素数じゃない
    }
  }
  return true;
}

//ライブラリ終わり

int main() {
  char X;
  cin >> X;
  bool ok = false;
  for (int i = 0; i < 27; i++) {
    if (X == ABC.at(i)) {
      ok = true;
    }
  }
  if (ok) {
    cout << 'A' << endl;
  }
  else {
    cout << 'a' << endl;
    }
    }

Measured memory_bytes: 3684
#include <stdio.h>

int main()
{
    int L, R, d, ans = 0;

    scanf("%d %d %d", &L, &R, &d);

    while (L <= R){
        if (L%d == 0){
            ans++;
            L++;
            continue;
        }else{
        L++;
        continue;
        }

    }

    printf("%d", ans);



    return 0;
}


Measured memory_bytes: 1716
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(System.in);
		int n= in.nextInt();
		int [] a= new int[n];
		for(int i=0; i<n; i++){
			a[i]= in.nextInt();
		}
		Arrays.sort(a);
		System.out.println(a[n-1]-a[0]);
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}

		public double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		public String next() throws IOException {
			if (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
				return next();
			}
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 21204
ToNode = Struct.new(:id, :weight)

N = gets.to_i

$graph       = {}

while (line = gets)
  node_id, _, *nodes = line.split(' ').map(&:to_i)
  $graph[node_id] = nodes.each_slice(2).map{|id, weight| ToNode.new(id, weight)}
end

$visited_nodes = []



$start_node_id = 0
# Min Distance '0' to `key`
$weights = {$start_node_id => 0}
$visited_nodes.push($start_node_id)


while $visited_nodes.size != N
  # Node which should be visited
  next_visit_node = nil
  min_weight = Float::INFINITY

  $visited_nodes.each{|node_id|
    to_nodes = $graph[node_id]
    w        = $weights[node_id]
    to_nodes.each{|n|
      if !$weights.has_key?(n.id)
        weight = w + n.weight
        if weight < min_weight
          min_weight = weight
          next_visit_node = {id: n.id, weight: weight}
        end
      end
    }
  }

  $visited_nodes.push(next_visit_node[:id])
  $weights[next_visit_node[:id]] = next_visit_node[:weight]
end

$weights
  .sort_by{|k, v| k}
  .each{|node, weight|
    puts("#{node} #{weight}")
  }



Measured memory_bytes: 6960
#include <cstdlib>
#include <iostream>
#include <typeinfo>
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
  int a, b;
  cin >> a >> b;
  int ans = 0;
  for (int i = 0; i < 2;i++){
    ans += max(a, b);
    if(a>b){
      a--;
    }else{
      b--;
    }
  }
  cout << ans << endl;
  return 0;
}

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

typedef long long lint; typedef pair<int, int> ii;
//const int MOD = 1'000'000'007, MOD2 = 1'000'000'009;
const int INF = 0x3f3f3f3f; const lint BINF = 0x3f3f3f3f3f3f3f3fLL;

lint a, b, c, k;

// a b c
// b+c a+c a+b
// (a+b+c)+a (a+b+c)+b (a+b+c)+c
// 2(a+b+c)+b+c 2(a+b+c)+a+c 2(a+b+c)+a+b
// 5(a+b+c)+a

int solve(){
	cin >> a >> b >> c >> k;
	if (k & 1)
		cout << b - a << endl;
	else
		cout << a - b << endl;
	return 0;
}

int main(){
	ios::sync_with_stdio(0);
	// int t; cin >> t; while(t--)
	solve();
	// cout << (solve() ? "YES" : "NO") << endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
//using P = pair<int,int>;
//pow(x,n)
//cout << fixed << setprecision(桁数);

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

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

int main() {

    int k; cin >> k;
    int sum=0;
    for(int a=1;a<=k;++a){
        for(int b=1;b<=k;++b){
            for(int c=1;c<=k;++c){
                sum+= gcd(gcd(a, b), c);
            }
        }
    }

    cout << sum << endl;
    return 0;
}

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

#define endl '\n'

// #define int long long

typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef pair<int, int> pii;

const int INF = 1000000000;
const int MOD = 1000000007; // 998244353

signed main() {  
   ios::sync_with_stdio(false);
   cin.tie(nullptr);
   int n;
   cin >> n;
   int p[n];
   for (int i = 0; i < n; i++)
      cin >> p[i];
   int res = 0;
   int mini = p[0];
   for (int i = 0; i < n; i++) {
      mini = min(p[i], mini);
      if (mini == p[i])
         ++res;
   }
   cout << res << endl;
   return 0;
}

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

using namespace std;

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

  if(x>=400 and x<=599) cout<<8<<endl;
  else if(x>=600 and x<=799) cout<<7<<endl;
  else if(x>=800 and x<=999) cout<<6<<endl;
  else if(x>=1000 and x<=1199) cout<<5<<endl;
  else if(x>=1200 and x<=1399) cout<<4<<endl;
  else if(x>=1400 and x<=1599) cout<<3<<endl;
  else if(x>=1600 and x<=1799) cout<<2<<endl;
  else if(x>=1800 and x<=1999) cout<<1<<endl;



}


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

using namespace std;

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

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n;
int dp[202020];
void solve(){
	cin >> n;
	vector<int> v;
	v.push_back(1);
	for(int i = 9; i <= n; i*=9) v.push_back(i);
	for(int i = 6; i <= n; i*=6) v.push_back(i);
	
	fill(dp+1,dp+202020, INF);
	for(int i = 0; i < n; i++){
		for(auto j : v){
			chmin(dp[i+j],dp[i]+1);
		}
	}
	cout << dp[n] << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String O = sc.next();
		String E = sc.next();
		String out = "";
		int cnt=1;
		while(E.length()!=0 || O.length()!=0){
			if(cnt%2==0){
				out += E.charAt(0);
				E = E.substring(1);
			}
			else{
				out += O.charAt(0);
				O = O.substring(1);
			}

			cnt++;
		}
		System.out.println(out);

	}

}


Measured memory_bytes: 21460
program main
  implicit none
  integer w,h,n,x,y,a,i
  integer,allocatable::m(:,:)
  read*,w,h,n
  allocate(m(w,h))
  m=1;
  do i=1,n
     read*,x,y,a
     if(a==1) then
        m(1:x,:)=0
     elseif(a==2)then
	m(x+1:w,:)=0
     elseif(a==3)then
	m(:,1:y)=0
     else
        m(:,y+1:h)=0
     end if

  end do
  print*,sum(m)
end program main


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

int main() {
    string str;
    vector<vector<string>> invalid(2, vector<string>(10));
    invalid[0][1] = "23968";
    invalid[0][2] = "369";
    invalid[0][3] = "";
    invalid[0][6] = "";
    invalid[0][9] = "";
    invalid[0][8] = "369";
    invalid[0][7] = "23698";
    invalid[0][4] = "23698";
    invalid[1][1] = "";
    invalid[1][4] = "";
    invalid[1][7] = "";
    invalid[1][2] = "147";
    invalid[1][8] = "147";
    invalid[1][3] = "78412";
    invalid[1][6] = "78412";
    invalid[1][9] = "78412";
    while (cin >> str, str != "#") {
        int rcount = 0;
        int lcount = 0;
        int r = 1;
        int l = 0;
        for (int i = 0; i < str.size() - 1; i++) {
            if (invalid[r % 2][(int)(str[i] - '0')].find(str[i + 1]) != string::npos) {
                rcount++;
                r--;
            }
            if (invalid[l % 2][(int)(str[i] - '0')].find(str[i + 1]) != string::npos) {
                lcount++;
                l--;
            }

            r++, l++;
        }

        cout << min(rcount, lcount) << endl;
    }

    return 0;
}

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

int main()
{
	int h, w, k;
	cin >> h >> w >> k;
	vector<vector<int>> v(h, vector<int>(w, 0));
	for (auto& i : v) {
		string s;
		cin >> s;
		for (int j = 0; j < w; ++j) {
			i[j] = s[j] - '0';
		}
	}

	int ret = h * w;
	int div = 0;
	int to = 1 << (h - 1);
	while (div != to)
	{
		vector<int> g(h, 0);
		for (int i = 1; i < h; ++i) {
			if ((div >> (i - 1)) & 1) {
				g[i] = g[i - 1] + 1;
			}
			else {
				g[i] = g[i - 1];
			}
		}

		int temp = g[h - 1];
		vector<int> count(g[h-1] + 1, 0);
		for (int j = 0; j < w; ++j) {

			vector<int> curcount(g[h - 1] + 1, 0);
			for (int i = 0; i < h; ++i) {
				curcount[g[i]] += v[i][j];
			}
			bool ng = false;
			bool isdiv = false;
			for (int l = 0; l <= g[h - 1]; ++l ) {
				if (k < curcount[l]) {
					ng = true;
					break;
				}
				if (k < (count[l] + curcount[l])) {
					isdiv = true;
				}
			}
			if (ng) {
				temp = -1;
				break;
			}

			if (isdiv) {
				++temp;
				count = curcount;
			}
			else {
				for (int l = 0; l <= g[h - 1]; ++l) {
					count[l] += curcount[l];
				}
			}
		}

		++div;
		if (temp == -1) {
			continue;
		}
		ret = min(ret, temp);
	}

	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main(){
    ll Q,H,S,D,N;cin>>Q>>H>>S>>D>>N;
    ll ans=0;
    ll now;
    now=min(8*Q,4*H),now=min(now,2*S),now=min(now,D);
    ans+=N/2*now;
    N%=2;
    now=min(4*Q,2*H),now=min(now,S);
    ans+=N*now;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second
int main() {
    string a; cin >> a;
    if(a[1] == 'B') cout << "ARC" << endl;
    else cout << "ABC" << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

int paper[10][10];

void printv() {
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			printf("%2d", paper[i][j]);
		}
		printf("\n");
	}
	printf("---------------------------\n");
}

int main() {
	int x, y, size;
	int blank = 0, depth = 0;
	int dx[] = { 1, -1,  0,  0,  1, -1,  1, -1,  2, -2,  0,  0};
	int dy[] = { 0,  0,  1, -1,  1, -1, -1,  1,  0,  0,  2, -2};

	memset(paper, 0, sizeof(paper));
	while (scanf("%d,%d,%d", &x, &y, &size) != EOF) {
		int i;
		paper[y][x] += 1;
		switch (size) {
			case 3:
				for (i = 8; i < 12; i++)
					if (x + dx[i] >= 0 && x + dx[i] <= 9 &&
						y + dy[i] >= 0 && y + dy[i] <= 9 )
						paper[y + dy[i]][x + dx[i]] += 1;
			case 2:
				for (i = 4; i < 8; i++)
					if (x + dx[i] >= 0 && x + dx[i] <= 9 &&
						y + dy[i] >= 0 && y + dy[i] <= 9 )
						paper[y + dy[i]][x + dx[i]] += 1;
			case 1:
				for (i = 0; i < 4; i++)
					if (x + dx[i] >= 0 && x + dx[i] <= 9 &&
						y + dy[i] >= 0 && y + dy[i] <= 9 )
						paper[y + dy[i]][x + dx[i]] += 1;
				break;
		}
//		printv();
	}
	for (int i = 0; i < 10; i++)
		for (int j = 0; j < 10; j++)
			if (paper[i][j] == 0)
				blank++;
			else
				depth = max(depth, paper[i][j]);
	printf("%d\n", blank);
	printf("%d\n", depth);
	return 0;
}

Measured memory_bytes: 1188
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


X, Y, Z, K = list(map(int, sys.stdin.buffer.readline().split()))
A = list(map(int, sys.stdin.buffer.readline().split()))
B = list(map(int, sys.stdin.buffer.readline().split()))
C = list(map(int, sys.stdin.buffer.readline().split()))

A = np.array(A, dtype=int)
B = np.array(B, dtype=int)
C = np.array(C, dtype=int)

AB = (A[:, None] + B[None, :]).ravel()
AB = np.msort(AB)[::-1][:K]
ABC = (AB[::-1][:K][:, None] + C[None, :]).ravel()
ans = np.msort(ABC)[::-1][:K]

print(*ans, sep='\n')


Measured memory_bytes: 77880
#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>;
const int INF = 1 << 29;
 
int main() {
	int x;
	cin >> x;
	int small = x % 100;
	int large = (x-small) / 100;
	int cnt_100 = 0;
	
	int p[5] = {5, 4, 3, 2, 1};
	rep(i, 5) {
		if (small <= 0) break;
		int now = min(small, small / p[i] * p[i]);
		cnt_100 += small / p[i];
		small -= now;
	}
	if (cnt_100 <= large) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {

	private static final String SPLIT_STR = " ";
	private static final String SPACE = " ";

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String x = sc.nextLine();

		String[] split = x.split(SPLIT_STR);

		int height = Integer.parseInt(split[0]);
		int width = Integer.parseInt(split[1]);

		sc.close();

		System.out.println(area(height, width) + SPACE + surfaceLength(height, width));
	}

	private static int area(int a, int b) {
		int result = a * b;
		return result;
	}

	private static int surfaceLength(int a, int b) {
		int result = a * 2 + b * 2;
		return result;
	}
}



Measured memory_bytes: 26328
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 18;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

int main() {
	int N, A, B;
	scanf("%d %d %d", &N, &A, &B);
	return !printf("%d\n", min(N*A, B));
}

Measured memory_bytes: 256
#include<stdio.h>
#include<vector>
using namespace std;

int main()
{
	long long h, n, sum=0;

	scanf("%lld %lld", &h, &n);
	vector<long long> a(n);
	for (int i=0; i<n; i++){
		scanf("%lld", &a[i]);
		sum += a[i];
	}
	
	if (sum >=h) printf("Yes\n");
	else printf("No\n");
	
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <inttypes.h>

int main(void)
{
    uint_fast32_t a, b, c, d;
    scanf("%" SCNuFAST32 " %" SCNuFAST32 " %" SCNuFAST32 " %" SCNuFAST32,
          &a, &b, &c, &d);
    printf("%" PRIuFAST32 "\n", (a * b > c * d) ? (a * b) : (c * d));
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <tuple>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

using T = tuple<ll,ll>;
using Graph = vector<vector<T>>;

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

    ll n;
    cin >>n;
    map<string, ll> s;
    rep(i,0,n)
    {
        string tmp;
        cin >> tmp;
        s[tmp]++;
    }

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

    return 0;
}


Measured memory_bytes: 19244
# うまく効率化できなかった
# 2 6=>4 (1,6)*2,(2,3)*2
# 3 12=>18 (1,1,12)*3,(1,2,6)*6,(1,3,4)*6,(2,2,3)*3
# import math
# def comb(a,b):
#     return math.factorial(a)//math.factorial(a-b)//math.factorial(b)
def comb(a,b): # aCb
    b=min(b,a-b)
    result=1
    for i in range(a,a-b,-1):
        result*=i
    for i in range(1,b+1):
        result//=i
    return result

n,m=map(int,input().split())
divisor={}
tmp=m
# for i in range(2,m+1):
#     while tmp%i==0:
#         tmp//=i
#         divisor.setdefault(i,0)
#         divisor[i]+=1
#         if tmp==1:
#             break
i=2
while i*i<=m:
    while tmp%i==0:
        tmp//=i
        divisor.setdefault(i,0)
        divisor[i]+=1
    i+=1
if tmp>1:
    divisor[tmp]=1
# print(divisor)
cnt=1
for key in divisor:
    c=divisor[key]
    cnt*=comb(c+n-1,c)
print(cnt%1000000007)


Measured memory_bytes: 3064
#include<stdio.h>
int main()
{
    int N,A[110],i,j,temp,count=0,mini=0;
    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        scanf("%d",&A[i]);
    }
    for(i=0;i<N;i++)
    {
        mini=i;
        for(j=i;j<N;j++)
        {
           if (A[j]<A[mini])
           {
               mini=j;
           }
        }
           if(i!=mini)
           {
               temp = A[i];
               A[i] = A[mini];
               A[mini] = temp;
               count++;
           }
        }
    for(i=0;i<N-1;i++)
        printf("%d ",A[i]);
        printf("%d",A[N-1]);

    printf("\n%d\n",count);
    return 0;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define REV(x) reverse(ALL((x)))
#define ASC(x) sort(ALL((x)))
#define DESC(x) ASC((x)); REV((x))
#define pb push_back
#define eb emplace_back

int main()
{
    ll N;
    cin >> N;
    vec H(N);
    REP(i,0,N) cin >> H[i];

    ll m = 0, c = 0;
    REP(i,1,N) {
        if(H[i-1] >= H[i]) ++c;
        else {
            m = MAX(m,c);
            c = 0;
        }
    }
    m = MAX(m,c);
    PR(m);

    return 0;
}

/*



*/

Measured memory_bytes: 3976
#include<iostream>
#include<cmath>

int main(int argc, char** argv) {
  int a, b;
  std::cin >> a;
  std::cin >> b;
  
  int c = std::max(a, b);
  if (a == b) {
    std::cout << a+b << std::endl;
  } else {
    std::cout << c + c - 1 << std::endl;
  }
  return 0;
}

Measured memory_bytes: 256
s = input()
l = []
n = len(s)
dp = [[0] * 13 for i in range(n)]
mod = 1000000007
for i in range(n):
    l.append(pow(10, i, 13))
if s[-1] == "?":
    for i in range(10):
        dp[0][i] += 1
else:
    dp[0][int(s[-1])] += 1
for i in range(n-1):
    if s[n-2-i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(j*l[i+1]+k)%13] += dp[i][k]
                dp[i+1][(j*l[i+1]+k)%13] %= mod
    else:
        for k in range(13):
            dp[i+1][(int(s[n-2-i])*l[i+1]+k)%13] += dp[i][k]
            dp[i+1][(int(s[n-2-i])*l[i+1]+k)%13] %= mod
print(dp[-1][5])

Measured memory_bytes: 66012
N, Q = gets.split.map(&:to_i)
S = gets.chomp

accum = []
accum[0] = 0
1.upto(S.size - 1) do |i|
  if (S[i - 1] + S[i]) == 'AC'
    accum[i] = accum[i - 1] + 1
  else
    accum[i] = accum[i - 1]
  end
end

# p accum

Q.times do
  l, r = gets.split.map(&:to_i)
  puts accum[r-1] - accum[l-1]
end


Measured memory_bytes: 3452