akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        private const int MODULO = 1000000007;
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static IEnumerable<int> Solve(int N, int[] A)
        {
            int cost = 0;
            int[] B = new int[N + 1];
            Array.Copy(A, 0, B, 1, N);
            for (int i = 0; i <= N; ++i) { cost += Math.Abs(B[(i + 1) % (N + 1)] - B[i]); }
            int[] costs = new int[N];
            for (int i = 0; i < N; ++i)
            {
                int i0 = i;
                int i1 = (i + 1) % (N + 1);
                int i2 = (i + 2) % (N + 1);
                costs[i0] = cost
                          - Math.Abs(B[i2] - B[i1])
                          - Math.Abs(B[i1] - B[i0])
                          + Math.Abs(B[i2] - B[i0]);
            }
            return costs;
        }
        static void Main(string[] args)
        {
            int N = ReadInt();
            int[] A = ReadInts();
            foreach (int cost in Solve(N, A))
            {
                Console.WriteLine(cost);
            }
        }
    }
}


Measured memory_bytes: 25692
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define INF 9223372036854775807
#define MOD 1000000007
#define pb push_back
#define F first
#define S second
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
ll n = 0, m = 0, ans = 0, sum = 0, cnt = 0, tmp = 0;
string s;
bool flag;
#pragma endregion
#define MAX 111111


