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

class Program
{
	static void Main(string[] args)
	{			
		//文字列を読み込む
		string word = Console.ReadLine();
		
		int num = word.Length;
		
		string answer = new string('x', num);
		
		//出力
		Console.WriteLine(answer);
	}
}



Measured memory_bytes: 11092
//雪花飄飄北風嘯嘯
//天地一片蒼茫

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n;
ll arr[85];
ll w[85];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n;
	rep(x,1,n+1) cin>>arr[x];
	
	w[0]=1000;
	rep(x,1,n+1){
		ll curr=1e18;
		
		rep(y,x,0){
			ll group=w[y]/curr;
			ll residue=w[y]-group*curr;
			w[x]=max(w[x],group*arr[x]+residue);
			curr=min(curr,arr[y]);
		}
	}
	
	//rep(x,1,n+1) cout<<w[x]<<endl;
	cout<<w[n];
}


Measured memory_bytes: 3688
#include<iostream>
#include <string> 
#include <vector>  
#include<math.h>

#define INF 1000000000
#define LM 55555
using namespace::std;


long Lmax(long x, long y) {
	if (x > y)return x;
	return y;
}

int max(int x, int y) {
	if (x > y)return x;
	return y;
}

long Lmin(long x, long y) {
	if (x < y)return x;
	return y;
}


int min(int x, int y) {
	if (x < y)return x;
	return y;
}

int abs(int a) {
	if (a < 0) {
		return -a;
	}
	return a;
}

int N, M[LM],num,v[55555],ch,ans[55];
string s[50], t[100];
int chx[4] = { 1,0,0,-1 };
int chy[4] = { 0,1,-1,0 };
bool a, b, c;
int main() {
	cin >> N;
	for (int i = 0; i < LM; i++) {
		M[i] = 1;
	}

	for (int i = 2; i < sqrt(LM); i++) {
		if (M[i] == 1) {
			for (int j = 0; j < LM; j++) {
				if (i*(j + 2) < LM) {
					M[i*(j + 2)] = 0;
				}
				else {
					break;
				}
			}
		}
	}
	num = 0;
	for (int j = 2; j < LM; j++) {
		if (M[j] == 1) {
			if (j % 5 == 1&&num<55) {
				ans[num] = j;
				num++;
			}
		}
	}

	for (int i = 0; i < N; i++) {
		cout << ans[i]<< " ";
	}
	cout << endl;
	return 0;
}




Measured memory_bytes: 512
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def comb(n,r,mod):
    p,q=1,1
    for i in range(r):
        p=p*(n-i)%mod 
        q=q*(i+1)%mod 
    return p*pow(q,mod-2,mod)%mod

def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    nca = comb(n,a,mod)
    ncb = comb(n,b,mod)

    print((pow(2,n,mod)-(nca+ncb)%mod) % mod-1)


    return

if __name__ == '__main__':
    main()

Measured memory_bytes: 5068
using System;

