akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>

using namespace std;

//nの一の位を切り上げ
//ただし，一の位が0ならそのまま
int upper(int n){ 
  if(n%10 == 0)
    return n;
  else
    return n += (10 - n%10);
}


int main(void){
  vector<int> times(5);
  int i;
  int sum = 0;
  for(i=0; i<5; i++)
    cin >> times[i];

  int m = 0;
  for(i=1; i<5; i++)
    //10で割った余りが最小(0以外)の場所を探す
    if((times[i]%10 < times[m]%10) && (times[i]%10 != 0))
      m = i;

  for(i=0; i<5; i++)
    //m番目以外では切り上げの和
    if(i != m){
      sum += upper(times[i]);
      //cout << "sum : " << sum << endl;
    }  
  //m番目を加算
  sum += times[m];

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 256
MOD = 1_000_000_007
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

lim = 60
bit_count = Array.new(lim, 0)
de = false

a.each do |num|
  lim.times do |i|
    bit_count[i] += num[i]
  end
end

p ['init', bit_count] if de

ans = 0

lim.times do |i|
  ans += bit_count[i] * (n - bit_count[i]) * 2 ** i
  ans %= MOD #=
end

puts ans




Measured memory_bytes: 42800
import java.util.*;

public class Main{
    static int[] a, b, c;
    static int n, ma, mb;
    static int opt=Integer.MAX_VALUE;
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        n=Integer.parseInt(sc.next());
        ma=Integer.parseInt(sc.next());
        mb=Integer.parseInt(sc.next());
        a=new int[n];
        b=new int[n];
        c=new int[n];
        for(int i=0;i<n;i++){
            a[i]=Integer.parseInt(sc.next());
            b[i]=Integer.parseInt(sc.next());
            c[i]=Integer.parseInt(sc.next());
        }
        sc.close();
        int ans=search(0, 0, 0, 0);
        if(ans==Integer.MAX_VALUE) ans=-1;
        System.out.println(ans);
    }

    public static int search(int sumA, int sumB, int sumC, int st){
        if(sumC>=opt) return opt;
        if((sumA+a[st])*mb==(sumB+b[st])*ma){
            opt=Math.min(opt,sumC+c[st]);
            if(st==n-1) return opt;
            return Math.min(opt, search(sumA, sumB, sumC, st+1));
        }
        if(st==n-1) return opt;
        return Math.min(Math.min(opt,search(sumA, sumB, sumC, st+1)), search(sumA+a[st], sumB+b[st], sumC+c[st], st+1));
    }
}

Measured memory_bytes: 24916
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int n; cin>>n;
	ll ans=MOD;
	rep(i,0,n+1){
		double m=i*1.08;
		int j=m;
		if(j==n){
			ans=i;
			break;
		}
	}
	if(ans!=MOD) cout<<ans<<endl;
	else cout<<":(";
		//cout<<double(927*1.08);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
//#include <iomanip>
#include <string>
#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	string s ; cin >> s ;
	ll n = s.size() ;
	vvll dp(n+1,vll(13,0)) ;
	ll m = 1 ;
	dp.at(0).at(0) = 1 ;
	for(int i=1;i<=n;i++){
		if(s.at(n-i)=='?'){
			for(int j=0;j<10;j++){
				for(int k=0;k<13;k++){
					dp.at(i).at(k) += dp.at(i-1).at((k-j*m%13+13)%13) ;
					dp.at(i).at(k) %= mod ;
				}
			}
		}else{
			int j = s.at(n-i)-'0' ;
			for(int k=0;k<13;k++){
				dp.at(i).at(k) += dp.at(i-1).at((k-j*m%13+13)%13) ;
				dp.at(i).at(k) %= mod ;
			}
		}
		m = m*10%13 ;
	}
	/*for(int i=0;i<=n;i++){
		for(int j=0;j<13;j++){
			cout << dp.at(i).at(j) << (j==12?'\n':' ') ;
		}
	}*/
	cout << dp.at(n).at(5) << endl ;
}


Measured memory_bytes: 13696
ABCD = input()

A = int(ABCD[0])
B = int(ABCD[1])
C = int(ABCD[2])
D = int(ABCD[3])

if A+B+C+D == 7:
    print(str(A)+"+"+str(B)+"+"+str(C)+"+"+str(D)+"=7")
elif A-B+C+D == 7:
    print(str(A)+"-"+str(B)+"+"+str(C)+"+"+str(D)+"=7")
elif A+B-C+D == 7:
    print(str(A)+"+"+str(B)+"-"+str(C)+"+"+str(D)+"=7")
elif A+B+C-D == 7:
    print(str(A)+"+"+str(B)+"+"+str(C)+"-"+str(D)+"=7")
elif A+B-C-D == 7:
    print(str(A)+"+"+str(B)+"-"+str(C)+"-"+str(D)+"=7")
elif A-B-C+D == 7:
    print(str(A)+"-"+str(B)+"-"+str(C)+"+"+str(D)+"=7")
elif A-B+C-D == 7:
    print(str(A)+"-"+str(B)+"+"+str(C)+"-"+str(D)+"=7")
elif A-B-C-D == 7:
    print(str(A)+"-"+str(B)+"-"+str(C)+"-"+str(D)+"=7")

