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

int main(){
    int a,b;
    cin>>a>>b;
    if (a>b){
        cout<<a*2-1;
    }
    else if (a==b){
        cout<<a*2;
    }
    else {
        cout<<b*2-1;
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream> 
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;
using ll = long long;

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

int main()
{
	int X,Y,Z,a;

	scanf("%d",&X);
	scanf("%d",&Y);
    scanf("%d",&Z);

    a=(X - Z )/(Y+Z);

	printf("%d\n",a);


    
	

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int search(int S[], int T,int n){
	int left = 0;
	int right = n - 1;
	int mid;
	while (left <= right){
		mid = (left + right) / 2;
		if (S[mid] == T) return 1;
		else if (S[mid] < T) left = mid + 1;
		else if (S[mid] > T) right = mid - 1;
	}
	return 0;
}
int main(){
	int n, q, i, T, sum = 0;
    int S[100000];
	cin >> n;
	for (i = 0; i < n; i++) cin >> S[i];
	cin >> q;
	for (i = 0; i < q; i++){
		cin >> T;
		if (search(S, T, n)) sum++;
	}
	cout << sum << endl;
	return 0;

}

Measured memory_bytes: 1548
S = input()
def partial_sum(pseq):
    #import pdb
    #pdb.set_trace()
    if len(pseq) > 0:
        return int(pseq) + sum(int(pseq[:i])*(2**(len(pseq)-i-1)) +  partial_sum(pseq[i:]) for i in range(1, len(pseq)))
    else:
        return 0
print(partial_sum(S))

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

using namespace std;

int main() {
    double a, b, x;
    cin >> a >> b >> x;
    if(x >= a * a * b / 2) {
        double l = 2 * x / a / a - b;
        double ret = atan((b - l) / a);
        printf("%.10f\n", 180 / M_PI * ret);
    } else {
        double l = 2 * x / a / b;
        double ret = atan(b / l);
        printf("%.10f\n", 180 / M_PI * ret);
    }
    return 0;
}

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

int main() {
 int a,v;
 cin>>a>>v;
 int b,w;
 cin>>b>>w;
 int t;
 cin>>t;
 int res;
 
 if(w>=v)
 res=0;
 
 else
 {
 	long long int dist=abs(b-a);
 	long long int vel=v-w;
 	long long d=vel*t;
 	if(d>=dist)
 	res=1;
 	else res=0;
 	
 }
 if(res)
 cout<<"YES"<<endl;
 else
 cout<<"NO"<<endl;
  
}


Measured memory_bytes: 3556
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	string s[n];
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	int cnt[n][26];
	for(int i=0;i<n;i++){
		for(int j=0;j<26;j++){
			cnt[i][j]=0;
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<s[i].size();j++){
			cnt[i][s[i][j]-97]++;
		}
	}
	string ans="";
	for(int i=0;i<26;i++){
		int mn=1000000000;
		for(int j=0;j<n;j++){
			mn=min(mn,cnt[j][i]);
		}
		for(int j=0;j<mn;j++){
			ans+=i+'a';
		}
	}
	cout<<ans;
	return 0;
} 

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class AAddSubMul {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    int a, b;
	    in >> a >> b;
	    vector<int> v;
	    v.push_back(a+b);
	    v.push_back(a-b);
	    v.push_back(a*b);
	    sort(v.begin(), v.end());
	    out << v[2] << endl;
	}
};


int main() {
	AAddSubMul solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
# coding: utf-8

def main():
    time = []
    time_zero = []
    for i in range(5):
        temp = int(input())
        if temp%10 == 0:
            time_zero.append(temp)
        else:
            time.append([temp,temp%10])
    sort_list = sorted(time, key=lambda x:x[1],reverse=True)

    # print(sort_list)
    ans = 0
    
    for i in time_zero:
        ans += i    
    for i in sort_list:
        if ans > 0 and ans%10 > 0:
            ans +=  (10 - ans%10)
        ans += i[0]
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
import sys

def Sieve2(N, AList, Bools, Max_A):
    N_NotDivisible = 0
    value = 0
    for i in range(N):
        if(AList[i]>value):
            value = AList[i]
            if(Bools[value]==True):
                N_NotDivisible += 1

            for j in range(2, Max_A//value+1, 1 ):
                Bools[j*value] = False
    #print(Mins)
    return N_NotDivisible


if(__name__ == "__main__"):

    N = int( input().strip() )
    AList_str = input().strip().split()
    Max = 0
    AList = [0] * N
    for i in range(N):
        AList[i] = int(AList_str[i])
        Max = max(AList[i], Max)
    Bools = [False] * (Max+1)
    AList.sort()
    Dups = []
    for Num in range(N):
        value = AList[Num]
        Bools[value] = True
        if(Num < N-1 and AList[Num] == AList[Num+1]):
            Dups.append(value)
    for Num in range(len(Dups)):
        value = Dups[Num]
        Bools[value] = False


    N_NotDivisible= Sieve2(N, AList, Bools, Max)
    print(N_NotDivisible)


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

int main(){
	int len, kk, kkk;
	string input, k;
	while (cin >> input) {
		string ans = "";
		len = input.size();
		for (int i = 0; i < len; i++) {
			kkk = input[i];
			if (kkk == 64) {
				i++;
				k = input[i];
				kk = stoi(k);
				i++;
				for(int j=0;j<kk;j++){
					ans += input[i];
				}
			}
			else {
				ans += input[i];
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 3008
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=II()
  l=LI()

  zcnt=l.count(0)
  c=0
  i=0

  while True:
    if zcnt==n:
      break
    if i>=n:
      i=0
    if l[i]>0:
      c+=1
      while True:
        if i<n and l[i]>=1:
          l[i]-=1

          if l[i]==0:
            zcnt+=1

          i+=1
        else:
          break
    else:
      i+=1

  return c

print(main())


Measured memory_bytes: 68076
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<iostream>
using namespace std;
long long int lcm(long long int a,long long int b){
  long long int n;
  n=a*b/__gcd(a,b);
  return n;
}
using ll =long long int;
#define ci(a) cin>>a
#define co(a) cout<<a<<endl
#define gcd(a,b) __gcd(a,b)
#define vec vector<ll>
#define For(i,a,b) for(int i=a;i<b;i++)
#define rFor(i,a,b) for(int i=a;i>b;i--)
#define sort(a,b) sort(a.begin(),b.end())
//gcd 最大公約数
//lcm 最小公倍数
//double 少数（変数）
//string 文字列（変数）
//sqrt 平方根
//ceil 天井関数
//floor 床関数
//abs 絶対値
//pow 累乗
//cbrt  立方根
//hypot 平方和の平方根
//(string-'0') 文字列を数字に変換
//vector<vector<int>> data(a,vector<b>(b)) a×b行列
//for(int i=0;i<a;i++)
//for(int j=0;j<b;j++)
//cin>>data.at(i).at(j)  a×b行列の入力
//floor(log10(a)+1) aの10進法での桁数

int main() {
  ll a;
  ci(a);
  vec b(a),c(a);
  For(i,0,a){
    ci(b[i]);
    c[i]=b[i];
  }
  sort(b,b);
  For(i,0,a){
    if(c[i]>b[a/2-1])
      co(b[a/2-1]);
    else
      co(b[a/2]);
  }
}

Measured memory_bytes: 5376
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    --x; --y;

    vi ans(n);
    rep(i, n) {
        rep(j, n) {
            int t = 0;
            t = min({abs(j-i), abs(i-x)+abs(j-y)+1, 1+abs(i-y)+abs(j-x)});
            ans[t]++;
        }
    }

    rep(i, n-1) {
        cout << ans[i+1]/2 << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(void){
    int n;
    cin>>n;
    int ans=0;
    for(int i=1;i<=n;i+=2){
        int tmp=0;
        for(int j=1;j<=i;j++){
            if(i%j==0)tmp++;
        }
        if(tmp==8)ans++;
    }
    cout<<ans<<endl;
}


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

const long long MOD = 1e9 + 7;

int main() {
    int h, w, k;
    cin >> h >> w >> k;
    
    vector<int> bit;
    for (int b = 0; b < 1 << (w - 1); b++) {
        bool ok = true;
        for (int i = 0; i < w - 1 - 1; i++) {
            if ((b & (1 << i)) && (b & (1 << (i + 1)))) ok = false;
        }
        if (ok) bit.push_back(b);
    }
    
    vector<vector<long long>> dp(h + 1, vector<long long>(w));
    dp.at(0).at(0) = 1;
    for (int i = 0; i < h; i++) {
        for (int b: bit) {
            for (int k = 0; k < w; k++) {
                if (0 <= k - 1 && b & (1 << (k - 1))) dp.at(i + 1).at(k) += dp.at(i).at(k - 1);
                else if (k + 1 < w && b & (1 << k)) dp.at(i + 1).at(k) += dp.at(i).at(k + 1);
                else dp.at(i + 1).at(k) += dp.at(i).at(k);
                dp.at(i + 1).at(k) %= MOD;
            }
        }
    }

    cout << dp.at(h).at(k - 1) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll a, b;
  cin >> a >> b;
  cout << (a + b + 1) / 2 << endl;
}

Measured memory_bytes: 3568
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;


int main() {
    int a, b;
    cin >> a >> b;
    printf("%d %d\n", a*b, 2*(a+b));
    return 0;
}

Measured memory_bytes: 3108
# python3.4.2用
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def lprint(l): print(*l, sep='\n')
def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

Q = iin()
L = []
R = []
for i in range(Q):
    l,r = imn()
    L.append(l)
    R.append(r)    

is_primes = sieves_of_e(10**5+1)

s = [0 for _ in range(10**5+1)]
for i in range(1, 10**5):
    s[i] = s[i-1]
    if i % 2 == 1:
        if is_primes[i] and is_primes[(i+1)//2]:
            s[i] = s[i-1]+1

for i in range(Q):
    print(s[R[i]] - s[L[i]-1])




Measured memory_bytes: 84440
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


vpair e[100005];
vint p;

bool dfs(int u, int d) {
    if (p[u] != INF) {
        if (p[u] != d) return false;
        return true;
    }
    
    p[u] = d;

    bool check = true;
    for (auto v : e[u]) {
        bool res = dfs(v.fi, d + v.se);
        if (!res) check = false;
    }
    return check;
}

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

    p.resize(n, INF);

    rep(i, m) {
        int l, r, d;
        cin >> l >> r >> d;
        --l;
        --r;
        e[l].emplace_back(r, d);
        e[r].emplace_back(l, -d);
    }

    rep(i, n) {
        int d = p[i] != INF ? p[i] : 0;
        if (!dfs(i, d)) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 12032
#include <iostream>
using namespace std;
 
int main() {
  string S;
  int tmp;
  
  cin >> S;
  int m = 1000;
  for(int i=0; i<S.size()-2; i++) {
    tmp = stoi(S.substr(i,3));
    tmp = abs(tmp-753);
    if(tmp<m) {
      m = tmp;
    }
  }
  
  cout << m << endl;
  
  return 0;
}

Measured memory_bytes: 256
def main():
    H, W, A, B = map(int, input().split())
    mod = 10**9 + 7
    ans = 0

    # 予め階乗を計算しておく
    f = [1]
    for i in range(H+W):
        f.append(f[i]*(i+1)%mod)

    # 組み合わせ関数
    def comb_mod(n, r, p):
        return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p)

    for i in range(H-A):
        ans += comb_mod(i+B-1,B-1,mod) * comb_mod(H-1-i+W-B-1,W-B-1,mod)

    print(ans%mod)

if __name__ == '__main__':
    main()

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

#if DEBUG && !ONLINE_JUDGE
  #include "header.h"
#else
  #define debug(args...)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long lli;
typedef long double ld;

#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x).size()
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b) for(auto i=(a);i<b;i++)

#define INF (int)1e9
#define EPS 1e-9
#define MOD 1000000007
void preprocess(void) {
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int n;
  string st; cin>>st;
  n = (int) st.length();
  vector<pair<int, int>> ar;
  vi ans(n+1);
  int cur = 0;
  for(int i = 0; i<n; i++) {
    if(st[i] == '<') {
      ans[i] = cur;
      cur++;
    }
    else {
      ans[i] = cur;
      cur = 0;
    }
  }
  ans[n] = cur;
  cur = 0;
  debug(ans);
  for(int i = n-1; i>=0; i--) {
    if(st[i] == '>') {
      ans[i+1] = max(ans[i+1], cur);
      cur++;
    }
    else {
      ans[i+1] = max(ans[i+1], cur);
      cur = 0;
    }
  }
  ans[0] = max(ans[0], cur);
  debug(ans);
  long long fans = 0;
  for(auto x: ans) fans += x;
  cout<<fans<<endl;
  /*
  for(int i = 0; i<n; i++) {
    int pos = i;
    while(pos<n && st[pos] == st[i]) {
      pos++;
    }
    ar.pb({pos-i, (st[i] == '<')?1:-1});
    i = pos - 1;
  }
  debug(ar);
  n = SZ(ar);
  long long sum = 0;
  int prev = 0;
  for(int i = 0; i<n; i++) {
    if(ar[i].se == -1) {
      int f = max(f, )
    }
  }*/
}



Measured memory_bytes: 2844
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
b = y[n//2-1]
a = y[n//2]
ans = []
for p in x:
    if p >= a:
        ans.append(b)
    else:
        ans.append(a)
for i in range(n):
    print(ans[i],)


Measured memory_bytes: 99796
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define TEST int t = 1; while(t--) solve()

void solve(){
    int n, ans = 0; cin>>n;
    for(int i=1;i<=n;i++){
        if(i%3 == 0 || i%5 == 0)
            continue;
        ans += i;
    }
    cout<<ans<<endl;
}

signed main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); TEST; return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <cmath>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REP1(i,n) for(int i = 1; i < n+1 ;i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
int main(){
  int N;
  cin >> N;
  int a,b,c;
  a = (N - N % 100) / 100;
  b = N - a * 100;
  b = (b - b % 10) / 10;
  c = N - a * 100 - b *10;
  if (a == 7 || b == 7 || c == 7) {
    cout << "Yes";
  }else{
    cout << "No";
  }

}


Measured memory_bytes: 3584
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <complex>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define dump(x)  cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i:a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

LL aaa(LL x, LL y) {
	x++;
	LL ret = x / y * (y / 2LL);
	//cout << "(" << x << ", " << y << ") = " << ret << " -> ";
	LL mod = x % y;
	ret += max(0LL, mod - y / 2);
	//cout << ret << endl;
	return ret;
}

int main() {
	LL a, b; cin >> a >> b;
	LL ans = 0;
	for (LL i = 1; i <= 2099511627776; i *= 2) {
		LL cnt = aaa(b, i * 2) - aaa(a-1, i * 2);
		cnt %= 2;
		ans += cnt * i;

		//cout << aaa(b, i * 2) << " - " << aaa(a-1, i * 2) << endl;
	}
	cout << ans << endl;

}

Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007;
const llint big=6.19e18+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
bool solve(vector<string>&masu,int mita){
	int H=masu.size();
	if(H==mita){
		int W=masu[0].size();
		int i,j,k;
		vector<bool>used(W);
		int chu=-1;
		if(W%2==0){chu=0;}
		for(j=0;j<W;j++){
			if(used[j]){continue;}
			bool bbb=false;
			for(k=j+1;k<W;k++){
				if(used[k]){continue;}
				bool ok=1;
				for(i=0;i<H;i++){
					if(masu[i][j]!=masu[i^1][k]){ok=0;break;}
				}
				if(ok){bbb=true;used[j]=1;used[k]=1;break;}
			}
			if(!bbb){
				if(chu!=-1){return false;}
				for(i=0;i<H;i++){
					if(masu[i][j]!=masu[i^1][j]){return false;}
				}
				chu=j;
			}
		}
		return true;
	}else{
		if(solve(masu,mita+2)){return true;}
		for(int i=mita+2;i<H;i++){
			swap(masu[mita+1],masu[i]);
			if(solve(masu,mita+2)){return true;}
			swap(masu[mita+1],masu[i]);
		}
	}
	return false;
}
int main(void){
	int H,W,i,j;cin>>H>>W;
	vector<string>masu(H);
	for(i=0;i<H;i++){cin>>masu[i];}
	//ペアを設定全探索
	bool can=false;
	if(H%2==1){
		for(i=0;i<H;i++){
			auto aaa=masu;
			aaa.pub(masu[i]);
			if(solve(aaa,0)){can=true;break;}
		}
	}else{
		can=solve(masu,0);
	}
	cout<<(can?"YES":"NO")<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int K = sc.nextInt();
		long[] H = new long[N];
		for( int i=0; i<N; i++ ){
			H[i] = sc.nextLong();
		}
		Arrays.sort(H);
		long ans = 0;
		if( K<N ){
			for( int i=0; i<N-K; i++ ){
				ans += H[i];
			}
		}
		System.out.println(ans);
	}
}


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

int n;
int weeds[101];
int d;
int main()
{
  while(true)
  {
    cin >> n;
    if(!n)
      break;
    for(int i = 0; i < n + 1; i++)
    {

      cin >> weeds[i];
    }
    for(int i = 0; i < n + 1; i++)
    {
      d = weeds[1] - weeds[0];
      if(i < 2)
        d = weeds[3] - weeds[2];

      for(int j = 1; j < n + 1; j++)
      {
        if(j == i)
          continue;
        if(j - 1 == i)
        {
          if(j < 2)
            continue;
          if(weeds[j] - weeds[j - 2] != d)
            goto end;
        }
        else if(weeds[j] - weeds[j - 1] != d)
        {
          goto end;
        }
      }
      cout << weeds[i] << endl;
      break;
    end:;
    }
  }
}

Measured memory_bytes: 1160
import java.util.Scanner;

import org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = splitInt(sc.nextLine(), " ");
		int times = array[2]/array[0];
		System.out.println(array[1]*times);
	}
	public static int[] splitInt(String str, String split) {
		String[] array = str.split(split);
		int[] array2 = new int[array.length];
		for(int i=0; i<array.length; i++) {
				array2[i] = Integer.parseInt(array[i]);
		}
		return array2;
	}
}


Measured memory_bytes: 21460
#include <cstdio>
#include <stdlib.h>
#include <time.h>
using namespace std;

// '-' == '+' + 2

int main(){
  char s[10] = {};
  int n[2] = {1, -1};//n[i] = (-1)^{i}

  scanf("%s", s);

  int a = s[0] - '0', b = s[1] - '0', c = s[2] - '0', d = s[3] - '0';

  for(int i = 0; i < 2; i++){
    for(int j = 0; j < 2; j++){
      for(int k = 0; k < 2; k++){
        if(a + n[i]*b + n[j]*c + n[k]*d == 7){
          printf("%d%c%d%c%d%c%d=7\n", a, '+'+2*i, b, '+'+2*j, c, '+'+2*k, d);
          return 0;
        }
      }
    }
  }
  
  return 0;
}


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


int main(){
	long long e,a,b,c,n;
	long long e2,x,y,z,M;
	cin >> e >> a >> b >> c >> n;
	e2=e*8,x=a*4,y=b*2,z=c;
	
	if(e2<x&&e2<y&&e2<z) cout << (e2/2)*n << endl;
	else if(x<e2&&x<y&&x<z) cout << (x/2)*n << endl;
	else if(y<e2&&y<x&&y<z) cout << (y/2)*n << endl;
	else{
		c=0;
		if(2<=n){
			c = (n/2)*z;
			if(n%2) n=1;
			else n=0;
		}
		
		if(e2<x&&e2<y) cout << c+(e2/2)*n << endl;
		else if(x<e2&&x<y) cout << c+(x/2)*n << endl;
		else cout << c+(y/2)*n << endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <deque>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
using namespace std;
#define MAXSIZE 200
#define MAXL 100
typedef long long int lli;

int main(){
    int n;
    cin >> n;
    deque<int> output_deq;
    for(int i = 0; i < n; i++){
        int din;
        cin >> din;

        if(n % 2 == i % 2){
            output_deq.push_back(din);
        }else{
            output_deq.push_front(din);
        }
    }

    for(int i = 0; i < output_deq.size(); i++){
        char c = (i == output_deq.size() - 1)? '\n' : ' ';
        cout << output_deq[i] << c;
    }
    return 0;
}

Measured memory_bytes: 2944
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N;
        public long MOD = 1000000007;

        public void Run()
        {
            var line = Input.ReadIntArray();
            int X = line[0];
            int A = line[1];

            Console.WriteLine(X < A ? 0 : 10);
        }
    }

    // libs ----------
    

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

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

int main(){
  char s[2001],t[2001];
  int m,n;
  static int dp[2][2001][2001];
  scanf("%d %d %s %s",&m,&n,s,t);
  int ans = 0;
  for(int i=0;i<=m;i++){
    for(int j=0;j<=n;j++){
      dp[0][i][j] = 0;
      dp[1][i][j] = 0;
      if(i!=0){
        if(s[i-1]=='I') dp[0][i][j] = max(dp[0][i][j],dp[1][i-1][j] + 1);
        else if(dp[0][i-1][j]>0&&s[i-1]=='O') dp[1][i][j] = max(dp[1][i][j],dp[0][i-1][j] + 1);
      }
      if(j!=0){
        if(t[j-1]=='I') dp[0][i][j] = max(dp[0][i][j],dp[1][i][j-1] + 1);
        else if(dp[0][i][j-1]>0&&t[j-1]=='O') dp[1][i][j] = max(dp[1][i][j],dp[0][i][j-1] + 1);
      }
      ans = max(ans,dp[0][i][j]);
    }
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 34004
#include <stdio.h>

int main(void)
{
	int N,K,i;
	char S[15];

	scanf("%d",&N);
	scanf("%s",S);
	scanf("%d",&K);
	
	for(i=0;i<N;i++){
	if(S[i]!=S[K-1]){
			S[i]='*';
	}
	}
	
	printf("%s\n",S);
	
	
	return 0;
}


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

int main() {
  uint64_t N;
  cin>>N;
  vector<uint64_t> B(N-1);
  rep(i,N-1) cin>>B[i];
  uint64_t ans=0;
  ans += B[0];//A[0]
  ans += B[N-2];//A[N-1]
  //両端以外
  for(int i=1;i<=N-2;i++){//A[i]
    ans += min(B[i-1],B[i]);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
	val s = readLine()!!
	var ans = mutableListOf<Char>()

	for (v in s) {
		if (v == 'B') {
			if (ans.size != 0) {
				ans.removeAt(ans.lastIndex)
			}
		} else {
			ans.add(v)
		}
	}
	println(ans.joinToString(""))
}


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

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

	if(y%2 != 0) cout << "No" << endl;
	else {
		int a, b;
		a = 2*x-y/2;
		b = y/2-x;
		if (a>=0 && b>=0) cout << "Yes" << endl;
		else  cout << "No" << endl;
	}
}



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

using namespace std;

typedef long long ll;

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

int main(void) {
    int A, B, C;
    cin >> A >> B >> C;

    cout << min(B, A * C) / A << endl;
    return 0;
}


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

int main() {
	int h, t, s, sum;
	while (cin >> h >> t >> s) {
		if (h == -1 && t == -1 && s == -1) break;

		sum = 3600 * 2 - (h * 3600 + t * 60 + s);
		printf("%02d:%02d:%02d\n", sum / 3600, sum % 3600 / 60, sum % 3600 % 60);
		sum *= 3;
		printf("%02d:%02d:%02d\n", sum / 3600, sum % 3600 / 60, sum % 3600 % 60);
	}
	return 0;
}

Measured memory_bytes: 3112
#include <cstdio>

int N;
double A, B, Ans;

int main() {
	scanf("%d%lf%lf", &N, &A, &B);
	for (int i = N; i >= 1; --i) {
		Ans += A + (2 * i - 1) * B / 2;
		A = ((2 * i + 2) * A + 5 * B) / (2 * i);
		B = B * (i + 2) / i;
	}
	printf("%.10lf\n", Ans);
	return 0;
}

Measured memory_bytes: 1736
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int n, a[100];

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

	bool flag = true;
	int count = 0;

	while (flag) {
		flag = false;
		for (int i = 0; i < n - 1; i++) {
			if (a[i] > a[i + 1]) {
				count++;
				flag = true;
				swap(a[i], a[i + 1]);
			}
		}
	}

	for (int i = 0; i < n; i++) {
		cout << a[i];
		if (i < n - 1) {
			cout << " ";
		}
	}
	cout << endl << count << endl;

	return 0;
}

Measured memory_bytes: 1164
N, A, B = map(int, input().split())
cnt = 0
if (A + B) % 2:
    if A - 1 < N - B:
        cnt += A
        B = max(1, B - A)
        A = 1
    else:
        cnt += N - B + 1
        A = min(N, A + N - B + 1)
        B = N
print(cnt + B - (A + B) // 2)


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

int main() {
  long long a,b;
  int k;
  cin >> a >> b >> k;
  
  if(b - a + 1 >= 2 * k){
    for(int i = 0; i < k; i++){
      cout << a + i << endl;
    }
  
    for(int j = k-1; j >= 0; j--){
      cout << b - j << endl;
    }
  }else{
    for(int k = a; k <= b; k++){
      cout << k << endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
double PHI = 1.6180339;
#define endl "\n"    
typedef long long ll;
#define int long long
//#define int unsigned long long

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

    int n;
    cin>>n;
    int arr[n+10];
    for(int i=1;i<=n-1;i++)
    cin>>arr[i];
    arr[n]=arr[n-1];
    arr[0]=arr[1];

    vector<int>v;

    for(int i=1;i<=n;i++)
    {
        int x=min(arr[i-1],arr[i]);
        v.push_back(x);
    }

    int res=0;
    for(int i=0;i<v.size();i++)
    {
         res+=v[i];
    }
    cout<<res<<endl;


}
 

Measured memory_bytes: 256
N, M = map(int, input().split())
D = [[0 if i == j else 1<<100 for j in range(N)] for i in range(N)]
X = []
for _ in range(M):
    a, b, c = map(int, input().split())
    X.append([a-1, b-1, c])
    D[a-1][b-1] = c
    D[b-1][a-1] = c

for k in range(N):
    for i in range(N):
        for j in range(N):
            D[i][j] = min(D[i][j], D[i][k] + D[k][j])

print(sum([1 if D[a][b] < c else 0 for a, b, c in X]))

Measured memory_bytes: 46060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#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 ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
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; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n; cin >> n;
	vector<int> a(n*3);
	REP(i,n*3) cin >> a[i];

	// first half
	priority_queue<ll, vector<ll>, greater<ll>> que1;
	ll sum = 0;
	vector<ll> red;
	REP(i,n){
		que1.push(a[i]);
		sum += a[i];
	}
	red.push_back(sum);
	FOR(i,n,n*2){
		que1.push(a[i]);
		sum += a[i] - que1.top();
		que1.pop();
		red.push_back(sum);
	}

	// second half
	reverse(ALL(a));
	priority_queue<ll> que2;
	sum = 0;
	vector<ll> blue;
	REP(i,n){
		que2.push(a[i]);
		sum += a[i];
	}
	blue.push_back(sum);
	FOR(i,n,n*2){
		que2.push(a[i]);
		sum += a[i] - que2.top();
		que2.pop();
		blue.push_back(sum);
	}
	reverse(ALL(blue));

	ll ans = -LINF;
	REP(i,SIZE(red)) chmax(ans, red[i]-blue[i]);
	cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 8348
n=int(input())
a=list(map(int,input().split()))
c,d=1000,0
for i in range(n):
    if i==n-1:
        c+=d*a[i]
        break
    if a[i+1]>a[i]:
        d+=c//a[i]
        c=c%a[i]
    else:
        c+=d*a[i]
        d=0
print(c)

Measured memory_bytes: 9184
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
  if S[i : i + 2] == 'AC':
    t[i + 1] = t[i] + 1
  else:
    t[i + 1] = t[i]
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])

Measured memory_bytes: 6060
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("tune=native")
    #pragma GCC target ("avx")
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

//--------------------------------------------

int n,k;
vpi edges;
string resp;

signed main(){
    I(n); I(k);
    if (n <= 8){
        cout << 0 << endl;
    } else {
        //1-8 がクエリノード、9-N が正解ノード
        //9を引いて2進数表記
        FOR(i,9,n+1){
            int ni = i-8;
            if (ni & 1) edges.eb(i,1);
            if (ni & 2) edges.eb(i,2);
            if (ni & 4) edges.eb(i,3);
            if (ni & 8) edges.eb(i,4);
            if (ni & 16) edges.eb(i,5);
            if (ni & 32) edges.eb(i,6);
            if (ni & 64) edges.eb(i,7);
            if (ni & 128) edges.eb(i,8);
        }
        cout << sz(edges) << endl;
        for(auto e: edges) cout << e.first << " " << e.second << endl;
    }
    while(k){
        int ansn = 0;
        REPS(i,8){
            cout << i << endl;
            cin >> resp;
            if(resp == "Yes"){
                goto LAST;
            } else if (resp == "Near"){
                ansn |= (1 << (i-1));
            }
        }
        cout << ansn + 8 << endl;
        cin >> resp;
        LAST:
        k--;
    }
}


Measured memory_bytes: 3360
N = int(input())
L = list(map(int, input().split()))
ans = 0

for i in range(N - 2):
  for j in range(i + 1, N - 1):
    for k in range(j + 1, N):
      I = L[i]
      J = L[j]
      K = L[k]
      if I != J and J != K and K != I and I + J > K and J + K > I and K + I > J:
        ans += 1
print(ans)

Measured memory_bytes: 9204
#include <iostream>
#include <string>
using namespace std;
int search(string a,int *loc){
	*loc = a.find("Hoshino",0);
	return *loc;
}
int main(){
	string a,t="Hoshina";
	int n,loc;
	cin >> n;
	getline(cin,a);
	while(n--){
		loc=0;
		getline(cin,a);
		while(~search(a,&loc)) a.replace(loc,t.length(),t);
		cout << a << endl;
	}
	return 0;
}

Measured memory_bytes: 1216
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int maxL =0;
		int sum = 0;
		for(int i=0; i<N; i++) {
			int L = sc.nextInt();
			//Lを合計する
			sum +=L;;
			//Lの最大値を出す
			maxL = Math.max(maxL, L);
		}
		//Lの最大値がLの合計から最大を引いた数より小さければYes
		if(maxL<sum-maxL) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

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

using namespace std;
using ll = long long;
using v1 = vector<int>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	int n;
	cin >> n;
	v1 a(n+1);
	v1 b(n+1);
	v1 c(10001, 0);
	for(int i = 1;i<n+1; i++){
		int x;
		cin >> x;
		a.at(i) = x;
		c.at(x)++;
	}
	for(int i=1; i <10001; i++){
		c.at(i) += c.at(i-1);
		if(c.at(i) == n) break;
	}
	for(int i = n; i >0; i--){

		b.at(c.at(a.at(i))) = a.at(i);
		c.at(a.at(i))--;
	}
	for(int i = 1;i<n+1; i++){
		cout << b.at(i);
		if(i == n){
			cout << endl;
		}else{
			cout << " ";
		}
	}
}



Measured memory_bytes: 18336
use std::io::prelude::*;
use std::io::stdin;
use std::iter::Iterator;
use std::str::FromStr;

fn main() {
    let a: i32 = read();
    let b: i32 = read();
    println!("{}", if a & b & 1 == 1 { "Odd" } else { "Even" });
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define pi pair<ll,ll>
#define pii pair<ll,pi>
#define pb push_back
#define mk make_pair
int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector<int>v(n);
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> v[i];
		sum += v[i];
	}
	int r;
	cin >> r;
	while (r--) {
		int x, val;
		cin >> x >> val;
		cout << sum + val - v[x - 1] << endl;
	}
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;


int main(){
 	int n, k;
 	cin >> n >> k;
 	vector<ll> v(n);
 	for (int i = 0; i < n; i++){
 		cin >> v[i];
 	}

 	ll ans = 0;
 	for (int i = 0; i <= min(n, k); i++){
 		for (int left = 0; left <= i; left++){
 			ll sum = 0;
 			vector<ll> lis;
 			int right = i - left;
 			for (int j = 0; j < left; j++){
 				sum += v[j];
 				lis.push_back(v[j]);
 			}
 			for (int j = 0; j < right; j++){
 				sum += v[n-j-1];
 				lis.push_back(v[n-j-1]);
 			}
 			sort(lis.begin(), lis.end());
 			for (int j = 0; j < min(k-i, (int)lis.size()); j++){
 				if (lis[j] < 0){
 					sum -= lis[j];
 				}else{
 					ans = max(ans, sum);
 					break;
 				}
 			}
 			ans = max(ans, sum);
 		}
 	}
 	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 3e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

struct UnionFind {
  vector< int > par;
  UnionFind(int n = 1) {
    init(n);
  }

  void init(int n = 1) {
    par.resize(n);
    for(int i = 0; i < n; i++)
      par[i] = -1;
  }
  
  int root(int n) {
    if (par[n] < 0) return n;
    return par[n] = root(par[n]);
  }

  bool merge(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;

    return true;
  }

  bool issame(int x, int y) {
    return root(x) == root(y);
  }

	int getSize(int x){
		return -(par[root(x)]);
	}
};

signed main() {
  INIT;
	VAR(int,n,k,l);

	UnionFind uf_train(2*n+1);
	REP(i,k){
		VAR(int,p,q);
		uf_train.merge(p-1,q-1);
	}
	UnionFind uf_road(2*n+1);
	REP(i,l){
		VAR(int,r,s);
		uf_road.merge(r-1,s-1);
	}

	map<pair<int,int>,int> cnt;
	REP(i,n){
		++cnt[make_pair(uf_train.root(i),uf_road.root(i))];
	}

	int isFirst = true;
	REP(i,n){
		if(isFirst) isFirst = false;
		else SP;
		OUT(cnt[make_pair(uf_train.root(i),uf_road.root(i))]);
	}
	BR;
  
  return 0;
}


Measured memory_bytes: 18176
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
using namespace std;
#define DEBUG(x) cout<<#x<<"="<<x<<endl
#define DEBUG2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
typedef long long ll;
const int MAXN=2e5+10;
const ll MOD=17;
ll _gcd(ll a,ll b){if(b==0)return a;return _gcd(b,a%b);}
ll gcd(ll a,ll b){a=abs(a),b=abs(b);if(a<b)swap(a,b);return _gcd(a,b);}
ll qpow(ll a,ll n){ll rt=1;while(n){if(n&1)rt=(rt*a)%MOD;a=a*a%MOD;n>>=1;}return rt;}
ll factor[MAXN];
void cal_factor(){factor[0]=1;for(int u=1;u<MAXN;u++){factor[u]=(factor[u-1]*u)%MOD;}}
ll C(ll n,ll k){return factor[n]*qpow(factor[n-k],MOD-2)%MOD*qpow(factor[k],MOD-2)%MOD;}
int n;
int A[MAXN];
int B[MAXN];
void solve(){
    cin>>n;
    for(int u=0;u<n;u++)cin>>A[u];
    for(int u=0;u<n;u++)cin>>B[u];
    sort(B,B+n,greater<int>());
    int c=-1;
    int l=0,r=-1;
    for(int u=0;u<n;u++){
        if(A[u]==B[u]){
            c=A[u];
            l=u;
            break;
        }
    }
    for(int u=n-1;u>=0;u--){
        if(A[u]==B[u]){
            r=u;
            break;
        }
    }
    for(int u=0;u<n;u++){
        if(l>r)break;
        if(A[u]!=c&&B[u]!=c){
            swap(B[u],B[l]);
            l++;
        }
    }
    if(l<=r){
        cout<<"No\n";
        return;
    }
    cout<<"Yes\n";
    for(int u=0;u<n;u++)cout<<B[u]<<" ";
}
// #define LOCAL
int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Measured memory_bytes: 5224
h, w = map(int, input().split())
a = ''.join([input() for _ in range(h)])
c = ''
b = ''

for i in range(h):
    s = a[i*w:-~i*w]
    if s != '.' * w:
        b += s

nh = len(b) // w
for j in range(w):
    s = b[j::w]
    if s != '.' * nh:
        c += s

nw = len(c) // nh
for i in range(nh):
    print(c[i::nh])


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

long long n,q,a,b,c,d,m,k;
string ss,s1,s2;

int main(){
    long long l[32]={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};
    cin>>a;
    cout<<l[a-1];
}

Measured memory_bytes: 256