namespace ABC_048_A_Csharp_ver
{
    class Program
    {
        static void Main(string[] args)
        {
            var word = Console.ReadLine().Split(' ');
            string AtCoder = (word[0]);
            string s = (word[1]);
            string Contest = (word[2]);
            string B = s.Substring(0, 1);
            Console.WriteLine("A" + B + "C");
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
/*。*/
#include <iostream>
#include<stdio.h>
#include <cmath>
using namespace std;

class saikoro{
public:
    int s1,s2,s3,s4,s5,s6;
    
public:saikoro(int* mas);
    void west();
    void north();
    void east();
    void sauth();
    
};
saikoro::saikoro(int* mas){
    s1=mas[0];
    s2=mas[1];
    s3=mas[2];
    s4=mas[3];
    s5=mas[4];
    s6=mas[5];
}
void saikoro::east(){
    int u=s6;
    s6=s3;
    s3=s1;
    s1=s4;
    s4=u;
    
}
void saikoro::north(){
    int u=s6;
    s6=s5;
    s5=s1;
    s1=s2;
    s2=u;
}
void saikoro::west(){
    int u=s6;
    s6=s4;
    s4=s1;
    s1=s3;
    s3=u;
}
void saikoro::sauth(){
    int u=s6;
    s6=s2;
    s2=s1;
    s1=s5;
    s5=u;
}

int main(){
   int  masu[6];
    for(int i=0;i<6;i++){
        cin>>masu[i];
    }
    saikoro sai(masu);
    string mei;
    cin>>mei;
    for(int i=0;i<mei.size();i++){
        if(mei[i]=='E')sai.east();
        else if(mei[i]=='S')sai.sauth();
        else if(mei[i]=='W')sai.west();
        else if(mei[i]=='N')sai.north();
    }
   
    cout<<sai.s1<<endl;
return 0;
}


Measured memory_bytes: 3240
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

int n,m,a[1000];

map<int,int> c;

int main() {
    while(true) {
        cin >> n >> m;
        if(n == 0)break;
        rep(i,n){
            cin >> a[i];
            c[a[i]] = 0;
        }
        rep(i,n) {
            c[a[i]]++;
        }
        sort(a,a+n);//aをソート

        int ans = -1;
        rep(i,n) {
            auto itr = upper_bound(a,a+n,m - a[i]);//m-a[i]<a[j] となる最小のjのa[j]へのポインタを取得
            if(itr - a == 0) {//m - a[i]>=a[j]を満たすjが存在しない時
                continue;
            }
            itr--;//ポインタを一つ減算してm-a[i]>=a[j]となる最大のjのa[j]へのポインタを取得
            if(*itr == a[i] && c[a[i]] < 2) {//境界のものがa[i]だった時
                if(itr - a == 0) {//a[i]未満のものがない時
                    continue;
                }
                itr--;//さらに一つ前に
            }
            ans = max(ans,*itr + a[i]);
        }
        if(ans == -1)cout << "NONE" << endl;
        else cout << ans << endl;
    }

    return 0;
}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define MAX_N 15

enum HONESTY {
    DISHONEST, HONEST
};

typedef pair<i64, HONESTY> P;
i64 N;
i64 A[MAX_N];
vector<P> testimony[MAX_N];

void solve() {
    i64 maxn = 0;

    for (i64 bit = 1; bit < (1 << N); bit++) {
        i64 n_honest = __builtin_popcount(bit);

        bool ok = true;
        REP(i, N) {
            if (!(bit & (1 << i))) continue;

            for (auto it = testimony[i].begin(); it != testimony[i].end(); it++) {
                if ((*it).S == HONEST) {
                    ok = ok && (bit & (1 << (*it).F));
                } else {
                    ok = ok && !(bit & (1 << (*it).F));
                }
            }
        }

        if (ok) chmax(maxn, n_honest);
    }

    cout << maxn << endl;
}

int main() {
    cin >> N;

    i64 x, y;
    REP(i, N) {
        cin >> A[i];
        REP(j, A[i]) {
            cin >> x >> y;
            x--; // 1-indexed to 0-indexed
            testimony[i].pb(mp(x, (y == HONEST ? HONEST : DISHONEST)));
        }
    }

    solve();

    return 0;
}

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

int main() {
	int n;
	cin >> n;
	vector<int>a(n);
	for (int i = 0; i < n; i++)cin >> a.at(i);
	sort(a.begin(), a.end());
	vector<vector<int>>as;
	for (int i = 0; i < n; i++) {
		if (i == 0)as.push_back({ a.at(i),1 });
		else {
			if (a.at(i) == a.at(i - 1))as.at(as.size() - 1).at(1)++;
			else as.push_back({ a.at(i),1 });
		}
	}
	for (int i = 0; i < as.size(); i++) {
		if (as.at(i).at(1) >= 3)as.at(i).at(1) %= 2;
		if (as.at(i).at(1) == 0)as.at(i).at(1) += 2;
	}
	ll a1 = 0;
	ll a2 = 0;
	for (int i = 0; i < as.size(); i++) {
		if (as.at(i).at(1) == 1)a1++;
		else a2++;
	}
	//cout << a1 << " " << a2 << endl;
	cout << a1+a2-a2%2 << endl;
}

Measured memory_bytes: 6064
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e+9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main(){
    vector<vector<int>> a(3,vector<int>(3,0));
    vector<vector<bool>> can(3,vector<bool>(3,false));

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

    int n; cin >> n;

    vector<int> b(n);
    REP(i, n) cin >> b[i];

    for(int i=0; i<3; i++)
    {
        for(int k=0; k<3; k++)
        {
            for(int j=0; j<n; j++)
            {
                if(b[j]==a[i][k])   can[i][k] = true;
            }
        }
    }

    bool flag=false;
    for(int i=0; i<3; i++)
    {
        if((can[i][0] == true) && (can[i][1] == true) && (can[i][2] == true)) flag = true;
    }

    for(int i=0; i<3; i++)
    {
        if((can[0][i] == true) && (can[1][i] == true) && (can[2][i] == true)) flag = true;
    }

    if((can[0][0] == true) && (can[1][1] == true) && (can[2][2] == true)) flag = true;
    if((can[0][2] == true) && (can[1][1] == true) && (can[2][0] == true)) flag = true;

    if(flag)    cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
	string s;cin>>s;
	map<char,int>a;
	rep(i,s.size()){
		a[s[i]]++;
	}
	sort(all(s));
	s.erase(unique(all(s)),s.end());
	rep(i,s.size()){
		if(a[s[i]]%2==1){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=1<<30;
const int mod=1e9+7;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;cin >> n >> m;
    vector<int> a(n);
    int sum=0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        sum+=a[i];
    }
    int cnt=0;
    for(int i=0;i<n;i++){
        if(a[i]*4*m>=sum){
            cnt++;
        }
    }
    if(cnt>=m){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;
// mp::cpp_int
// mp::cpp_dec_float_100



int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  
  stack<char> s;
  char i;
  int cnt = 0;
  while(cin >> i) {
    cnt++;
    if(not(s.empty()) and i != s.top()) {
      s.pop();
    }
    else s.push(i);
  }
  
  cout << cnt-s.size() << "\n";
  
  //cout << (  ?"Yes" :"No") << "\n";

}

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

vector<int> flagl(26,0);
vector<int> flagr(26,0);

int main(){
    int N;
    cin>>N;
    string S;
    cin>>S;
    int cnt,MAX=0;

    for(int i=0;i<N-1;i++){
        cnt=0;
        for(int j=0;j<=i;j++){
            flagl[S[j]-'a']=1;
        }
        for(int j=i+1;j<=N-1;j++){
            flagr[S[j]-'a']=1;
        }
        for(int j=0;j<26;j++){
            if(flagl[j]&&flagr[j]){
                cnt++;
            }
        }
        MAX=max(MAX,cnt);
        flagl.assign(26,0);
        flagr.assign(26,0);
    }

    cout<<MAX<<endl;

    return 0;
}

Measured memory_bytes: 256
import collections

N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))
flag = False
ans_flag = True
d = collections.Counter(D)
t = collections.Counter(T)
# print(d.most_common())
# print(t.most_common())
for i in t:
    i_str = str(i)
    d_count = d[i]
    if d_count < t[i]:
        print("NO")
        ans_flag = False
        break

if ans_flag == True:
    print("YES")

Measured memory_bytes: 57056
#include <iostream>
#include <string>
 
using namespace std;
 
void func150b()
{
    int n;
    string s;
    cin >> n;
    cin >> s;
 
    //ここでsの中にあるABCを数える
    int num = 0;
   // for (int i = 0; i <= n - 3; ++i) {
     //   if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') num++;
    //}
    for (int i = 0; (i= s.find((string) "ABC",i)) != string::npos; ++i) {
        num++;
    }
    cout << num << endl;
}
 
int main()
{
  func150b();
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define N 200005
#define M 100005
#define s second
#define f first
using namespace std;
typedef pair<int,int> P;
int n,m;
P p[M],A[N];

void merge(int a,int b){
  A[a]=A[b]=P(min(A[a].f,A[b].f),max(A[a].s,A[b].s));
}

void solve(){
  for(int i=1;i<=n;i++)
    A[i]=P(i,i);
  for(int i=0;i<m;i++)
    merge(p[i].second,p[i].second+1);
  for(int i=1;i<=n;i++){
    if(i!=1)cout<<' ';
    cout<<A[i].second-A[i].first+1;
  }
  cout<<endl;
}

int main(){
  cin>>n>>m;
  for(int i=0;i<m;i++)
    cin>>p[i].first>>p[i].second;
  sort(p,p+m);
  solve();
  return 0;
}

Measured memory_bytes: 5456
package main

import(
    "fmt"
    "sort"
    "strings"
)



func main() {
    var n,x int
    fmt.Scan(&n,&x)
    mi := 1000000
    ans := n
    for i:=0; i<n; i++{
        var m int
        fmt.Scan(&m)
        x -= m
        mi = min32(mi,m)
    }
    ans += x/mi
    fmt.Println(ans)
}





// Pairsort
type Pair struct {
    first,second int64
}

type By func(p1, p2 *Pair) bool

func (by By) Sort(pairs []Pair) {
    ps := &pairSorter{
            pairs : pairs,
            by: by,
    }
    sort.Sort(ps)
}

type pairSorter struct {
    pairs []Pair
    by func(p1, p2 *Pair) bool
}

func (s *pairSorter) Len() int {
    return len(s.pairs)
}

func (s *pairSorter) Swap(i, j int) {
    s.pairs[i], s.pairs[j] = s.pairs[j], s.pairs[i]
}

func (s *pairSorter) Less(i, j int) bool {
    return s.by(&s.pairs[i], &s.pairs[j])
}

func first (p1, p2 *Pair) bool {
        return p1.first < p2.first
}

func second (p1, p2 *Pair) bool {
        return p1.second < p2.second
}
// end



func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}

func SortString(s string) string{
    t := strings.Split(s, "")
    sort.Strings(t)
    return strings.Join(t, "")
}


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

int main(){
  int D;
  cin >> D;
  
  
  switch(D){
      case 22: cout << "Christmas Eve Eve Eve" << endl;break;
      case 23: cout << "Christmas Eve Eve" << endl;break;
      case 24: cout << "Christmas Eve" << endl;break;
      case 25: cout << "Christmas" << endl;break;
  }
  
  return 0;
  
}


Measured memory_bytes: 256
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()

for a in range(1, 10):
	for b in range(1, 10):
		if N == a*b:
			print('Yes')
			exit()
print('No')


Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
int main () {
    int n;
    int k;
    cin >> n >> k;
    int keta = 0 ;
    while ( n > 0){
        n = n / k ;
        keta++ ;
    }
    cout << keta << endl;
    return 0;
}


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

int main() {
  int n=0, x, A[10000];
  bool flag = true;

  while (flag) {
    cin >> x;
    if (x != 0 ){
      A[n] = x;
      n++;
    } else {
      flag = false;
    }    
  }
  for (int i = 0; i < n; i++) {
    cout << "Case " << (i + 1) << ": " << A[i] << endl;
  }
  return 0;
}


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


int main()
{   
    string s,t ;
    int n,m;
    cin >> s >> t ;
    n=s.length() ; m=t.length() ;

    int ans[m+1][n+1] ;
    int dp [m+1][n+1];
    
    for (int i=0;i<=m;i++){
        for (int j=0 ;j<=n ;j++)
            dp[i][j]=0 ;
    }

    for (int i=1 ; i<=m ; i++)
        for (int j=1 ; j<=n ;j++){
            if (t[i-1]==s[j-1]){
                ans[i][j]=0 ; // match
                dp[i][j]=dp[i-1][j-1]+1 ;
            }
            else{
                dp[i][j]=dp[i-1][j-1] ;
                ans[i][j]=3 ; // lu
                if (dp[i-1][j]>=dp[i][j]){
                    dp[i][j]=dp[i-1][j] ;
                    ans[i][j]=2 ; // u
                }
                if (dp[i][j-1]>=dp[i][j]) {
                    dp[i][j]=dp[i][j-1] ;
                    ans[i][j]=1 ; // l
                }
            }
        }


    for (int i=0 ; i<= m ;i++)
        ans[i][0]=2 ; // u
    for (int i=0 ; i<= n ;i++)
        ans[0][i]=1 ; // l

    string answer="" ;
    int i=m , j= n ;
    while (i>=0 && j>=0){
        if (ans[i][j]==0) {
            answer+=s[j-1] ;
            i-- ;
            j-- ;
        }
        else if (ans[i][j]==1)
            j-- ;
        else if (ans[i][j]==3){
            i-- ;
            j-- ;
        }
        else
            i-- ;
    }

    reverse(answer.begin(),answer.end()) ;
    cout << answer ;
    return(0);
}



Measured memory_bytes: 73920
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string a;
	int b;
	b=700;
	cin>>a;
	for(int i=0;i<3;i++){
		if(a[i]=='o'){
			b=b+100;
		}
	}
	cout<<b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std; 
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define ll long long
struct rb
{
	int l,r;
}R[100005];
bool operator <(const struct rb &a,const struct rb &b)
{
	
	return a.r<b.r;
}
int main(int argc, char** argv) {
	int n,k,s;
	cin>>n>>k>>s;
	if(s!=1e9)
	{
		for(int i=1;i<=k;i++)
		{
			printf("%d ",s);
		}
		for(int i=k+1;i<=n;i++)
		{
			printf("%d ",s+1);
		}
	}
	else
	{
		for(int i=1;i<=k;i++)
		{
			printf("%d ",s);
		}
		for(int i=k+1;i<=n;i++)
		{
			printf("%d ",3);
		}
	}
	return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()

using namespace std;

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

    cout << (n >= 1000 ? "ABD" : "ABC") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
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; }

int main(){
  vi a(3);
  rep(i,3){
    cin >> a[i];
  }
  sort(all(a));
  if(a[0]+a[1]==a[2]){
    print("Yes");
  }
  else{
    print("No");
  }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    int n = Integer.parseInt(s);

    long b[] = {0, 0, 0, 0, 0};

    for(int i = 0; i < n; i++)
    {
      s = r.readLine();
      char c = s.charAt(0);
      switch(c)
      {
        case 'M':
          b[0]++;
          break;
        case 'A':
          b[1]++;
          break;
        case 'R':
          b[2]++;
          break;
        case 'C':
          b[3]++;
          break;
        case 'H':
          b[4]++;
          break;
      }
    }

    long a = 0;

    for(int i = 0; i < 3; i++)
      for(int j = i + 1; j < 4; j++)
        for(int k = j + 1; k < 5; k++)
        {
          a += b[i] * b[j] * b[k];
        }

    System.out.println(a);

  }

}


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

int main() {
  long long x;
  cin >> x;
  long long ans = x / 11 * 2;
  x %= 11;
  if (1 <= x && x <= 6)
    ++ans;
  if (7 <= x && x <= 10)
    ans += 2;
  cout << ans << endl;
}


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

int main() {
    int n; cin >> n;
    switch (n % 10) {
        case 2:
        case 4:
        case 5:
        case 7:
        case 9:
            cout << "hon" << endl;
            return 0;

        case 0:
        case 1:
        case 6:
        case 8:
            cout << "pon" << endl;
            return 0;

        default:
            cout << "bon" << endl;
            return 0;
    }
}



Measured memory_bytes: 3600
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <limits>
#include <numeric>
#include <stack>
#include <queue>
#include <functional>

typedef long long ll;
typedef long double ld;

#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);

#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()

#define rep(i,a,b,c)            for(int i=(a);i<(b);i+=(c))
#define repb(i,a,b,c)           for(int i=(a);i>=(b);i-=(c))
#define ln '\n';
#define mod 1e9 + 7
#pragma warning(disable:4996)

using namespace std;

ll gcd(ll a, ll b) {
	while (a > 0 && b > 0) {
		if (a > b)
			a %= b;
		else
			b %= a;
	}

	return a + b;
}

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

int bitcount(int n) {
	int c = 0;
	while (n > 0) {
		if (n & 1)
			c++;
		n >>= 1;
	}
	return c;
}

struct cmp {
	constexpr bool operator()(pair<int, int>& a, pair<int, int>& b) const {
		return a.second > b.second;
	}
};


void solve() {
}

int main()
{
	fast
	int n;
	cin >> n;
	vector<int> a(n);
	int i = 0;
	int t;
	for(int j = 0; j < n; j++) {
		cin >> t;
		a[i++] = t;
	}
	n = i;
	a.resize(n);
	sort(all(a));
	int res = 0;
	for (int i = 0; i < n - 2; i++) {
		for (int j = i + 1; j < n - 1; j++) {
			for (int k = j + 1; k < n; k++) {
				int l1 = a[i];
				int l2 = a[j];
				int l3 = a[k];
				if (l1 != l2 && l2 != l3 && l1 != l3) {
					if (a[i] + a[j] > a[k] && a[i] + a[k] > a[j] && a[k] + a[j] > a[i]) {
						res++;
					}
				}
			}
		}
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 3656
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

const std::string YES = "Yes";
const std::string NO = "No";

void solve(std::string s, std::string t){
	sort(s.begin(), s.end());
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	if(s < t){
		cout<<YES<<endl;
	}else{
		cout<<NO<<endl;
	}
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string s;
    std::cin >> s;
    std::string t;
    std::cin >> t;
    solve(s, t);
    return 0;
}


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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int n,ans;

main() {
    cin >> n;
    rep(i,4) {
        if (n%10 == 2) ans++;
        n/=10;
    }
    ct(ans)
}


Measured memory_bytes: 256
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

	ll n;
	cin>>n;
	Array t(n,0),v(n,0);
	REP(i,n) cin>>t[i];
	REP(i,n) cin>>v[i];

	Array sum_t(n+1,0);
	REP(i,n) sum_t[i+1]=sum_t[i]+t[i];
	
	vector<double> vt(sum_t[n]*2+1,0);

	ll ii=0;
	double now=0;
	for(int time=1;time<=sum_t[n]*2;time++){
		
		if(time>sum_t[ii+1]*2) ii++;
		if(now<v[ii]) now+=0.5;
		if(now>v[ii])now=v[ii];
		vt[time]=now;
		//cout<<time<<":"<<now<<endl;;
	}
	
	ii=n-1;
	now=0;
	vt[sum_t[n]*2]=0;
	for(int time=sum_t[n]*2-1;time>=0;time--){
		if(time<sum_t[ii]*2) ii--;
		if(now<v[ii]) now+=0.5;
		if(now>vt[time]) now=vt[time];
		chmin(vt[time],now);
		//cout<<time<<":"<<vt[time]<<endl;
	}

	double ans=0;

	for(int time=1;time<=sum_t[n]*2;time++){
		double y=vt[time-1]+vt[time];
		y/=4.0;
		ans+=y;
	}

	cout<<fixed  << setprecision(10)<<ans<<endl;

	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;
public class Main{
	public  static int count = 0;
	public  static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(); // 要素の個数
		int[] num = new int[n]; // 個数のリスト

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}
		// merge(num,0,5,10) ;
		int[] A = mergeSort(num,0,n);
		for(int i = 0;i < n;i++){
			if(i != n-1){
				System.out.print(A[i]+" ");
			}else{
				System.out.println(A[i]);
			}
		}

		System.out.println(count);
	}
	/**
	 * 比較してソートする
	 * @param A	ソートするリスト
	 * @param left	ソート対象の一番左側のリスト番号
	 * @param mid	分割地点
	 * @param right	ソート対象の一番右側のリスト番号
	 */
	public static void merge(int[] A,int left,int mid,int right){
		int n1 = mid -left;
		int n2 = right -mid;
		int[] L =new int[n1+1];
		int[] R =new int[n2+1];
		L[n1] = 1000000000;//∞
		R[n2] = 1000000000;//∞
		for(int i = 0;i<n1;i++){

			L[i] = A[left+i];
		}
		for(int i = 0;i<n2;i++){	  
			R[i] = A[mid+i];
		}

		int i = 0;
		int j = 0;
		for(int k = left; k<right;k++ ){
			count++;
			if(L[i] <= R[j]){
				A[k] = L[i];
				i = i+1;
			}else{
				A[k] = R[j];
				j = j+1;
			}

		}


	}
	/**
	 *  マージソート
	 * @param A	ソートするリスト
	 * @param left　ソート対象の一番左側のリスト番号
	 * @param right　ソート対象の一番右側のリスト番号
	 * @return
	 */
	private static int[]   mergeSort(int[] A, int left, int right){
		if(left +1 < right){

			int mid = (left + right) /2;
			mergeSort(A,left,mid);
			mergeSort(A,mid , right);
			merge(A,left,mid,right);
		}
		return A;
	}
}



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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

//実行部
void Main()
{
  ll n; cin >> n;
  if(n == 7||n == 5||n == 3) fin("YES")
  else fin("NO")
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
string S[26][26];
int main() {
	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) cin >> S[i][j];
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (S[i][j] == "snuke") {
				printf("%c%d\n", 'A' + j, i + 1);
				return 0;
			}
		}
	}
}