Measured memory_bytes: 3064
import itertools
import math
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
for i, ind in enumerate(itertools.permutations([j+1 for j in range(N)])):
  if P == list(ind):
    a = i
  if Q == list(ind):
    b = i
print(abs(a-b))

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

int main()
{
    long long N,K,A,B;
    cin >> N >> K;
    A = N%K;
    B = K-(N%K);
    if(A<=B) {
        cout << A << endl;
    }
    else {
        cout << B << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<map>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define all(a) a.begin(),a.end()
#define P pair<int,int>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

const int maxn=100;

int main(){
    
    int n;
    int ans=0;
    vector<pair<int,int>> rp;    //(x,y)
    vector<pair<int,int>> bp;    //(x,y)
    bool rp_made_pair[maxn]={0};
    
    cin >> n;
    
    rep(i,n){
        int x,y;
        cin >> x>>y;
        rp.push_back(P(x,y));
    }
    
    rep(i,n){
        int x,y;
        cin >> x>>y;
        bp.push_back(P(x,y));
    }
    
    sort(all(rp));
    sort(all(bp));
    
    
    rep(i,bp.size()){
        int prerp=-1;
        int dis=INF;
        int x=bp[i].first,y=bp[i].second;
        rep(j,rp.size()){
            if(rp[j].first>=x){
                break;
            }else{
                if(!rp_made_pair[j]&&y-rp[j].second>0&&dis>y-rp[j].second){
                    dis=y-rp[j].second;
                    if(prerp>=0)rp_made_pair[prerp]=false;
                    rp_made_pair[j]=true;
                    prerp=j;
                }
            }
        }
    }
    
    rep(i,n){
        if(rp_made_pair[i])ans++;
    }
    
    cout << ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

struct unionfind {
    vector<int> d;
    unionfind(int n=0) : d(n,-1) {}
    int find(int x) {
        if (d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y) {
        x = find(x); y = find(y);
        if (x == y) return false;
        if (d[x] > d[y]) swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y) { return find(x) == find(y);}
    int size(int x) { return -d[find(x)];}
};

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

    int n, m;
    cin >> n >> m;
    unionfind uf(n);
    rep(i, m) {
        int x, y, z;
        cin >> x >> y >> z;
        x--; y--;
        uf.unite(x, y);
    }
    int ans = 0;
    rep(i, n) if (uf.find(i) == i) ans++;
    cout << ans << endl;
}


Measured memory_bytes: 3708
using System;
using System.Collections.Generic;
using System.Linq;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = ReadInt();
            Console.WriteLine(a[0] + a[1] >= a[2] ? "Yes" : "No");
        }

        static int[] ReadInt()
        {
            return Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        }
        static char[] ReadStringToCharArray()
        {
            return Console.ReadLine().ToArray();
        }
    }
}



Measured memory_bytes: 13268
N = int(input())
A = [[] for i in range(N)]
for i in range(N):
    a = int(input())
    for j in range(a):
        x, y = [int(_) for _ in input().split()]
        A[i].append([x-1, y])

ans = 0
for i in range(2**N):
    ss = str(format(i, 'b')).zfill(N)
    h = [int(s) for s in ss]
    t = True
    for j, a in enumerate(A):
        for x in a:
            if h[j] and h[x[0]] != x[1]:
                t = False
    if t:
        ans = max(ans, h.count(1))
print(ans)


Measured memory_bytes: 3064
#include <cstdlib>
#include <cstdio>
#include <vector>

using namespace std;

template<class T> void gc(T &x)
{
    char c;
    int s = 0;
    x = 0;

    c = getchar_unlocked();

    if (c == '-') s = 1;
    else if ('0' <= c && c <= '9')  x = c - '0';

    while (true)
    {
        c = getchar_unlocked();

        if (c < '0' || '9' < c) break;
        x = x * 10 + (c - '0');
    }

    if (s) x = -x;
}

vector<int> A;

int main()
{
    int N;

    gc(N);

    A.resize(N);

    int pre = 0;
    int D = 0;
    for (int i = 0; i < N; i++)
    {
        gc(A[i]);

        D += abs(A[i] - pre);
        pre = A[i];
    }

    D += abs(A[N - 1] - 0);

    int tmp = 0;
    int end = 0;
    pre = 0;
    for (int i = 0; i < N; i++)
    {
        if (i != 0) pre = A[i - 1];

        if (i != N - 1)
        {
            tmp =
                D - abs(A[i + 1] - A[i]) - abs(A[i] - pre)
                + abs(A[i + 1] - pre);
        }
        else
        {
            tmp =
                D - abs(end - A[i]) - abs(A[i] - pre)
                + abs(end - pre);
        }

        printf("%d\n", tmp);
    }

    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
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;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
ll n,k,a[105],cnt,d,ans;
int main()
{
    //IOS;
    cin>>n>>k;
    for(int i=1;i<=k;i++)
    {
        cin>>d;
        for(int j=1;j<=d;j++)
        {
            cin>>cnt;
            a[cnt]++;
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i]==0)
        {
            ans++;
        }
    }
    cout<<ans;
    return 0;
}
/*

*/


Measured memory_bytes: 3636
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>

using namespace std;

