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

namespace Repetitive_Processing
{
    class Swapping_Two_Numbers
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var token = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
                if (token[0] == 0 && token[1] == 0) break;
                if (token[0] < token[1]) Console.WriteLine(token[0] + " " + token[1]);
                else Console.WriteLine(token[1] + " " + token[0]);
            }
        }
    }
}

Measured memory_bytes: 9704
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
  int n, m;
  cin >> n >> m;
  cout << (n-1)*(m-1) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string n;
  cin >> n;
  int a;
  a = n.size() - 1;
  if(n[a]=='2'||n[a]=='4'||n[a]=='5'||n[a]=='7'||n[a]=='9'){
      cout << "hon" << endl;
  }
  else if(n[a]=='0'||n[a]=='1'||n[a]=='6'||n[a]=='8'){
      cout << "pon" << endl;
  }
  else if(n[a]=='3'){
      cout << "bon" << endl;
  }
}

Measured memory_bytes: 3628
#include "bits/stdc++.h"
using namespace std;

int main(){
  const int INF = 1000000000;
	int N,K;
	cin >> N >> K;
	vector<int> h(N+200, 0);
	for (int i = 0; i < N; i++)	cin >> h.at(i);

	vector<int> cost(N+200, INF);
	cost.at(0) = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 1; j <= K; j++) {
			cost.at(i + j) = min(cost.at(i) + abs(h[i + j] - h[i]),
				cost.at(i + j));

		}
	}
	cout << cost.at(N - 1) << endl;
}

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

namespace AtCoder.Abc
{
    class QuestionD
    {

        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            // 文字列の入力
            //string s = Console.ReadLine();

            // 整数の入力
            //int n = int.Parse(Console.ReadLine());

            // 文字列配列の入力
            //string[] inputStrArray = Console.ReadLine().Split(' ');

            // 整数配列の入力

            ///////入力の受け取り

            var NM = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();

            int N = NM[0], M = NM[1];

            var flag = new int[N];
            for (int i = 0; i < N; i++) flag[i] = -1;


            List<int>[] G = new List<int>[N];
            for (int i = 0; i < N; i++) G[i] = new List<int>();
            for (int i = 0; i < M; i++)
            {
                var Road = Console.ReadLine().Split(' ').Select(k => int.Parse(k) - 1).ToArray();
                G[Road[0]].Add(Road[1]);
                G[Road[1]].Add(Road[0]);
            }

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

            Queue<Tuple<int, int>> que = new Queue<Tuple<int,int>>();
            que.Enqueue(Tuple.Create(0, 0));

            while (que.Count > 0)
            {
                var q = que.Dequeue();

                foreach (var room in G[q.Item1])
                {
                    int c = q.Item2;

                    if (flag[room] == -1)
                    {
                        flag[room] = q.Item1;
                        que.Enqueue(Tuple.Create(room, c + 1));
                    }
                }



            }

            Console.WriteLine("Yes");
            for (int i = 1; i < N; i++)  Console.WriteLine(flag[i]+1);


            Console.Out.Flush();
        }
    }
}



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

using LL = long long;
using LD = long double;
 
LL mod = 1e9+7;

int main()
{
	LL r;
	cin >> r;
	cout << 2*(double)(r)*(double)(3.14159265) << "\n";
}



Measured memory_bytes: 3784
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
n = int(input())
nn = num2alpha(n)
print(nn.lower())

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

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

