akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll inf = 1000000000;
int n=200,r=200,m=19900;

//vector<pair<int,ll>>adj[n];

int main()
{
	vector<int>towns;
	ll dista=10000000000;
	cin>>n>>m>>r;
	ll dist[n][n];
	ll adm[n][n];
	for(int i=0;i<r;i++){
		int ti;
		cin>>ti;
		towns.push_back(ti-1);
	}
	sort(towns.begin(),towns.end());
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			adm[i][j]=0;
	for(int i=0;i<m;i++)
	{
		int a,b; ll c;
		cin>>a>>b>>c;
		a--;b--;
		//adj[a].push_back({b,c});
		//adj[b].push_back({a,c});
		adm[a][b]=c;
		adm[b][a]=c;
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(i==j)
				dist[i][j]=0;
			else if(adm[i][j])
				dist[i][j]=adm[i][j];
			else
				dist[i][j]=inf;
		}
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			for(int k=0;k<n;k++)
			{
				if(dist[j][k]>dist[i][j]+dist[i][k])
					dist[j][k]=dist[i][j]+dist[i][k];
			}
		}
	}
	/*for(int i=0;i<n;i++){
		for(int j=0;j<n;j++)
			cout<<dist[i][j]<<" ";
		cout<<"\n";
	}*/
	do{
		ll mind=0;
		for(int i=0;i<towns.size()-1;i++)
		{
			mind += dist[towns[i]][towns[i+1]];
			//cout<<towns[i]<<" "<<towns[i+1]<<" "<<dist[towns[i]][towns[i+1]]<<"\n";
		}
		//cout<<mind<<" \n";
		if(mind<dista){
			dista=mind;
		}
	}while(next_permutation(towns.begin(),towns.end()));
	cout<<dista<<"\n";
}

Measured memory_bytes: 4252
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int hh = s / 3600;
        int mm = s % 3600 / 60;
        int ss = s % 60;
        System.out.format("%d:%d:%d\r\n", hh, mm, ss);
    }
}



Measured memory_bytes: 26312
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <vector>
#include <numeric>
#include <bits/stdc++.h>
#include <atcoder/all>

#define int long long

struct edge {
    int to;
    int cost;
};

using namespace std;
using namespace atcoder;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vb = vector<bool>;
using qi = queue<int>;
using P = pair<int, int>;
using graph = vector<vector<edge>>;
// using graph = vector<vector<int>>;
using mint = modint1000000007;


#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define REP(i,n) for(int i=0;i<n;i++)
#define delim(i, n) cout << (i == n-1 ? "\n" : " ")
#define print1(v) cout << fixed << setprecision(10) << v << "\n"
#define print2(v1, v2) cout << fixed << setprecision(10) << v1 << " " << v2 << "\n"
#define printvi(v, n) REP(iiii, n) { cout << v[iiii]; delim(iiii, n); }
#define printvii(v, h, w) REP(iiiii, h) { printvi(v[iiiii], w); }

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int inf = 1LL << 60;
// const int inf = 100000000;
const int mod = 1000000007;

const int maxn = 1e5;
int n, m, k;
vii G(maxn);
vi seen(maxn);

vi dx = {-1, 0, 0, 1};
vi dy = {0, -1, 1, 0};

void dfs(int v) {
    // should initialize seen, d and f.
    seen[v] = true;
    for(auto next_v : G[v]) {
        if (seen[next_v]) continue;
        dfs(next_v);
    }
}

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

    cin >> n >> m;
    REP(i, m) {
        int a, b; cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    seen.assign(n, false);
    int cnt = -1;
    
    REP(i, n) {
        if (seen[i]) continue;
        cnt++;
        dfs(i);
    }

    print1(cnt);
}

Measured memory_bytes: 10608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll read(){
	ll a=0,b=getchar(),c=1;
	while(!isdigit(b))c=b=='-'?-1:1,b=getchar();
	while(isdigit(b))a=a*10+b-'0',b=getchar();
	return a*c;
}
int n,u,v,ans,d[2][100005];
vector<int> g[100005];
void dfs(int x,int y,int w){
    for(int i=0;i<g[x].size();i++){
    	int z=g[x][i];
		if(z!=y)d[w][z]=d[w][x]+1,dfs(z,x,w);
    }
}
int main(){
	n=read(),u=read(),v=read();
    for(int i=0;i<n-1;i++){
    	int x=read(),y=read();
		g[x].push_back(y),g[y].push_back(x);
    }
    dfs(u,-1,0),dfs(v,-1,1);
    for(int i=1;i<=n;i++){
		if(d[0][i]<d[1][i])
		    ans=max(ans,d[1][i]-1);
    }
    printf("%d",ans);
	return 0;
}

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