int main() {
	int N; cin >> N;
	map<int, int>mp;
	for (int i = 0; i < N; ++i) {
		int a; cin >> a;
		mp[a]++;
	}
	vector<long long int>v;
	for (auto m : mp) {
		if (m.second >= 4) {
			v.push_back(m.first);
			v.push_back(m.first);
		}
		else {
			if (m.second >= 2) {

				v.push_back(m.first);
			}
		}
	}
	if (v.size() <= 1)cout << 0 << endl;
	else {
		sort(v.begin(), v.end());
		long long int ans = v[v.size() - 1] * v[v.size() - 2];
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 4992
INF = 10 ** 11
BLACK = '#'
H, W = [int(i) for i in input().split()]
M = [None] * H
D = [[INF] * W for _ in range(H)]

for i in range(H):
    inputs = input()
    for idx, j in enumerate(inputs):
        if j == BLACK:
            D[i][idx] = 0


def forward_update(i, j):
    up = INF
    if i > 0:
        up = D[i-1][j]
    left = INF
    if j > 0:
        left = D[i][j-1]

    D[i][j] = min(D[i][j], up + 1, left + 1)


def backward_update(i, j):
    down = INF
    if i < H-1:
        down = D[i+1][j]
    right = INF
    if j < W-1:
        right = D[i][j+1]
    D[i][j] = min(D[i][j], down + 1, right + 1)


_ = [forward_update(i, j) for i in range(H) for j in range(W)]
_ = [backward_update(i, j) for i in range(H-1, -1, -1) for j in range(W-1, -1, -1)]

max_value = max([max(x) for x in D])
print(max_value)


Measured memory_bytes: 124644
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
typedef long long ll;
typedef vector<vector<ll>> vvl;
typedef vector<ll> vl;
typedef vector<vector<char>> vvc;
typedef vector<char> vc;
typedef pair<ll,ll> pll;
typedef priority_queue<string> priquest;
typedef priority_queue<string,vector<string>,greater<string>> rpriquest;
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
  return x+y-max(x,y);
}

const ll big=1000000007;
ll exp(ll x,ll y){
    if(y==0)return 1;
    if(x==1||x==0)return x;
    if(y%2==1)return (exp(x,y-1)*x)%big;
    ll t=exp(x,y/2);
    return (t*t)%big;
}


int main(){
    int n;cin >> n;
    vector<ll> a(n);
    rep(i,n)cin >> a[i];
    vl ans(n);
    ans[0]=0;
    ans[1]=abs(a[0]-a[1]);
    rep2(i,2,n){
        ans[i]=min(ans[i-1]+abs(a[i]-a[i-1]),ans[i-2]+abs(a[i]-a[i-2]));
    }
    printf("%lld\n",ans[n-1]);
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <queue>
using namespace std;
typedef long long int ll;
typedef long double ld;
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 long long INF = 1LL << 60;
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
#define MAX_N 100100
#define MOD 1000000007
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}
#define PI 3.14159265359
int main(){
    ll n;
    cin >> n;
    ll a[n+1];
    fill(a,a+n+1,0);
    for (ll i=1;i<n;i++){
        ll x;
        cin >> x;
        a[x-1]=a[x-1]+1;
    }
    for (ll i=0;i<n;i++){
        cout << a[i] << endl;
    }
    return 0;
}



Measured memory_bytes: 5196
from collections import deque
que = deque([i for i in range(1,10)])
n = int(input())

for i in range(n):
    x = que.popleft()
    xl = [x%10-1, x%10,x%10 + 1]
    for j in xl:
        if j == -1 or j == 10:
            continue
        else:
            que.append(10*x+j)
        
print(x)


Measured memory_bytes: 12404
#include "bits/stdc++.h"

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> seeds(N);
	int ans = 0;

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

	for (int i = 0; i < N; i++) {
		if (seeds[i] % 2 == 1 && (i + 1) % 2 == 1) ans++;
	}

	cout << ans;
}

Measured memory_bytes: 3592
import sys
sys.setrecursionlimit(10**8)

N = int(input())
edge = [[] for _ in range(N+1)]
for i in range(N-1):
  u,v,w = map(int, input().split())
  edge[u].append([v,w%2])
  edge[v].append([u,w%2])
color = [0]*(N+1)
visited = [False]*(N+1)
def dfs(u):
  for v,w in edge[u]:
    if visited[v]==False:
      #print(v)
      visited[v]=True
      color[v]=color[u]^w
      dfs(v)
  return 0
visited[1]=True
dfs(1)
ans = color[1:]
print(*ans,sep='\n')

Measured memory_bytes: 82908
from collections import deque
n = int(input())
a = list(map(int, input().split()))
q = deque([])

for i in range(n):
    if i % 2 == 0:
        q.append(a[i])
    else:
        q.appendleft(a[i])

if n % 2 == 1:
    q.reverse()

for i in range(n):
    if i != n - 1:
        print("{} ".format(q[i]), end= "")
    else:
        print("{}".format(q[i]))


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