int main() {
    ll X;
    cin >> X;
    ll ans = 0, a = 100;

    while (a < X)
    {
        a += a/100;
        ans++;
    }
    
    cout << ans << endl;

    return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> A(4);
  for(int &i:A){
    i=N%10;
    N/=10;
  }
  reverse(A.begin(),A.end());
  cout << A.at(0);
  for(int tmp=0;tmp<(1<<3);tmp++){
    bitset<3> s(tmp);
    int j=A.at(0);
    for(int i=0;i<3;i++){
      if(s.test(i))
        j+=A.at(i+1);
      else
        j-=A.at(i+1);
    }
    if(j==7){
      for(int i=0;i<3;i++){
        if(s.test(i))
          cout << '+';
        else
          cout << '-';
        cout << A.at(i+1);
      }
      break;
    }
  }
  cout << "=7" << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
//#define INF (1LL<<59)
typedef pair<double,int> pdi;


vector<int> G[150000];
double val[150000];
double ans[150000];
int deg[150000];

pdi dfs(int cur, int prev){
    double ret = 0;
    int c=0;
    for(auto e:G[cur]){
        if(e==prev)continue;
        c++;
    }
    if(c==0)return pdi(val[cur] = 0,0);
    
    int height=0;
    for(auto e:G[cur]){
        if(e==prev)continue;
        double res;
        int h;
        tie(res,h) = dfs(e,cur);
        ret+=1+res;
        height = max(1+h,height);
    }
    ret/=c;
    return pdi(val[cur] = ret,height);
}


double dfs2(int cur, int prev, double d_par){
    vector<pdi> v;
    for(auto e:G[cur]){
        if(e==prev)v.pb(pdi(d_par+1,e));
        else v.pb(pdi(val[e]+1,e));
    }
    
    double ave = 0;
    rep(i,v.size())ave+=v[i].first;
    ave/=deg[cur];
    
    
    for(auto e:G[cur]){
        if(e==prev)continue;
        if(deg[cur]==1)dfs2(e,cur,0);
        else dfs2(e,cur,(ave*deg[cur]-(val[e]+1))/(deg[cur]-1));
    }
    
    return ans[cur] = ave;
}

int main(){
    int n;
    cin>>n;
    
    rep(i,n-1){
        int u,v;
        cin>>u>>v;
        u--,v--;
        deg[u]++;
        deg[v]++;
        G[u].pb(v);
        G[v].pb(u);
    }
    
    dfs(0,-1);
    
    dfs2(0,-1,0);
    
    rep(i,n){
        printf("%.20lf\n",ans[i]);
    }
    
}


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

using namespace std;

typedef long long lli;
typedef double lld;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<double> vdl;
typedef vector<vector<lli>> mat;
typedef vector<vdl> mad;
typedef unordered_map<lli,unordered_map<lli,lli>> graph;
typedef complex<double> cmp;
typedef vector<cmp> vcl;

lli n;
lli m;
graph g;
vll has_p;
queue<lli> q;
lli root;
vll ans;
vll vis;

int main(){
  cin >> n >> m;
  has_p = vll(n+1, 0ll);
  vis = vll(n+1, 0ll);
  ans = vll(n+1, 0ll);
  for(lli i = 0;i < n-1+m;i++){
    lli a,b;
    cin >> a >> b;
    g[a][b] = 1;
    has_p[b]++;
  }
  for(lli i = 1;i <= n;i++){
    if(has_p[i] == 0) root = i;
  }
  q.push(root);
  while(!q.empty()){
    lli node = q.front();
    q.pop();
    for(auto x : g[node]){
      lli child = x.first;
      vis[child]++;
      if(vis[child] == has_p[child]){
        ans[child] = node;
        q.push(child);
      }
    }
  }
  for(lli i = 1;i <= n;i++){
    cout << ans[i] << endl;
  }
}


Measured memory_bytes: 18212
#include <bits/stdc++.h>
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define ll long long int
#define ld long double
#define el '\n'
#define PI (ld)3.14159265358979323846
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < int(n); i++)
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

/*vector<int> parent, rak;

int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}

void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (rak[a] < rak[b])
            swap(a, b);
        parent[b] = a;
        rank[a]+=rank[b];
    }
}*/

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}
ll extend_gcd(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1,y1;
    ll ans =extend_gcd(b,a%b,x1,y1);
    x=y1;
    y=x1-(a/b)*y1;

    return ans;
}
ll inverse(ll a,ll m){
    ll x,y;
    extend_gcd(m,a,x,y);
    y%=m;
    y+=m;
    y%=m;
    return y;
}

/*const int N = 1000001;
int lp[N+1];
vector<int> pr;
void s(){
for (int i=2; i<=N; ++i) {
        if (lp[i] == 0) {
            lp[i] = i;
            pr.push_back (i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=N; ++j)
            lp[i * pr[j]] = pr[j];
    }
}*/


ll kv;
ll t,n,x,y,h,k,z,p,q,w;

//vector<vector<ll>>v;
//vector<ll>vis,d;

int main() {
    IOS;
    cin>>n>>k>>h;
    ll b[k],a[n][k];
    fo(i,k)cin>>b[i];
    fo(i,n)fo(j,k)cin>>a[i][j];
    fo(i,n){
        x=h;
        fo(j,k)x+=a[i][j]*b[j];
        if(x>0)kv++;
    }
    cout<<kv;
    return 0;
}

Measured memory_bytes: 256
using System;
//using System.Linq;
//using System.Collections.Generic;