Measured memory_bytes: 256
# coding: utf-8
#素因数分解
def prime_factorize(N):
    f = []
    i = 2
    while i * i <= N:
        if N % i != 0:
            i += 1
            continue
        #指数
        exp = 0
        #割れる限り割り続ける
        while N % i == 0:
            exp += 1
            N //= i
        #結果をpush
        f.append([i, exp])
        #次の素数へ: 合成数は順次消されている
        i += 1
    #最後残った数について
    if N != 1:
        f.append([N, 1])
    return f

#main
N = int(input())
F = prime_factorize(N)

cnt = 0
for i in range(len(F)):
    a = F[i][1] - 1
    j = 1
    while a >= 0:
        cnt += 1
        j += 1
        a -= j
print(cnt)

Measured memory_bytes: 9224
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<iomanip>
#include<map>
#include<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=1e5+10;
int n;
int p[MAXN];
int pos[MAXN];
int lp[MAXN];
int rp[MAXN];
int main()
{
    // freopen("in.txt","r",stdin);
    ios::sync_with_stdio(false);
    cin>>n;
    for(int u=1;u<=n;u++){
        cin>>p[u];
        pos[p[u]]=u;
        lp[u]=u-1;
        rp[u]=u+1;
    }
    ll ans=0;
    for(int idx=1;idx<=n;idx++){
        ll lp1=(ll)lp[pos[idx]];
        ll lp2=(ll)lp[lp1];
        ll rp1=(ll)rp[pos[idx]];
        ll rp2=(ll)rp[rp1];
        if(lp1!=0)ans+=(ll)idx*(lp1-lp2)*(rp1-pos[idx]);
        if(rp1!=n+1)ans+=(ll)idx*(pos[idx]-lp1)*(rp2-rp1);
        lp[rp1]=lp1;
        rp[lp1]=rp1;
    }
    cout<<ans;
}

