akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h> 

using namespace std;

typedef short sho;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
typedef string str; 
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll; 
typedef pair<ld,ld> pld;
 
typedef vector<int> vi; 
typedef vector<ll> vl; 
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pld> vpd;

#define LOCAL
#define MP make_pair 
#define FF first
#define SS second
#define sz(x) (int)x.size()
#define begin(x) (x).begin() 
#define end(x) (x).end()
#define rbegin(x) (x).rbegin()
#define rend(x) (x).rend()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define PF push_front 
#define PB push_back
#define PP push
#define lb lower_bound 
#define ub upper_bound
#define lowbit(x) x&(-x)
#define testbit(x,i) x&(1<<i)

inline void checkmin(int &x,int y){x=min(x,y);}
inline void checkmax(int &x,int y){x=max(x,y);}

int k,a,b;

int main() 
{
	#ifndef LOCAL
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /* start code */
	cin>>k>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(i%k==0)
		{
			cout<<"OK"<<endl;
			return 0;
		}
	}
	cout<<"NG"<<endl;
    /* end code */
	return 0;
}

Measured memory_bytes: 3652
#include<stdio.h>

int main(int argc,const char * argv[])
{
    int n,i,x;
    long int g;
    int max = -1000001;
    int min = 1000000;
    g = 0;
    
    scanf("%d", &n);
    
    for (i=1;i<=n;i++) {
        scanf("%d",&x);
        g = g + x;
        if (max<x) {
            max = x;
        }
        if(min>x) {
            min = x;
        }
    }
    printf("%d %d %ld\n", min, max, g);
    return 0;
}



Measured memory_bytes: 2140
def digit(a,b):
    a = str(a)
    b = str(b)
    return max(len(a),len(b))

def makedivisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n//i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
l = makedivisors(n)
m = 10**9
for a in range(len(l)):
    for b in range(a,len(l)):
        if l[a] * l[b] == n:
            m = min(m,digit(l[a],l[b]))
print(m)
    


Measured memory_bytes: 9204
/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

#define bip(n) __builtin_popcount(n)//no of ones bit in binary!!
#define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!!
#define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!!
#define bffs(n) __builtin_ffs(n)//index of first one bit!!

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

//#define fi1 ifstream fin("input.txt")
//#define of1 ofstream fout("output.txt")
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	cout<<180*(n-2);
    return 0;
}

Measured memory_bytes: 256
#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 _GLIBCXX_DEBUG

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vvd = vector<vd>;
using vvvi = vector<vvi>;
using vvvll = vector<vvll>;
using vvvd = vector<vvd>;

const double pi=3.141592653589793;
const ll MOD=1e9+7;

int main() {
    int n;
    cin>>n;
    ll ans=0;
    for (int i=1;i<n+1;i++){
        if (i%3!=0 && i%5!=0){
            ans+=i;
        }
    }
    cout<<ans<<endl;
    

    return 0;
}

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

#define ll long long
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
// #define forn(i,n) for(ll i=0; i<(n); i++)
#define forn for(ll i=0; i<(n); i++)
#define fori(i,k,n) for(ll i=k; i<(n); i++) 
#define all(x) (x).begin(),(x).end()
#define en '\n'
#define FILL(x,v) memset(x,v,sizeof(x))
#define pb push_back


template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
 
template<typename T> void print(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
 
template<typename T> void print(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}
void min_self(int &a, int b){
	a = min(a, b);
}

const int INF = 1e9 + 5;

void solve(){
	int s, w; cin >> s >> w;
	if(w>=s){
		cout << "unsafe" << en;
	} else cout << "safe" << en;
}

int main(){
    ios::sync_with_stdio(0);
	cin.tie(0);
    cout.tie(0);
 
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
    return 0;
}

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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18 + 1;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll N;

signed main() {
    cin >> N;
    ll T = 1, A = 1;
    REP(i, N) {
        LCIN(a, b);
        ll n1 = T / a;
        ll n2 = A / b;
        if(T % a) n1++;
        if(A % b) n2++;
        ll n = max(n1, n2);
        T = n * a;
        A = n * b;
    }
    cout << T + A << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vector<ll> > vvl;
typedef vector<vector<P> > vvp;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll x,y;
  cin >> x >> y;
  ll ans=0;
  ll cnt=1;
  while(y/x>=cnt){
    cnt*=2;
    ans++;
  }
  cout << ans << endl;
  return 0;     
}


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;

struct point{
    ll x, y;
};

/*FUNCs=================================================*/



/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化

    vii c(3,vi(3));
    for(int i = 0; i < 3; i++){
        for(int j  = 0; j < 3 ;j++){
            cin >> c[i][j];
        }
    }
    bool ans = true;
    if(!((c[0][0] - c[1][0]) == (c[0][1] - c[1][1]) && (c[0][1] - c[1][1]) == (c[0][2] - c[1][2]))) ans = false;
    if(!((c[1][0] - c[2][0]) == (c[1][1] - c[2][1]) && (c[1][1] - c[2][1]) == (c[1][2] - c[2][2]))) ans = false;
    if(!((c[0][0] - c[0][1]) == (c[1][0] - c[1][1]) && (c[1][0] - c[1][1]) == (c[2][0] - c[2][1]))) ans = false;
    if(!((c[0][1] - c[0][2]) == (c[1][1] - c[1][2]) && (c[1][1] - c[1][2]) == (c[2][1] - c[2][2]))) ans = false;

    cout << (ans ? "Yes" : "No") << "\n";
}


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