class Test
{
    static void Main()
    {
        Dice dice1 = new Dice(Console.ReadLine());
        string s = Console.ReadLine();
        foreach (char x in s)
        {
            switch (x)
            {
                case 'N':
                    dice1.North();
                    break;
                case 'E':
                    dice1.East();
                    break;
                case 'W':
                    dice1.West();
                    break;
                case 'S':
                    dice1.South();
                    break;
            }
        }
        Console.WriteLine(dice1.d1);
    }
}

class Dice
{
    string[] ss ;
    public string d1, d2, d3, d4, d5, d6;

    public Dice(string s)
    {
        this.ss = s.Split();
        d1 = ss[0];
        d2 = ss[1];
        d3 = ss[2];
        d4 = ss[3];
        d5 = ss[4];
        d6 = ss[5];
    }

    string tmp;

    public void North()
    {
        tmp = d1;
        d1 = d2;
        d2 = d6;
        d6 = d5;
        d5 = tmp;
    }

    public void East()
    {
        tmp = d1;
        d1 = d4;
        d4 = d6;
        d6 = d3;
        d3 = tmp;
    }

    public void West()
    {
        tmp = d1;
        d1 = d3;
        d3 = d6;
        d6 = d4;
        d4 = tmp;
    }

    public void South()
    {
        tmp = d1;
        d1 = d5;
        d5 = d6;
        d6 = d2;
        d2 = tmp;
    }
}


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

using namespace std;

int main(int argc, char *argv[]) {
    int64_t N;
    cin >> N;

    int64_t p = N;
    int64_t m = 0;

    string ans;
    while (p != 0) {
        m = p % -2;
        p = p / -2;
        if (m < 0) {
            m += 2;
            p += 1;
        }
        ans = to_string(m) + ans;
    }
    if (ans.empty()) {
        ans = "0";
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main() {
	int a, b, c;
	int k;
	cin >> a >> b >> c >> k;
	int x, z;

	x = k - a;
	z = x - b;

	if (k <= a) {
		cout << k;
	}
	else if (x <= b) {
		cout << a;
	}
	else if (z > 0) {

		cout << a + (-1 * z);
	}else {
    cout << a;
	}
}


Measured memory_bytes: 3596
//------------------------------------------
// C++ templete 
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

//REPEAT
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//grobal variable
//------------------------------------------
int N,M;
VI Vec;

//動的計画法で役に立つ関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  
    // intだとOverflowする！{
    long long N, K;cin >> N >> K;
    vector<pair<int, int> > C(N);
    REP(i, N)
    {
        int a, b;
        cin >> a >> b;
        C.at(i) = make_pair(a, b);
    }
    
    SORT(C);
    REP(i, N)
    {
        K -= C.at(i).second;
        if (K<=0) 
        {
            cout << C.at(i).first << endl;
            break;
        }
    }

    return 0;
}



Measured memory_bytes: 1024
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  int s=0;
  int m=0;
  char f[10];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int M1;
int D1;
int M2;
int D2;
int main(){
  rd(M1);
  rd(D1);
  rd(M2);
  rd(D2);
  if(M1!=M2){
    wt_L(1);
    wt_L('\n');
  }
  else{
    wt_L(0);
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20191125-1

// --- original code ---
// int M1, D1, M2, D2;
// {
//   rd(M1,D1,M2,D2);
//   wt(if[M1!=M2, 1, 0]);
// }


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <string>
#include <cmath>
#include <map>
#include <iomanip>
#include <tuple>
#include <functional>
#define INF 1000000009
#define LINF 1000000000000000009
#define double long double
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
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 (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

vector<vector<int>> graph(200010, vector<int>());

void dfs(int n, int par, int dis, vector<int> &res) {
	res[n] = dis;
	for (auto i : graph[n]) {
		if (i != par) {
			dfs(i, n, dis + 1, res);
		}
	}
}

int main() {
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n - 1; i++) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		graph[a[i]].push_back(b[i]);
		graph[b[i]].push_back(a[i]);
	}
	vector<int> x(n), y(n);
	dfs(0, -1, 0, x);
	int p = -1, d = -1;
	for (int i = 0; i < n; i++) {
		if (x[i] > d) {
			p = i; d = x[i];
		}
	}
	dfs(p, -1, 0, y);
	int ans = 0;
	for (auto i : y) chmax(ans, i);
	cout << (ans % 3 == 1 ? "Second" : "First") << endl;
}

Measured memory_bytes: 26880
#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 (long long i = j; i < (long long)(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(){
	ll a,b,k; cin>>a>>b>>k;
	map<ll,ll> mp;
	rep(i,a,a+k) mp[i]++;
	rep(i,b-k,b) mp[i+1]++;
	for(auto c:mp){
		ll m=c.first;
		if(a<=m && m<=b)cout<<m<<endl;
	}
		
	
	return 0;
}

Measured memory_bytes: 3604
import sys
sys.setrecursionlimit(10**6)
n = int(input())
G = [[] for _ in range(n)]
mod = 10**9 + 7

for _ in range(n-1):
    a,b = map(int,input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

stack = [0]
depth = [-1]*n
depth[0] = 0
while stack:
    v = stack.pop()
    d = depth[v]
    for nv in G[v]:
        if depth[nv] >= 0:continue
        depth[nv] = depth[v] + 1
        stack.append(nv)

d_to_i = [[] for _ in range(n)]

for i in range(n):
    d_to_i[depth[i]].append(i)

data = [[] for _ in range(n)]

for d in range(n-1,-1,-1):
    for v in d_to_i[d]:
        for nv in G[v]:
            if depth[nv] < depth[v]:continue
            if data[nv]:
                data[v].append(n-data[nv][-1])
        if data[v]:
            data[v].append(n-1-sum(data[v]))
        else:
            data[v].append(n-1)

ans = 0
two = [1]
for i in range(n):
    two.append(two[-1]*2%mod)
for i in range(n):
    now = two[n-1]-1
    for x in data[i]:
        now -= two[x]-1
        now %= mod
    ans += now

#print(ans)

x = two[n]
x = pow(x,mod-2,mod)
print(ans*x%mod)

Measured memory_bytes: 123256
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}

#[allow(unused_macros)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn main() {
    let (a, b): (f32, f32) = read!(f32, f32);
    println!("{}", ((a + b) / 2.0).ceil());
}