Measured memory_bytes: 1920
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <set>
#include <queue>
#include <limits>
#include <deque>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
#define all(v) v.begin(),v.end()
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define MN 0LL
#define Mx 2000000005
#define Mn -Mx
#define MX 20000000000000005
using namespace std;
int readint(){
	char c;
	while(c=getchar(),(c<'0'||c>'9')&&c!='-');
	bool flag=(c=='-');
	if(flag)c=getchar();
	int x=0;
	while(c>='0'&&c<='9'){
		x=x*10+c-48;
		c=getchar();
	}
	return flag?-x:x;
}
inline string tos(int x){
	string s;
	while(x) s=(char)(x%10+'0')+s,x/=10;
	return s;
}
inline int pt(int a[],int l,int r){
	int p,i,j;
	p=a[l];
	i=l;
	j=r+1;
	for(;;){
		while(a[++i]<p) if(i>=r) break;
		while(a[--j]>p) if(j<=l) break;
		if(i>=j) break;
		else swap(a[i],a[j]);
	}
	if(j==l) return j;
	swap(a[l],a[j]);
	return j;
}
inline void q_sort(int a[],int l,int r){
	int q;
	if(r>l){
		q=pt(a,l,r);
		q_sort(a,l,q-1);
		q_sort(a,q+1,r);
	}
}
int main(){
	int n,t;
	long long ans=1,T=1;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>t;
		if(t%2) T*=1;
		else T*=2;
		ans*=3;
	}
	cout<<ans-T<<endl;
	return 0;
}