ll knapSack(ll w,ll wei[],ll val[],ll n)
{
    ll kVal[n+1][w+1],i,j;
    for(i=0;i<=n;i++){
            for(j=0;j<=w;j++){
    if(i==0||j==0)
    {
        kVal[i][j]=0;
    }
    else if(wei[i-1]>j)
    {
        kVal[i][j]=kVal[i-1][j];
    }
    else{
        kVal[i][j]= max(val[i-1]+kVal[i-1][j-wei[i-1]],kVal[i-1][j]);
    }
    }
    }
    return kVal[n][w];
}
int main()
{
    ll n,i,j,cnt=1,k,w,a,b,t;
   /* freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);*/
	cin>>n>>w;
	ll wei[n];
	ll val[n];
	for(i=0;i<n;i++)
    {
        cin>>wei[i]>>val[i];
    }
   cout<<knapSack(w,wei,val,n);



	    return 0;
}


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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

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

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

using vec = vint;
using mat = vector<vec>;

mat mul(const mat& A, const mat& B) {
  mat C(A.size(), vec(B[0].size()));
  for(int i = 0; i < (int)A.size(); i++) {
    for(int j = 0; j < (int)B.size(); j++) {
      for(int k = 0; k < (int)B[0].size(); k++) {
	C[i][k] += A[i][j] * B[j][k] % mod;
	C[i][k] %= mod;
      }
    }
  }
  return C;
}

mat pow(mat A, int n) {
  mat B(A.size(), vec(A.size()));
  for(int i = 0; i < (int)A.size(); i++) B[i][i] = 1;
  while(n > 0) {
    if(n & 1) B = mul(B, A);
    A = mul(A, A);
    n >>= 1;
  }
  return B;
}

int F(int n) {
  mat A(2, vec(2));
  A[0][0] = 1; A[0][1] = 1;
  A[1][0] = 1; A[1][1] = 0;
  mat b(2, vec(1));
  b[0][0] = 1; b[1][0] = 0;
  b = mul(pow(A, n), b);
  return b[0][0];
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  if(0) {
    reps(i, 2, 20) {
      reps(j, 1, i/2+1) cout << F(j)*F(i-j) << " ";
      cout << endl;
    }
  }

  int K;
  cin >> K;

  int row = -1;
  {
    int lb = 0, ub = 3e9;
    while(lb+1 < ub) {
      int mb = (lb+ub)/2;
      //cout<<(mb/2)*((mb+1)/2)<<endl;
      if((mb/2)*((mb+1)/2) < K) lb = mb;
      else ub = mb;
    }
    //cout << lb << endl;
    K -= (lb/2)*((lb+1)/2);
    row = ub;
  }
  //cout<<K<<endl;
  int col = -1;
  if(K <= (row/2+1)/2) {
    col = 2*(K-1)+1;
  } else {
    K -= (row/2+1)/2;
    //cout<<"!"<<K<<endl;
    col = 2*(row/2/2-(K-1));
    //cout<<col<<endl;
  }
  cout << F(col)*F(row-col)%mod <<endl;

  return 0;
}



Measured memory_bytes: 3220
raw1 = gets.split(" ").map{|nn|nn.to_i}
n = raw1[0]
request_amount = raw1[1]

class Shop
  attr_accessor :price,:amount
  def initialize(a,b)
    self.price = a;
    self.amount = b;
  end

  def <=> (other)
    return self.price - other.price
  end
end

shops = []
n.times do
  raw = gets.split(" ").map{|nn|nn.to_i}
  shops << Shop.new(raw[0],raw[1])
end

shops.sort!{|nn,mm| nn <=> mm};
money = 0
bought = 0
shops.each{|elem|
  while(bought < request_amount)
    money += elem.price
    bought += 1
    elem.amount -= 1
    break if elem.amount == 0
  end
}