Measured memory_bytes: 4352
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
inline void Yeah(){//可以得到
	puts("Yes");
	exit(0);
}
int main(){ 
    int n,m,k;
    cin>>n>>m>>k;
    for(int i=1;i<=n;++i){
        int kk=(k-i*m),a=n-i-i;//kk是剩下的要变成黑色的格子,a是每次增加的黑格子
        if(!kk||a&&(kk>>31&1)==(a>>31&1)&&kk%a==0&&kk/a<=m) Yeah();
        //!kk说明已经填完了，可以直接输出。
        //a不能等于0,否则%0会报错，
        //(kk>>31&1)==(a>>31&1)这句是判断kk和a是否同号,二进制表示的负数第一位是1
        //kk%a==0前面已经说过，就是可以组成的情况
        //kk/a必须小于等于m,因为j最多加m次
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
ll n,m,x[100010],y[100010],ans,cnt,q[100010],l,r;
int main()
{
	ll i,s,a,b,j,k;
	scanf("%lld",&n);
	for(i=1;i<=n;i++)scanf("%lld",&q[i]);
	sort(q+1,q+1+n);
	cnt=1;x[1]=q[1];y[1]=1;
	for(i=2;i<=n;i++)
	{
		if(q[i]==q[i-1])y[cnt]++;
		else x[++cnt]=q[i],y[cnt]=1;
	}
	for(i=cnt;i>=1;i--)if(y[i]>=2){y[i]-=2;l=x[i];break;}
	for(;i>=1;i--)if(y[i]>=2){r=x[i];break;}
	ans=l*r;
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#include<cmath>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
const ll MOD = 1000000007;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};
#define print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define fs first
#define sc second
 
template<typename T>
T gcd(T a,T b){return b?gcd(b,a%b):a;}

const int INF = 1e9;
const ll LLINF = 1e16;
 
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 
template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::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==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

// 割り算の切り上げ処理
template<typename T>
T round_up(T a, T b) {
  return (a + b - 1) / b;
}


using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    char a,b;
    cin >> a >> b;
    if(a == 'H'){
      if(b == 'H') {
        print('H');
      }
      else{
        print('D');
      }
    }else{
      if(b == 'H'){
        print('D');
      } else{
        print('H');
      }
    }
    

}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int a,b,c;
  int cnt=0;
  cin>>a>>b>>c;
  for(int i=a;i<=b;i++){
    if(c%i==0){
      cnt++;
    }
  }
  cout<<cnt<<endl;
  return (0);
}

Measured memory_bytes: 3084
#include "bits/stdc++.h"
using namespace std;
#define ll long long;
const int nax = 3005;
long long dp[nax][nax];