using namespace std;

int main(void) {
	long long N, A, B, C, D;
	cin >> N >> A >> B >> C >> D;
	--A;
	--B;
	--C;
	--D;
	string S;
	cin >> S;
	for(int i = A; i < C; ++i) {
		if(S[i] == '#' && S[i + 1] == '#') {
			cout << "No\n";
			return 0;
		}
	}
	for(int i = B; i < D; ++i) {
		if(S[i] == '#' && S[i + 1] == '#') {
			cout << "No\n";
			return 0;
		}
	}
	if(C < D) {
		cout << "Yes\n";
		return 0;
	}
	for(int i = B - 1; i < min(D, N - 1); ++i) {
		if(S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
			cout << "Yes\n";
			return 0;
		}
	}
	cout << "No\n";
	return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using namespace atcoder;
 
int main() {
  long long N,M;
  cin>>N>>M;
  vector<long long> a(N);
  vector<long long> b(M);
  rep(i,N) cin>>a[i];
  rep(i,M) cin>>b[i];
  auto c=convolution(a,b);
  for(auto x:c){
    cout<<x<<" ";
  }
  cout<<endl;
}

Measured memory_bytes: 27188
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	a := nextInt()
	b := nextInt()

	fmt.Println(6 - a - b)
}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 640
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ASumOfInteriorAngles solver = new ASumOfInteriorAngles();
        solver.solve(1, in, out);
        out.close();
    }

    static class ASumOfInteriorAngles {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            out.println((n - 2) * 180);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

int main() {
  int n;
  string s;
  cin >> n >> s;
  
  int ans = 0;
  
  for (int i = 0; i + 3 <= n; i++) {
    if (s.substr(i, 3) == "ABC") {
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

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

int main(){
    int h1,h2,m1,m2,k;
    cin>>h1>>m1>>h2>>m2>>k;
    int sum=0;
    if(m1>0&&m2==0){
    	sum+=(h2-h1-1)*60;
    	sum+=60-m1;
    	if(sum-k<=0)cout<<0;
        else cout<<sum-k;  
	}
	else if(m2>0&&m1==0){
    	sum+=(h2-h1)*60;
    	sum+=m2;
    	if(sum-k<=0)cout<<0;
        else cout<<sum-k;  
	}
	else if(m1>0&&m2>0){
    	sum+=(h2-h1-1)*60;
    	sum+=60-m1;
    	sum+=m2;
    	if(sum-k<=0)cout<<0;
        else cout<<sum-k;  
	}
	else {
    	sum+=(h2-h1)*60;
    	if(sum-k<=0)cout<<0;
        else cout<<sum-k;  
	}
    return 0;
}

Measured memory_bytes: 3636
x,n = map(int,input().split())
p = set(map(int,input().split()))

if not x in p:
    print(x)
else:
    for i in range(19999):
        if not x-i in p:
            res = x-i
            break
        elif not x+i in p:
            res = x+i
            break
    print(res)

Measured memory_bytes: 61808
import numpy as np
h, w = map(int, input().split())
field = []
for _ in range(h):
    row = list(input())
    field.append(row)
field = np.array(field)


deleterow = []
deleteline = []
for i in range(field.shape[0]):
    if set(field[i,:])=={'.'}:
        deleterow.append(i)
for j in range(field.shape[1]):
    if set(field[:,j])=={'.'}:
        deleteline.append(j)

for i, row in enumerate(field):
    if i in deleterow:
        continue
    for j, val in enumerate(row):
        if j in deleteline:
            continue
        print(val, end='')
    print('')

Measured memory_bytes: 13692
#include <stdio.h>

int dp[50][3333];
int dpw[50][3333];

int main()
{
	while(1)
	{
		int n,m,s;
		scanf("%d %d %d",&n,&m,&s);
		if(n == 0)
		{
			break;
		}
		n *= n;
		for(int i = 0; i < n; i++)
		{
			for(int ii = 0; ii <= s; ii++)
			{
				dp[i][ii] = 0;
			}
		}
		for(int i = 1; i <= m; i++)
		{
			for(int ii = 0; ii < n; ii++)
			{
				for(int iii = 0; iii <= s; iii++)
				{
					dpw[ii][iii] = dp[ii][iii];
				}
			}
			for(int ii = 0; ii < n - 1; ii++)
			{
				for(int iii = 0; iii < s; iii++)
				{
					if(i + iii <= s)
					{
						dpw[ii + 1][i + iii] += dp[ii][iii];
					}
				}
			}
			dpw[0][i] += 1;
			for(int ii = 0; ii < n; ii++)
			{
				for(int iii = 0; iii <= s; iii++)
				{
					dp[ii][iii] = dpw[ii][iii] % 100000;
				}
			}
		}
		printf("%d\n",dp[n - 1][s]);
	}
	return 0;
}

Measured memory_bytes: 2308
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
ll llmax = LLONG_MAX;
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
vi d1 = {1, 0, -1, 0}, d2 = {0, 1, 0, -1};
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << -1 << endl;}
void mysort(vs &a) {sort(a.begin(), a.end());}

int main() {
  ll n, p;
  cin >> n >> p;
  vll a(n);
  ll ev = 0, od = 0;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) ev++;
    else od++;
  }
  ll ans = pow(2, ev);
  if (p == 0) {
    ll subans = 0;
    for (ll i = 0; i <= od; i += 2) {
      ll ncr = 1, r = min(i, od - i);
      for (ll j = 0; j < r; j++) ncr *= od - j;
      for (ll j = 0; j < r; j++) ncr /= j + 1;
      subans += ncr;
    }
    ans *= subans;
  }
  else {
    ll subans = 0;
    for (ll i = 1; i <= od; i += 2) {
      ll ncr = 1, r = min(i, od - i);
      for (ll j = 0; j < r; j++) ncr *= od - j;
      for (ll j = 0; j < r; j++) ncr /= j + 1;
      subans += ncr;
    }
    ans *= subans;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
using System;

class Class13
{
    static void Main()
    {
        int X = int.Parse(Console.ReadLine());
        for (int i = 2; i < Math.Sqrt(X); i++)
        {
            if (X % i == 0)
            {
                i = 1;
                X++;
            }
        }
        Console.WriteLine(X);
    }
}

Measured memory_bytes: 13140
using System;

namespace ABC112
{
    class Program
    {
        static void Main(string[] args)
        {
            a();
        }

        public static void a()
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 1)
                Console.WriteLine("Hello World");
            else
            {
                int a = int.Parse(Console.ReadLine());
                int b = int.Parse(Console.ReadLine());
                Console.WriteLine(a + b);
            }
        }
    }
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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

#define MAX_V 2222
vector<int> v[MAX_V];
int match[MAX_V];
bool used[MAX_V];

void add_edge(int a,int b){
	v[a].PB(b);
	v[b].PB(a);
}

bool matchdfs(int a){
	used[a] = true;
	for(int i = 0;i < v[a].size();i++)	{
		int u = v[a][i],w = match[u];
		if(w < 0 || !used[w] && matchdfs(w)){
			match[u] = a;
			match[a] = u;
			return true;
		}
	}
	return false;
}

//二部マッチング
int two_matching_max(int l){
	int res = 0;
	memset(match,-1,sizeof(match));
	REP(v,l){
		if(match[v] < 0){
			memset(used,0,sizeof(used));
			if(matchdfs(v))res++;
		}
	}
	return res;
}

int main(){
	
	int x, y, e;cin >> x >> y >> e;
	
	REP(i,e){
		int a, b;cin >> a >> b;
		b += x;
		add_edge(a, b);
	}
	
	cout << two_matching_max(x + y) << endl;
	
	
	return 0;
}



Measured memory_bytes: 3344
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <vector>
#include <math.h>
#include <bitset>
#include <cmath>
#include <set>

typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)
#define rep_r(i,s,n)for(ll i = n;i>s;i--)
#define rep_re(i,s,n)for(ll i = n;i>=s;i--)
using namespace std;
static const ll MOD = 1e9 + 7;
static const ll INF = 999;// 1e25;
static const ll MAX_N = 100001;

//ll a[100001];
ll p[100001];
int main() {
	ll n, k, q; cin >> n >> k >> q;
	//repe(i, 1, q)cin >> a[i];
	repe(i, 1, n) p[i] = k - q;

	repe(i, 1, q) {
		ll a; cin >> a;
		p[a]++;
	}

	repe(i, 1, n) {
		if (p[i] <= 0)cout << "No" << endl;
		else cout << "Yes" << endl;
	}

	return 0;
}

Measured memory_bytes: 1408
import collections
N, M = map(int, input().split())
a = [0]*M
b = [0]*M
table = collections.defaultdict(list)
for i in range(M):
    a[i], b[i] = map(int, input().split())
    table[a[i]].append(b[i])
    table[b[i]].append(a[i])
bridge = []
for x in table:
    if len(table[x]) < 2:
        bridge.append(x)
prev = 0
now = len(bridge)
while(prev != now):
    for x in table:
        if x not in bridge:
            lenx = len(table[x])
            for y in table[x]:
                if y in bridge:
                    lenx -= 1
            if lenx < 2:
                bridge.append(x)
    prev = now
    now = len(bridge)
ans = 0
for i in range(M):
    if a[i] in bridge or b[i] in bridge:
        ans += 1

print(ans)


Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9+7;

int main(){
    string s;
    cin >> s;
    char ans = '0';
    ll k;
    cin >> k;ll cnt = 0;
    for(int i = 0; i < s.size(); i++){
        
        if(s[i] == '1') cnt++;
        if(s[i] != '1'){
            ans = s[i];
            break;
        } 
    }    
    if(k <= cnt) cout << 1 << endl;
    else cout << ans << endl;
    
}

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

using namespace std;

int main()
{
    string compare2;
    string given;

    cin>>compare2>>given;
    
    int len1 = compare2.size();
    int len2 = given.size();
    
    int cost = 0;
    int mincost = INT_MAX;

    if(len1==len2)
    {
        if(compare2.compare(given)==0)
        {
            cout<<0<<endl;
        }
        else
        {
            for(int i=0;i<len2;i++)
            {
                if(compare2.at(i)!=given.at(i))
                {
                    cost++;
                }
            }
            cout<<cost<<endl;
        }
        
    }
    else
    {
        for(int i=0;i<(len1 - len2);i++)
        {
            cost=0;
            for(int j=i;j<(i + len2);j++)
            {
                if(given.at(j-i)!=compare2.at(j))
                {
                    cost++;
                }
        
            }  
            if(mincost>=cost)
            {
                mincost=cost;
            }
        }
        cout<<mincost<<endl;    
    }
    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define int long long
#define maxn 100005
using namespace std;

const int mod = 1e9 + 7;

vector<int> G[maxn];
int dp[maxn][2];
int n;

void dfs(int x, int p) {
    dp[x][0] = 1;
    dp[x][1] = 1;
    for(int y : G[x]) {
        if(y == p) continue;
        dfs(y, x);
        dp[x][1] = dp[x][1] * dp[y][0] % mod;
        dp[x][0] = dp[x][0] * (dp[y][1] + dp[y][0]) % mod;
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for(int i = 1; i < n; i++) {
        int x, y; cin >> x >> y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    dfs(1, -1);
    cout << (dp[1][0] + dp[1][1]) % mod << '\n';
    return 0;
}


Measured memory_bytes: 17588
#include<stdio.h>

int search(int A[], int n, int key){
    int i=0;
    A[n] = key;
    while(A[i]!=key) i++;
    return i != n;
}

int main(){
    int i, n, A[10000+1], q, key, sum = 0;

    scanf("%d", &n);
    for (i = 0; i < n; i++)
        scanf("%d", &A[i]);

    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d", &key);
        if(search(A,n,key)) sum++;
    }
    printf("%d\n",sum);
    return 0;
}



Measured memory_bytes: 2132
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int X, Y;
    cin >> X >> Y;

    int ans = 1;
    while(X * 2 <= Y){
        X *= 2;
        ans++;
    }

    cout << ans;

    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

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

ll ans = 0;

const int N = 26;
ll x[N] = {},y[N] = {};

int main(){
    string s;
    int n = 3;
    cin >> s;
    for(int i = 0; i < n; ++i){
        if(s[i] == '1')cout << 9;
        else if(s[i] == '9') cout << 1;
        else cout << s[i];
    }
    cout << endl;
}

Measured memory_bytes: 256
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  int a,b;
  string s;
  cin >> a >> b >> s;

  int h = s.find('-');
  if(h == -1)
  {
    cout << "No" << endl;
    return 0;
  }

  string b1,b2;
  b1 = s.substr(0,h);
  b2 = s.substr(h + 1);
  if((all_of(b1.cbegin(),b1.cend(),::isdigit))
    &&(all_of(b2.cbegin(),b2.cend(),::isdigit)))
  {
    if(sz(b1) == a && sz(b2) == b)
      cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
  


  return 0;
}
// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(char &c){
  int i;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c = i;
}
inline int rd(char c[]){
  int i;
  int sz = 0;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
char c;
int main(){
  rd(c);
  c++;
  wt_L(c);
  wt_L('\n');
  return 0;
}
// A

Measured memory_bytes: 256
n=int(input())
a=input()

if n%2==1:
  print("No")
  exit()
else:
  count=0
  m=n//2
  for i in range(m):
    if a[i]==a[i+m]:
      count+=1
    else:
      count=0

if count==m:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
import java.io._
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
import scala.reflect.ClassTag

object Main {
  val MOD = 1000000007
  val out = new PrintWriter(System.out)

  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val N = sc.nextInt()
    val A, B = Array.ofDim[Int](N)
    rep(N) { i =>
      A(i) = sc.nextInt()
      B(i) = sc.nextInt()
    }

    var ans = 0L
    rep_r(N) { i =>
      val cur = A(i) + ans
      val r = cur % B(i)
      if (r != 0) ans += B(i) - r
    }

    out.println(ans)
  }

  def main(args: Array[String]): Unit = {
    solve()
    out.flush()
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = _

    def next(): String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next().toInt
    def nextLong(): Long = next().toLong
    def nextChar(): Char = next().charAt(0)
  }
  def rep(n: Int)(f: Int => Unit): Unit = {
    var i = 0
    while(i < n) { f(i); i += 1 }
  }
  def rep_r(n: Int)(f: Int => Unit): Unit = {
    var i = n - 1
    while(i >= 0) { f(i); i -= 1 }
  }

  def map[@specialized A: ClassTag](n: Int)(f: Int => A): Array[A] = {
    val res = Array.ofDim[A](n)
    rep(n)(i => res(i) = f(i))
    res
  }

  implicit class ArrayOpts[A](val as: Array[A]) extends AnyVal {
    // todo Orderingだとboxing発生するので自作Orderを用意したい
    def maxByOpt[B: Ordering](f: A => B): Option[A] = {
      if (as.nonEmpty) Some(as.maxBy(f)) else None
    }

    def grpBy[K](f: A => K): mutable.Map[K, ArrayBuffer[A]] = {
      val map = mutable.Map.empty[K, ArrayBuffer[A]]
      rep(as.length)(i => map.getOrElseUpdate(f(as(i)), ArrayBuffer()) += as(i))
      map
    }

    def sumBy[B](f: A => B)(implicit num: Numeric[B]): B = {
      var sum = num.zero
      rep(as.length)(i => sum = num.plus(sum, f(as(i))))
      sum
    }

    def minByEx[B](f: A => B, ixRange: Range = as.indices)(implicit cmp: Ordering[B]): (A, B) = {
      limit(f, ixRange)(cmp.lt)
    }

    def maxByEx[B](f: A => B, ixRange: Range = as.indices)(implicit cmp: Ordering[B]): (A, B) = {
      limit(f, ixRange)(cmp.gt)
    }

    private def limit[B](f: A => B, ixRange: Range)(cmp: (B, B) => Boolean): (A, B) = {
      var limA = as(ixRange.head)
      var limB = f(limA)

      for (i <- ixRange.tail) {
        val a = as(i)
        val b = f(a)
        if (cmp(b, limB)) {
          limA = a
          limB = b
        }
      }
      (limA, limB)
    }
  }

  implicit class IterableOpts[A](val as: Iterable[A]) extends AnyVal {
    def sumBy[B](f: A => B)(implicit num: Numeric[B]): B = {
      as.foldLeft(num.zero)((acc, a) => num.plus(acc, f(a)))
    }
  }
}


Measured memory_bytes: 41332
#!/usr/bin/env python

import sys

class bigint:
    def __init__(self,n,mod=10**9+7):
        self.n = n % mod
        self.mod = mod
        return
    #
    def __str__(self):
        return str(self.n)
    #
    def __add__(self,other):
        assert self.mod==other.mod, "modulos of the two not match"
        return bigint(self.n+other.n,self.mod)
    #
    def __iadd__(self,other):
        assert self.mod==other.mod, "modulos of the two not match"
        self.n = (self.n + other.n) % self.mod
        return self
    #
    def __sub__(self,other):
        assert self.mod==other.mod, "modulos of the two not match"
        return bigint(self.n-other.n,self.mod)
    #
    def __isub__(self,other):
        assert self.mod==other.mod, "modulos of the two not match"
        self.n = (self.n - other.n) % self.mod
        return self
#
#::::::::::::::::::::::::::::::::::::::::::::::::::
n,m = [ int(x) for x in sys.stdin.readline().split() ]
step= [bigint(0)] * (n+1)
wall= [False] * (n+1)
for i in range(m):
    am = int( sys.stdin.readline() )
    wall[am] = True
#
step[0]= bigint(1)
if not wall[1]: step[1]= bigint(1)
#
zero=bigint(0)
for i in range(2,n+1):
    if wall[i]: continue
    s1= step[i-1]
    s2= step[i-2]
    if s1==s2==zero: break
    step[i] = s1 + s2
#
print( step[n] )


Measured memory_bytes: 24308
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
using namespace std;


void output_field(vector< vector<char> >& field, int h, int w) {
    for (int i=0; i<h; i++) {
        for (int j=0; j<w; j++) {
            cout << field[i][j];
        }
        cout << endl;
    }
}

bool is_rectangle(vector< vector<char> >& field, int top, int bot, int lef, int rig, char c) {
    for (int i=top; i<=bot; i++) {
        for (int j=lef; j<=rig; j++) {
            if (field[i][j] != '*' && field[i][j] != c) {
                return false;
            }
        }
    }
    return true;
}

void paint(vector< vector<char> >& field, int top, int bot, int lef, int rig) {
    for (int i=top; i<=bot; i++) {
        for (int j=lef; j<=rig; j++) {
            field[i][j] = '*';
        }
    }
}

int main() {
    int n, i;
    cin >> n;
    for (i=0; i<n; i++) {
        // dataset
        int h, w, j, k;
        char c;
        vector< vector<char> > field;
        string s;
        cin >> h >> w;
        field = vector< vector<char> > (h, vector<char>(w, '.'));
        set<char> se;
        set<char>::iterator it;

        // input field
        for (j=0; j<h; j++) {
            cin >> s;
            for (k=0; k<w; k++) {
                field[j][k] = s[k];
                se.insert(s[k]);
            }
        }

        // output field (function)
        // output_field(field, h, w);

        // for each char
        se.erase('.');
        while (1) {
            char delc = '-';
            for (it=se.begin(); it!=se.end(); it++) {
                if (*it != '.') {
                    int lef = 100, top = 100, rig = -1, bot = -1;
                    for (j=0; j<h; j++) {
                        for (k=0; k<w; k++) {
                            if (field[j][k] == *it) {
                                lef = min(lef, k);
                                top = min(top, j);
                                rig = max(rig, k);
                                bot = max(bot, j);
                            }
                        }
                    }
                    bool isr = is_rectangle(field, top, bot, lef, rig, *it);
                    if (isr) {
                        delc = *it;
                        paint(field, top, bot, lef, rig);
                        break;
                    }
                }
            }
            if (delc != '-') {
                se.erase(delc);
                if (!se.size()) {
                    break;
                }
            } else {
                break;
            }
        }
        if (!se.size()) {
            cout << "SAFE" << endl;
        } else {
            cout << "SUSPICIOUS" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int 	     	  long long   // [9,223,372,036,854,775,807 to -9.....808] 19 digits
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define mp                make_pair
#define vi                vector<int>
#define vpi               vector<pair<int,int>>
#define mii               map<int,int>
#define x                 first
#define y                 second
#define mem(a,x)          memset(a,x,sizeof(a))
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define sz(x)             (int)((x).size())

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // find_by_order()  // order_of_key

//const int32_t hellhsh = 444440583533; const double pi=2*acos(0.0);
const int32_t mod = 1e9+7;
const int32_t maxn=2e5+5;
int inf=1e18;

void solve(){
    string s,t;
    cin>>s>>t;
    int n=sz(s),m=sz(t);
    int ans=m;
    for(int i=0;n-i>=m;i++){
        int res=0;
        rep(j,i,i+m){
            res+=s[j]!=t[j-i];
        }
        //cout<<i<<res<<' ';
        ans=min(ans,res);
    }
    cout<<ans;
}

signed main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int tc=1,k=1;
    //cin>>tc;
    while(tc--){
        //cout<<"Case #"<<k++<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 3640
package main

import "fmt"

func main() {
        a := make([]int, 3)
        for i := range a {
                fmt.Scan(&a[i])
        }
        var k int
        fmt.Scan(&k)

        maxi, _ := max(a)
        for i := 0; i < k; i++ {
                a[maxi] *= 2
        }
        fmt.Println(sum(a))
}

func max(a []int) (int, int) {
        maxi := 0
        max := a[0]
        for i := 1; i < len(a); i++ {
                if a[i] > max {
                        maxi = i
                        max = a[i]
                }
        }
        return maxi, max
}

func sum(a []int) int {
        s := 0
        for i := range a {
                s += a[i]
        }
        return s
}

Measured memory_bytes: 512
import java.util.Scanner;

/**
 * Lucky PIN
 */
public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            char[] S = sc.next().toCharArray();

            int[] C = new int[N];
            for (int i = 0; i < N; i++) {
                C[i] = S[i] - '0';
            }

            boolean[] d1 = new boolean[10];
            boolean[][] d2 = new boolean[10][10];
            boolean[][][] d3 = new boolean[10][10][10];

            for (int i = 2; i < N; i++) {
                d1[C[i - 2]] = true;

                for (int j = 0; j < 10; j++) {
                    if (d1[j]) {
                        d2[j][C[i - 1]] = true;
                    }
                }

                for (int j = 0; j < 10; j++) {
                    if (!d1[j]) {
                        continue;
                    }

                    for (int k = 0; k < 10; k++) {
                        if (!d2[j][k]) {
                            continue;
                        }

                        d3[j][k][C[i]] = true;
                    }
                }
            }

            int ans = 0;
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    for (int k = 0; k < 10; k++) {
                        if (d3[i][j][k]) {
                            ans++;
                        }
                    }
                }
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 24908
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

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

void prime_factorize(auto n, auto &res)
{
  // 素因数分解する。計算量はO(√N)。
  for (LL s = 2; n >= s * s; s += 2)
  {
    LL e = 0;
    if (n % s == 0)
    {
      while(n % s == 0)
      {
        n /= s;
        e++;
      }
      res.emplace_back(s, e);
    }
    if (s == 2) s--;
  }
  if (n != 1) res.emplace_back(n, 1);
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  LL n, p;
  cin >> n >> p;
  LL ans = 1;
  VPLL res;
  prime_factorize(p, res);
  REPx(x, res)
  {
    LL s = x.first, e = x.second;
    ans *= pow(s, e/n);
  }
  cout << ans << endl;

  return 0;
 } 


Measured memory_bytes: 256
# coding: utf-8
# Here your code /
N, A, B = map(int, input().split())
S = input()
through = 0
oversee_thr = 0
for i in range(N):
    if S[i] == "c":
        if i + 1 == N:
            print("No", end="")
        else:
            print("No")
    elif S[i] == "a":
        if through < A + B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")
    elif S[i] == "b":
        if through < A + B and oversee_thr < B:
            if i + 1 == N:
                print("Yes", end="")
            else:
                print("Yes")
                through += 1
                oversee_thr += 1
        else:
            if i + 1 == N:
                print("No", end="")
            else:
                print("No")


Measured memory_bytes: 4040
#include<iostream>
using namespace std;
int main(){
  int t,n;
  int tt[4]={6000,4000,3000,2000};
  for(int i=0;i<4;i++){
    cin >> t >> n;
    cout << tt[t-1] * n << endl;
  }
  return 0;
}
 

Measured memory_bytes: 1160
s=input()
c=0

if len(s)%2==0:
    for i in range(int(len(s)/2)):
        if s[i]!=s[len(s)-i-1]:
            c+=1
else:
    for i in range(int(len(s)/2)):
        if s[i]!=s[len(s)-1-i]:
            c+=1

print(c)

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

#define MOD 1000000007LL
#define ll long long

using namespace std;

int main(void){
    ll N, ans = 0;
    cin >> N;
    for(int i = 1; i <= N; i++){
        ll a;
        cin >> a;
        if(i % 2 == 1 && a % 2 == 1) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <iostream>
using namespace std;
int main(void){
  int n,i = 1;
  scanf("%d",&n);
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
 INCLUDE3:
  if ( x % 10 == 3 ){
    cout << " " << i;
    goto END_CHECK_NUM;
  }
  x /= 10;
  if ( x ) goto INCLUDE3;
 END_CHECK_NUM:
  if ( ++i <= n ) goto CHECK_NUM;

  cout << endl;
 return 0;
}

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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  
  vector<vector<ll>> x(n, vector<ll>(3));
  for (int i = 0; i < n; i++) {
    cin >> x.at(i).at(1) >> x.at(i).at(2);
    x.at(i).at(0) = x.at(i).at(1) + x.at(i).at(2);
  }
  
  sort(x.rbegin(), x.rend());
  
  ll taka = 0, aoki = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) taka += x.at(i).at(1);
    else aoki += x.at(i).at(2);
  }
  
  cout << taka - aoki << '\n';
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    int r, g, b;
    cin >> r >> g >> b;
    cout << ((r*100+g*10+b)%4==0?"YES":"NO");
    return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

int main() {
	vi prime(1000001, 1);
	prime[0] = prime[1] = 0;
	FOR(i, 2, 1000) {
		if(prime[i]) {
			for(int j = i*2; j <= 1000000; j += i) {
				prime[j] = 0;
			}
		}
	}

	int n;
	while(cin >> n) {
		int minP, maxP;
		REP(i, n) {
			if(prime[i]) {
				minP = i;
			}
		}
		FOR(i, n+1, 100000) {
			if(prime[i]) {
				maxP = i;
				break;
			}
		}

		cout << minP << " " << maxP << endl;
	}

	return 0;
}

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

// boost
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll r, c, k;
  cin >> r >> c >> k;
  vvll v(r, vll(c));
  rep(i, k) {
    ll y, x, p;
    cin >> y >> x >> p;
    y--;
    x--;
    v[y][x] = p;
  }

  using vvvll = vector<vvll>;
  vvvll dp(r, vvll(c, vll(4)));
  rep(y, r) {
    rep(x, c) {
      if (y > 0) {
        ll mx = *max_element(all(dp[y - 1][x]));
        chmax(dp[y][x][0], mx);
      }
      rep(k, 4) {
        if (x > 0) {
          chmax(dp[y][x][k], dp[y][x - 1][k]);
        }
      }
      if (v[y][x]) {
        for (int k = 3; k >= 1; k--) {
          chmax(dp[y][x][k], dp[y][x][k - 1] + v[y][x]);
        }
      }
    }
  }

  ll ans = *max_element(all(dp[r - 1][c - 1]));
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 706580
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	long c[]=new long[a+1];
	long count=0;
	for(int i=1;i!=a+1;i++) {
		int b=scan.nextInt();
		count+=b;
		c[i]=count;
	}
	Arrays.sort(c);
	long co=0;
	for(int i=0;i!=a+1;i++) {
	}
	count=0;
	for(int i=0;i!=a;i++) {
		co++;
		if(c[i]!=c[i+1]) {
			count+=co*(co-1)/2;
			co=0;
		}
	}
	count+=(co+1)*(co)/2;
	System.out.println(count);
	}
}


Measured memory_bytes: 83604
/*
2つの正整数 a, b が与えられます。 
a, b の平均値を x とします。 
x の小数点以下を切り上げて得られる整数を出力してください。
制約a, b は整数である。
1≤a,b≤100


*/


#include <iostream>
using namespace std;
 
int main() {
    int a, b;
    cin >> a >> b;
    int m = (a + b + 1) / 2;
	cout << m << endl;
}

Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>
using ll = long long;
 
#define rep(i, n) for(ll i = 0; i < (int)(n); i++)
#define reps(i,x) for(ll i=1;i<=(int)(x);i++)
#define rrep(i,x) for(ll i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(ll i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define mp make_pair
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007 
using namespace std;
char a[101][101];
int b[101];
int c[101];
int main() {
  int n;
  string w, pr = "";
  set<string> ws;
  cin >> n;
  cin >> w;
  pr = w;
  ws.insert(w);
  reps(i, n-1){
    cin >> w;
    if(ws.find(w) != ws.end() || pr[pr.size()-1] != w[0]){
      cout << "No" << endl;
      return 0;
    }else{
      ws.insert(w);
      pr = w;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
S = list(input())

tmp = S.count("#")
tmp2 = len(S)-tmp
num = [0]*N
num_sharp = 0
num_peri = 0
for i in range(len(S)):
	if S[i] == "#":
		num_sharp += 1
	else:
		num_peri += 1
	num[i] = num_sharp + (len(S)-(i+1))-(tmp-num_sharp)
# print(num)
print(min(tmp2, min(num)))


Measured memory_bytes: 13316
A, B, C = map(int, input().split())
sumof3 = A + B + C
maxof3 = max(A, B, C)
oddeven = sumof3 % 2
oe_of_max = maxof3 % 2
if oddeven != oe_of_max:
    maxof3 += 1
ans = (maxof3 * 3 - sumof3) // 2
print(ans)


Measured memory_bytes: 2940
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>

using namespace std;

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

using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

using Graph = vector<vector<int>>;
// 深さ優先探索
vector<bool> seen;
int cnt = 0;
void dfs(const Graph &G, int v) {
    seen[v] = true;
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
        cnt+=1;
        dfs(G, next_v); // 再帰的に探索
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, m;
    cin >> n >> m;
    Graph G(n);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    seen.assign(n, false);
    int res = 0;
    for (int v = 0; v < n; ++v) {
        if (seen[v]) continue; // v が探索済みだったらスルー
        cnt = 0;
        dfs(G, v); // v が未探索なら v を始点とした DFS を行う
        res = max(res, cnt+1);
    }
    cout << res << endl;
}

Measured memory_bytes: 23444
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<map>
#include<utility>
#include<string>
#include<unordered_map>
#include <queue>

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

using namespace std;

#define min_3(a, b, c) min(a, min(b, c))
#define max_3(a, b, c) max(a, max(b, c))
typedef long long ll;

int main(){
    int n; cin >> n;
    if(n%2 == 0) cout << (double)n/2/n << endl;
    else cout << (double)(n/2+1)/n << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define REPW(i,n) for(i=0;i<(int)(n);++i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : "\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
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;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

signed main() {
    int n,a,b;
    cin>>n>>a>>b;
    cout<<max((a+b*(n-1))-(b+a*(n-1))+1,0ll)<<endl;
    return 0;
}


Measured memory_bytes: 256