int main(void) {
  ll c, k;
  vll t;
  cin >> n >> c >> k;
  FOR(i, 0, n) {
	cin >> tmp;
	t.pb(tmp);
  }
  sort(ALL(t));
  ll now = 0;
  while (now < n) {
	tmp = t[now] + k;
	cnt = 1;
	FOR(i, now + 1, now + c) {
	  if (i >= n) break;
	  if (t[i] > tmp) break;
	  cnt++;
	}
	now += cnt;
	ans++;
	//cout << now << endl;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1528
# -*- coding: utf-8 -*-
n,y = list(map(int, input().split(' ')));
match = False

try:
    for i in range(n, -1, -1):
        for j in range(n, -1, -1):
            if ( i + j > n ):
                continue
            k = n - i - j
            total = 10000 * i + 5000 * j + 1000 * k;
            if (total > 10000 * y ):
                break
            if (total == y):
                print( i,j,k )
                match = True
                raise Exception
except Exception:
    pass

if (not match): print("-1 -1 -1")

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
 
typedef pair<int, int> P;
 
bool compare(P a, P b) {
    if(a.first*a.first+a.second*a.second == b.first*b.first+b.second*b.second) return a.first < b.first;
    return a.first*a.first+a.second*a.second < b.first*b.first+b.second*b.second;
}
 
 
int main() {
    vector<P> vec;
    for(int i = 1; i <= 150; i++) {
        for(int j = i + 1; j <= 150; j++) {
            vec.push_back(P(i,j));
        }
    }
    sort(vec.begin(), vec.end(), compare);
    for(int h, w; cin >> h >> w, h || w; ) {
        int t;
        for(int i = 0; i < (int)vec.size(); i++) {
            if(P(h,w) == vec[i]) {
                t = i;
                break;
            }
        }
        cout << vec[t+1].first << ' ' << vec[t+1].second << endl;
    }
}

Measured memory_bytes: 1328
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file 
//#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define pb push_back
#define ff first
#define ss second
#define ii insert
#define ld long double
#define sz(x) (int)x.size()
#define all(v) v.begin(),v.end()
#define ppb pop_back
#define nuenxfiu ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout);
#define TT int testcases;cin>>testcases;while(testcases--)
#define mk make_pair
#define MAX ((int)2e9+17)
#define N 200005
#define mod ((int)1e9+7)
#define MOD 1000003
//int fact[1000007]={0};
int fpow(int n, int k, int p = mod) {int r = 1; while(k > 0) {if (k & 1) r = r * n%p; n = n * n%p; k = k >> 1;} return r;}
int expo(int x,int y){ int res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}
int sub(int a, int b) {return (a%mod - b%mod + mod)%mod;}
int mul(int a, int b) {return ((a%mod)*(b%mod) + mod)%mod;}
int inv(int x) {return expo(x, mod-2);}
using namespace std;





void solve()
{
	int a;double b;
	cin>>a>>b;
	
	
	int p=round(b*100);
	
	int q=a*p;
	q/=100;
	
	
	cout<<(int)q<<endl;
	
	
}
signed main()
{
    
	nuenxfiu
	//TT
	solve();
     return 0;
}

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

using i64 = long long;

int main() {
#ifdef HOME
	freopen("agc030a.in", "r", stdin);
	freopen("agc030a.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	i64 a, b, c;

	cin >> a >> b >> c;
	cout << b + min(a + b + 1, c) << endl;

	return 0; }



Measured memory_bytes: 384
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};



void solve(){
    ll n,k;
    ll a[100010],b[100010];
    ll cnt[100010]={};
    cin>>n>>k;
    rep(i,n){
        cin>>a[i]>>b[i];
        cnt[a[i]]+=b[i];
    }
    rep2(i,1,100001){
        // cout<<i<<" "<<k<<endl;
        if(cnt[i]>=k){
            cout<<i<<endl;
            return ;
        }
        else k-=cnt[i];
    }

}


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
typedef long long ll;
ll a[N],n,m,v,p;
int ans;
bool cmp(ll x,ll y) {
	return x>y;
}
int main() {
	scanf("%lld%lld%lld%lld",&n,&m,&v,&p);
	for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
	sort(a+1,a+n+1,cmp);
	ll d=a[p];
	ans=p;
	for(ll i=p+1;i<=n;i++) {
		if(a[i]+m>=a[p]) {
			ll cnt=max(0ll,v-(n-i+p)); //p~i-1 放的点数 
			if(cnt==0) ans++;
			else {
				if(d+cnt*m<=(a[i]+m)*(i-p))
					ans++;
				else break;
			}
		}
		else break;
		d+=a[i];
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 4572
N, M = gets.chomp.split().map(&:to_i)
X = gets.chomp.split().map(&:to_i).sort

X_pad = []
(M-1).times do |i|
  X_pad << X[i+1] - X[i]
end

X_pad.sort!
ans = 0
(M - 1 - (N - 1)).times do |i|
  ans += X_pad[i]
end

puts ans


Measured memory_bytes: 23568
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  ll a,b,k;
  cin>>a>>b>>k;
  if(k<=a)
    cout<<a-k<<" "<<b<<endl;
  else if(k<=a+b)
    cout<<0<<" "<<b-k+a<<endl;
  else
    cout<<0<<" "<<0<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
   ll int a,b;
cin>>a>>b;
if((a==1&&b==2)||(a==2&&b==1))
cout<<3;
if((a==2&&b==3)||(a==3&&b==2))
cout<<1;
if((a==1&&b==3)||(a==3&&b==1))
cout<<2;


return 0;
}

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

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  std::map<string, int> m;
  string s;
  rep(i, N) {
    cin >> s;
    m[s]++;
  }

  cin >> M;
  rep(i, M) {
    cin >> s;
    m[s]--;
  }

  int mx = 0;
  for (const auto& e : m) {
    if (mx < e.second) mx = e.second;
  }

  cout << mx << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string func(long long int n) {
	if (n < 0) {
		return "";
	}
	if (n < 26) {
		return string(1,'a' + n);
	}
	return func(n / 26 -1) + func(n % 26);
}
int main() {
	long long int n;
	cin >> n;
	cout << func(n-1) << endl;
}

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

int main(void){
    int h,w; cin >> h >> w;
    vector<vector<int>> mass(h,vector<int>(w));
    vector<vector<int>> ans;

    for(int i=0;i<h;i++)for(int j=0;j<w;j++) cin >> mass[i][j];
    
    for(int i=0;i<h;i++){
        if(i%2==0){
            for(int j=0;j<w;j++){
                if(mass[i][j]%2==1){
                    int n_x=i,n_y=j;
                    if(j+1<w){
                        n_y++;
                    }else{
                        n_x++;
                    }
                    if(n_x<h){
                        mass[n_x][n_y]++;
                        ans.push_back({i+1,j+1,n_x+1,n_y+1});
                        // cout << i << ' ' << j << ' ' << n_x << ' ' << n_y << endl;
                    }
                }
            }
        }else{
            for(int j=w-1;0<=j;j--){
                if(mass[i][j]%2==1){
                    int n_x=i,n_y=j;
                    if(0<=j-1){
                        n_y = j-1;
                    }else{
                        n_x = i+1;
                    }
                    if(n_x<h){
                        mass[n_x][n_y]++;
                        ans.push_back({i+1,j+1,n_x+1,n_y+1});
                        // cout << i << ' ' << j << ' ' << n_x << ' ' << n_y << endl;
                    }
                }
            }
        }
    }

    cout << ans.size() << endl;
    for(int i=0;i<ans.size();i++){
        cout << ans[i][0] << ' ' << ans[i][1] << ' ' << ans[i][2] << ' ' << ans[i][3] << endl;
    }
    return 0;
}

Measured memory_bytes: 9904
#include <stdio.h>
#include <math.h>
 
int isPrime(int);
 
int main(){
  int a[10000],i,n,c=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(isPrime(a[i])==1)c++;
  }
 printf("%d\n",c);
 return 0;
}
     
int isPrime(int x){
  int i;
  if(x==2)return 1;
  if(x<2||x%2==0)return 0;
  i=3;
  while(i<=sqrt(x)){
    if(x%i==0)return 0;
    i=i+2;
  }
  return 1;
}

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

typedef long long ll;

int main() {
    int A, B, C, X, Y;
    ll ans = 0;
    cin >> A >> B >> C >> X >> Y;

    int a = min(X, Y);
    X -= a;
    Y -= a;
    ll cost_a = 0;
    ll cost_b = 0;
    cost_a = A*a + B*a;
    cost_b = 2 * C * a;
    ans = min(cost_a, cost_b);
    if (X <= 0 && Y <= 0) {
        cout << ans << endl;
    } else if (X > 0) {
        cost_a = A*X;
        cost_b = 2 * C * X;
        ans += min(cost_a, cost_b);
        cout << ans << endl;
    } else {
        cost_a = B*Y;
        cost_b = 2 * C * Y;
        ans += min(cost_a, cost_b);
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>

using namespace std;
int main(){
int x,y,z;
cin>>x>>y>>z;
if(x>20||x<0||y>50||y<0||z>50||z<0)
    return 0;
if(x*y<z)
     cout<<x*y;
else cout<<z;


return 0;

}



Measured memory_bytes: 256
import scala.annotation.tailrec
import scala.collection.mutable

object Main extends App {

  import scala.io.StdIn._

  solve
  @tailrec
  def solve: Unit = {
    val record = readLine.trim
    if (record == "0") return
    val color = Color(record.drop(1))
    val colorName = Array("black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white")
    val colors = Array("000000", "0000ff", "00ff00", "00ffff", "ff0000", "ff00ff", "ffff00", "ffffff").map(Color(_))
    println(colors.indices.minBy(i ⇒ colors(i).distance(color)).let(colorName(_)))
    solve
  }
  object Color{
    def apply(expression: String): Color = Color(Integer.parseInt(expression.take(2), 16), Integer.parseInt(expression.drop(2).take(2), 16), Integer.parseInt(expression.drop(4), 16))
  }
  case class Color(red: Int, green: Int, blue: Int) {
    def distance(that: Color): Double = math.sqrt((red - that.red).let{it ⇒ it * it} + (green - that.green).let{it ⇒ it * it} + (blue - that.blue).let{it ⇒ it * it})
  }

  implicit class Extension[T](value :T){
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}


Measured memory_bytes: 56216
while True:
    a,b,c = input().split()
    a = int(a)
    c = int(c)
    if b == "+":
        print(a + c)
    if b == "-":
        print(a - c)
    if b == "*":
        print(a * c)
    if b == "/":
        print(a // c)
    if b == "?":
        break


Measured memory_bytes: 5596
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//配列はvector<>を使う：意味わからないエラーがなくなる。
//背反な事象にちゃんとわける
//チェックリストはマップを使う
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//またはかかつか
//例外処理は最初にする
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

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

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//円周率
const double PI = 3.14159265358979323846;
//割るやつ
const ll M = (pow(10, 9) + 7);

int main() {
	ll A, B, T; cin >> A >> B >> T;

	ll ans = 0;
	for (int i = 1; i * A <= T + 0.5; i++) ans += B;
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define endl "\n"
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define traceV(v) for(auto x:v)cout<<x<<" ";cout<<endl
#define traceM(mp) for(auto x:mp)cout<<x.first<<" "<<x.second<<endl

//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 2e+9 + 10;
typedef pair<ll, ll> P;

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

  int N,A,B; cin>>N>>A>>B;
  if((B-A)%2==0)cout <<"Alice" << endl;
  else cout << "Borys" << endl;

  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
const int MOD = (int)1e9 + 7;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()

int main(int argc, char const *argv[]) {
  string S;
  string zero_one;
  string one_zero;
  cin >> S;
  REP(i, S.size()) {
    if (i % 2 == 0) {
      zero_one.push_back('0');
      one_zero.push_back('1');
    } else {
      zero_one.push_back('1');
      one_zero.push_back('0');
    }
  }
  int temp1 = 0;
  int temp2 = 0;
  REP(i, S.size()) {
    if (S[i] != zero_one[i]) temp1++;
    if (S[i] != one_zero[i]) temp2++;
  }
  cout << min(temp1, temp2) << endl;
  ;
  return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
#define N 10000005
using namespace std;
const int p = 1000000007;
int n,k;
int jie[N],ni[N];
int c(int x,int y)
{
    return 1LL*jie[x]*ni[y]%p*ni[x-y]%p;
}
int f[2005][2005];
int main()
{
    jie[0]=ni[0]=ni[1]=1;
    for(int i=1;i<=10000000;i++)jie[i]=1LL*jie[i-1]*i%p;
    for(int i=2;i<=10000000;i++)ni[i]=1LL*(p-p/i)*ni[p%i]%p;
    for(int i=2;i<=10000000;i++)ni[i]=1LL*ni[i-1]*ni[i]%p;
    scanf("%d%d",&n,&k);
    if(k==1)return puts("1"),0;
    f[0][0]=1;
    for(int i=0;i<=n;i++)
    {
        //cout<<i<<endl;
        for(int j=n;j>=0;j--)
        {
           // cout<<i<<' '<<j<<endl;
            (f[i+1][j+1]+=1LL*f[i][j]*c((i+1)*k-j-2,k-2)%p)%=p;
            if(j)(f[i][j-1]+=f[i][j])%=p;
        }
    }
    int ans=1LL*f[n][0]*jie[n]%p;
    printf("%d\n",ans);
    return 0;
}


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

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

typedef vector<int> vi;
typedef vector<bool> vb;

int main()
{
	while (1)
	{
		int n; cin >> n;
		if (n == 0) return 0;

		vi x(n), y(n), r(n), c(n);
		rep(i, 0, n) cin >> x[i] >> y[i] >> r[i] >> c[i];
		bool ison[24][24];
		rep(i, 0, n) rep(j, 0, n)
		{
			int dd = (x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])*(y[i] - y[j]);
			int rr = (r[i] + r[j])*(r[i] + r[j]);
			if (dd >= rr)
				ison[i][j] = false;
			else
				ison[i][j] = true;
		}

		vb dp(1 << n, false);
		dp[0] = true;
		int ans = 0;
		int cc;
		bool ok;
		rep(i, 0, 1 << n)
		{
			if (!dp[i]) continue;

			cc = 0;
			rep(j, 0, n) if ((i & (1 << j)) != 0) cc++;
			ans = max(ans, cc);

			rep(j, 1, n)
			{
				if ((i & (1 << j)) != 0) continue;
				ok = true;
				rep(jj, 0, j) if ((i & (1 << jj)) == 0) if (ison[j][jj]) ok = false;
				if (!ok) continue;

				rep(k, 0, j)
				{
					if (c[j] != c[k]) continue;
					if ((i & (1 << k)) != 0) continue;
					ok = true;
					rep(kk, 0, k) if ((i & (1 << kk)) == 0) if (ison[k][kk]) ok = false;
					if (!ok) continue;

					dp[(i | (1 << j)) | (1 << k)] = true;
				}
			}
		}

		cout << ans << endl;
	}
}

Measured memory_bytes: 5112
import sys
from collections import defaultdict

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())

d = defaultdict(int)
for i in range(n):
    s = input().rstrip()
    d[s] += 1

ma = 0
for v in d.values():
    ma = max(ma, v)

a = sorted(d.items())
for k, v in a:
    if ma == v:
        print(k)


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

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

vector<int> solve(int N, int K, int C, const string& s)
{
    vector<int> ps(2*N + 2, 0), ms(2*N + 2, 0);

    for (int i = N - 1; i >= 0; --i)
    {
        if (s[i] == 'o')
            ps[i] = 1 + ms[i + C + 1];

        ms[i] = max(ms[i + 1], ps[i]);
    }
 
#ifdef DEBUG
    cout << "ps = ";
    for (int i = 0; i < N; ++i)
        cout << ps[i] << (i + 1 == N ? '\n' : ' ');

    cout << "ms = ";
    for (int i = 0; i < N; ++i)
        cout << ms[i] << (i + 1 == N ? '\n' : ' ');
#endif

    if (ms[0] > K)
        return { };

    auto L = 0;
    vector<int> ans;

    while (L < N)
    {
        int start = N;

        vector<int> xs;

        while (L < N and ms[L] == K)
        {
            if (ps[L])
            {
                xs.push_back(L + 1);
                start = min(start, L + 1);
            }

            ++L;
        }

        if (xs.size() == 1)
        {
            ans.push_back(xs.front());
            L = ans.back() + C;
        } else
            L = start + C;            

        --K;
    }

    return ans;
}

int main()
{
    ios::sync_with_stdio(false);

    int N, K, C;
    cin >> N >> K >> C;

    string S;
    cin >> S;

    auto ans = solve(N, K, C, S);

    for (auto x : ans)
        cout << x << '\n';

    return 0;
}


Measured memory_bytes: 7604
/*                                                                                 
	Author :- Gaurang_Kothiya
	
	Quote :- " Practice makes a man perfect. "		
*/  
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  
 
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> data_set; 
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ld long double
#define f(i,x,n) for(auto i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(auto i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
const ll inf= 1e9;
const ll inf64= 1e18;
const ll MOD= 1e9 +7;





void Solve()
{
	int n,k;
	cin>>n>>k;
	v(ll) vec(n);
	fe(x,vec) cin>>x;
	sort(all(vec));
	ll ans= accumulate(vec.B,vec.B+k,0);
	cout<<ans;
} 
 
signed main() 
{
	speed		
	
	int q=1;
	//cin>>q;
	
	while(q--)
	Solve();
	
	return 0;
} 

Measured memory_bytes: 3656
// 17.07.2017


# include <iostream>
# include <algorithm>


using namespace std;

# define lint long long int

//# define __TRR__

const int N = 200100;

int a [N], n, k, m, mi;

int main ()
{
# ifdef __TRR__
   freopen ("C.TXT", "r", stdin);
   freopen ("C.OUT", "w", stdout);
# endif

   cin >> n;

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

   if ( n % 2 == 0 )
   {
      for ( int i = n-1; i > 0; i-=2 )
         cout << a [i] << " ";
      for ( int i = 0; i < n-1; i+=2 )
         cout << a [i] << " ";
   }
   else
   {
      for ( int i = n-1; i >= 0; i-=2 )
         cout << a [i] << " ";
      for ( int i = 1; i < n-1; i+=2 )
         cout << a [i] << " ";
   }

   return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <string>
using namespace std;
int main()
{
  string s, t;
  int counter = 0;
  cin >> s >> t;

  for (int i = 0; i < s.length(); i++)
  {
    if (s[i] != t[i])
    {
      counter++;
    }
  }

  cout << counter << endl;
  return 0;
}

Measured memory_bytes: 3848
#include <stdio.h>

int p, m;

void x1(int a, int b)
{
    if (b == 0) p = m = 0;
    else if (b > 0) p = 0, m = 1;
    else p = 1, m = 0;
}

void x2(int a, int b, int c)
{
    if (c == 0) {
        x1(a, b);
        return;
    }
    if (b*b-4*a*c < 0) p = m = 0;
    else {
        if (c < 0) p = m = 1;
        else if (b > 0) p = 0, m = 2;
        else p = 2, m = 0;
    }
}

void x(int a, int b, int c, int d)
{
    int e, f1, f2;
    
    if (a < 0) {
        x(-a, -b, -c, -d);
        return;
    }
    if (d == 0) {
        x2(a, b, c);
        return;
    }
    
    long long df = (long long)b*b*c*c - 4*(long long)a*c*c*c - 4*(long long)b*b*b*d - 27*(long long)a*a*d*d + 18*(long long)a*b*c*d;
    
    e = b*b - 3*a*c;
    
    f1 = f2 = 0;
    if (b*b < e) f1 = f2 = 1;
    else f1 = b < 0, f2 = b > 0;
    
    if (df >= 0) {
        if (e == 0) {
            if (b > 0) p = 0, m = 3;
            else p = 3, m = 0;
            return;
        }
        if (d > 0) {
            if (!f1) p = 0, m = 3;
            else p = 2, m = 1;
        } else {
            if(!f2) p = 3, m = 0;
            else p = 1, m = 2;
        }
    } else {
        if (d > 0) p = 0, m = 1;
        else p = 1, m = 0;
    }
}

int main(void){
    int n, a, b, c, d;
    
    scanf("%d",&n);
    while(n-- > 0) {
        scanf("%d%d%d%d", &a, &b, &c, &d);
        x(a, b, c, d);
        printf("%d %d\n", p, m);
    }
    return 0;
}



Measured memory_bytes: 1988
#include<iostream>
#define INT_MAX 1000000
#include <cstring>
using namespace std;

int main()
{
  int n, k;
  cin >> n >> k;
  int arr[n];
  for(int i=0; i<n; i++)
    cin>>arr[i];
  int cost[n];
  memset(cost, INT_MAX, sizeof cost);
  cost[0] = 0;
  for(int i=1; i<n; i++)
  {
    if (i<=k)
    {
      for(int j=0; j<i; j++)
        cost[i] = min(cost[i], abs(arr[i]-arr[j])+cost[j]);
    }
    else
    {
      for(int j=i-k; j<i; j++)
        cost[i] = min(cost[i], abs(arr[i]-arr[j])+cost[j]);
    }
  }
  cout<<cost[n-1];
  return 0;
}

Measured memory_bytes: 4408
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

int main() {
  int A, B, K; cin >> A >> B >> K;
  vector<int> v;
  for (int i = 1; i <= min(A, B); ++i) {
    if (A % i == 0 && B % i == 0) v.push_back(i);
  }

  int N = v.size();
  cout << v[N-K] << endl;
}


Measured memory_bytes: 256
//#include<bits\stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<string>
#include<ctime>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<algorithm>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#define ll long long
#define db double
#define INF 1000000000
#define ldb long double
#define pb push_back
#define get(x) x=read()
#define gt(x) scanf("%d",&x)
#define gi(x) scanf("%lf",&x)
#define put(x) printf("%d\n",x)
#define putl(x) printf("%lld\n",x)
#define gc(a) scanf("%s",a+1)
#define rep(p,n,i) for(RE ll i=p;i<=n;++i)
#define go(x) for(ll i=lin[x],tn=ver[i];i;tn=ver[i=nex[i]])
#define fep(n,p,i) for(RE ll i=n;i>=p;--i)
#define pii pair<ll,ll>
#define mk make_pair
#define RE register
#define P 1000000007
#define mod 998244353
#define S second 
#define F first
#define gf(x) scanf("%lf",&x)
#define pf(x) ((x)*(x))
#define ull unsigned long long
#define ui unsigned
#define zz p<<1
#define yy p<<1|1
using namespace std;
char buf[1<<15],*fs,*ft;
inline char getc()
{
    return (fs==ft&&(ft=(fs=buf)+fread(buf,1,1<<15,stdin),fs==ft))?0:*fs++;
}
inline ll read()
{
    register ll x=0,f=1;register char ch=getc();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getc();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getc();}
    return x*f;
}
const ll MAXN=200010;
char a[MAXN];
ll n;
ll vis[MAXN];
signed main()
{
	//freopen("1.in","r",stdin);
	gc(a);ll ans=0;
	n=strlen(a+1);
	ll ww=0;
	int cc=1;
	vis[0]=1;
	fep(n,1,i)
	{
		ww=ww+(a[i]-'0')*cc;
		ww%=2019;cc=cc*10;cc%=2019;
		ans+=vis[ww];
		++vis[ww];
	}
	putl(ans);
	return 0;
}


Measured memory_bytes: 3948
#include <stdio.h>
#include <ctype.h>

int main(void)
{
    char ch;

    while(1) {
        scanf("%c", &ch);
        if(ch=='\n') {
            printf("\n");
            break;
        }
        if(islower(ch))
            printf("%c", toupper(ch));
        else if (isupper(ch))
            printf("%c", tolower(ch));
        else
            printf("%c", ch);
    }

    return 0;
}

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

int main() {
  int N,K;
  cin >> N >> K;
  int a[N];
  for(int i=0; i< N;i++){
  	cin >> a[i];
  }
  sort(a,a+N);
  int r=1000000000;
  for(int j=0; j<N-K+1;j++){
  		r= min(r,a[j+K-1]-a[j]);
  }
  cout << r << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include <stdio.h>
#include <algorithm>

#define all(x) x.begin(),x.end()
#define sc(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define pr(x) printf("%d",x)
#define prl(x) printf("%lld",x)
#define LL long long
#define pb push_back
#define PB pop_back
#define PF pop_front
#define F first
#define S second
#define inrow(vec)    for(int i=0;i<vec.size();i++)cout<<vec[i]<<" ";
#define incoloum(vec) for(int i=0;i<vec.size();i++)cout<<vec[i]<<endl;

const double PI=3.1415926;
const int KL=1e6;

using namespace std;

LL q,x,y,z,n,m,p[KL],mn=1e9,mx=-1e9,ans;
string t;
vector <LL> vec;
set <int> s;
map <int,int> M;


int main()
{
    scl(n);scl(m);
    cout<<(n+m-1)/m;
   return 0;
}


Measured memory_bytes: 256
H,W = map(int,input().split())
N = int(input())
arr = [0] + list(map(int,input().split()))
c = [[-1]*W for _ in range(H)]
goto = [[0,1],[1,0],[0,-1],[-1,0]] #right,down,left,up


q = 1
h = 0
w = 0
cnt = 0
g = 0
count = 0

def judge(tmph,tmpw):
    ok = False
    if tmph >= 0 and tmph < H and tmpw >= 0 and tmpw < W:
        if c[tmph][tmpw] < 0:
            ok = True
    return ok
for _ in range(H*W):
    c[h][w] = q
    cnt += 1
    if cnt == arr[q]:
        q += 1
        cnt = 0
    tmph = h + goto[g][0]
    tmpw = w + goto[g][1]
    for i in range(4):
        if judge(tmph,tmpw):
            break
        g += 1
        g %= 4
        tmph = h + goto[g][0]
        tmpw = w + goto[g][1]
    h = tmph
    w = tmpw

for i in c:
    print(*i)

Measured memory_bytes: 3828
#include <bits/stdc++.h>
 
using namespace std;
#define int long long
 
int ans, p10[50];
 
void solve(int p1, int p2, int rem, int nmult) {
    if (p1 <= p2) {
        if (p1 == p2) nmult *= 10;
        if (rem == 0) ans += nmult;
        return;
    }
    int ndiff = p10[p1] - p10[p2];
    for (int i = -9; i <= 9; i++) {
        int knew = rem + i * ndiff;
        if (abs(knew) < p10[p1]) {
            int nways = 10 - abs(i);
            if (p2 == 0 && i <= 0) nways--;
            solve(p1 - 1, p2 + 1, knew, nmult * nways);
        }
    }
}
 
int32_t main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    ans = 0;
    p10[0] = 1;
    for (int i = 1; i < 50; i++)
        p10[i] = p10[i - 1] * 10;
    int D;
    cin >> D;
    for (int i = 1; i <= 18; i++)
        solve(i - 1, 0, D, 1);
 
    cout << ans << "\n";
    return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a, b) accumulate(all(a), b)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
typedef unsigned long long ull;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
ll const INF = 1e18;

template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}

class Combination{
public:
    ll N;
    ll mod;
    vector<ll> fact;

    Combination(ll n, ll m) : N(n), mod(m), fact(n+1){
        fact.at(0) = 1;
        for(ll i=1; i<=N; i++){
            fact.at(i) = i * fact.at(i-1) % mod;
        }
    }

    ll POW(ll a, ll b){
        ll res = 1;
        while(b > 0){
            if(b & 1){
                res = res * a % mod;
            }
            a = a * a % mod;
            b >>= 1;
        }
        return res;
    }

    ll combin(ll n, ll k){
        if(n < 0 || k < 0 || n < k){
            return 1;
        }
        return fact.at(n) * POW(fact.at(k) * fact.at(n-k) % mod, mod - 2) % mod;
    }
};

signed main(){
    ll n, a, b, c;
    cin >> n >> a >> b >> c;

    Combination C(2*n, MOD);

    vector<ll> powa(2*n+1, 1), powb(2*n+1, 1), powc(2*n+1, 1), pow100(2*n+1, 1);
    REP(i, 2*n){
        powa[i+1] = powa[i] * a % MOD;
        powb[i+1] = powb[i] * b % MOD;
        powc[i+1] = powc[i] * (100 - c) % MOD;
        pow100[i+1] = pow100[i] * 100 % MOD;
    }

    ll ans = 0;

    FOR(i, n, 2*n){
        ll x = C.combin(i-1, n-1) * ((powa[n]*powb[i-n]%MOD + powa[i-n]*powb[n]%MOD) % MOD) % MOD;
        x = (x * i * 100) % MOD;
        x *= C.POW(powc[i+1], MOD-2);
        x %= MOD;
        ans = (ans + x) % MOD;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8064
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <deque>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <climits>

using namespace std;

int main(){
    int n;
    string s;
    cin >> n >> s;
    vector<bool> ans(n);
    bool found=false;
    for(int i=0; i<4; ++i){
        ans[0]=bool(i & 0x1);
        ans[1]=bool(i & 0x2);
        for(int j=1; j<n-1; ++j){
            if(ans[j] && s[j]=='o') ans[j+1]=ans[j-1];
            else if(ans[j] && s[j]=='x') ans[j+1]=!ans[j-1];
            else if(!ans[j] && s[j]=='o') ans[j+1]=!ans[j-1];
            else if(!ans[j] && s[j]=='x') ans[j+1]=ans[j-1];
        }
        found=true;
        for(int j=-1; j<1; ++j){
            int jl=(j+n-1)%n, ji=(j+n)%n, jr=j+1;
            if(ans[ji] && s[ji]=='o') found=found && !(ans[jl] ^ ans[jr]);
            else if(ans[ji] && s[ji]=='x') found=found && (ans[jl] ^ ans[jr]);
            else if(!ans[ji] && s[ji]=='o') found=found && (ans[jl] ^ ans[jr]);
            else if(!ans[ji] && s[ji]=='x') found=found && !(ans[jl] ^ ans[jr]);
        }
        if(found) break;
    }
    if(found){
        for(int i=0; i<n; ++i){
            cout << (ans[i] ? 'S' : 'W');
        }
        cout << endl;
    } else cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <functional>
#include <list>
#include <utility>
#include <map>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll, ll> Pll;
typedef pair<int, Pii > P1;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define mp1(a,b,c) P1(a,P(b,c))
#define get_arsize(a) (sizeof(a)/sizeof(a[0]))
const ll mod = 1000000007;
const double eps = 1e-10;
const int MAX = 200000;

int main() {
	int a,b;
	cin >> a >> b;
  if (a > 9 || b > 9) {
    cout << "-1" << endl;
  } else {
    cout << a * b<< endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
#define INF 0x3f3f3f3f
const int maxn=2e5+10,mod=998244353;
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
int n,R[maxn],L[maxn];
int b[maxn]={0},c[maxn],d[maxn];
long long f[maxn];
struct Node
{
    int x,d;
}a[maxn];
bool operator <(Node A,Node B) { return A.x<B.x;}

int lowbit(int x) {return x&-x;}
void add(int x,int k)
{
    while(x<=n)
        b[x]=max(b[x],k),x+=lowbit(x);
}
int query (int L, int R) 
{
	int ret = 0, len = R-L+1;
	while (len && R)
    { 
		if (len < lowbit(R)) 
        {
			ret = max (ret, b[R]);
			R--; len--;
		} 
        else 
        {
			ret = max (ret, b[R]);
			len -= lowbit(R); 
			R -= lowbit(R); 
		}
	}
	return ret;
}

int query1 (int L,int R) 
{
	int ret = 0;
	while (L<=R)
    { 
		ret = max (ret, b[R]);
		R -= lowbit(R); 
	}
	return ret;
}

int main()
{
    #ifdef __LOCAL__
        freopen("1.in","r",stdin);
        freopen("1.out","w",stdout);
    #endif
    scanf("%d",&n);
    _rep(i,1,n)
        scanf("%d%d",&a[i].x,&a[i].d);
    sort(a+1,a+n+1);

    // R[n]=n;
    // for(int i=1;i<n;i++)
    // {
    //     int j=i,far=a[i].x+a[i].d;
    //     while(far>a[j+1].x&&j<n)
    //     {
    //         far=max(far,a[j+1].x+a[j+1].d);    
    //         j++;
    //     }                
    //     R[i]=j;
    // }

    _rep(i,1,n)
        b[i]=lower_bound(a+1,a+1+n,(Node){a[i].x+a[i].d,0})-a-1;    

    //i~b[i]-1
    // _rep(i,1,n)
    // {
    //     int mx=b[i];
    //     for(int j=i;j<=mx;j++)
    //     {
    //         d[i]=max(d[i],b[j]);
    //         if(b[j]>mx)
    //             mx=b[j];
    //     }
    // }
    // for(int i=1;i<=n;i++)
    //     cout<<R[i]<<" "<<d[i]<<endl;

    for(int i=n;i>=1;i--)
    {
        L[i]=max(i,query1(i,b[i]));
        add(i,L[i]);
    }

    // for(int i=n;i>=1;i--)
    //     cout<<i<<" "<<R[i]<<" "<<L[i]<<endl;

    f[n+1]=1;
    for(int i=n;i>=1;i--)
        f[i]=(f[i+1]+f[L[i]+1])%mod;

    cout<<f[1]<<endl;
    return 0;
}

Measured memory_bytes: 6528
n = int(input())
a = list(map(int, input().split()))
f = list(filter(lambda x: x % 2 == 0, a))
for i in f:
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        print('DENIED')
        exit()
else:
    print('APPROVED')


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

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  int a;
  cin >> a;
  string s;
  cin >> s;
  if (a >= 3200)
    cout << s << endl;
  else
    cout << "red" << endl;
}


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

#define ll long long
#define pb push_back
#define vi vector<int>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define sizeOf(A) (sizeof(A))/(sizeof(A[0]))
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
const ll MOD = 1e9 + 7;

int main() {
    fastio;

    string s;
    cin >> s;
    cout << s[0] << s.size()-2 << s[s.size()-1] << "\n";
    return 0;
}


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

int main(){
  int a, b;
  cin >> a >> b;
  if( a >= 13 ) cout << b;
  else if (a >= 6 && a <= 12) cout << b/2;
  else if (a <= 5) cout << 0;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var L = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            Array.Sort(L);
            var answer = 0;
            for (int i = 0; i < L.Length; i++)
            {
                var a = L[i];
                for (int j = i + 1; j < L.Length; j++)
                {
                    var b = L[j];
                    answer += LowerBound(L, a + b) - 1 - j;
                }
            }

            Console.WriteLine(answer);
        }

        //引数省略のオーバーロード
        public static int LowerBound<T>(T[] arr, T value) where T : IComparable
        {
            return LowerBound(arr, 0, arr.Length, value, Comparer<T>.Default);
        }

        /// <summary>
        /// 指定した値以上の先頭のインデクスを返す
        /// </summary>
        /// <typeparam name="T">比較する値の型</typeparam>
        /// <param name="arr">対象の配列（※ソート済みであること）</param>
        /// <param name="start">開始インデクス [inclusive]</param>
        /// <param name="end">終了インデクス [exclusive]</param>
        /// <param name="value">検索する値</param>
        /// <param name="comparer">比較関数(インターフェイス)</param>
        /// <returns>指定した値以上の先頭のインデクス</returns>
        public static int LowerBound<T>(T[] arr, int start, int end, T value, IComparer<T> comparer)
        {
            int low = start;
            int high = end;
            int mid;
            while (low < high)
            {
                mid = ((high - low) >> 1) + low;
                if (comparer.Compare(arr[mid], value) < 0)
                    low = mid + 1;
                else
                    high = mid;
            }
            return low;
        }
    }
}


Measured memory_bytes: 13428
#include<stdio.h>

int main(){
  int k,a,b,c;

  while(scanf("%d%d",&a,&b)!=EOF){
    c = a+b;
    for(k=0;c>0;k++)
      c /=10;
 
    printf("%d\n",k);
  }
  return 0;
}

Measured memory_bytes: 600
#include<stdio.h>
 
int dp[50];
 
int fib(int n) {
   if ( n == 0 || n == 1 ) 
      return dp[n] = 1;
   if ( dp[n] != -1 )
      return dp[n];
   return dp[n] = fib(n - 1) + fib(n - 2);
}
 
int main() {
   int n, i;
   for ( i = 0; i < 50; i++) 
      dp[i] = -1;
 
   scanf("%d", &n);
   printf("%d\n", fib(n));
 
   return 0;
}

Measured memory_bytes: 1852
using System;

namespace Sample101
{
    class Program
    {
        // 各桁の和を計算
        static int findSumOfDigits(int n)
        {
            int sum = 0;
            while (n > 0)
            {
                sum += n % 10;
                n /= 10;
            }
            return sum;
        }

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int result;

            result = 1 + findSumOfDigits(N - 1);

            for (int i = 2; i < N / 2; ++i)
            {
                int A = i;
                int B = N - i;
                int temp = findSumOfDigits(A) + findSumOfDigits(B);
                if (temp < result)
                {
                    result = temp;
                }
            }

            Console.WriteLine(result);
        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()
#define chmax(x,y) x=max(x,y)




int main(){
    int a,b,c,d,e,f; cin>>a>>b>>c>>d>>e>>f;
    int ansf=1,anss=0;
    int nowf=0, nows=0;
    rep(i,35){
        rep(j,35){
            nowf=a*100*i+b*100*j;
            if(i==0 && j==0) continue;
            if(a*100*i+b*100*j>f) break;
            int cnt=0;
            while(1){
                if(nowf+cnt*d>f) break;
                int lim=nowf/100;
                lim*=e;
                if(cnt*d>lim) break;
                int cc=max(0, min(lim-cnt*d, f-nowf-cnt*d))/c;
                nows=cnt*d+c*cc;
                if(nows*ansf>anss*nowf){
                    anss=nows;
                    ansf=nowf;
                }
                cnt++;
            }
        }
    }
    if(ansf==1){
        cout<<100*a<<" "<<0<<endl;
        return 0;
    }
    cout<< ansf+anss <<" "<< anss <<endl;
    return 0;
}

Measured memory_bytes: 3612
import java.io.*;
import java.util.*;

class Main{
	public static void main(String[] args) throws Exception{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		HashSet<Integer> set = new HashSet<>(n);
		int result = 0;
		for(String _s : reader.readLine().split(" ")) {
			int _num = Integer.parseInt(_s);
			if(set.contains(_num)) {
				result++;
			}else {
				set.add(_num);
			}
		}
		System.out.println(n-(result+((result%2==1)?1:0)));
	}
}


Measured memory_bytes: 34924
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		BigDecimal result = new BigDecimal("1");
		int n = sc.nextInt();

		double sum = 0;

		for(int i=0;i < n;i++) {
			BigDecimal next = new BigDecimal(sc.nextInt());
			BigDecimal div = BigDecimal.ONE.divide(next,10,BigDecimal.ROUND_HALF_UP);
			sum += div.doubleValue();
		}

		System.out.println(BigDecimal.ONE.divide(new BigDecimal(sum),20,BigDecimal.ROUND_HALF_UP));

	}
}

Measured memory_bytes: 21972
#include<stdio.h>

int main(void){
  int N;
  int i,j,k;
  scanf("%d",&N);
  N--;
  printf("3 ");
  for(i=13;i<=55555 && N>0;i+=10){
    for(j=3;j*j<=i;j+=2){
      if(i%j==0) break;
    }
    if(i!=3 && i%j==0) continue;
    N--;
    printf("%d%c",i,N==0?'\n':' ');
  }
  return 0;
}


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

  int N;
  cin >> N;
  vector <int> A(N);
  bool isOdd = false;
  int count = 0;

  for (int i = 0; i < N; i++){
    cin >> A.at(i);
    if (A.at(i) % 2 != 0){
      isOdd = true;
    }
  }

  while (true){
    if (isOdd) {
      break;
    }
    count++;
    for (int i = 0; i < N; i++){
      A.at(i) = A.at(i) / 2;
    }
    for (int i = 0; i < N; i++){
      if (A.at(i) % 2 != 0){
        isOdd = true;
      }
    }
  }

  cout << count << endl;

}


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

int main() {
  int a,b,c;cin>>a>>b>>c;
  for(int i=1;i<100000;i++){
    int ans=a*i;
    if(ans%b==c){
      cout<<"YES"<<endl;
      return 0;
    }
  }
  cout<<"NO"<<endl;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define double long double
#define int long long
#define low lower_bound
#define upp upper_bound
#define mod 1000000007 //10^9+7
#define inf 10000000000000000 //10^16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
#define cend cout<<endl;
using namespace std;

int mypow(int x,int a) {
  if(a==0) return 1;
  if(a%2) return x*mypow(x,a-1);
  return mypow(x*x,a/2);
}

signed main() {
  int a,b;
  cin>>a>>b;
  a--;
  int ans=0;
  rep(i,40) {
    int n=mypow(2,i+1);
    int cnt=0;
    cnt+=b/n*(n/2);
    cnt+=max((int)0,b%n-n/2+1);
    cnt-=a/n*(n/2);
    cnt+=max((int)0,a%n-n/2+1);
    if(cnt%2==1) ans+=n/2;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
def main():
    s = list(str(input()))
    if s.count('R') == 3:
        print(3)
        return
    elif s.count('R') == 2 and s[1] == 'S':
        print(1)
        return
    elif s.count('R') == 2:
        print(2)
        return
    elif s.count('R') == 1:
        print(1)
        return
    else:
        print(0)
        return
main()

Measured memory_bytes: 9040