int main() {
    int n;
    cin >>n;
    vector<int> a(n);
    for(int i = 0; i < n; ++i) {
     cin >>a[i];
    }
    // dp[0][n-1]
    for(int L = n - 1; L >= 0; --L) {
        for(int R = L; R < n; ++R) {
            if(L == R) {
                dp[L][R] = a[L];
            }
            else {
                dp[L][R] = max(a[L] - dp[L+1][R], a[R] - dp[L][R-1]);
            }
        }
    }
  /*  for(int i=0;i<n;i++){
    	for(int j=0;j<n;j++) cout <<dp[i][j]<<" ";
    	cout <<endl;
	}
}*/
 cout <<dp[0][n-1]<<"\n";
}


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

int main() {
  

  int N ,X ;
  cin >> N >> X;
  int t = 0;
  vector<int> D(N);
  
  for(int i = 0; i < N; i++){
    cin >> D.at(i);
    t += D.at(i);
  }
  
  sort(D.begin(), D.end());
   t = X - t;
  t /= D.at(0);
  t += N;
  
  cout << t << endl;
      
  
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define ALL(x) x.begin(), x.end()
#define INF (1001000000)
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i:c)
#define EXIST(cs,v) (find(ALL(cs),(v))!=cs.end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define UNIQ(c) (c).erase(unique((c).begin(),(c).end()), (c).end());
#define P(p) cout<<(p)<<endl;


double check(int n, int k, int score) {
    double prob = 1.0/n;
    while (score < k) {
        prob *= 0.5;
        score *= 2;
    }
    return prob;
}

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

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

    double prob = 0.0;
    REP(i, n) {
        prob += check(n, k, i+1);
    }
    cout << fixed << setprecision(10) << prob << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define fore(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);++i)
#define rep(i,n) fore(i,0,(n)-1)
#define rfore(i,a,b) for(ll i=(ll)(b);i>=(ll)(a);--i)
#define rrep(i,n) rfore(i,0,(n)-1)
#define all(x) (x).begin(),(x).end()
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
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;}

ll par[100005];
ll find(ll x){
    if(par[x]<0)return x;
    return par[x]=find(par[x]);
}
void unite(ll x,ll y){
    x=find(x),y=find(y);
    if(x==y)return;
    par[x]+=par[y];
    par[y]=x;
}
ll size(ll x){
    ll root=find(x);
    return -par[root];
}
void solve(){
    memset(par,-1,sizeof(par));
    ll n,m;cin>>n>>m;
    vl a(m),b(m);
    rep(i,m){
        cin>>a[i]>>b[i];
        a[i]--,b[i]--;
    }
    vl ans(m);
    ll inc=n*(n-1)/2;
    rrep(i,m){
        ans[i]=inc;
        if(find(a[i])!=find(b[i])){
            inc-=size(a[i])*size(b[i]);
            unite(a[i],b[i]);
        }
    }
    rep(i,m){
        cout<<ans[i]<<endl;
    }
}

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


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

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

  for (int i = 0; i <= n; i++)
  {
    if(n == floor(i * 1.08))
    {
      cout << i << endl;
      return 0;
    }
  }
  
  cout << ":(" << endl;
  return 0;
}

Measured memory_bytes: 3612
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>

using namespace std;

#define ll long long