signed main(){

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int a, b; cin >> a >> b;
    if (a <= b){
        rep(i,b) cout << a;
        cout << endl;
    } 
    else {
        rep(i,a) cout << b;
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0)
#define so sizeof
#define pb push_back
#define vl vector<ll>
#define forn(i,a,b) for(ll i=1;i<=b;++i)
#define forr(i,a,b) for(ll i=0;i<b;++i)
#define vll vector<pair<ll,ll> >
#define r0 return 0
#define be begin()
#define en end()
#define pll pair<ll,ll>
#define plll pair<ll,pair<ll,ll>>
#define plvl pair<pair<ll,ll> ,ll>
#define mp make_pair
#define cf cout.flush()
int main()
{
   ios;
   long long n  ;
   cin >> n ;
   vl v ;
   forn(i , 1 , n){
    ll x;
    cin >> x;
    v.pb(x);
 }
  sort(v.begin() , v.end());
  ll foo = accumulate(v.be , v.en , 0 );
  foo = foo - v[n-1];
  if(v[n-1]  < foo ) cout <<"Yes\n";
  else cout <<"No\n";
  r0;
}


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

int main(){
  string s;cin>>s;
  bool ans=true;
  for(int i=1;i<s.size();++i) {
    if(s[i]==s[i-1]) {
      ans = false;
      break;
    }
  }
  cout<<(ans?"Good":"Bad")<<endl;
}



Measured memory_bytes: 256
#define taskname "test"

#include <bits/stdc++.h>

using namespace std;

#define sz(x) (int)x.size()
#define fi first
#define se second

typedef long long lli;
typedef pair<int, int> pii;

const int maxn = 1e5 + 5;

int n;
int a[maxn];

int cnt[maxn];
vector<pii> gr[maxn];

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

int calc(int u)
{
    if(cnt[u] == 0) return 0;
    int res = cnt[u];
    vector<int> vals(cnt[u]);
    for(int i = 0; i < cnt[u]; ++i)
    {
        int v = gr[u][i].se;
        vals[i] = calc(v);
    }
    sort(vals.begin(), vals.end());
    for(int i = 0; i < cnt[u]; ++i)
        res = max(res, vals[i] + cnt[u] - i);
    return res;
}

void solve()
{
    for(int i = 2; i <= n; ++i)
        ++cnt[a[i]];
    for(int i = 2; i <= n; ++i)
        gr[a[i]].push_back(pii(cnt[i], i));
    cout << calc(1) << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    read_input();
    solve();
}



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

int main(){
  int a, b;
  cin >> a >> b;
  int ans = 0;
  if(a>=2){
    ans = a*(a-1)/2;
  }
  if(b >=2){
    ans += b*(b-1)/2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


int main() {
    int h, w, n; std::cin >> h >> w >> n;
    int x = std::max(h, w);
    std::cout << (n + x - 1) / x << std::endl;
    return 0;
}

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

#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define INF (1 << 29)

using namespace std;

/*class Point{
	public:
		double x, y;

		Point(double x = 0, double y = 0): x(x), y(y) {}

		Point operator + (Point p){ return Point(x + p.x, y + p.y); }
		Point operator - (Point p){ return Point(x - p.x, y - p.y); }
		Point operator * (double a){ return Point(a * x, a * y); }
		Point operator / (double a){ return Point (x / a, y / a); }

		double abs(){ return sqrt(norm()); }
		double norm(){ return x * x + y * y; }

		bool operator < (const Point &p) const{
			return x != p.x ? x < p.x : y < p.y;
		}

		bool operator == (const Point &p) const{
			return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
		}
};

class Segment{
	public:
		Point p1, p2;
		Segment(Point p1 = Point(), Point p2 = Point()): 
			p1(p1), p2(p2) {}
};

class Circle{
	public:
		Point c;
		double r;
		Circle(Point c = Point(), double r = 0.0): c(c) , r(r) {}
};

typedef Segment Line;
typedef vector<Point> Polygon;
typedef Point Vector;

double dot(Vector a, Vector b){
	return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b){
	return a.x * b.y - a.y * b.x;
}
*/

int main(){
	int cnt = 0;
	string s;
	cin >> s;
	if(s[0] == '1') cnt++;
	if(s[1] == '1') cnt++;
	if(s[2] == '1') cnt++;
	cout << cnt << endl;

	return 0;
}


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

const int MAXN = 2e5 + 5;
int n;
long long tree[4*MAXN];

long long query(int v, int tl, int tr, int l, int r) {
	if (l > r) return 0;
	if (l == tl && r == tr) return tree[v];

	int tm = (tl + tr) / 2;
	return max(query(v*2, tl, tm, l, min(r, tm)), query(v*2+1, tm+1, tr, max(l, tm+1), r));
}

void update(int v, int tl, int tr, int pos, long long new_val) {
	if (tl == tr) tree[v] = new_val;
	else {
		int tm = (tl + tr) / 2;
		if (pos <= tm)
			update(v*2, tl, tm, pos, new_val);
		else
			update(v*2+1, tm+1, tr, pos, new_val);
		tree[v] = max(tree[v*2], tree[v*2+1]);
	}
}

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

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

	int max_h = *max_element(h.begin(), h.end());
	long long answer = 0;
	for (int i = 0; i < n; i++) {
		long long x = a[i] + query(1, 0, max_h, 0, h[i]-1);
		//~ cerr << i << ':' << x << '\n';
		//~ for (int j = 0; j <= 4*max_h; j++) cerr << tree[j] << ' '; cerr << '\n';
		answer = max(answer, x);
		update(1, 0, max_h, h[i], x);
	}

	cout << answer << endl;
}


Measured memory_bytes: 7936
object Main{
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val a, b = sc.nextInt
    val x = math.max(a, b)
    val y = math.min(a, b)
    println(gcd(x,y))
  }
  def gcd(x: Int, y: Int) : Int = {
    if (y == 0) x else gcd(y, x%y)
  }
}

Measured memory_bytes: 44916
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    if (x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) {
      if (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12) {
        System.out.println("Yes");
        return;
      } else {
        System.out.println("No");
        return;
      }
    }
    
    if (x == 4 || x == 6 || x == 9 || x == 11) {
      if (y == 4 || y == 6 || y == 9 || y == 11) {
        System.out.println("Yes");
        return;
      } else {
        System.out.println("No");
        return;
      }
    }
    
    if (x == 2 && y == 2) {
      System.out.println("Yes");
      return;
    } else {
      System.out.println("No");
      return;
    }
  }
}