Measured memory_bytes: 256
<?php
fscanf(STDIN,'%d%d',$A,$B);
if($A==2){
  $A=0;
}elseif($A==4||$A==6||$A==9||$A==11){
  $A=1;
}else{
  $A=2;
}
if($B==2){
  $B=0;
}elseif($B==4||$B==6||$B==9||$B==11){
  $B=1;
}else{
  $B=2;
}
if($A==$B){
  echo 'Yes';
}else{
  echo "No";
}
 ?>


Measured memory_bytes: 3576
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include<set>

using namespace std;

int main() {
	int n;
	int k = 0;
	cin >> n;
	set<int> A;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (A.count(a)) {
			A.erase(a);
		}
		else{
			A.insert(a);
		}
	}
	cout << A.size() << endl;
}






Measured memory_bytes: 4864
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const ll mod = 998244353;
const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int kazu[100001];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();

	//解けなかった...ｶﾅｼｲ...
	if (getint() != 0) {
		printf("0");
		return 0;
	}

	int saidai = 0;;
	rep(i, N - 1) {
		int d = getint();
		if (!d) {
			printf("0");
			return 0;
		}
		kazu[d]++;
		chmax(saidai, d);
	}

	ll kotae = 1;
	int mae = 1;
	rep1(i, saidai) {
		rep(j, kazu[i]) kotae = kotae * mae % mod;
		mae = kazu[i];
	}

	printf("%d", kotae);

	Would you please return 0;
}