void solve()
{
    ll N, L;
    cin >> N >> L;
    ll minv = 1000000;
    ll minvv = 0;
    ll sum = 0;
    for (ll i = 1; i <= N; i++)
    {
        sum += i;
        if (abs(L + i - 1) < minv)
        {
            minv = abs(L + i - 1);
            minvv = L + i - 1;
        }
    }
    cout << N * L + sum - N - minvv << endl;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
from functools import reduce
from itertools import combinations
from math import gcd


def func(A):
    is_A = [0] * (10**6+1)
    for a in A:
        is_A[a] += 1
    if any(x > 1 for x in is_A[2:]):
        return False
    if sum(is_A[i] for i in range(2, 10**6+1, 2)) > 1:
        return False
    for i in range(3, 10**6+1, 2):
        if sum(is_A[j] for j in range(i, 10**6+1, i)) > 1:
            return False
    return True


def solve():
    N = int(input())
    A = list(map(int, input().split()))
    if func(A):
        # if not all(gcd(i, j)==1 for i, j in combinations(A, 2)):
        #     raise NameError
        print('pairwise coprime')
    elif reduce(gcd, A) == 1:
        print('setwise coprime')
    else:
        print('not coprime')
    

if __name__ == '__main__':
    solve()

Measured memory_bytes: 127832
N, M, X, Y = map(int, input().split())
x = map(int, input().split())
y = map(int, input().split())
max_x = max(x)
min_y = min(y)
if min_y <= max_x or min_y <= X or Y <= max_x:
    print("War")
else:
    print("No War")


Measured memory_bytes: 2940
n,a,b = map(int, input().split())
MOD = 10 ** 9 + 7

def comb(n, k):
    nCk = 1


    for i in range(n - k + 1, n + 1):
        nCk *= i
        nCk %= MOD

    for i in range(1, k + 1):
        nCk *= pow(i, MOD - 2, MOD)
        nCk %= MOD
    return nCk

print((((pow(2,n,MOD)-1-comb(n,a))%MOD)-comb(n,b))%MOD)

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

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    int ans = 2*5000*100000;
    rep(i, 2*max(X, Y)) {
        int tmp = i*2*C + max(0, X - i)*A + max(0, Y - i)*B;
        ans = min(ans, tmp);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;


int main()
{
	int A[256], h;

	cin >> h;
	for (int i = 1; i <= h; i++)
		cin >> A[i];

	for (int i = 1; i <= h; i++)
	{
		int k;
		cout << "node " << i << ": key = " << A[i] ;
		k = i / 2;
		if(k)
			cout << ", parent key = " << A[k];

		k = i * 2;
	    if(k<=h)
			cout << ", left key = " << A[k];
		if ((k+1)<= h)
			cout << ", right key = " << A[k+1];

		 cout << ", "<<endl;
	}


	return 0;
}


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

int main(void){
    int n;
    cin >> n;
    int f[n]={},p[n][11];
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < 10; j++)
        {
            int tmp;
            cin >> tmp;
            f[i]+=(tmp<<(9-j));
        }
    }
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < 11; j++)
        {
            cin >> p[i][j];
        }
    }
    list<int> x;
    for (size_t state = 0; state < 1<<10; state++)
    {
        if(bitset<10>(state).count()==0)continue;
        int tmp=0;
        for (size_t i = 0; i < n; i++)
        {
            tmp += p[i][bitset<10>(state&f[i]).count()];
        }
        x.push_back(tmp);
    }
    x.sort(greater<int>());
    cout << x.front() << endl;
    return 0;
}

Measured memory_bytes: 256
fn main() {
    let (a, b): (i64, i64) = readln();
    let c = (a as f64 + b as f64 + 1.0) / 2.0;
    let x = c as i64;
    println!("{}", x);
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashSet;

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);


Measured memory_bytes: 4352
import fractions
n,x=map(int, input().split())
c=list(map(int, input().split()))
c.append(x)
c.sort()
v=[]
r=[0]
for i in range(n):
    v.append(c[i+1]-c[i])
for i in range(n):
    z=fractions.gcd(r[-1],v[i])
    r.append(z)
print(r[-1])

Measured memory_bytes: 16240
#include <ctype.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tgmath.h>

int main(int argc, char **argv)
{
    char s[11], t[11], u[11];
    int a, b;
    scanf("%s %s", s, t);
    scanf("%d %d", &a, &b);
    scanf("%s", u);
    if (strcmp(s, u) == 0) {
        a--;
    } else {
        b--;
    }
    printf("%d %d\n", a, b);
    return EXIT_SUCCESS;
}


Measured memory_bytes: 128
#include <iostream>
using namespace std;
int a,b,ans,c,d=9999;
int main(){
	cin>>a>>b;
	for(int i=0;i<a;i++){
		cin>>c;
		b=b-c;
		if(d>c) d=c;
	} 
	ans=a+b/d;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<math.h>
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false); 
//    cin.tie(NULL); 
    cout.tie(NULL);
  	lli n;
  	cin>>n;
  	cout<<(n+1)/2<<endl;
	return 0;
}



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

int a, b;

int ans;

int main(void){
  // Here your code !
  scanf("%d %d", &a, &b);

  int ta = 0;
  for (int i = 1; i < (b - a); ++i) {
    ta += i;
  }

  ans = ta - a;

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

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  int N;
  cin >> N;
  int a[N];
  multiset<int> s;
  set<int> t;
  rep(i,N){
    cin >> a[i];
    t.insert(a[i]);
    s.insert(a[i]);
    s.insert(a[i]+1);
    s.insert(a[i]-1);
  }
  int ans=0;
  for(auto i : t){
    ans = max((int) s.count(i),ans);
  }
  cout << ans << endl;
  
  return 0;

}

Measured memory_bytes: 17664
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
using namespace std;

#define V 10000
#define INF 100000000

typedef pair<int,int> P;