Measured memory_bytes: 23764
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		boolean isNine = false;
		int n = scan.nextInt();
		int tens = (n / 10) % 10; // (n % 100) / 10
        int ones = n % 10;
        if(tens == 9) {
        	isNine = true;
        	//System.out.println("Yes");
        }
        if(ones == 9) {
        	isNine = true;
        	//System.out.println("Yes");
        }
        if(isNine == true) {
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
		}
}

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

using namespace std;

int main(){
    string s;
    cin >> s;

    int c = 0;
    int res = 0;
    for(int i=0; i<3; i++){
        if(s.at(i) == 'R')c++;
        else{
            res = max(res, c);
            c = 0;            
        }
    }

    res = max(res,c);

    cout << res << endl;   
}

Measured memory_bytes: 3624
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(a: int, b: int, c: int):
    ret = len({a, b, c})
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    solve(a, b, c)

if __name__ == '__main__':
    main()


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

using namespace std;

int main()
{
  int ans = 700;
  string s;
  cin >> s;

  for (int i = 0; i < 3; i++)
  {
    if (s[i] == 'o')
      ans += 100;
    else
      continue;
  }

  printf("%d", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

map<long long,long long> decomposite(long long N, map<long long,long long> & primes,long long next_p = 2){
    if (N == 1){
        return primes;
    }


    while (next_p * next_p <= N ) {
        if (N % next_p == 0) {
            primes[next_p] += 1;
            return decomposite(N/next_p,primes,next_p);
        } else {
            next_p++;
        }
    }
    primes[N] += 1;
    return primes;
}

int can_use(ll N,ll l,ll r){
    if (l+ 1  == r){
        return l;
    }
    ll center = (l+r)/2;
    if(center * (center + 1)/2 <= N){
        return can_use(N, center,r);
    }else{
        return can_use(N, l,center);
    }
}
int main()
{
  // 整数の入力
  ll N,M;
  cin >> N;
  map<ll,ll> primes;
  decomposite(N,primes);
  ll ans = 0;
  for(auto p:primes){
      ans += can_use(p.second,0,1e9);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include <array>
#include <map> 
#define ALL(a)  (a).begin(),(a).end()
const long long INF = 1LL<<58;
const long long MOD=1e9+7;


using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd(int a, int b)
{
  if(a>b){
    return gcd(b,a);
  }
	return a == 0 ? b : gcd(b % a, a);
}
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}

int moji(char in)
{
    int ans = (int)in-(int)'a';
    if((ans < 0) || (ans > 25)){
        ans = 26;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}

int binary_searchh(long long x,long long k[],int n){
  int l=0;
  int r=n;
  while(r-l>=1){
    int i=(l+r)/2;
    if(k[i]==x)return i;
    else if(k[i]<x)l=i+1;
    else r=i;
  }
  return -1;
}

struct File {
    int aa;
    int bb;

    File(const int& aa, const int& bb)
        : aa(aa), bb(bb) {}
};

bool operator<(const File& a, const File& b)
{
    // ファイル種別、ファイル名の順番で優先順位を付けて比較
    return std::tie(a.aa, a.bb) < std::tie(b.aa, b.bb);
}

long long kaijo(long long x){
  long long l=10*10*10*10*10*10*10*10*10+7;
  long long sum=1;
  for(int i=x;i>0;i--){
    sum*=i;
    if(sum>l){
      sum%=l;
    }
  }
  return sum;
}


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

//formerは前方のindex(自分自身を含んで良い)
template<class T>int former(const vector<T>&v,T x){
  return upper_bound(v.begin(),v.end(),x)-v.begin()-1;
}
//latterは後方のindex(自分自身を含んで良い)
template<class T>int latter(const vector<T>&v,T x){
  return lower_bound(v.begin(),v.end(),x)-v.begin();
}


int main() {
  int A,B,K;
  cin>>A>>B>>K;
  int sum=0;
  for(int i=min(A,B);i>=0;i--){
    if(A%i==0&&B%i==0){
      sum++;
      if(sum==K){
        cout<<i<<endl;
        return 0;
      }
    }
  }
  



  
    

}
  




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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;

#define fr first
#define sc second
#define chmax(a,b) a=max(a,b)
#define chmin(a,b) a=min(a,b)
#define mp1(a,b,c) P1(a,P(b,c))

template<int sz=1<<17,class T=ll>
struct BIT{
	T s[sz+2];
	void init(){
		for(int i=1;i<=sz;i++){
			s[i]=0;
		}
	}
	void add(int k,T x=1){
		while(k<=sz){
			s[k]+=x;
			k+=k&-k;
		}
	}
	T sum(int k){
		T ret=0;
		while(k>0){
			ret+=s[k];
			k-=k&-k;
		}
		return ret;
	}
};

int main(){
	static ll n;
	static ll p[300010];
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld",&p[i]);
	}
	bool ok=true;
	for(int i=1;i<=n;i++){
		ok&=(i&1)==(p[i]&1);
	}
	if(!ok){
		puts("No");
		return 0;
	}
	static BIT<1<<19,ll> bit[2];
	bit[0].init();
	bit[1].init();
	ll x=0,y=0;
	for(int i=1;i<=n;i++){
		x+=bit[i&1].sum(n+1)-bit[i&1].sum(p[i]);
		y+=bit[1-(i&1)].sum(n+1)-bit[1-(i&1)].sum(p[i]);
		bit[(i&1)].add(p[i]);
	}
	if(y==2*x)puts("Yes");
	else puts("No");
}



Measured memory_bytes: 10752
#include<bits/stdc++.h>
#define P pair<int,int>
using namespace std;
const int mod=20010531;
const int N=20;
typedef long long ll;
int t[N],n,a[N],b[N];
ll ans;
char s[N*2];
map<P,int> mp;
void dfs1(int x)
{
	if (x==n+1)
	{
		int s1=0,s2=0;
		for (int i=1;i<=n;i++)
		  if (t[i]) s1=((ll)s1*31%mod+a[i])%mod;
		  else s2=((ll)s2*31%mod+a[i])%mod;
		mp[P(s1,s2)]++;
		return;
	}
	t[x]=0;dfs1(x+1);
	t[x]=1;dfs1(x+1);
}
void dfs2(int x)
{
	if (x==n+1)
	{
		int s1=0,s2=0;
		for (int i=n;i>=1;i--)
		  if (t[i]) s1=((ll)s1*31%mod+b[i])%mod;
		  else s2=((ll)s2*31%mod+b[i])%mod;
		if (mp.count(P(s1,s2))) ans+=mp[P(s1,s2)];
		return;
	}
	t[x]=0;dfs2(x+1);
	t[x]=1;dfs2(x+1);
}
int main()
{
	scanf("%d%s",&n,s+1);
	for (int i=1;i<=n;i++) a[i]=s[i]-'a'+1;
	for (int i=n+1;i<=2*n;i++) b[i-n]=s[i]-'a'+1;
	dfs1(1);dfs2(1);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 18688
#include<iostream>
#include<string>
#include<list>
#include<map>
#include<vector>
#include<cmath>
#include<unordered_map>
#include<unordered_set>
using namespace std;

using lli = long long int;


int main(void){
	lli H,W;
	cin >> H >> W;
	auto S=vector<string>(H);
	for (lli i = 0; i < H; ++i)
	{
		string s;
		cin >> S[i];
	}
	//for (lli i = 0; i < H; ++i){for (lli j = 0; j < W; ++j) cout << S[i][j];cout << endl;}
	
	auto SWR = vector<vector<lli>>(H);
	for (lli i = 0; i < H; ++i) SWR[i] = vector<lli>(W);
	for (lli i = 0; i < H; ++i) {
		SWR[i][0] = (S[i][0] == '#') ? 0 : 1;
		for (lli j = 1; j < W; ++j) SWR[i][j] = (S[i][j] == '#') ? 0 : (SWR[i][j-1] + 1);
	}
	//for (lli i = 0; i < H; ++i){ for (lli j = 0; j < W; ++j) cout << SWR[i][j]; cout<<endl; } cout<<endl;

	auto SWL = vector<vector<lli>>(H);
	for (lli i = 0; i < H; ++i) SWL[i] = vector<lli>(W);
	for (lli i = 0; i < H; ++i) {
		SWL[i][W-1] = (S[i][W-1] == '#') ? 0 : 1;
		for (lli j = W-2; j >=0; --j) SWL[i][j] = (S[i][j] == '#') ? 0 : (SWL[i][j+1] + 1);
	}
	//for (lli i = 0; i < H; ++i){ for (lli j = 0; j < W; ++j) cout << SWL[i][j]; cout<<endl; } cout<<endl;

	auto SHB = vector<vector<lli>>(H);
	for (lli i = 0; i < H; ++i) SHB[i] = vector<lli>(W);
	for (lli j = 0; j < W; ++j) {
		SHB[0][j] = (S[0][j] == '#') ? 0 : 1;
		for (lli i = 1; i < H; ++i) SHB[i][j] = (S[i][j] == '#') ? 0 : (SHB[i-1][j] + 1);
	}
	//for (lli i = 0; i < H; ++i){ for (lli j = 0; j < W; ++j) cout << SHB[i][j]; cout<<endl; } cout<<endl;

	auto SHT = vector<vector<lli>>(H);
	for (lli i = 0; i < H; ++i) SHT[i] = vector<lli>(W);
	for (lli j = 0; j < W; ++j) {
		SHT[H-1][j] = (S[H-1][j] == '#') ? 0 : 1;
		for (lli i = H-2; i >=0; --i) SHT[i][j] = (S[i][j] == '#') ? 0 : (SHT[i+1][j] + 1);
	}
	//for (lli i = 0; i < H; ++i){ for (lli j = 0; j < W; ++j) cout << SHT[i][j]; cout<<endl; } cout<<endl;

	auto ans = 0ll;
	for (lli i = 0; i < H; ++i) {
		for (lli j = 0; j < W; ++j) {
			ans = max(ans, SWR[i][j] + SWL[i][j] + SHB[i][j] + SHT[i][j] - 3);
		}
	}
	cout << ans << endl;
}

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

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

	int a[50], b[50];
	for (int i = 0; i < M; i++)
	{
		cin >> a[i] >> b[i];
	}

	int c[51];

	for (int i = 0; i < 51; i++)
	{
		c[i] = 0;
	}

	for (int i = 0; i < M; i++)
	{
		c[a[i]]++;
		c[b[i]]++;
	}

	for (int i = 1; i <= N; i++)
	{
		cout << c[i] << endl;
	}

	return 0;
}

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

using namespace std;

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

int main() {
    int d;
    cin >> d;
	string s = "Christmas";
	rep(i, 25-d) s += " Eve";
	cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define maxn 100010
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
	   if(x%i==0)return false;
   }return true;
}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
template <typename T>
inline void read(T &x) {
	char c = getchar(); int w = 1; x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
		  dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};
int main(){
	fast;
	ll n;
	cin>>n;
	ll a[n+1],ans=0,maxv=-100,p;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=2;i<=n;i++){
		if(a[i]<=a[i-1]){
			ans++;
		}else{maxv=max(maxv,ans);ans=0;}
	}maxv=max(ans,maxv);
	cout<<maxv<<endl;
}/*『你强归你强，我永不示弱』*/


Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define maxn 200005
using namespace std;
typedef long long ll;
int n;
int a[maxn];
int main()
{
	scanf("%d",&n);
	int temp=0;
	for(int i=1;i<=n;i++)
	scanf("%d",&a[i]),temp^=a[i];
	if(n&1)
	{
		for(int i=1;i<=n;i++)
		printf("%d ",a[i]);
		printf("\n");
	}
	else
	{
		for(int i=1;i<=n;i++)
		printf("%d ",a[i]^temp);
		printf("\n");
	}
}

Measured memory_bytes: 4552
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+7;
string ans,s,t;
int n;
int main()
{
    
    cin>>n;
    cin>>s>>t;
    for(int i=0;i<n;i++){
        ans=ans+s[i]+t[i];
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define repp(i, m, n) for(int i = m; i < n; i++)
#define reps(i, n) for(int i = 1; i <= n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int, int> pai;
typedef pair<ll,ll> pal;



int main()
{
	string s;
	cin >> s;
	int ac=0;
	rep(i, s.size()-1)
	{
		if(s[i]=='A'&&s[i+1]=='C') ac=1;
	}
	if(ac==1) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
def divisors_lower(n):
    lower = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower.append(i)
        i += 1
    return lower

n = int(input())

ans = 10 ** 11
A = divisors_lower(n)
for a in A:
    b = n // a
    a, b = str(a), str(b)
    l = max(len(a), len(b))
    ans = min(ans, l)
print(ans)

Measured memory_bytes: 3064
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

def hashing(my_list):   
    freq = {} 
    for item in my_list: 
        if (item in freq): 
            freq[item] += 1
        else: 
            freq[item] = 1  
    return freq

a = cino(True)
a = list(a)
h = hashing(a)
check = False
for key, value in h.items():
    if value%2!=0:
        check = True
        break
if check:
    print("No")
else:
    print("Yes")

# print(ans)
# a = list(a)
# has = {}
# x,y = -1,-1
# for i in range(len(a)):
#     has[a[i]]=[0,0]

# for i in range(len(a)):
#     has[a[i]][0] += 1
#     if has[a[i]][0]==1:
#         has[a[i]][1] = i
#     temp1 = has[a[i]][0]
#     # print(temp1)
#     if i>2 and temp1>2:
#         temp = has[a[i]][1]
#         if temp1>(i-temp)//2:
#             x,y = temp+1,i+1
#             break
# print(x,y)




Measured memory_bytes: 3064
#!/usr/bin/perl
use strict;
my($n,$x)=glob<>;
my $a=<>;
my @arr = split (/\s+/, $a);  
my $d = 0;
for(my $i = 0; $i < $n; $i++){
  $d = $d + @arr[$i];
  if ($d > $x){
    my $r = $i+ 1;
    print $r."\n";
    last;
  }

};
my $r2 = $n + 1;
if($d <= $x){print $r2."\n";}

Measured memory_bytes: 768
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
#include<random>

//#include<boost/circular_buffer.hpp>
using namespace std;

//cout << fixed << setprecision(10);
typedef long long ll;
#define PI 3.141592653589793
#define Yes(a) a ? "Yes" : "No";
#define YES(a) a ? "YES" : "NO";
#define rep(i,n) for(int i=0;i<n;i++)

int gcd(int a, int b) {
	if (a < b) {
		int tmp = a;
		a = b;
		b = tmp;
	}
	int r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}

int lcm(int a, int b) {
	long long int L;
	L = (a * b) / gcd(a, b);
	return L;
}

vector<long long  int> Prime;
void Eratosthenes(long long int n) {
	vector<bool> is_prime(n, true);
	for (int i = 2; i * i <= n; i++) {
		;
		if (is_prime.at(i)) {
			for (int j = i * i; j <= n; j += i) {
				is_prime.at(j) = false;
			}
		}
		Prime.emplace_back(i);
	}
}

/*
map<int, int> prime;
void Prime_number(long long int n) {
	for (int i = 2; i <= n; i++) {
		int count = 0;
		while (n % i == 0) {
			count++;
			n /= i;
		}
		if (count != 0) {
			prime.insert(make_pair(i, count));
		}
	}
}
*/
//std::cout.fill('0');

int keta(long long int N) {
	int k = 0;
	while (N > 0) {
		N /= 10;
		k++;
	}
	return k;
}

int main() {
	int m1, m2, d1, d2;
	cin >> m1 >> d1 >> m2 >> d2;
	if (m1 == m2)
		cout << 0 << endl;
	else
		cout << 1 << endl;
}

Measured memory_bytes: 384
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        v: [i64; n]
    }
    let mut dp = vec![vec![0; n + 1]; n + 1];
    let mut id: Vec<usize> = (0..n).collect();
    id.sort_by(|&x, &y| v[y].cmp(&v[x]));
    for i in 1..=n {
        dp[i][0] = dp[i - 1][0] + v[id[i - 1]] * (id[i - 1] as i64 - (i - 1) as i64);
        dp[0][i] = dp[0][i - 1] + v[id[i - 1]] * ((n - i) as i64 - id[i - 1] as i64);
        for j in 1..i {
            dp[i - j][j] = max(dp[i - j - 1][j] + v[id[i - 1]] * (id[i - 1] as i64 - (i - j - 1) as i64),
                               dp[i - j][j - 1] + v[id[i - 1]] * ((n - j) as i64 - id[i - 1] as i64));
        }
    }
    let mut ans = 0;
    for i in 0..=n {
        ans = max(ans, dp[i][n - i]);
    }
    println!("{}", ans);
}



Measured memory_bytes: 33552
h,w=map(int,input().split())
grid=[list(input()) for i in range(h)]
c=[['.']*w for i in range(h)]
dx=[1,0,-1,0]
dy=[0,1,0,-1]
for i in range(h):
  for j in range(w):
    for k in range(4):
      ny=i+dy[k]
      nx=j+dx[k]
      if 0<=ny<h and 0<=nx<w and grid[i][j]=='#' and grid[ny][nx]=='#':
        c[i][j]=c[ny][nx]='#'
for i in range(h):
  for j in range(w):
    if c[i][j]!=grid[i][j]:
      print('No')
      exit()
print('Yes')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef vector<int> vi;
const int MX = 2e5 + 5;
#define f(i, x, n) for (int i = x; i < n; i++)
#define int long long
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)
#define pb push_back
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    // online submission
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int a,b,c,cnt{0},ans;
    cin>>a>>b>>c;
    //int ans=ceil(((double)b-a)/(double)c);
    for(int i=a;i<=b;i++)
    {
        if(i%c==0)
        {
            cnt++;
        }
    }


    cout<<cnt<<endl;
    
    
    
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
    return 0;
}