Measured memory_bytes: 640
n = gets.chomp.to_i
an = gets.chomp.split(/\s/).map{|x| x.to_i}
me = an.inject(0) {|s,x| s+x} / n.to_f
i = an.index(me)
if i
    puts i
else
    d = []
    for i in 1..n
        d[i-1] = (me - an[i-1]).abs
    end
    puts d.index(d.min)
end

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

int main() {
    int s, a, b, c;
    cin >> s;
    a = s % 10;
    b = (s % 100 - a) / 10;
    c = (s - 10*b - a) / 100;
    cout << a + b + c << endl;
}


Measured memory_bytes: 3580
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N;
	cin >> N;
	VI A(N), B(N), C(N);
	REP(i, N)cin >> A[i];
	REP(i, N)cin >> B[i];
	REP(i, N - 1)cin >> C[i];
	int ans = 0;
	REP(i, N)ans += B[i];
	REP(i, N-1) {
		if (A[i] + 1 == A[i + 1]) {
			ans += C[A[i] - 1];
		}
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 256
import numpy as np

K = input()
digit = len(K)
K = int(K)
divided = int(((10**(digit) - 1)*7) / 9)
flag = True
remains = np.zeros(K)
while flag:
  remain = divided%K
  if remain==0:
    flag = False
    print(digit)
  elif remains[remain-1]==1:
    flag = False
    print(-1)
  else:
    remains[remain-1] = 1
    digit += 1
    divided = remain*10 + 7

Measured memory_bytes: 34508
#include <bits/stdc++.h>
using namespace std;
  
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

const int N = 1e5 + 5, INF = 1e9;
int a[N], b[N];

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

    int n, m, k;
    cin >> n >> m >> k;

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

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

    int ans = INF;

    for (int i = 0; i < k; i++) {
        int x, y, z;
        cin >> x >> y >> z;
        x--, y--;
        ans = min(ans, a[x] + b[y] - z);
    }

    ans = min(ans, *min_element(a, a + n) + *min_element(b, b + m));

    cout << ans;

    return 0;
}   

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;


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

  std::vector<ll> a(n);
  std::vector<ll> b(n);

  rep(i,n) cin >> a.at(i) >> b.at(i);

  ll count=0,sur,push;
  for(ll i=n-1;i>=0;i--){
    a.at(i)+=count;
    sur=a.at(i)%b.at(i);
    if(sur==0){
      continue;
    }
    else{

      push=b.at(i)-sur;
      count+=push;
    }

  }
    cout << count << endl;

}