puts money.to_s

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

int main() {
  int a,b,r,sum;
  cin >> a >> b;
  sum = a + b;
  if(sum%2==0){
    r = sum/2;
  }else{
    r=sum/2+1;
  }
  cout << r << endl;
}


Measured memory_bytes: 256
i = []
for x in range(5):
    i.append(int(input()))

last = min([10 if x % 10 == 0 else x % 10 for x in i])
s = 0
for x in i:
    if x % 10 == 0:
        s += x
    else:
        s += (int(x / 10) + 1) * 10
s = s + last - 10
print(str(s))

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

int main() {
  string s;
  cin >> s;
  bool exist[26] = {false};
  for (int i = 0; i < s.size(); i++) exist[s[i] - 'a'] = true;
  for (int i = 0; i < 26; i++) {
    if (exist[i] == false) {
      cout << (char)('a' + i) << endl;
      break;
    }
    if (i == 25 && exist[i] == true) cout << "None" << endl;
  }
  return 0;
}

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

int main() {
    int H, W, i, j;
    char C[150][150];
    scanf("%d %d", &H, &W);
    for (i = 0; i < H; i++) {
        scanf("%s",C[i]);
    }
    for (i = 0; i < H; i++) {
       printf("%s\n%s\n",C[i],C[i]);
    }

    return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
W, E = [0], [0]
for s in S[::-1]:
    if s == "E":
        E.append(E[-1]+1)
    else:
        E.append(E[-1])

for s in S:
    if s == "W":
        W.append(W[-1]+1)
    else:
        W.append(W[-1])

ans = float('inf')
E = E[::-1]
for i in range(N):
    ans = min(ans, E[i-1]+W[i-1])

print(ans)

Measured memory_bytes: 68956
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define MOD (int) (1e9+7)
#define INF (int) 2e9
#define LLINF (ll) 2e18

ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

ll modfact(ll n){
    ll ans = 1;
    for (ll i = 1; i <= n; i++){   
        ans *= i;
        ans %= MOD;
    }
    return ans;
}

ll modcomb(ll n, ll k){
    ll tmp = modfact(n);
    tmp *= modpow(modfact(n-k), MOD-2);
    tmp %= MOD;
    tmp *= modpow(modfact(k), MOD-2);
    tmp %= MOD;
    return tmp;
}

ll modcomb2(ll n, ll k){
    ll ans = 1;
    for (ll i = (n-k+1); i <= n; i++){   
        ans *= i;
        ans %= MOD;
    }
    for (ll i = 1; i <= k; i++){   
        ans *= modpow(i, MOD-2);
        ans %= MOD;
    }
    return ans;
}

int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    ll ans = modpow(2, n);
    ll aa = modcomb2(n, a);
    ll bb = modcomb2(n, b);
    ll tmp = ans - aa -bb -1;
    while(tmp<0){
        tmp += MOD;
    }
    cout << tmp << endl;
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

struct P { int x,y; };

ll want;
P p[3];

void solve() {
	int z=(int)sqrt(1.0*want);
	while((ll)z*z<want) ++z;
	p[0].x=p[0].y=0;
	p[1].x=p[2].y=z;
	p[1].y=1,p[2].x=(ll)z*z-want;
}

void run() {
	scanf("%lld",&want);
	solve();
	REP(i,3) { if(i!=0) printf(" "); printf("%d %d",p[i].x,p[i].y); } puts("");
}

int main() {
	run();
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cfloat>
#include <climits>
#include <cassert>
#include <random>

long long int count(long long int health) {
	if (health == 1) return 1;
	else return (count(health >> 1) << 1) + 1;
}
int main() {
	long long int health; std::cin >> health;
	std::cout << count(health) << std::endl;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e15;

signed main(){
  int n;
  string al="";
  for(char i='a';i<='z';i++)al+=i;
  for(char i='A';i<='Z';i++)al+=i;
  while(cin>>n,n){
    vector<int> a(n);
    string s;
    rep(i,n)cin>>a[i];
    cin>>s;
    rep(i,s.size()){
      int index;
      rep(j,al.size())if(al[j]==s[i])index=j;
      cout<<al[(index-a[i%n]+52)%52];
    }
    cout<<endl;
  }
 return 0;
}



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

int main(){

	int a,n;
	cin >> n >> a;

	for(int i=0;i<=a;i++){
		if((n-i)%500==0){
			cout << "Yes" <<  endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}


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

using namespace std;

using ull = unsigned long long;
using ll = long long;

#define READ freopen("input.txt", "r", stdin)
#define ROUT freopen("output.txt", "w", stdout)
#define pb push_back
#define endl '\n'

void fasterIO()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

void fileIO()
{
    READ;
    ROUT;
}

/*bool solve(string s1, string s2, string s3)
{
    int X=0, O=0;

    for(auto i : s1) {
        if(i=='X') X++;
        else if(i=='O') O++;
    }
    for(auto i : s2) {
        if(i=='X') X++;
        else if(i=='O') O++;
    }
    for(auto i : s3) {
        if(i=='X') X++;
        else if(i=='O') O++;
    }

    return O>X?false:true;
}*/

int main()

{
    ///fileIO();
    fasterIO();

    string s;
    cin>>s;

    if(s=="SUN") cout<<7<<endl;
    else if(s=="MON") cout<<6<<endl;
    else if(s=="TUE") cout<<5<<endl;
    else if(s=="WED") cout<<4<<endl;
    else if(s=="THU") cout<<3<<endl;
    else if(s=="FRI") cout<<2<<endl;
    else cout<<1<<endl;
    /*while(n--) {

    }*/

    exit(0);
}


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

int main() {
	int n;
	while(cin >> n && n){
		int hs, ms, ss, he, me, se, count[24 * 3600] = {0};
		for(int i = 0; i < n; ++i){
			char c;
			scanf("%d:%d:%d", &hs, &ms, &ss);
			scanf("%d:%d:%d", &he, &me, &se);
			/*scanf("%d%c%d%c%d", hs, c, ms, c, ss);
			scanf("%d%c%d%c%d", he, c, me, c, se);*/
			for(int j = hs * 3600 + ms * 60 + ss; j < he * 3600 + me * 60 + se; ++j){
				count[j]++;
			}
		}
		int ans = 0;
		for(int i = 0; i < 24 * 3600; ++i){
			ans = max(ans, count[i]);
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1580
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

int main() {
	ll H, W;
	cin >> H >> W;
	ll s = H * W;
	//cout << s << endl;
	ll tmp = s;

	for (int i = 1; i<H; i++) {
		int w = W / 2;
		ll sa = i * W;
		ll sb = (H - i)*w;
		ll sc = s-sa-sb;
		ll a = max(sa,max(sb,sc))
			-min(sa, min(sb, sc));
		int h = (H - i) / 2;
		sa = i * W;
		sb = h * W;
		sc = s - sa - sb;
		ll b = max(sa,max(sb,sc))
			-min(sa, min(sb, sc));
		tmp = min(tmp, min(a, b));
	}
//	cout << tmp << endl;
	for (int i = 1; i < W; i++) {
		ll sa = i * H;
		ll sb = (W - i)*(H/2);
		ll sc = s - sa - sb;
		ll a = max(sa, max(sb, sc))
			- min(sa, min(sb, sc));
		int w = (W - i) / 2;
		sa = i * H;
		sb = w * H;
		sc = s - sa - sb;
		ll b = max(sa, max(sb, sc))
			- min(sa, min(sb, sc));
		tmp = min(tmp, min(a, b));
	}
	cout << tmp << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long lli;
const int maxn = 5e5 + 50;
typedef pair<int, int> P;

int arr[maxn];
int a, b, c, d, e, f, g;
void solve();
int main()
{
	int t = 1;
//	cin >> t;
	for(int i=0; i<t; i++)
	{
		solve();
	}
	return 0;
}

// type below

void solve()
{
	string str; cin >> str;
	if(str == "ABC") cout << "ARC\n";
	else			 cout << "ABC\n"; 
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S; cin >> S;
  int N = S.size();
  int count =0;
  bool ans = true;
  
  for(int i=0; i< N/2; i++) {
    if(S.at(i) != S.at(N-1-i)) ans=false;
  }
  for(int i=0; i<N/2/2; i++) {
    if(S.at(i) != S.at(N/2-1-i)) ans=false;;
  }
    
  if(ans==true) cout << "Yes" << endl;
  else cout << "No" << endl;
    
}

Measured memory_bytes: 3636
def main():
    H,W,K = [int(e) for e in input().split()]
    s = [];
    for i in range(H):
        s+=[input()]
    ans =[]
    notFound=True
    initialLine=0
    count=1
    for i in range(H):
        ans+=[[]]
        num=s[i].count("#")
        if notFound and num==0:
            continue
        elif notFound and num!=0:
            initialLine=i
            notFound=False
        elif num==0:
            ans[i] =ans[i-1]
        current =0
        for j in range(W):
            ans[i] += [count]
            if s[i][j] == "#":
                current+=1
                if current ==num:
                    for k in range(W-j-1):
                        ans[i] += [count]
                    count +=1
                    break
                count +=1
    for i in range(initialLine):
        ans[i] = ans[initialLine]
        
    for i in range(H):
        for j in range(W):
            print(str(ans[i][j]), end="\t")
        print()

if __name__=="__main__":
    main()


Measured memory_bytes: 7568
/**
       **********    ************
	  Author : Avi J Patel
	  University : DAIICT
       **********    ************
**/
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 1844674407370955161
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
#define min_heap priority_queue<int, vector<int>, greater<int>>
#define max_heap priority_queue<int>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> 

bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    if(a.ss < b.ss) return true; 
    else if(a.ss==b.ss) return a.ff<b.ff;
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss<b.ss;
	else return false;
} 
bool sortff_resortss(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.ff<b.ff) return true;
	else if(a.ff==b.ff) return a.ss>b.ss;
	else return false;
}
bool sortbystring(const string &a, const string &b)
{
	string c=a+b;
	string d=b+a;
	if(c>=d) return true;
	else return false;
}

ll modi(ll a, ll m) 
{ 
    ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) 
      return 0; 
    while (a > 1) 
    { 
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    } 
    if (x < 0) 
       x += m0; 
    return x; 
} 
ll Logn(ll  n, ll r) 
{ 
    return (n > r - 1) ? 1 + Logn(n / r, r) : 0; 
} 

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 

  
int main()
{
	FAST
	int t=1;
//	cin>>t;
	while(t--)
	{	
		string s;
		cin>>s;
		int n=s.size();
		string s1=s.substr(0,n/2);
		string s2;
		if(n%2==0)
		s2=s.substr(n/2,n/2);
		else
		s2=s.substr(n/2+1,n/2);
		int temp=0;
		for(int i=0;i<n/2;i++)
		{
			if(s[i]!=s[n-i-1])
			{
				cout<<"No";
				return 0;
			}
		}
		for(int i=0;i<s1.size()/2;i++)
		{
			if(s1[i]!=s1[s1.size()-i-1])
			{
				cout<<"No";
				return 0;
			}
		}
		for(int i=0;i<s2.size()/2;i++)
		{
			if(s1[i]!=s1[s2.size()-i-1])
			{
				cout<<"No";
				return 0;
			}
		}
		cout<<"Yes"<<endl;
	}
	return 0;
}
















Measured memory_bytes: 256
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var a = new int[n];
        var amax = 0;
        for (int i = 0; i < n; i++)
        {
            a[i] = int.Parse(Console.ReadLine().Trim());
            amax = Math.Max(amax, a[i]);
        }
        var div = getDiv(amax);
        var ret = 0;
        for (int i = 0; i < n; i++)
        {
            var w = LowerBound(div, a[i]);
            ret += div[w] - a[i];
        }
        Console.WriteLine(ret);
    }
    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;
    }
    public static int LowerBound<T>(T[] arr, T value) where T : IComparable
    {
        return LowerBound(arr, 0, arr.Length, value, Comparer<T>.Default);
    }
    public static int[] getDiv(int n)
    {
        var w = new List<int>();
        for (int i = 1; i <= n / 2; i++)
            if (n % i == 0) w.Add(i);
        w.Add(n);
        return w.ToArray();
    }
}


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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;


/*FUNCs=================================================*/
/*--------------------------------------------------------*/
//nの素因数とその個数のpairのmapを返す
template<typename T_n>
std::map<T_n, int> prime_factor(T_n n) {
    std::map<T_n, int> ret;
    for(T_n i = 2; i*i <= n; i++){
        while(n % i == 0){
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    int n,m, p; cin >> n >> m;
    p = 1;
    vi a;
    for(int i = 1; i*i <= m; ++i) {
        if(m%i!=0) continue;
        a.push_back(i);
        if(i != m/i) a.push_back(m/i);
    }
    sort(all(a));
//    for(auto d : a) debug(d);
    for(auto i : a) {
        if(n <= i) {
            cout << m/i << '\n';
            return 0;
        }
    }


    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

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

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    ll N;
    cin >> N;

    ll ans = 0;
    for (int i = 1; i <= N; i++) {
        if (i % 3 == 0 || i % 5 == 0) {
        }
        else {
            ans += i;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%lld",&a)
#define ll long long
#define pb push_back
#define mkp make_pair
#define inf 1e9
#define rn 100007
#define ppi pair<int,int>
#define mod 1000000007

int n,k,dp[100007][4];
struct stt{
int a,b,c;
};
stt ara[100007];
int fun(int ind,int pre)
{
    if(ind>=n)return 0;
    if(dp[ind][pre]!=-1)return dp[ind][pre];
      int mx=-1;
    if(ind==0)mx=max(fun(1,1)+ara[0].a,max(fun(1,2)+ara[0].b,fun(1,3)+ara[0].c));
  else{
    if(pre==1)mx=max(mx,max(fun(ind+1,2)+ara[ind].b,fun(ind+1,3)+ara[ind].c));
    if(pre==2)mx=max(mx,max(fun(ind+1,1)+ara[ind].a,fun(ind+1,3)+ara[ind].c));
    if(pre==3)mx=max(mx,max(fun(ind+1,1)+ara[ind].a,fun(ind+1,2)+ara[ind].b));
  }

    return dp[ind][pre]=mx;
}
int main()
{
    cin>>n;
    memset(dp,-1,sizeof dp);
    for(int i=0;i<n;i++)
        cin>>ara[i].a>>ara[i].b>>ara[i].c;
    cout<<fun(0,0)<<endl;

}


Measured memory_bytes: 7680
#include<bits/stdc++.h>
#define ll         long long
#define fl(i,n)    for(i=0;i<n;i++)
#define fld(i,a,b) for(i=a;i>b;i--)
#define fli(i,a,n) for(i=a;i<n;i++)
#define inp(i,a,n) for(i=0;i<n;i++) {cin>>a[i];}
#define op(i,a,n)  for(i=0;i<n;i++) {cout<<a[i]<<" ";}
#define pb         push_back
#define mp         make_pair
#define F          first 
#define S          second
#define mod        998244353
#define all(x)     x.begin(),x.end()    
#define speedup    ios_base::sync_with_stdio(false),cin.tie(0)
using namespace std;
void comp() {
	ll i,j,k,m,n,l;
	string s;
	cin>>k>>s;
	n=s.length();
	if(n>k) {
		fl(i,k) cout<<s[i];
		cout<<"...\n";
	}
	else {
		cout<<s<<"\n";
	}
}

int main() {
    speedup;
    ll i=0,t;
    t=1;
    //cin>>t;
    while(t--) {
        comp();
    }
    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
using namespace std;
static const int MAX = 200000;
void show_st(int *st, int N)
{
  for(int i = 0; i < N ; i++)
  {
    if(i > 0)cout << " ";
    cout << st[i];
  }
  cout << endl;
}
void sort_1(int *st, int N)
{
  int j,v;
  for(int i = 1 ; i < N ; i++)
  {
    j = i - 1;
    v = st[i];
    while(j >= 0 && st[j] > v)
    {
      st[j + 1] = st[j];
      j --;
    }
    st[j + 1] = v;
    show_st(st,N);
  }
}
int main()
{
  int n,R[MAX];
  cin >> n;
  for(int i = 0; i < n ; i++ )cin >> R[i];
  show_st(R,n);
  sort_1(R,n);
  return 0;
}



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

using namespace std;
typedef long long ll;

ll N, X;

ll f(ll a, ll b) {
	if(!b) return -a;
	if(a < b) return f(b, a);
	return 2 * b * (a / b) + f(b, a % b);
}

int main() {
	scanf("%lld%lld", &N, &X);
	printf("%lld\n", N + f(X, N - X));
	return 0;
}

Measured memory_bytes: 256
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<functional>
#include<math.h>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main(){
	string str;
	int i;
	cin >> str;
	RREP(i,str.size()){
		cout << str[i-1];
	}
	cout << endl;
	return 0;
}

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

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;


signed main(){
    int n;
    cin >> n;
    int ans = 1;
    for(int i = 2; i <= n; ++i){
        int tp = i * i;
        while(tp <= n){
            ans = max(tp, ans);
            tp *= i;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
ue = list(map(int, input().split()))
naka = list(map(int, input().split()))
sita = list(map(int, input().split()))
n = int(input())
b = [0] * n
for i in range(n):
    b[i] = int(input())

for i in b:
    ue = ['ok' if j == i else j for j in ue]
    naka = ['ok' if j == i else j for j in naka]
    sita = ['ok' if j == i else j for j in sita]

if ue[0]==ue[1]==ue[2] \
    or naka[0]==naka[1]==naka[2] \
    or sita[0]==sita[1]==sita[2] \
    or ue[0]==naka[0]==sita[0] \
    or ue[1]==naka[1]==sita[1] \
    or ue[2]==naka[2]==sita[2] \
    or ue[0]==naka[1]==sita[2] \
    or ue[2]==naka[1]==sita[0]:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38516
#include<stdio.h>
int main(void)
{
	int n, b, f, r, v, i, j, k, house[4][3][10] = { { { 0 } } };

	scanf("%d", &n);

	for (i = 0; i < n; i++)
	{
		scanf("%d %d %d %d", &b, &f, &r, &v);
		house[b - 1][f - 1][r - 1] += v;
	}

	for (i = 0; i < 4; i++)
	{
		for (j = 0; j < 3; j++)
		{
			for (k = 0; k < 10; k++)
			{
				printf(" %d", house[i][j][k]);
			}
			printf("\n");
		}
		if (i != 3)
		{
			for (j = 0; j < 20; j++)
			{
				printf("#");
			}
			printf("\n");
		}
	}
}


Measured memory_bytes: 2052
import java.util.Scanner;

public class Main {
public static void main(String [] args) {
		
		
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int [] arr = new int [n];
		
		for(int i = 0; i < n; i++) {
			arr[i] = in.nextInt();
		}
		
		int n2 = in.nextInt();
		int [] arr2 = new int [n2];
		
		for(int i = 0; i < n2; i++) {
			arr2[i] = in.nextInt();
		}
		
		int count = 0;
		
		
		
		for(int i = 0; i < n2; i++) {
			
			int left =0;
			int right = n;
			int mid = (left + right) / 2;
			
			while(left != mid && right != mid) {
				
				if(arr2[i] == arr[mid]) {
					count++;
					break;
				}
				
				else if(arr2[i] < arr[mid]) {
					right = mid;
					mid = (left + right) / 2;
				}
				
				else {
					left = mid;
					mid = (left + right) / 2;
				}
			}
		}
		
		System.out.println(count);
}

}



Measured memory_bytes: 67588
n = gets.to_i
a = gets.split.map{|m|m.to_i}
temp_color = ["hai","cha","midori","mizu","ao","ki","daidai","aka"]
color = Array.new
c = 0
a.each do |rate|
    i = rate / 400
    if i+1 < 9
        if !(color.include?(temp_color[i]))
            color.push(temp_color[i])
        end
    else
        c+=1
    end 
end
print color.length != 0 ? color.length : 1
print " "
print color.length+c
print "\n"

Measured memory_bytes: 1788
#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 - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

ll mod = 1e9+7;

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

    ll n;
    cin >> n;

    vll a(n);
    REP(i, n) cin >> a[i];

    VSORTR(a);
    
    ll s1 = 0, s2 = 0;
    REP(i, n){
        if(i % 2 == 0) s1 += a[i];
        else s2 += a[i];
    }
    cout << s1 - s2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define ld long long int
int adddig(ld a, ld b);
int main()
{
    ld a, b;
    while(scanf("%lld %lld", &a, &b)!=EOF)
        printf("%d\n", adddig(a,b));
}
int adddig(ld a, ld b)
{
    int c=0;
    a+=b;
    for(;a!=0;a/=10)
        c++;
    return c;
}

Measured memory_bytes: 1028
/////////////////////////////////////////////////////////
//
//  c/temp.cpp file
//  Last Updated: 2018-10-23 ...Maybe
//
//    I hope you adding this code to the setting file
//    alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
/////////////////////////////////////////////////////////

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

//#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REAP(i,0,n)
#define REAP(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REAP,_REP,)(__VA_ARGS__)

#define _REPR(i,n) REAPR(i,n,0)
#define REAPR(i,a,b) for(int i=int(a-1);i>=int(b);--i)
#define REPR(...) _overload3(__VA_ARGS__,REAPR,_REPR,)(__VA_ARGS__)

#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()

#define coutALL(a) {int loop_coutALL=0;for(auto e:a) cout<<(loop_coutALL++?" ":"")<<e; cout<<endl;}

#define coutYN(a) cout<<((a)?"YES":"NO")<<endl;
#define coutYn(a) cout<<((a)?"Yes":"No")<<endl;
#define coutyn(a) cout<<((a)?"yes":"no")<<endl;

#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)

const int INF=1145141919;
//const long long INF=114514191911451419;
const int MOD=(int)1e9+7;
const double EPS=1e-12;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
//const int dx[]={-1,-1,-1,0,1,1,1,0},dy[]={-1,0,1,1,1,0,-1,-1};

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;

typedef pair<int,int> pii;
typedef pair<int,string> pis;
typedef pair<string,int> psi;
typedef pair<string,string> pss;

typedef long long ll;

template<typename T> istream &operator >> (istream &is, vector<T> &v){for(T &x:v) is>>x;return is;}
template<typename T> ostream &operator << (ostream &os, vector<T> &v){int i=0;for(T &x:v) os<<(i++?" ":"")<<x;return os;}

ll rev(ll n){ll x=0;for(;n>0;){x=x*10+n%10;n/=10;}return x;}

ll upper(ll n,ll m){return (n+m-1)/m;};
ll rounding(ll n){return (long double)n+0.5;};

bool inG(ll x,ll n){return 0<=x && x<n;}
bool outG(ll x,ll n){return x<0 || n<=x;}

inline int qp(int a,ll b){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
inline int qp(int a,ll b,int mo){if(!b)return 1;int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

inline ll fac(ll k,ll n){ll a=1;for(int i=0;i<n;i++)a*=k--;return a;}
inline ll fac(ll k,ll n,int mo){ll a=1;for(int i=0;i<n;i++)a*=k--,a%=mo;return a;}

inline int dsum(ll n){int a=0;for(;n;n/=10)a+=n%10;return a;}

struct Arithmetic{Arithmetic(){cin.tie(0);ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);}};

//#define DEBUG_LOCAL

#ifdef DEBUG_LOCAL
template<typename T> void deb(T a){cerr<<"deb: "<<a<<"です"<<endl;}
#define debl {cerr<<"debug: "<<__LINE__<<"行目だ"<<endl;}
void what_cr(){cout<<__GCC_ATOMIC_CHAR16_T_LOCK_FREE<<" ←？"<<endl;}
//ori_func S

//ori_func E
#else
template<typename T>void deb(T a){}
#define debl
void what_cr(){}void t_t(){}
#endif

signed main(){

  Arithmetic Exception;

  int n,a,b;
  cin>>n>>a>>b;

  cout<<min(a,b)<<" ";

  a+=b;

  a-=n;

  if(a<0) a=0;

  cout<<a<<endl;

  return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll N;
vector<ll>sum;
vector<ll>bunpu;
int check(ll K,ll cnt){
	ll S;
	if(cnt < bunpu.back()){
		ll idx = lower_bound(all(bunpu), cnt) - bunpu.begin();
		S = cnt * (N - idx + 1LL) + sum[idx];
	}
	else S = N;
	return S >= cnt * K;
}

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

	cin >> N;
	sum.resize(N+2);
	bunpu.resize(N+1);
	for (int i = 0; i < N; i++) {
		int A;
		cin >> A;
		bunpu[A]++;
	}
	sort(all(bunpu));
	for (int i = 0; i <= N; i++)sum[i + 1] = bunpu[i] + sum[i];

	for (int K = 1; K <= N; K++) {
		int ok = 0, ng = (N/K) + 3;
		while (ng - ok > 1) {
			int mid = (ng + ok) / 2;
			if (check(K,mid))ok = mid;
			else ng = mid;
		}
		puts(ok);
	}



	return 0;
}

Measured memory_bytes: 5504
from bisect import bisect_left as bl
from math import pi
fx = 1
fy = 1
x1, y1, x2, y2 = map(int, input().split())
if x1 > x2: fx = -1
if y1 > y2: fy = -1
N = int(input())
inf = 10 ** 9
f = [list(map(int, input().split())) for _ in range(N)]
f = [[p[0] * fx, p[1] * fy] for p in f if (min(x1, x2) <= p[0] <= max(x1, x2) and min(y1, y2) <= p[1] <= max(y1, y2))]
f.sort(key = lambda x: (x[0], -x[1]))
lis = [inf] * N
lislen = 0
for i in range(len(f)):
  t = f[i][1]
  ind = bl(lis, t)
  lis[ind] = t
  lislen = max(lislen, ind + 1)
if lislen == min(abs(x2 - x1), abs(y2 - y1)) + 1:
  print((abs(x2 - x1) + abs(y2 - y1)) * 100 - 20 * lislen + 10 * pi + 5 * pi * max(lislen - 1, 0))
else:
  print((abs(x2 - x1) + abs(y2 - y1)) * 100 - 20 * lislen + 5 * pi * lislen)

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

int main(void){
    // 自分の得意な言語で
    // Let's チャレンジ！！
    int t, x;
    double answer;
    char str[1000], *t1, *t2;
    fgets(str, sizeof(str), stdin);
    t1 = strtok(str, " ");
    t2 = strtok(NULL, " ");
    
    t = atoi(t1);
    x = atoi(t2);
    
    answer = (double) t / x;
    
    printf("%lf", answer);
    
    return 0;
}

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

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(auto i=0;i<(n);i++)

using namespace std;


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    
    int a, b;
    cin >> a >> b;
    string s = "x";
    if(a+b == 15) s = "+";
    if(a*b == 15) s = "*";

    cout << s << endl;

    
    return 0;
}


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

int main() {
    ll n, x;
    cin >> n >> x;

    // the first 2 step always results in travel by n
    ll ans = n;
    // the initial parallelogram
    ll a = max(n - x, x), b = min(n - x, x);

    // Euclidean Algorithm
    while (b) {
        // # of times to reflect by 2*b
        ll q = a / b;
        ll r = a % b;

        ans += (b * 2) * q;
        // the last would be the diagonal
        if (r == 0) ans -= b;

        a = b, b = r;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3592