Measured memory_bytes: 3752
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            String s = Console.ReadLine();
            String[] strArr = s.Split(' ');

            var List = new List<int>();

            for (int i = 0; i < strArr.Length; i++)
            {
                List.Add(int.Parse(strArr[i]));
            }

            int W = List[0];
            int H = List[1];
            int x = List[2];
            int y = List[3];
            int r = List[4];

            int xr = x - r;
            int xrSum = x + r;
            int yr = y - r;
            int yrSum = y + r;

            String strMessage = null;

            if (0 <= xr && xrSum <= W)
            {
                if (0 <= yr && yrSum <= H)
                {
                    strMessage = "Yes";
                }else
                {
                    strMessage = "No";
                }                
            }else
            {
                strMessage = "No";
            }
            Console.WriteLine(strMessage);
        }
    }
}



Measured memory_bytes: 19964
#include<stdio.h>

int n;
int map[15][15];

void make_map(int h,int w,int num){
  
  if(num > n*n)return;

  while(h>n-1 || w<0 || w>n-1 || map[h][w]){
    if(h>n-1)h = 0;
    else if(w>n-1)w = 0;
    else if(w<0)w = n-1;
    else if(map[h][w]){
      h++;
      w--;
    }
  }

  map[h][w] = num;
  make_map(h+1,w+1,num+1);

  return;
}

void print_map(void){
  int i,j;

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      printf("%4d",map[i][j]);
    }
    putchar('\n');
  }
  return;
}

int main(void){
  int i,j;
  int h,w;

  while(1){
    scanf("%d",&n);
    if(!n)break;

    h = n/2+1;
    w = n/2;

    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	map[i][j] = 0;
      }
    }

    make_map(h,w,1);

    print_map();
  }
  return 0;
}

Measured memory_bytes: 0