struct edge {
  int to,cap,cost,rev;
  edge(int a,int b,int c,int d){to = a;cap = b,cost = c;rev = d;}
};

int n,m[110],g,a;
int x[110][30],y[110][30],c[110][30];
vector<int> ar[110];
P ans;

vector<edge> G[V];
int h[V];
int dist[V];
int prevv[V], preve[V];

void add_edge(int from,int to,int cap,int cost){
  G[from].push_back(edge(to,cap,cost,G[to].size()));
  G[to].push_back(edge(from,0,-cost,G[from].size() - 1));
}

int min_cost_flow(int s,int t,int f){
  int res = 0;
  fill(h,h+V,0);
  while(f>0){
    priority_queue<P ,vector<P>, greater<P> > q;
    fill(dist,dist+V,INF);
    dist[s] = 0;
    q.push(P(0,s));
    while(!q.empty()){
      P p = q.top(); q.pop();
      int v = p.second;
      if(dist[v] < p.first)continue;
      for(int i=0;i<G[v].size();i++){
	edge &e = G[v][i];
	if(e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]){
	  dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
	  prevv[e.to] = v;
	  preve[e.to] = i;
	  q.push(P(dist[e.to],e.to));
	}
      }
    }
    if(dist[t] == INF)return -1;

    for(int v=0;v<V;v++)h[v] += dist[v];

    int d = f;
    for(int v=t;v!=s;v = prevv[v]){
      d = min(d,G[prevv[v]][preve[v]].cap);
    }

    f -= d;
    res += d*h[t];
    for(int v=t;v!=s;v=prevv[v]){
      edge &e = G[prevv[v]][preve[v]];
      e.cap -= d;
      G[v][e.rev].cap += d;
    }
  }
  return res;
}

