akhauriyash/Code-Regression huggingface dataset:
while True:
    a, op, b = input().split()
    if op == "?":
        break
    a = int(a)
    b = int(b)
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)


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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////

const ll inf = 1LL<<60;

int main()
{
  ll n; cin >> n;
  vector<ll> l(n);
  for (int i=0; i<n; i++){
    cin >> l[i];
  }
  ll ans = 0;
  for (int i=0; i<n; i++) {
    for (int j=i+1; j<n; j++) {
      for (int k=j+1; k<n; k++) {
        if (l[i] < l[j]+l[k] && l[j] < l[i]+l[k] && l[k] < l[i]+l[j]
          && l[i] != l[j] && l[i] != l[k] && l[j] != l[k]) ans++;
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scr =new Scanner(System.in);
		
		int N = scr.nextInt();
		int M = scr.nextInt();
		int A;
		int B;
		
		int result = 0;
		
		int []Ns = new int [N];
		int []Max = new int [N];
		
		for(int i = 0;i < N;i++) {
			Ns[i] = scr.nextInt();
			Max[i] = Ns[i];
		}
		
		
		for(int i = 0;i < M;i++) {
			A = scr.nextInt();
			B = scr.nextInt();
			if(Ns[A-1] <= Ns[B-1]) {
				Max[A-1] = -1;
				
			}
			if(Ns[A-1] >= Ns[B-1]) {
				Max[B-1] = -1;
			}
		}
		
		for(int i = 0;i < N;i++) {
			if(Max[i] != -1) {
				result += 1;
			}
		}
		
		System.out.println(result);
		
	}
}

Measured memory_bytes: 60124
#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int X = a / d;
	int Y = c / b;
	if (a % d != 0)X++;
	if (c % b != 0)Y++;
	//cout << Y << " " << X << endl;
	if (Y <= X) {
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;

}


Measured memory_bytes: 3040
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int main() {
  int n;
  cin >> n;
  int a, b;
  cin >> a >> b;
  int C;cin >>C;
  int c[n];
  REP(i, n) {
    cin >> c[i];
  }
  sort(c, c+n, greater<int>());
  int sum[n+1];
  sum[0] = 0;
  for (int i=1; i<=n; ++i) {
    sum[i] = sum[i-1] + c[i-1];
  }
  double ans = 0;
  for (int i=0; i<=n; ++i) {
    ans = max(ans, double(C+sum[i])/(a+b*i));
  }
  cout << (int)(ans+EPS) << endl;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<string, string> sP;
typedef pair<ll, pair<ll, ll>> PP;

const ll mod = 1e4;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second

ll bit[1000010] = { 0 }, n = 200001;

void add(ll a, ll w) {
	for (int x = a; x <= n + 2; x += x & -x) bit[x] += w;
}
int SUM(ll a) {
	ll ret = 0;
	for (int x = a; x > 0; x -= x & -x) ret += bit[x];
	return ret;
}

int main() {
	ll n, a[200010], b[200010], ans = 0;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a[i];
		b[i] = a[i];
	}
	sort(b, b + n);
	for (int i = 0;i < n;i++) {
		a[i] = lower_bound(b, b + n, a[i]) - b + 1;
	}
	for (int i = 0;i < n;i++) {
		add(a[i], 1);
	}
	for (int i = n - 1;i >= 0;i--) {
		ans += SUM(n) - SUM(a[i]);
		add(a[i], -1);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 7832
#include <stdio.h>
#include <stdlib.h>

int desc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}

int main(void)
{
  int num[] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  const int N, M;
  scanf("%d %d", &N, &M);
  int A[M];
  for(int i = 0; i < M; i++)
    scanf("%d", &A[i]);
  qsort(A, M, sizeof(int), desc);

  int dp[N+1];
  dp[0] = 0;
  const int MIN = -1000000000;
  for(int i = 1; i < N+1; i++){
      int max = MIN;
      for(int j = 0; j < M; j++){
          int k = i-num[A[j]];
          if(k >= 0 && max <= dp[k])
              max = dp[k] + 1;
      }
      dp[i] = max;
  }

  int d = dp[N];
  int n = N;
  char s[d+1]; s[d] = '\0';
  for(int i = 0; i < d; i++){
      for(int j = 0; j < M; j++){
          int tmp = n-num[A[j]];
          if(tmp >= 0 && dp[tmp] == dp[n]-1){
              s[i] = (char)(A[j]+'0');
              n -= num[A[j]];
              break;
          }
      }
  }
  printf("%s", s);
}


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

using namespace std;

int main() {
	long long int n, k;
	cin >> n >> k;
	
	if (k > n) {
		cout << 0 << endl;
		return 0;
	}
	vector<long long int> h;
	for (long long int i = 0; i < n; i++) {
		long long int x;
		cin >> x;
		h.push_back(x);
	}

	sort(h.begin(), h.end());

	long long int ans = 0;
	for (long long int i = 0; i < n - k; i++) {
		ans += h.at(i);
	}
	cout << ans << endl;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
int n;
map<string, int> mp;
string s;
int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> s;
		mp[s]++;
	}
	cout << "AC x " << mp["AC"] << endl;
	cout << "WA x " << mp["WA"] << endl;
	cout << "TLE x " << mp["TLE"] << endl;
	cout << "RE x " << mp["RE"] << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
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; }
using Graph = vector<vector<int>>;
int fg(int k){
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}
signed main(){
  int x,y,z;
  cin>>x>>y>>z;
  cout<<z<<" "<<x<<" "<<y;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
const int INF = 2e9;
const int MOD = 1e9 + 7;

int main() {
   int n;
   cin >> n;
   int i;
   for (i = 1; i <= n; i *= 2)
      ;
   cout << i / 2 << endl;
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define PI 3.141592653589793

int n, m, q;
string s[2010];
int sten[2010][2010] = {}, shenl[2010][2010] = {}, shenr[2010][2010] = {}, shenu[2010][2010] = {}, shend[2010][2010] = {};
void solve(){
  int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; x1--; y1--;
  int ans = sten[x2][y2] - sten[x1][y2] - sten[x2][y1] + sten[x1][y1];
  //cout << ans << "ten" << endl;
  int u=0, d=0, l=0, r=0;
  if(x1!=x2) u = shenu[x2][y2] - shenu[x1+1][y2] - shenu[x2][y1] + shenu[x1+1][y1];
  if(x1!=x2) d = shend[x2-1][y2] - shend[x1][y2] - shend[x2-1][y1] + shend[x1][y1];
  l = shenl[x2][y2] - shenl[x1][y2] - shenl[x2][y1+1] + shenl[x1][y1+1];
  r = shenr[x2][y2-1] - shenr[x1][y2-1] - shenr[x2][y1] + shenr[x1][y1];
  //cout << u << " " << d << " " << l << " " << r << endl;
  //cout << shenr[x2][y2-1] << shenr[x1][y2-1] << shenr[x2][y1] << shenr[x1][y1] << endl;
  ans -= (u+d+l+r)/2;
  cout << ans << endl;
}
    
  

int main(){
  cin >> n >> m >> q;
  rep(i, n){
    cin >> s[i];
  }
  int ten[n][m] = {}, henl[n][m] = {}, henr[n][m] = {}, henu[n][m] = {}, hend[n][m] = {};
  rep(i, n){
    rep(j, m){
      if(s[i][j]=='0') continue;
      ten[i][j] = 1;
      if(i>0 && s[i-1][j]=='1') henu[i][j] = 1;
      if(j>0 && s[i][j-1]=='1') henl[i][j] = 1;
      if(i+1<n && s[i+1][j]=='1') hend[i][j] = 1;
      if(j+1<m && s[i][j+1]=='1') henr[i][j] = 1;
    }
  }
  rep(i, n){
    rep(j, m){
      sten[i+1][j+1] = sten[i][j+1] + sten[i+1][j] - sten[i][j] + ten[i][j];
      shenl[i+1][j+1] = shenl[i][j+1] + shenl[i+1][j] - shenl[i][j] + henl[i][j];
      shenr[i+1][j+1] = shenr[i][j+1] + shenr[i+1][j] - shenr[i][j] + henr[i][j];
      shenu[i+1][j+1] = shenu[i][j+1] + shenu[i+1][j] - shenu[i][j] + henu[i][j];
      shend[i+1][j+1] = shend[i][j+1] + shend[i+1][j] - shend[i][j] + hend[i][j];
    }
  }
  //rep(i, n){
    //rep(j, m){
      //cout << henr[i][j] << " ";
    //}
    //cout << endl;
  //}
  while(q--) solve();
}

Measured memory_bytes: 167772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int main(void){
    ll n; cin>>n;
    ll f=0;
    ll m=n;
    while(m>0){
        f+=m%10;
        m=m/10;
    }
    if(n%f==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
ll mod=1e9+7;
ll f[200001],g[200001],inv[200001];
ll C(int x,int y){
	return f[x+y]*g[x]%mod*g[y]%mod;
}
int main(){
	f[0]=1;
	rep1(i,200000) f[i]=f[i-1]*i%mod;
	inv[1]=1;
	for(int i=2;i<=200000;i++) inv[i]=mod-mod/i*inv[mod%i]%mod;
	g[0]=1;
	rep1(i,200000) g[i]=g[i-1]*inv[i]%mod;

	int H,W,h,w;
	cin>>H>>W>>h>>w;
	H--,W--;
	ll ans=C(H,W);
	rep(i,w){
		ll tmp=C(H-h,i)*C(h-1,W-i)%mod;
		ans-=tmp;
	}
	cout<<(ans%mod+mod)%mod<<endl;
}


Measured memory_bytes: 4992
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main = do
  [n,c] <- fmap (map read . words) getLine
  text <- B.getContents
  let xs = map ((\(x:v:_)-> x`seq`v`seq`(x,v)) . map readI . B.words) (B.lines text)
  print (solve c xs)


-- for fast read
readI :: B.ByteString -> Int
readI s = case B.readInt s of Just (n,_) -> n


-- MaxState, CurrentState, CurrentX
type State = (Int, (Int, Int))

solve :: Int -> [(Int,Int)] -> Int
solve c xs =
  solveTurn roundR roundL
  where
    roundR = scanl f (0,(0,0)) xs
    roundL = scanr (flip f) (0,(0,0)) [x'`seq`(x',v)|(x,v)<-xs, let x' = c-x]

    f (m,(s,y)) (x,v) = let s' = s-(x-y)+v in s'`seq`(max m s', (s', x))

solveTurn :: [State] -> [State] -> Int
solveTurn ss1 ss2 =
  foldl' f 0 (zip ss1 ss2)
  where
    f a (((m1,(s1,x1))),((m2,(s2,x2)))) = max a $! max (s1+m2-x1) $! (s2+m1-x2)


Measured memory_bytes: 46332
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("NO"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 200005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

// Union find
struct uf {
  vi d;
  uf(){}
  uf(int mx):d(mx,-1){}
  int root(int x) {
    if(d[x] < 0) return x;
    return d[x] = root(d[x]);
  }
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if(x == y) return false;
    if(d[x] > d[y]) swap(x,y);
    d[x] += d[y]; d[y] = x;
    return true;
  }
  int size(int x) { return -d[root(x)];}
};
//


int main() {
  string s;
  cin>>s;
  s += 'a';
  int n = sz(s);
  char pre = 'a';
  vi d;
  rep(i,n) {
    d.pb((s[i]-pre+26)%26);
    pre = s[i];
  }
  int pn = n;
  n = (n+1)/2;
  srep(i,n,pn) {
    d[pn-1-i] += d[i];
  }

  int m;
  scanf("%d",&m);
  auto f = [&](int v) {
    if (v < n) return v;
    return pn-1-v;
  };
  uf t(n);
  rep(i,m) {
    int l,r;
    scanf("%d%d",&l,&r);
    --l;
    l = f(l);
    r = f(r);
    t.unite(l,r);
  }
  vi sum(n);
  rep(i,n) sum[t.root(i)] += d[i];
  rep(i,n) if (sum[i]%26) dame;
  cout<<"YES"<<endl;
  return 0;
}






















Measured memory_bytes: 1272
#![allow(unused_imports)]

//input
use proconio::input;
use proconio::marker::{Bytes, Chars};
//use std::io::Read;

//collections
//use std::collections::BTreeMap;
//use std::collections::BTreeSet;
//use std::collections::HashMap;
//use std::collections::HashSet;
//use std::collections::VecDeque;
//use std::collections::BinaryHeap;

//use std::cmp::*;

fn main() {
    input! {
        r: f64,
    }

    println!("{}", 2f64 * std::f64::consts::PI * r);
}


Measured memory_bytes: 2232
using PanasonicProgrammingContest2020.Questions;
using PanasonicProgrammingContest2020.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace PanasonicProgrammingContest2020.Questions
{
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var abc = inputStream.ReadLongArray();
            var a = abc[0];
            var b = abc[1];
            var c = abc[2];

            yield return a + b < c && 4 * a * b < (c - a - b) * (c - a - b) ? "Yes" : "No";
        }
    }
}


namespace PanasonicProgrammingContest2020
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace PanasonicProgrammingContest2020.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace PanasonicProgrammingContest2020.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

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

int main()
{
    int N;
    cin >> N;
    vector<int> bit_count(62, 0);
    rep(i, N)
    {
        long long A;
        cin >> A;
        bitset<62> bs(A);
        rep(j, 62)
        {
            if (bs[j] == 1)
                bit_count[j]++;
        }
    }
    long long ans = 0;
    long long mod = pow(10, 9) + 7;
    long long num = 1;

    rep(i, 62)
    {
        long long x = (bit_count[i] % mod) * ((N - bit_count[i]) % mod);
        x %= mod;
        ans += (x * num) % mod;
        ans %= mod;

        num *= 2;
        num %= mod;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
	string str, inv;
	int cnt=0;
	while( getline(cin, str), str.length()!=0 ){
		inv.resize(str.length());
		for( int i=0; i<str.length(); i++ ){
			inv[i] = str[str.length()-1-i];
		}
		if( str == inv ){
			cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
#pragma GCC optimize("Ofast")

// Begin {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
// }}} End

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    size_t N; string s;
    cin >> N >> s;

    string abc = "";
    int i = 0;
    unordered_map<char, int> mp;
    for (char c = 'A'; c <= 'Z'; ++c) {
        abc += string(1, c);
        mp[c] = i;
        ++i;
    }

    abc += abc;

    for (auto &si: s) {
        si = abc[mp[si] + N];
    }

    cout << s << "\n";

    return 0;
}


Measured memory_bytes: 256
s = int(input())
v = [False] * (10**6 + 1)

v[s] = True
a = s

for i in range(2, 10**6+1):
    if a % 2 == 0:
        a = a // 2
    else:
        a = 3 * a + 1

    if v[a]:
        break
    else:
        v[a] = True

print(i)

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


 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
  
  
  int k,x;
  cin >> k >> x;
  int min=x-k+1;
  int max=x+k-1;
  //if(max>1000000){max=1000000;}
  //if(min<−1000000){min=−1000000;}
  
  for(int i=0;i<abs(max-min+1);i++){
  	cout << min+i << " ";
  }
  cout << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (long long i=0;i<(n);i++)
#define FOR(i,a,b) for (long long i=(a);i<(b);i++)
#define RREP(i,n) for(long long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl
#define dump(x)  cerr << #x << " => " << (x) << endl
#define dumpP(p) cerr << "( " << p.first << " , " << p.second << " )" << ends
#define SORT(c) sort((c).begin(),(c).end())
#define MIN(vec) *min_element(vec.begin(), vec.end())
#define MAX(vec) *max_element(vec.begin(), vec.end())
#define UNIQ(vec) vec.erase(unique(vec.begin(), vec.end()),vec.end()) //ソートの必要あり
#define IN(n,m)  (!(m.find(n) == m.end()))
#define ENUM(m) for (auto itr = m.begin(); itr != m.end(); ++itr)
#define dump_MAP(m) for(auto itr = m.begin(); itr != m.end(); ++itr) { cerr << itr->first << " --> "  << itr->second << endl; }
#define FINDL(vec,x) (lower_bound(vec.begin(),vec.end(),x) - vec.begin())
#define FINDU(vec,x) (upper_bound(vec.begin(),vec.end(),x) - vec.begin())
#define ROUND(N) setprecision(N)
#define ROUND_PRINT(N,val) cout << fixed;cout << setprecision(N) << val << endl
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()

using namespace std;
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
typedef long long LL;
typedef vector<LL> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<LL,LL> pr;
typedef vector<pr> VP;
struct Order {
	bool operator() (pr const& a,pr const& b) const {
		return a.first > b.first || ((a.first == b.first) && (a.second > b.second));
	}
};

int main(void) {
	long N,l,r,mid,idx;
	cin >> N;
	VI dp(N,loINF); // dp[i] := 長さiの最小の数
	VI a(N); 
	REP(i,N) cin >> a[i];
	REP(i,N) {
		idx = FINDL(dp,a[i]);
		dp[idx] = min(dp[idx],a[i]);
	}

	REP(i,N) {
		if (dp[i] == loINF) {
			cout << i << endl;
			break;
		}
		if (i == (N-1)) {
			cout << N << endl;
		}

	}
}



Measured memory_bytes: 4404
/*宣言*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string.h>
#include<string>
#include<vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
long long int oranges[20001];
long long int n, m, K;
int main()
{
	cin >> n >> m >> K;
	for (int i = 1; i <= n; i++)cin >> oranges[i];
	long long int dp[20001];
	memset(dp, 120, sizeof(dp));
	dp[0] = 0;
	for (int i = 1; i <= n; i++) {
		long long int MAX = oranges[i];
		long long int MIN = oranges[i];
		for (int j = 0; j < min(m,n-i+1); j++) {
			MAX = max(MAX, oranges[i + j]);
			MIN = min(MIN, oranges[i + j]);																	//	7/31
			dp[i+j] = min(dp[i+j], dp[i - 1] + K + (j+1)*(MAX - MIN));
		}
	}
	cout << dp[n] << endl;

	return 0;
}


Measured memory_bytes: 3424
import math
cooks = [int(input()) for _ in range(5)]
sorted_cooks = sorted(cooks, key=lambda x: int(str(x)[-1]))
ans = 0
last_order = False
for i in range(len(sorted_cooks)):
  if(last_order == False and int(str(sorted_cooks[i])[-1]) != 0 ):
    ans += sorted_cooks[i]
    last_order = True
  else:
    ans += math.ceil(sorted_cooks[i] / 10) * 10

print(ans)

Measured memory_bytes: 3064
#include <algorithm>
#include  <iterator>
#include  <iostream>
#include   <cstring>
#include   <cstdlib>
#include   <iomanip>
#include    <bitset>
#include    <cctype>
#include    <cstdio>
#include    <string>
#include    <vector>
#include     <stack>
#include     <cmath>
#include     <queue>
#include      <list>
#include       <map>
#include       <set>
#include   <cassert>

using namespace std;
#define lson (l , mid , rt << 1)
#define rson (mid + 1 , r , rt << 1 | 1)
#define debug(x) cerr << #x << " = " << x << "\n";
#define pb push_back
#define pq priority_queue



typedef long long ll;
typedef unsigned long long ull;
//typedef __int128 bll;
typedef pair<ll ,ll > pll;
typedef pair<int ,int > pii;
typedef pair<int,pii> p3;
typedef pair<ll,int>pli;
//priority_queue<int> q;//这是一个大根堆q
//priority_queue<int,vector<int>,greater<int> >q;//这是一个小根堆q
#define fi first
#define se second
//#define endl '\n'

#define OKC ios::sync_with_stdio(false);cin.tie(0)
#define FT(A,B,C) for(int A=B;A <= C;++A)  //用来压行
#define REP(i , j , k)  for(int i = j ; i <  k ; ++i)
#define max3(a,b,c) max(max(a,b), c);
#define min3(a,b,c) min(min(a,b), c);
//priority_queue<int ,vector<int>, greater<int> >que;

const ll mos = 0x7FFFFFFF;  //2147483647
const ll nmos = 0x80000000;  //-2147483648
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f; //18
const int mod = 1e9+9;
const double esp = 1e-8;
const double PI=acos(-1.0);
const double PHI=0.61803399;    //黄金分割点
const double tPHI=0.38196601;


template<typename T>
inline T read(T&x){
    x=0;int f=0;char ch=getchar();
    while (ch<'0'||ch>'9') f|=(ch=='-'),ch=getchar();
    while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x=f?-x:x;
}
/*-----------------------showtime----------------------*/
int main(){
            int n,a,b;
            cin>>n>>a>>b;
            cout<<min(a,b)<<" "<<max(0, a + b - n)<<endl;
            return 0;
}


Measured memory_bytes: 256
#include "vector"
#include "iostream"
#include "string"
#include "algorithm"

using namespace std;

int main()
{
	int h, w;
	cin >> h >> w;
	vector<string> inputString(h);
	for (auto itr = inputString.begin(); itr != inputString.end(); itr++)
	{
		string temp;
		cin >> temp;
		temp = "#" + temp + "#\n";
		*itr = temp;
	}
	string frame(w + 2, '#');
	cout << frame << endl;
	for (auto elem : inputString)
	{
		cout << elem;
	}
	cout << frame << endl;
	return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  if(a * b % 2 == 0) {
    cout << "Even" << endl;
  } else {
    cout << "Odd" << endl;
  }
  return 0;
}

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

int main() 
{
    lli a, b;
    cin >> a >> b;
    lli x = (a*(100LL))/8LL;
    x = (x/10)*10;
    //cout << x << endl;
    for(lli i = x; i <= x +10; i++)
    {
        if((i*(8LL))/100LL == a && (i*(10LL))/100LL == b)
        {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int A[5];
	for (int i = 0; i < 5; i++) {
		scanf("%d", &A[i]);
	}

	int k;
	int b;
	int count = 0;
	scanf("%d", &k);

	for (int i = 0; i < 5; i++) {
		for (int j = i; j < 5; j++){
			b = A[j] - A[i];
			if (b > k) {
				count++;
			}
	}

	}

	if (count == 0) {
		printf("Yay!");
	}
	else {
		printf(":(");
	}
	return 0;

	}

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
#include<chrono>
#include<random>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const int MAXN=100005;
void gg(){puts("No");exit(0);}
vector<int> nxt[MAXN];
void ins(int x,int y){nxt[x].emplace_back(y);}
int L[MAXN],R[MAXN],n,m,INF,ans[MAXN];
void dfs(int x,int fa)
{
	int l=-INF,r=INF;
	for(auto y:nxt[x])if(y^fa)
	{
		dfs(y,x);
		if(L[y]==INF)continue;
		else chkmax(l,L[y]),chkmin(r,R[y]);
	}--l;++r;if(l>r)gg();
	if(L[x]!=INF)
	{
		if(l>L[x]||r<L[x])gg();
		return ;
	}L[x]=l;R[x]=r;
}
void getans(int x,int fa)
{
	if(!fa)ans[x]=L[x];
	else
	{
		if(L[x]<=ans[fa]-1&&ans[fa]-1<=R[x])ans[x]=ans[fa]-1;
		else if(L[x]<=ans[fa]+1&&ans[fa]+1<=R[x])ans[x]=ans[fa]+1;
		else gg();
	}
	for(auto y:nxt[x])if(y^fa)getans(y,x);
}
int main()
{
//	freopen("a.txt","r",stdin);
	n=read();
	for(int i=1;i<n;i++)
	{
		int x=read(),y=read();
		ins(x,y);ins(y,x);
	}m=read();memset(L,63,sizeof(L));memset(R,63,sizeof(R));INF=L[0];
	int rt=0;
	for(int i=1;i<=m;i++)
	{
		int a=read(),b=read();
		L[a]=R[a]=b;rt=a;
	}dfs(rt,0);
////	for(int i=1;i<=n;i++)assert(L[i]<=R[i]);
	getans(rt,0);
	puts("Yes");
	for(int i=1;i<=n;i++)pr2(ans[i]);
	return 0;
}



Measured memory_bytes: 15360
<?php
$N = int();
for($i = 0; $i < $N-1; $i++){
  list($from, $to, $d) = array_map("intval", explode(" ", trim(fgets(STDIN))));
  $G[$from][$to] = $d;
  $G[$to][$from] = $d;
}
list($Q, $K) = ints();
$distance = array_fill(1, $N, PHP_INT_MAX);
$current[] = $K;
$distance[$K] = 0;
while($current){
    $f = array_pop($current);
    foreach($G[$f] as $next => $dd){
        if($distance[$next] == PHP_INT_MAX){
            $distance[$next] = $distance[$f] + $dd;
            $current[] = $next;
        }
    }
}

while($Q--){
    list($from, $to) = ints();
    $result[] = $distance[$from]+$distance[$to];
}
echo implode("\n", $result),"\n";


function str(){
  return trim(fgets(STDIN));
}
function ints(){
  return array_map("intval", explode(" ", trim(fgets(STDIN))));
}
function int(){
  return intval(trim(fgets(STDIN)));
}
function chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}
function chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}

function o(...$val){
    if(count($val)==1)$val = array_shift($val);
    $trace = debug_backtrace();
    echo $trace[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0){
            echo "empty array";
        }elseif(!is_array(current($val))){
            echo "array: ";
            echo implode(" ", addIndex($val))."\n";
        }else{
            echo "array:array\n";
            if(isCleanArray($val)){
                foreach($val as $row)echo implode(" ", addIndex($row))."\n";
            }else{
                foreach($val as $i => $row)echo "[".$i."] ".implode(" ", addIndex($row))."\n";
            }
        }
    }else{
        echo $val."\n";
    }
}
function addIndex($val){
    if(!isCleanArray($val)){
        $val = array_map(function($k, $v){return $k.":".$v;}, array_keys($val), $val);
    }
    return $val;
}
function isCleanArray($array){
    $clean = true;
    $i = 0;
    foreach($array as $k => $v){
        if($k != $i++)$clean = false;
    }
    return $clean;
}
/**
 * 座圧対象の配列を渡すと以下の値を返す
 * ・圧縮された配列
 * ・復元用のMap
 * ・圧縮用のMap
 **/
function atsu($array){
    $a = array_flip($array);
    $fuku = array_flip($a);
    sort($fuku);
    $atsu = array_flip($fuku);
    foreach($array as $i => $val)$array[$i] = $atsu[$val];
    return [$array, $fuku, $atsu];
}
//配列の最大公約数
function gcdAll($array){
    $gcd = $array[0];
    for($i = 1; $i < count($array); $i++){
        $gcd = gcd($gcd, $array[$i]);
    }
    return $gcd;
}

//最大公約数
function gcd($m, $n){
    if(!$n)return $m;
    return gcd($n, $m % $n);
}

//配列の最小公倍数
function lcmAll($array){
    $lcm = $array[0];
    for($i = 1; $i < count($array); $i++){
        $lcm = lcm($lcm, $array[$i]);
    }
    return $lcm;
}

//最小公倍数
function lcm($a, $b) {
    return $a / gcd($a, $b) * $b;
}
//ビットカウント-1の数を数える
function popcount($x){
    $con = 0;
    while ($x) {
        $x &= $x-1;
        ++$con;
    }
    return $con;
}


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

void solve(int n){
	if(!n)
		return;
	solve(n/8);
	int tmp = n%8;
	switch(n%8){
		case 0:
		case 1:
		case 2:
		case 3:
			break;
		case 4:
			tmp++;
			break;
		default:
			tmp += 2;
	}
	cout << tmp;
}

int main(){
	int n;
	while(true){
		cin >> n;
		if(!n)
			return 0;
		solve(n);
		cout << endl;
	}
}

Measured memory_bytes: 864
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define RREP(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define INF 1000000000000
typedef long long ll;

int main()
{
  ll n, sum = 0;
  cin >> n;

  vector<ll> a(n);

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

  REP(i, n - 1)
  {
    if (a[i + 1] < a[i])
    {
      sum += a[i] - a[i + 1];
      a[i + 1] = a[i];
    }
  }
  cout << sum << endl;
}

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

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

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

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

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline ll toLL(string s) {
  ll v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}
ll ans = 1e12;
void calc(VLL &v) { chmin(ans, *max_element(all(v)) - *min_element(all(v))); }

void solve(int h, int w) {
  rep(i, h / 2) {
    ll left = (i + 1) * w;
    ll less = h - (i + 1);
    if(w % 2 == 0) {
      ll right = less * w / 2;
      chmin(ans, abs(left - right));
    } else {
      if(i == 0) {
        VLL v = {left, less * (w / 2), less * ((w + 1) / 2)};
        calc(v);
      } else {
        VLL v = {left, less * (w / 2), less * ((w + 1) / 2)};
        calc(v);
        VLL v2 = {left, ((less + 1) / 2) * w, (less / 2) * w};
        calc(v2);
      }
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w;
  cin >> h >> w;

  if(h % 3 == 0 || w % 3 == 0) {
    cout << 0 << endl;
    return 0;
  }

  solve(h, w);
  solve(w, h);

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


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  vector<int> x(n),a(n);
  rep(i,n) cin >> x[i];
  rep(i,n) a[i] = x[i];
  sort(x.begin(),x.end());
  int l = n/2-1, r = n/2;
  rep(i,n){
    if(a[i]<=x[l]) cout << x[r] << endl;
    else cout << x[l] << endl;
  }
}


Measured memory_bytes: 3712
#include<stdio.h>

int solve(int,int);

int n,A[50];

main(){
  int q,M,i;

  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&M);
    if(solve(0,M))printf("yes\n");
    else printf("no\n");
  }
  return 0;
}

int solve(int i,int m){
  if(m==0)return 1;
  if(i>=n)return 0;
  int res=solve(i+1,m)||solve(i+1,m-A[i]);
  return res;
}

Measured memory_bytes: 580
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <utility>
#include <algorithm>
#include <set>
#include <queue>
#include <climits>
#include <limits>
#include <map>
#include <unordered_map>
#include <cstring>
#include <ctime>

using namespace std;

#define ll long long
#define max(A, B) ((A) > (B) ? (A) : (B))
#define min(A, B) ((A) < (B) ? (A) : (B))
#define mp make_pair
#define pb push_back
#define fi first
#define sd second
#define fu(A, B, C) for(ll (A) = (B); (A) < (C); (A)++)
#define fu0(A, B) fu((A), 0, (B))
#define fd(A, B, C) for(ll (A) = (B); (A) >= (C); (A)--)
#define mem(A, B) memset((A), (B), sizeof((A)))
#define v(A, B, C) vector<ll> (A)((B), (C))
#define v2d(A, B, C) vector<vector<int>> (A)((B), vector<int> (C));
#define all(x) x.begin(), x.end()

typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;

void perform() {
  int arr[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k; cin >> k;
  cout << arr[k-1] << endl;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ll t = 1; //cin >> t;
  while(t--) {perform();}
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.La;
		var n=s[1]+s[2];
		long ans=(s[0]/n)*s[1];
		Console.WriteLine(ans+Min(s[1],s[0]%n));
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 13268
import collections
N = int(input())
A = collections.Counter(list(map(int, input().split())))
seihou = []
tyouhou = []
ans = 0
#tyouhou = tyouhou+[i]にするとTLEするのでappendを用いる

for i in A.keys():
    if A[i] >= 2:
        tyouhou.append(i)
    if A[i] >= 4:
        seihou.append(i)

if len(seihou) >= 1:
    ans = max(seihou)**2

if len(tyouhou) >= 2:
    c = max(tyouhou)
    tyouhou.remove(c)
    ans = max(ans, c*max(tyouhou))
print(ans)

Measured memory_bytes: 18600
#include <iostream>

int main()
{
     char num[2];
     std::cin >> num[0];
     std::cin >> num[1];
     
     if(num[0] == num[1])
     {
          std::cout << "H" << std::endl;
     }
     else
     {
          std::cout << "D" << std::endl;
     }

     return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define MAX 500000
#define MOD 1000000007

#define add(a,b) (((a)+(b))%MOD)
#define mult(a,b) (((a)*(b))%MOD)
typedef long int lli;

lli power(lli a,lli b){
  if(b<=0)return 1;
  if(b%2==0 && b<32){
    lli k=power(a,b/2);
    return mult(k,k);
  }
  return mult(a,power(a,b-1));
}


int main (void){
  lli n;
  scanf("%ld",&n);
  lli i,j,a;

  lli *dpx,*dp0,sum=0,*Onum,On=0;
  dpx=(lli *)malloc(sizeof(lli)* (5e5));      // ----x
  dp0=(lli *)malloc(sizeof(lli)* (5e5));      // --x--
  Onum=(lli *)malloc(sizeof(lli)* (5e5));


  lli *prev;
  prev=(lli *)malloc(sizeof(lli)* (1<<20));
  for(i=0;i<1<<20;i++)    prev[i]=-1;



  for(i=0;i<n;i++){
    scanf("%ld",&a);
    sum^=a;
    //                    printf("%ld ",sum);
    Onum[i]=sum?On:(++On);
    if(prev[sum]==-1){
      dp0[i]=1;
      dpx[i]=1;

    }
    else{
      dpx[i]=add(dpx[prev[sum]],
		 mult(Onum[i-1]-Onum[prev[sum]],dp0[prev[sum]]));
      dp0[i]=add(dpx[i],dp0[prev[sum]]);
    }
    prev[sum]=i;
  }

  lli ans;
  if(sum!=0){
    ans=dpx[n-1];
  }
  else{
    ans=power(2,On-1);
    for(i=1;i<1<<20;i++)
      if(prev[i]+1){
	ans=add(ans,dp0[prev[i]]);
      }
  }

  //  printf("\n",1<<20);
  //       printf(":sum\n");
  printf("%ld",ans);
  //       printf(":ans\n");

  /*    
  for(i=0;i<n;i++)
  printf("%ld ",dpx[i]);
  printf(":dpx(----x)\n",sum);
  for(i=0;i<n;i++)
  printf("%ld ",dp0[i]);
  printf(":dp0(--x--)\n",sum);
  for(i=0;i<n;i++)
  printf("%ld ",Onum[i]);
  printf(":0num\n");
  for(i=0;i<10;i++)
  printf("%ld ",prev[i]);
  printf(":prev\n",sum);
  */

  
  free(prev);
  return 0;
}



Measured memory_bytes: 27904
#include <bits/stdc++.h>
 
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define EPS ((ld)(1e-9))
 
#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define rep(i, e) for (int i = 0, _##i = (e); i < _##i; i++)
#define repp(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)
#define repr(i, s, e) for (int i = (s)-1, _##i = (e); i >= _##i; i--)
#define repi(i, x) for (auto &i : (x))
#define ARR(...) vector<int>({__VA_ARGS__})
#define ARS(...) vector<string>({__VA_ARGS__})
 
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef complex<double> base;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    return os << '(' << pai.first << ' ' << pai.second << ')';
}
 
template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    cout << '[';
    for (auto p : v) cout << p << ",";
    cout << "]";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const set<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
#ifndef __SOULTCH
#define debug(...) 0
#define endl '\n'
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif
 
template<typename T> void get_max(T &a, T b) {a = max(a, b);}
template<typename T> void get_min(T &a, T b) {a = min(a, b);}

const ll MOD = 1e9+7;

int N, K;
ll dp[101][100001];

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

    cin >> N >> K;

    dp[0][0] = 1;
    repp(i, 1, N+1) {
        int v; cin >> v;
        ll s = 0;
        rep(j, K+1) {
            s += dp[i-1][j];
            if (j > v) s -= dp[i-1][j-v-1];
            s = (s+MOD)%MOD;
            dp[i][j] = s;
        }
    }

    cout << dp[N][K] << endl;
}

Measured memory_bytes: 78336
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        int a = Integer.parseInt(s.substring(0, 1));
        int b = Integer.parseInt(s.substring(1, 2));
        int c = Integer.parseInt(s.substring(2, 3));
        int d = Integer.parseInt(s.substring(3, 4));

        sc.close();

        boolean[] ifplus = {true, false};
        for(boolean op1 : ifplus) {
            for(boolean op2 : ifplus) {
                for(boolean op3 : ifplus) {
                    int ans = a;
                    ans += op1? b : -b;
                    ans += op2? c : -c;
                    ans += op3? d : -d;

                    if(ans == 7) {
                        StringBuilder sb = new StringBuilder();
                        sb.append(a);
                        sb.append(op1? '+' : '-');
                        sb.append(b);
                        sb.append(op2? '+' : '-');
                        sb.append(c);
                        sb.append(op3? '+' : '-');
                        sb.append(d);
                        sb.append("=7");
                        System.out.println(sb);
                        System.exit(0);
                    }
                }
            }
        }
    }
}

Measured memory_bytes: 23124