Measured memory_bytes: 4812
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


#define INF 1e9+7
#define LLINF 1e18+7
#define N 250000

vector<vector<pii>> mempar;
vector<vector<pii>> memsize;

int turn=0;

struct UnionFind{
    vector<int> par,sizes;
    UnionFind(int n):par(n+1),sizes(n+1,1){
        rep2(i,1,n)par[i]=i;
    }
    int find(int x){
        if(x==par[x])return x;
        else{
            int res=find(par[x]);
            par[x]=res;
            mempar[x].pb({turn,res});
            return res;
        }
        // return (x==par[x]?x:par[x]=find(par[x]));
    }
    void unite(int x,int y){
        x=find(x);y=find(y);
        if(x==y)return ;
        if(sizes[x]<sizes[y]){
            swap(x,y);
        }
        par[y]=x;
        mempar[y].pb(pii{turn,x});
        sizes[x]+=sizes[y];
        memsize[x].pb(pii{turn,sizes[x]});
    }
    bool same(int x,int y) {return (find(x)==find(y));}
    int size(int x) {return sizes[find(x)];}
};


main(){
    ll a,b,c;
    cin>>a>>b>>c;
    ll ans=LLINF;
    ans=min(ans,a%2*b*c);
    ans=min(ans,b%2*a*c);
    ans=min(ans,c%2*a*b);
    cout<<ans;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  int ans;
  
  vector<int> h(N);
  for (int i = 0; i < N; i++) {
    cin >> h.at(i);
  }

  vector<int> h_test(N);
  
  for (int i = 0; i < N; i++) {
    if (h.at(i) >= K) {
      h_test.at(i) = 1;
    }
    else if (h.at(i) < K) {
      h_test.at(i) = 0;
    }
  }
  
  ans = accumulate(h_test.begin(),h_test.end(),0);
  cout << ans << endl;
}

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