int main(){
  while(scanf("%d",&n) != EOF, n){
    m[0] = 1; ar[0].clear(); ar[0].push_back(0);
    x[0][0] = 0; y[0][0] = 0; c[0][0] = 0;
    for(int i=1;i<n;i++){
      scanf("%d",&m[i]);
      ar[i].clear();
      for(int j=0;j<m[i];j++){
	scanf("%d %d %d",&x[i][j],&y[i][j],&c[i][j]);
	ar[i].push_back(y[i][j]);
      }
      sort(ar[i].begin(),ar[i].end());
      ar[i].erase(unique(ar[i].begin(),ar[i].end()),ar[i].end());
    }
    m[n] = 1; ar[n].clear(); ar[n].push_back(INF);
    x[n][0] = INF; y[n][0] = INF; c[n][0] = 0;
    scanf("%d",&g);
    for(int ans = g;ans>=0;ans--){
      for(int i=0;i<=V;i++)G[i].clear();
      for(int i=0;i<n;i++){
        for(int j=0;j<ar[i].size();j++){
    	  for(int k=0;k<m[i+1];k++){
            if(ar[i][j]<=x[i+1][k]){
              for(int l=0;l<ar[i+1].size();l++){
	        if(y[i+1][k] == ar[i+1][l]){
	       	  a = l;
		  break;
	        }
	      }
	      add_edge(i*50 + j*2 + 1, (i+1)*50 + a*2, 1, c[i+1][k]);
	    }
  	  }
        }
        for(int j=0;j<ar[i+1].size();j++){
	  add_edge((i+1)*50 + j*2,(i+1)*50 + j*2 + 1, 1, 0);
        }
      }
    
      int res = min_cost_flow(1,n*50,ans);
      if(0<=res){
        cout << ans << " " << res << endl;
        break;
      }
    }
  }
}

Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll a, b, c;
  cin >> a >> b >> c;
  if(a==b&&b==c){
    print(1);
  }
  else if(a!=b&&b!=c&&c!=a){
    print(3);
  }
  else{
    print(2);
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    int A, B; cin >> A >> B;
    REP(i, 1, 10000) {
        int a = i * 8 / 100;
        int b = i * 10 / 100;
        if (a == A && b == B) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main() {
    int n; cin >> n;
    string S; cin >> S;
    bool ans = true;
    if(n % 2 != 0){
        cout << "No" << endl;
        return 0;
    }else{
        rep(i,n/2){
            if(S[i] != S[n/2 + i]){
                ans = false;
            }
        }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

// エラトステネスの篩：n以下の素数を昇順に返す
vector<long long> SieveOfEratosthenes(const long long n){
    vector<bool> chkPrime(n+1, true);
    vector<long long> ret;
    for(long long i=2; i<=n; i++){
        if(chkPrime[i]){
            for(long long j=2*i; j<=n; j+=i) chkPrime[j]=false;
            ret.push_back(i);
        }
    }
    return ret;
}

int main(){
    Init();
    ll n; cin >> n;
    set<ll> a;
    vector<int> d(1000001, 0);

    ll ans = 0, max_a = 0;
    rep(i, n){
        ll tmp; cin >> tmp;
        if(d[tmp] == 0) a.insert(tmp);
        d[tmp]++;
        chmax(max_a, tmp);
    }

    vector<bool> dp(max_a+1, true);

    for(auto p: a){
        if(!dp[p]) continue;
        if(d[p] == 1) ans++;
        for(ll i=1; p*i<=max_a; i++) dp[p*i] = false;
    }

    // vector<pair<ll, bool>> list;
    // for(auto p: a) list.push_back(make_pair(p, true));

    // for(ll i=0; i<list.size(); i++){
    //     if(!list[i].second)continue;
    //     if(d[list[i].first] == 1) ans++;
    //     for(ll j=i+1; j<list.size(); j++) if(list[j].second && list[j].first%list[i].first == 0) list[j].second = false;
    // }
    cout << ans << endl;
}

Measured memory_bytes: 16656
import math
a,b,x=map(int,input().split())
V=a*a*b
if x>=V/2:
    theta=math.atan((2*a*a*b-2*x)/(a**3))
else:
    theta=math.atan((a*b*b)/(2*x))
print(math.degrees(theta))

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String S = scan.next();
        System.out.println(S.substring(0,3));
    }
}


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

int main(){
  char c;
  cin >> c;
  c++;
  cout << c << endl;
}


Measured memory_bytes: 3656
a = int(input())
b = [int(x) for x in input().split()]
dp = [0] + [None] * (a - 1)
dp[1] = abs(b[0] - b[1])
for x in range(2, a):
    dp[x] = min(dp[x - 2] + abs(b[x] - b[x - 2]), dp[x - 1] + abs(b[x] - b[x - 1]))
print(dp[-1])

Measured memory_bytes: 85804
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	if(a+b==15)
		printf("+");
	else if(a*b==15)
		printf("*");
	else
		printf("x");
	return 0;
}


Measured memory_bytes: 256
'use strict';
function Main(input) {
	input = input.split(" ");
	
	var h = parseInt(input[0], 10);
	var a = parseInt(input[1], 10);
  	var count = 0;
	while(h > 0){
      h -= a;
      count ++;
    }
  console.log(count);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 30528
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		Queue<Integer> que = new PriorityQueue<>((e1,e2)->-e1+e2);
		for(int i=0;i<n;i++) que.add(in.nextInt());
		for(int i=0;i<m;i++) {
			int tmp = que.poll()/2;
			que.add(tmp);
		}
		long ans = 0;
		for(int i=0;i<n;i++) {
			ans += que.poll();
		}
		System.out.println(ans);
		in.close();

	}

}


Measured memory_bytes: 63040
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
    public  static void main(String[] args) {
        FastScanner sc = new FastScanner();
        String text = "";
        List<String> listA = new ArrayList<>();
        int count = Integer.parseInt(sc.next());

        for(int i = 0; i < count; i++) {
            text = sc.next();
            listA.add(text);

        }
        List<String> listB = new ArrayList<String>(new HashSet<>(listA));
        System.out.print(listB.size());
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

}

Measured memory_bytes: 59472
/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>

using namespace std;

#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define Str(x) to_string(x)
#define len(s) (int)s.size()

typedef long long ll;
typedef long double lld;
typedef string str;
typedef unsigned long long ull;

const int maxn = 1e5 + 228;

bool can[maxn * 2];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    can[0] = true;
    for (int i = 0; i < maxn; i++) {
        if (can[i]) {
            for (int j = 0; j < 6; j++) {
                can[i + 100 + j] = true;
            }
        }
    }
    int n;
    cin >> n;
    cout << can[n];


    return 0;
}


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

namespace AtCoder
{
    class Takofes
    {
        public static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();
            char[] chArrayData = str.ToArray();
            var list = new List<int>();

            for (int i = 0; i < N; i++)
            {
                 list.Add(chArrayData[i]);
            }

            for(int j = 0; j < N - 1; j++)
            {
                if(list[j] == list[j + 1])
                {
                    list.RemoveAt(j + 1);
                    N--;
                    j--;
                }
            }
            Console.WriteLine(list.Count);
        }
    }
}


Measured memory_bytes: 13300