// B
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll n;
    cin>>n;
    ll i;
    ll a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll c=0;
    for(i=1;i<n-1;i++)
    {
        if((a[i]>a[i-1] && a[i]<a[i+1]) || (a[i]<a[i-1] && a[i]>a[i+1]))
            c++;
    }
    cout<<c;
}

Measured memory_bytes: 256
#include <stdio.h>

int main (void)
{
	int n,i,a;
	int max,min;
	long int sum;
	max=-1000000;
	min=1000000;
	sum=0;
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		if(max<=a){
			max=a;
		}
		if(min>=a){
			min=a;
		}
		sum+=a;
	}
	printf("%d %d %ld\n",min,max,sum);
	return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
const int N = 10101010;
int main() {
	/*
	int n, m, k;
	cin >> n >> m >> k;
	VL a(n), b(m);
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, m) {
		cin >> b[i];
	}
	int i = 0, j = 0;
	ll now = 0, ans = 0;
	while (1) {
		if (i == n && j == m) break;
		else {
			if (i == n && j != m) {
				if (now + b[j] <= k) {
					now += b[j];
					ans++;
					j++;
				}
				else break;
			}
			else if (i != n && j == m) {
				if (now + a[i] <= k) {
					now += a[i];
					ans++;
					i++;
				}
				else break;
			}
			else {
				ll x = a[i], y = b[j];
				if (x != y) {
					if (x < y) {
						if (now + x <= k) {
							now += x;
							ans++;
							i++;
						}
						else break;
					}
					else {
						if (now + y <= k) {
							now += y;
							ans++;
							j++;
						}
						else break;
					}
				}
				else {
					ll xx = i + 1 == n ? UPPER : a[i + 1];
					ll yy = j + 1 == m ? UPPER : b[j + 1];
					if (xx < yy) {
						if (now + x <= k) {
							now += x;
							ans++;
							i++;
						}
						else break;
					}
					else {
						if (now + y <= k) {
							now += y;
							ans++;
							j++;
						}
						else break;
					}
				}
			}
		}
	}
	cout << ans << endl;
	*/
	int n;
	cin >> n;
	ll ans = 1;
	VL cnt(N, 1);
	REP(i, 2, n + 1) {
		for (int j = i; j <= n; j += i) cnt[j]++;
		ans += cnt[i] * i;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 82192