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

using namespace std;

int main(){
        string s;
        int sum = 0;
        while(cin >> s){ 
                bool flag = true;
                for(int i = 0; i < s.size(); i++){
                        if(s[i] != s[s.size()-1-i]) flag = false;
                }   
                if(flag) sum++;
        }   
        cout << sum << endl;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

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

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d[] = new int[n];
        for (int i = 0; i < n; i++) {
            d[i] = sc.nextInt();
        }
        Arrays.sort(d);
        int min = d[n / 2 - 1];
        int max = d[n / 2];
        int ans = max - min;
        if (ans > 0) {
            System.out.println(ans);
        } else {
            System.out.println(0);
        }
        sc.close();
    }
}


Measured memory_bytes: 56616
#include<stdio.h>
int main(){
	int a,b,c,sub;
	scanf("%d %d %d",&a,&b,&c);
	if(a>c){
		sub=a;
		a=c;
		c=sub;
	}
	if(a>b){
		sub=a;
		a=b;
		b=sub;
	}
	if(b>c){
		sub=b;
		b=c;
		c=sub;
	}
	printf("%d %d %d\n",a,b,c);
	return 0;
}

Measured memory_bytes: 2668
#include <bits/stdc++.h>
using namespace std;
#define MAXN 114514

long long N;
long long h[MAXN];
long long dp[MAXN];

const unsigned short k[] = {1,2};

int main() {
	ios::sync_with_stdio(false);
	memset(h, 0, sizeof(h));
	memset(dp, 127, sizeof(dp));
	cin >> N;
	for(long long i=0; i<N; i++) {
		cin >> h[i];
	}
	dp[0] = 0;
	for(long long i=0; i<N; i++) {
		for(long long j=0; j<sizeof(k)/sizeof(k[0]); j++) {
			if(k[j]<=i) {
				const long long f = i - k[j];
				const long long cost = llabs(h[i]-h[f]);
				const long long ndp = dp[f] + cost;
				dp[i] = min(ndp, dp[i]);
			}
		}
	}
	cout << dp[N-1] << "\n";
	return 0;
}


Measured memory_bytes: 2048
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, read().split()))
cnt = 0
for aa, bb in zip(a, b):
    v = bb - aa
    if bb > aa:
        v //= 2
    cnt += v
if cnt >= 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 4408
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	D
# CreatedDate:  2020-09-03 21:15:23 +0900
# LastModified: 2020-09-03 21:29:19 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    S = []
    for _ in range(n):
        S.append(list(map(int, input().split())))
    S.sort(key=lambda x:x[1])
    current_time = 0
    for s in S:
        current_time += s[0]
        if current_time <= s[1]:
            pass
        else:
            print('No')
            return
    print('Yes')


if __name__ == "__main__":
    main()


Measured memory_bytes: 47092
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n,num,min,max;
        long sum = 0;
        n = sc.nextInt();
        num = sc.nextInt();
        min = num;
        max = num;
        sum += num;
        for(int i=1; i<n; i++) {
            num = sc.nextInt();
            min = Math.min(min, num);
            max = Math.max(max, num);
            sum += num;
        }
        System.out.println(min + " " + max + " " + sum);
    }
}

Measured memory_bytes: 31760
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c; cin >> a >> b >> c;
  if(a == b && c != b){
    cout << "Yes" << endl;
  }else if(b == c && a != c){
    cout << "Yes" << endl;
  }else if(c == a && c != b){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> Vec<T>
where
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).ok();
    buf.trim().split(' ').map(|x| x.parse().unwrap()).collect()
}

fn main() {
    let n = read::<usize>()[0];
    let mut l: Vec<i32> = read();
    l.sort();
    l.reverse();

    let mut ans = 0;

    for i in 0..(n - 2) as usize {
        for j in (i + 1)..(n - 1) as usize {
            let mut k = n - 1;
            let min = l[i] - l[j];
            if min >= l[j] {
                break;
            }
            loop {
                if l[k] > min {
                    break;
                }
                k -= 1;
            }
            ans += k - j;
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
N,M,K = map(int, input().split())

p = 998244353

factorial = [1]
counter = 0
for i in range(1,N+1):
    factorial.append(factorial[i-1]*i%p)



for k in range(K+1):
    counter += factorial[N-1]*pow(factorial[k],p-2,p)*pow(factorial[N-k-1],p-2,p)*M*pow(M-1,N-1-k,p)
print(counter%p)


Measured memory_bytes: 83092
using System;
using System.Collections.Generic;
using System.Linq;
    class Program
    {
        static void Main(string[] args)
        {
            var inputs = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray();
            var N = inputs[0];
            var M = inputs[1];
            var AB = new List<KeyValuePair<long, long>>();
            for (int i = 0; i < N; i++)
            {
                var As = Console.ReadLine().Split(' ').Select(c => long.Parse(c)).ToList();
                AB.Add(new KeyValuePair<long, long>(As[0], As[1]));
            }
            AB = AB.OrderBy(k => k.Key).ToList();

            long result = 0;
            var getM = 0;
            foreach(var item in AB)
            {
                for(int i = 0;i<item.Value; i++)
                {
                    getM++;
                    result += item.Key;
                    if(getM>=M)
                    {
                        Console.WriteLine(result);
                        return;
                    }
                }
            }
        }
    }

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

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

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)

int main(){
    int n;
    ll sum=0,cnt=0,ans=0;
    cin>>n;
    vector<ll> a(n),b(n);
    vector<bool> c(n,false);
    priority_queue<ll> que2;
    priority_queue<pair<ll,ll>> que;
    rep(i,n){
        cin>>a[i];
    }
    rep(i,n){
        cin>>b[i];
        ll x=a[i]-b[i];
        sum+=x;
        if(x<0){
            cnt++;
            que2.push(-x);
        }else{
            que.push({x,i});
        }
    }
    if(sum<0){
        cout<<-1<<endl;
        return 0;
    }else if(cnt==0){
        cout<<0<<endl;
        return 0;
    }else{
        auto x=que.top();
        ll y=que2.top();
        que.pop();que2.pop();
        c[x.second]=true;
        rep(i,cnt){
            while(y>0){
                if(x.first>=y){
                    x.first-=y;
                    break;
                }else{
                    y-=x.first;
                    x=que.top();
                    que.pop();
                    c[x.second]=true;
                }
            }
            y=que2.top();
            que2.pop();
        }
        ans=cnt;
        rep(i,n)if(c[i])ans++;
        cout<<ans<<endl;
    }
    return 0;
}

//a=97,z=122

Measured memory_bytes: 6744
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;
const int M = 100000;
const double pi = 3.141592653589;

int main()
{
	for (int i = 1; i <= 9; i++) {
		for (int k = 1; k <= 9; k++) {
			int qq = i*k;
			printf("%dx%d=%d\n", i, k,qq);
		}
	}
}

Measured memory_bytes: 3144
//abc171_a.cpp
//Sun Jun 21 20:55:03 2020

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	if (int(s-'a')>=0){
		cout << "a" << endl;
	}else {
		cout << "A" << endl;
	}

}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define ll long long
#define rn(i,n) for(int i=1;i<=n;i++)



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

  vector<ll> a(n);
  ll sum=0,mini=1000000000000000000LL;

  r(i,n){
    cin>>a.at(i);
    sum+=a.at(i);
  }

  ll sum1=0;
  r(i,n-1){
    sum1+=a.at(i);
    if(mini>=abs(sum-2*sum1))mini=abs(sum-2*sum1);
    //cout<<mini<<endl;
  }

  cout<<mini<<endl;





  return 0;
}


Measured memory_bytes: 1792
num_num = int(input())
numbers = list(map(int, input().split()))
numbers_even = []

for i in range(num_num):
    if numbers[i] % 2 == 0:
        numbers_even.append(numbers[i])
    else:
        pass
i = 1
for even in numbers_even:
    if even % 3 == 0 or even % 5 == 0:
        i += 1
        if i == num_num:
            break
    else:
        print("DENIED")
        exit()

print("APPROVED")


Measured memory_bytes: 9060
#include <iostream>

#define int64 unsigned long long

using namespace std;

int main()
{
  int64 xx, yy;
  cin >> xx >> yy;
  for(int64 ii = 1;true;ii++)
  {
    if((xx << ii) >yy)
    {
      cout << ii << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,x,n) for (int i = x;i < n;++i)

vector<int> tr[100001];
int n, k, c, an;

int go(int v = 1, bool f = false) {
	int d = 0;
	f(i, 0, tr[v].size())d = max(d, go(tr[v][i], v != 1));
	if (++d == k && f)++an, d = 0;
	return d;
}

int main() {
	scanf("%d%d", &n, &k);
	scanf("%d", &c);
	if (c != 1)++an;
	f(i, 2, n + 1) {
		int t;
		scanf("%d", &t);
		tr[t].push_back(i);
	}
	go();
	printf("%d", an);
}

Measured memory_bytes: 11904
N,K = map(int,input().split())
candy = [0]*N
for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for j in A:
    candy[j-1] += 1
count = 0
for k in candy:
  if k == 0:
    count += 1
print(count)
  

Measured memory_bytes: 9180
S = input()
N = len(S)
K = int(input())

dp = [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)]
dp[1][0][1] = 1
dp[1][1][0] = 1
dp[1][1][1] = int(S[0])-1

for i in range(1, N):
    n = int(S[i])
    ok = 0 if n == 0 else 1
    for j in range(4):
        dp[i+1][0][j+ok] += dp[i][0][j]
        if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
        dp[i+1][1][j] += dp[i][1][j]
        dp[i+1][1][j+1] += 9*dp[i][1][j]

print(dp[N][0][K]+dp[N][1][K])

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>

int main() {
  int N;
  scanf("%d",&N);
  char word[N][11];
  scanf("%s",&word[0][0]);
  int len1,len2;
  len1 = strlen(&word[0][0]);
  for (int i = 1; i < N; i++) {
    scanf("%s",&word[i][0]);
    if (word[i-1][len1-1] != word[i][0]) {
      printf("No\n");
      return 0;
    }
    len2 = strlen(&word[i][0]);
    len1 = len2;
    for (int j = 0; j < i; j++) {
      if (strcmp(&word[j][0],&word[i][0]) == 0) {
        printf("No\n");
        return 0;
      }
    }
  }
  printf("Yes\n");
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s,s1="abc",s2="def";
    cin >> s;
    do
    {
        s.erase(s.end()-1);
        if (s.length()%2==0)
        {
            s1=s.substr(0,s.length()/2);
            s2=s.substr(s.length()/2,s.length()/2);
        }
    }
    while(s1.compare(s2));
    cout<<s.length();
    return 0;
}


Measured memory_bytes: 256
/*
    Written by Nitrogens
    Desire for getting accepted!!
*/
#include <cstdio>
#include <ctime>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <bitset>
#include <stack>
#include <set>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

const int maxn = 1e5+5;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e = exp(1);
const db PI = acos(-1);
const db ERR = 1e-10;

#define Se second
#define Fi first
#define pb push_back
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl

int head[maxn], cnt, n;

struct edge
{
    int v, nxt;
} Edge[2 * maxn];

void init()
{
    for(int i = 0; i <= n; i++) head[i] = -1;
    cnt = 0;
}

void addedge(int u, int v)
{
    Edge[cnt].v = v;
    Edge[cnt].nxt = head[u];
    head[u] = cnt++;
}

ll dp[maxn][2];

void dfs(int id, int fa)
{
    dp[id][0] = dp[id][1] = 1;
    for(int i = head[id]; i != -1; i = Edge[i].nxt)
    {
        int v = Edge[i].v;
        if(v == fa) continue;
        dfs(v, id);
        dp[id][0] = (dp[id][0] * dp[v][1]) % Mod;
        dp[id][1] = (dp[id][1] * ((dp[v][0] + dp[v][1]) % Mod)) % Mod;
    }
    /*
    if(!dp[id][0])  dp[id][0] = 1;
    if(!dp[id][1])  dp[id][1] = 1;
    */
}

int main()
{
    //ios::sync_with_stdio(false);
    //freopen("a.txt","r",stdin);
    //freopen("b.txt","w",stdout);

    int u, v;
    scanf("%d", &n);
    init();

    for(int i = 1; i <= n - 1; i++)
    {
        scanf("%d%d", &u, &v);
        addedge(u, v);
        addedge(v, u);
    }


    dfs(1, -1);

    printf("%lld\n", (dp[1][0] + dp[1][1]) % Mod);

    //cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
    return 0;
}


Measured memory_bytes: 9344
# encoding:utf-8

import numpy as np
import random

n = int(input())
s = []
t = []
for i in range(n):
    s_tem = str(input())
    s.append(s_tem)

m = int(input())
for i in range(m):
    t_tem = str(input())
    t.append(t_tem)

count_dic = {}

for name in s:
    if name in count_dic.keys():
        count_dic[name] += 1
    else:
        count_dic[name] = 1
for name in t:
    if name in count_dic.keys():
        count_dic[name] -= 1
    else:
        count_dic[name] = -1

sorted_count_dic = sorted(count_dic.items(),key=lambda x:x[1],reverse = True)
answer = max(sorted_count_dic[0][1], 0)
print(answer)


Measured memory_bytes: 19488
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int s,w;
	scan(s>>w);
	if(w>=s) prin("unsafe");
	else prin("safe");
	return 0;
}


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

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b, a % b);
}

using Graph = vector<vector<int>>;

ll calc(ll a, ll b, ll p){//aのb乗をpで割った余り
  if(b == 0) return 1;

  else if(b%2 == 0){
    ll d = calc(a,b/2,p);
    return (d*d)%p;
  }
  else if(b%2 == 1){
    return (a * calc(a,b-1,p))%p;
  }
}

typedef pair<int,int> P;

bool is_prime(int n){//nが素数であるかどうか判定 iで割り切れると素数でない
    if(n == 1) return false;//1は例外
    for(int i = 2;i*i <= n;i++){
        if(n%i == 0) return false;
    }
    
    return true;
}
int factorial(int a){
  int res = 1;
  while(a){
    res *= a;
    a--;
  }
  return res;
}

int main(){
  int N;
  cin >> N;
  vector<int> L(N);
  rep(i,N){
    cin >> L[i];
  }
  sort(L.begin(),L.end());
  ll ans = 0;

  for(int i = 0;i<N;i++){
    for(int j = i+1;j<N;j++){
      //L[i] + L[j]以上の最小の要素の先頭からの距離kを求める
      int a = L[i];
      int b = L[j];
      auto itr = lower_bound(L.begin()+j,L.end(),a+b);
      int k = distance(L.begin(),itr);
      ans += k - j -1;
    }
  }
  cout << ans << endl;
 }

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)

typedef  unsigned long long ull;
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }



int main() {

	int T, D, ta, tb, da, db;
	cin >> T >> D >> ta >> tb >> da >> db;
	double ans = ten(8);
	for (int i = 0; i <= D; i += da) {
		for (int j = 0; j <= D; j += db) {
			if (1 <= i + j && i + j <= D) {
				double tmp = (ta * i + tb * j) / double(i + j);
				ans = min(ans, abs(T - tmp));
			}
		}
	}
	
	printf("%.10lf\n",ans);

	return 0;
}

Measured memory_bytes: 1196
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    Map<String, Long> map = new HashMap<>();
    String[] strings = {"M", "A", "R", "C", "H"};
    for(String s : strings) {
      map.put(s, 0L);
    }
    for(int i = 0; i < n; i++) {
      String key = sc.next().substring(0, 1);
      for(String s : strings) {
        if(s.equals(key)) {
          map.put(key, map.get(key) + 1L);
          break;
        }
      }
    }
    long count = 0;
    for(int i = 0; i < strings.length; i++) {
      for(int j = i + 1; j < strings.length; j++) {
        for(int k = j + 1; k < strings.length; k++) {
          count += map.get(strings[i]) * map.get(strings[j]) * map.get(strings[k]);
        }
      }
    }
    System.out.println(count);
  }
}

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

int main(){
  int N;
  long long W;
  cin >> N >> W;
  long long key = pow(10, 5)+1;
  vector<long long> dp(key, 0);
  long long w;
  long long v;
  
  for(int i = 0; i < N; i++){
    cin >> w >> v;
    for(int j = key-1; j >= 0; j--){
      if((j == 0) || (dp[j] != 0)){
        if((dp[j]+w <= W) && (j+v <= key-1)){
          if(dp[j+v] == 0){
            dp[j+v] = dp[j]+w;
          }
          else{
            dp[j+v] = min(dp[j]+w, dp[j+v]);
          }
        }
      }
    }
  }
  long long ans = 0;
  
  
  for(int j = key-1; j >= 0; j--){
    if(dp[j] != 0){
      ans = j;
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void) {
	char *kami, *naka, *simo;
	char buf[128];

	fgets(buf, sizeof(buf), stdin);
	kami = strtok(buf, ",");
	naka = strtok(NULL, ",");
	simo = strtok(NULL, ",");

	printf("%s %s %s\n", kami, naka, simo);

	return 0;
}


Measured memory_bytes: 2032
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main()
{
    char c;
    cin >> c;

    cout << (char)(c + 1) << endl;
    return 0;
}

Measured memory_bytes: 256
import random
from random import randint
random.seed(0)

D = int(input())
C = [int(i) for i in input().split()]
S = [[int(i) for i in input().split()] for j in range(D)]

def score_calc(T):
    total = 0
    last = [0] * 26
    for i in range(1, D+1):
        t = T[i-1]
        total += S[i-1][t-1]
        last[t-1] = i
        for j in range(26):
            total -= C[j] * (i - last[j])
    return total

total = 0
last = [0] * 26
ans = []
for i in range(1, D+1):
    score = [0] * 26
    for t in range(26):
        score[t] += S[i-1][t]
        for j in range(26):
            if j != t:
                score[t] -= C[j] * (i - last[j])
    total += max(score)
    last[score.index(max(score))] = i
    ans.append(score.index(max(score))+1)

N = 50000
Q = [[randint(0, (D-1)), randint(0, 25)] for i in range(N)]
for d, q in Q:
    old = ans[d]
    ans[d] = q + 1
    if score_calc(ans) > total:
        total = score_calc(ans)
    else:
        ans[d] = old

for i in range(D):
    print(ans[i])


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

namespace CSharpSample01
{

    class Vector
    {
        public int x;
        public int y;

        public Vector(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

    }
    
    class Program
    {       
        
        static void Main(string[] args)
        {
            int q = int.Parse(Console.ReadLine());

            var ans = new List<int>();

            for(int i = 0; i < q; i++)
            {
                int[] data = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                Vector a = new Vector(data[2] - data[0], data[3] - data[1]);
                Vector b = new Vector(data[6] - data[4], data[7] - data[5]);

                int k = 0;

                if(a.x * b.x + a.y * b.y == 0)
                {
                    k = 1;
                }
                else if (a.x * b.y - a.y * b.x == 0)
                {
                    k = 2;
                }

                ans.Add(k);

            }

            foreach(var s in ans)
            {
                Console.WriteLine(s);
            }

        }
    }
}



Measured memory_bytes: 20384
n = int(input())
h_L = list(map(int,input().split()))

dp = [0] * (n+1)
dp[1] = abs(h_L[1]-h_L[0])

for i in range(n-2):
    dp[i+2] = min(dp[i+1]+abs(h_L[i+2]-h_L[i+1]),dp[i] + abs(h_L[i+2]-h_L[i]))

print(dp[n-1])

Measured memory_bytes: 84744
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define ld long double

using namespace std;

int main()
{
    fastio;

    ll n;
    cin >> n;

    cout << n*(n+1)/2;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cassert>
#define InfL 2000000000
#define InfLL 4000000000000000000LL
#define mod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<db> vd;

int main() {
	ll X;
	cin >> X;
	ll ans = 1;
	while (1) {
		if (X * ans % 360 == 0)
			break;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3620
l=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())-1
print(l[k])


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

class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		while(true){

			String[] token = br.readLine().split(" ");
			int a = Integer.parseInt(token[0]);
			char op = token[1].charAt(0);
			int b = Integer.parseInt(token[2]);

			if(op == '?'){
				break;
			}

			if(op == '+'){
				sb.append((a + b) + "\n");
			}else if(op == '-'){
				sb.append((a - b) + "\n");
			}else if(op == '*'){
				sb.append((a * b) + "\n");
			}else if(op == '/'){
				sb.append((a / b) + "\n");
			}

		}

		System.out.print(sb);

	}
}

Measured memory_bytes: 24228
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)



Measured memory_bytes: 3060
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();

    if (a == 1 || b == 1) {
      if (a > b) {
        System.out.println("Bob");
      } else if (a < b) {
        System.out.println("Alice");
      } else {
        System.out.println("Draw");
      }
    } else {
      if (a < b) {
        System.out.println("Bob");
      } else if (a > b) {
        System.out.println("Alice");
      } else {
        System.out.println("Draw");
      }
    }

  }

}


Measured memory_bytes: 22100
#include <bits/stdc++.h>
#ifdef DEBUG
#include "_debug.cpp"
#include "callable.hpp/callable.hpp"
#endif
#define endl '\n'
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    set<char> s;
    for(int i = 0; i < n; i++) {
        char c;
        cin >> c;
        s.insert(c);
    }
    cout << (s.size() == 3 ? "Three" : "Four") << endl;
    return 0;
}


Measured memory_bytes: 256
//C
#include <cassert>
//#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

//ここまで標準include

using namespace std;

long aCb(long a, long b) {
	long out = 1;
	for (long i = 1; i <= b; i++) {
		out = out * (a + 1 - i) / i;
	}
	return out;
}

int main() {
	int a, b;
	cin >> a >> b;
	if (a >= 13) {
		cout << b << endl;
	}
	else if (a >= 6) {
		cout << b / 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
}


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

int main( void )
{
	bool isPrime[50001 + 1];
	isPrime[2] = true;
	for ( int i = 3; i < 50001; i += 2 )
	{
		isPrime[i] = true;
	}

	for ( int i = 3; i < 50001; i += 2 )
	{
		for ( int j = i + i; j < 50001; j += i )
		{
			isPrime[j] = false;
		}
	}

	int cnt = 1;
	int primes[5500];
	primes[0] = 2;
	for ( int i = 3; i < 50001; i += 2 )
	{
		if ( isPrime[i] )
		{
			primes[cnt] = i;
			cnt++;
		}
	}

	int n;
	while ( cin >> n && n != 0 )
	{
		int kotae = 0;
		for ( int i = 0; i < cnt; i++ )
		{
			if ( primes[i] <= n / 2 )
			{
				if ( isPrime[n-primes[i]] )
					kotae++;
			}
		}
		cout << kotae << endl;
	}

	return 0;
}

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

int main(){
  ll n, a, b;
  cin >> n >> a >> b;
  ll ans;
  if((n % (a+b)) == 0){
    ans = (n / (a+b)) * a;
  }else if(n % (a+b) < a){
  	ans = (n / (a+b)) * a + (n % (a+b));
  }else{
  	ans = (n / (a+b)) * a +a;
  }
  cout << ans;
}

Measured memory_bytes: 256
n,m = map(int,input().split())

l = []

for i in range(m):
    a,b = map(int,input().split())
    c = list(map(int,input().split()))
    bit_c = 0
    for x in c:
        bit_c = bit_c | (1<<(x-1))
    l.append([a,bit_c])

dp = [[float("INF")]*(2**n+1) for _ in range(m+1)]

dp[1][0] = 0
dp[1][l[0][1]] = l[0][0]

for i in range(2,m):
    for j in range(2**n):
        dp[i][j] = dp[i-1][j]
    for j in range(2**n):
        dp[i][j | l[i-1][1]] = min(dp[i][j|l[i-1][1]],dp[i-1][j|l[i-1][1]],dp[i-1][j]+l[i-1][0])

if dp[m-1][2**n-1] >= 10**12:
    print(-1)
else:
    print(dp[m-1][2**n-1])


Measured memory_bytes: 113240
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */

#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cmath>
#include <iostream>
#include <stack>
#include <queue>
#include <climits>
#include <iomanip>

#define all(x) x.begin(), x.end()
#define debug(x) cout << #x << " = " << x << "\n"
#define MOD 998244353

const long double PI = 3.141592653589793236L;

typedef long long int ll;
typedef long double ld;

using namespace std;

void solve()
{
    int n;
    cin >> n;

    vector<ll> a(n);

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

    sort(all(a));

    reverse(all(a));

    ll ans = 0;

    ans += a[0];

    ll count = 2;

    for(int i = 1; i < n && count < n; i++)
    {
        ans += a[i];
        count++;

        if(count >= n)
        {
            break;
        }

        ans += a[i];

        count++;
    }

    cout << ans << "\n";

}

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

    int T = 1;
    //cin >> T;
    
    while (T--)
    {
        solve();
    }
    
    return 0;
}




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

#define ed cout<<"\n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long 
#define ffor(i,a,b) for(ll i=(a);i<(ll)(b);++i)
#define rep(i, n) ffor(i,0,n)
#define All(obj) (obj).begin(),(obj).end()
#define INF ((ll)1e9+7)
#define c(a) cout<<a<<"\n";
using namespace std;

int main() {
	speed;
	string s;
	cin >> s;
	set<char>a;
	rep(i, s.size()) {
		a.insert(s[i]);
	}
	if (s.size() == a.size())cout << "yes";
	else c("no");
	ed;
	return 0; 
}



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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 1000000007LL
#define maxn 100005
#define IN freopen("C.in","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define INF 1000000000
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2

using namespace __gnu_pbds;
using namespace std ;

typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<i64, i64> pii;


class numberTheory{

public:
    numberTheory(){}

    pii extendedEuclid(i64 a, i64 b) { // returns x, y | ax + by = gcd(a,b)

        if(b == 0) return pii( a >= 0 ? 1 : -1 , 0LL);
        else {
            pii d = extendedEuclid(b, a % b);
            return pii(d.yy, d.xx - d.yy * (a / b));
        }

    }

    i64 modularInverse(i64 a, i64 n) {
        pair<i64,i64> ret = extendedEuclid(a, n);
        return ((ret.xx % n) + n) % n;
    }


    i64 bigMod(i64 a, i64 n , i64 m)
    {
        if(n==0) return 1 ;
        i64 ret = bigMod(a,n/2,m) ;
        ret = (ret*ret)%m ;
        if(n%2) ret = (ret*a)%m ;
        return ret ;
    }
};

const i64 N = 200000 ;

i64 fact[N+5] , invFact[N+5] ;

i64 C(i64 n, i64 r)
{
    if( n<0 || r<0 || r>n ) return 0 ;
    i64 ret = (fact[n]*invFact[r])%mod ;
    return (ret*invFact[n-r])%mod ;
}

void preprocess()
{
    numberTheory nt ;

    fact[0] = 1 ;
    for(i64 x=1 ; x<=N ; x++) fact[x] = (fact[x-1]*x)%mod ;

    invFact[N] = nt.modularInverse(fact[N],mod) ;

    for(i64 x=N-1 ; x>=0 ; x--) invFact[x] = (invFact[x+1]*(x+1) )%mod ;
}

int pos[maxn] ;

int main()
{
    preprocess() ;

    int n ;
    scanf("%d",&n) ;

    for(int i=1 ; i<=n ; i++) scanf("%d",&pos[i]) ;

    int ans = 0  , tot = 0;

    numberTheory nt ;

    for(int i=1; i<n ; i++)
    {
        tot = (tot + nt.modularInverse(i,mod) )%mod ;
        ans = (ans + 1LL*tot*(pos[i+1]-pos[i]) )%mod ;
    }

    ans = (1LL*ans*fact[n-1])%mod ;

    ans = (ans%mod + mod)%mod ;

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

    return 0 ;
}


Measured memory_bytes: 3712
#include<stdio.h>
int main()
{
    int n, k, x, y;
    scanf("%d%d%d%d", &n, &k, &x, &y);
    if (n <= k)
        printf("%d\n", n*x);
    else
        printf("%d\n", k*x + (n - k)*y);
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
#define BIG 2000000007
 
#define MOD 1000000007
typedef unsigned long long ull;
typedef   signed long long sll;
 
typedef struct {
	int a;
	int b;
} hw;
 
#define N_MAX 100000
#define M_MAX 100000
 
ull n, m, k;
ull h, w;
ull va, vb, vc, vd;
ull a[N_MAX];
// sll a[N_MAX];
ull b[N_MAX];
// ull dp[N_MAX][M_MAX + 1];
// char s[N_MAX + 1];
// char t[N_MAX + 1];
// hw arr[N_MAX];
 
void swap_adj(ull *a, ull *b){
	ull tmp = *b;
	*b = *a;
	*a = tmp;
	return;
}

ull divide(ull a, ull b){
	ull x = MOD - 2;
	ull ans = 1;
	while (x) {
		if (x & 1) ans = (ans * b) % MOD;
		b = (b * b) % MOD;
		x /= 2;
	}
	return (a * ans) % MOD;
}
 
int digits(ull x){
	int i = 1;
	while (x >= 10) {
		x /= 10;
		i++;
	}
	return i;
}
 
int min(ull x, ull y){
	return (x < y) ? x : y;
}
 
ull gcd(ull x, ull y){
	if (x < y) {
		return gcd(y, x);
	} else if (y == 0) {
		return x;
	} else {
		return gcd(y, x % y);
	}
}
 
ull bitpow(ull a, ull x){
	ull result = 1;
	while (x) {
		if (x & 1) {
			result *= a;
			result %= MOD;
		}
		x /= 2;
		a = (a * a) % MOD;
	}
	return result;
}

int comp(const void *left, const void *right){
	if ((*(int*)left) < (*(int*)right)) {
		return -1;
	} else if ((*(int*)left) > (*(int*)right)) {
		return +1;
	} else {
		return 0;
	}
}

// int nextroute(int arr[]){
// 	int i = n - 1;
// 	int j, x;
// 	while (arr[i - 1] > arr[i]) i--;

// 	x = n;
// 	for (j = i; j < n; j++) {
// 		if (arr[j] < arr[i - 1]) continue;
// 		if (x == n || arr[x] > arr[j]) x = j;
// 	}
// 	arr[i - 1] ^= arr[x];
// 	arr[x] ^= arr[i - 1];
// 	arr[i - 1] ^= arr[x];

// 	qsort(&arr[i], n - i, sizeof(int), comp);
// 	return 0;
// }

ull solve(){
	int i, j;

	ull index = 0;
	ull times = 0;

	for (;;) {
		if (b[index]) {
			puts("-1");
			return 1;
		}
		b[index] = 1;
		index = a[index];
		times++;
		if (index == 1) {
			printf("%llu", times);
			return 0;
		}
	}

	return 0;
}
 
int main(void){
	int i, j;
	int x;

	scanf("%llu", &n);
	for (i = 0; i < n; i++) {
		scanf("%llu", &a[i]);
		a[i]--;
	}

	solve();

	return 0;
}


Measured memory_bytes: 1664
const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);
const nin=()=>{const r = input[0];input.shift();return Number(r)};
const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};
const sin=()=>{const r = input[0];input.shift();return String(r)}
const out=(...a)=>{console.log(...a)}
const floor=(a)=>{return Math.floor(a)}
const abs=(a)=>{return Math.abs(a)}
const min=(...a)=>{return Math.min(...a)}
const max=(...a)=>{return Math.max(...a)}
const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}}
const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};
const permutation = ({ result = [], pre = [], post, n = post.length }) => {
  if (n > 0) {
    post.forEach((_, i) => {
      const rest = [...post];
      const elem = rest.splice(i, 1);
      permutation({ result, pre: [...pre, ...elem], post: rest, n: n - 1});
    });
  } else {
    result.push(pre);
  }
  return result;
}
const main = ()=>{
  switch (sin()) {
    case 'A':
      out('T');
      break;
    case 'T':
      out('A');
      break;
    case 'C':
      out('G');
      break;
    case 'G':
      out('C');
      break;
  } 
}
main();

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

int main(){
  int N, M; cin >> N >> M;
  vector<int> num(N + 1);
  for(int i = 0; i < M; i++){
    int a, b; scanf("%d%d", &a, &b);
    num[a]++; num[b]++;
  }
  bool ok = true;
  for(int i = 0; i <= N; i++){
    if(num[i] % 2 == 1) ok = false;
  }
  if(ok) cout << "YES" << endl;
  else cout << "NO" << endl;
}


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

int main()
{
    int n,m;
    cin>>n>>m;
    bool done[n+1]={0}; int in[n+1]={0};
    for(int i=0; i<m; i++)
    {
        int a; string s;
        cin>>a>>s;
        if(s=="AC")
        {
            if(!done[a]) done[a]=1;
        }
        else if(s=="WA")
        {
            if(!done[a]) in[a]++;
        }
    }
    int x=0,y=0;
    for(int i=0; i<=n; i++)
    {
        if(done[i])
        {
            x++;
            y+=in[i];
        }
    }
    cout<<x<<" "<<y<<endl;
    return 0;
}


Measured memory_bytes: 768
import java.util.Scanner;
import java.util.stream.LongStream;

public class Main {
    static int n;
    static int W;
    static long[][] dp;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        W = sc.nextInt();
        dp = new long[n + 1][1000 * n + 1];
        for (int i = 0; i < n+1; i++) {
            for (int j = 1; j < dp[i].length; j++) {
                dp[i][j] = Integer.MAX_VALUE * 10L;
            }
        }
        for (int i = 0; i < n; i++) {
            int w = sc.nextInt();
            int v = sc.nextInt();
            dp[i + 1][v] = Math.min(w, dp[i][v]);
            for (int j = 0; j < v; j++) {
                dp[i + 1][j] = dp[i][j];
            }
            for (int j = v; j < dp[0].length; j++) {
                dp[i + 1][j] = Math.min(dp[i][j], dp[i][j - v] + w);
            }


        }
        int max = 0;
        for (int i = 0; i < dp[n].length; i++) {
            if (dp[n][i] <= W) max = i;
        }
        System.out.println(max);
    }

}


Measured memory_bytes: 127060
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<stdlib.h>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
#define exp 1e-10
using namespace std;
const int maxn=1e5+1;
int main(){
	int n;
	cin >> n;
	int a[maxn];
	for(int i=0;i<n;i++)cin >> a[i];
	int ans=0;
	int maxn=0;
	for(int i=0;i<n-1;i++){
		if(a[i]>=a[i+1])ans++;
		else ans=0;
		maxn=max(maxn,ans);
	}
	cout << maxn << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>

#define CK(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)
#define F first
#define S second
#define ll long long

const int INF = 1e9;
const long long  LLINF = 1e18;

using namespace std;

int main(){

  string S;
  cin>>S;

  REP(i,0,S.size()){
    if(i % 2 == 0){
      cout<<S[i];
    }
  }
  cout<<endl;

  return 0;
}


Measured memory_bytes: 512
from collections import deque
 
INF = float('inf')
MOD = 10 ** 9 + 7
dy = (0, -1, 0, 1)
dx = (1, 0, -1, 0)


H,W=map(int,input().split())
M = []
Max_list = []
for i  in range(H):
    t = input()
    M.append(t)
dx = [0,0,-1,1]
dy = [1,-1,0,0]
dist = [[-1]*W for _ in range(H)]
q = deque()
for i in range(H):
    for j in range(W):
        dist = [[-1]*W for _ in range(H)]
        if M[i][j] == '.':
            Ma = 0
            q.append((i, j))
            dist[i][j] = 0
            while q:
                cx,cy = q.popleft()
                for nx,ny in zip(dx,dy):
                    x ,y= cx+nx,cy+ny
                    if x<0 or y<0 or x>=H or y>=W or dist[x][y]>0:
                        continue
                    if M[x][y] == "." and dist[x][y] == -1:
                        dist[x][y]=dist[cx][cy]+1
                        Ma = max(Ma,dist[x][y])
                        q.append((x,y))
            # print(Ma)
            Max_list.append(Ma)
# print(Max_list)

print(max(Max_list))

Measured memory_bytes: 3316
#include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          
          int N, M_1, M_2; 
          cin >> N ;
          M_1 =0;
          int i_max1, i_max2 ; 
          M_2 =0; 
          
          vector<int> A(N);
          for (int i = 0; i < N; i++) {
            cin >> A.at(i);
            if( A.at(i) > M_1 ){
              i_max1 = i; 
              M_1 = A.at(i);  
            }
          }
          
          for (int i = 0; i < N ; i++) {
            if( i!= i_max1 ){
              M_2 = max( M_2,  A.at(i)); 
            }
          }
          
          for (int i = 0; i < N ; i++) {
            if( i==i_max1 ){
              cout << M_2 << endl; 
            }
            else{
              cout << M_1 << endl; 
            }
          }          
       
        }

Measured memory_bytes: 2432
function getLines(input){
	return input.split("\n").map((s)=>s.trim())
}
function parseLine(line){
	return line.split(" ").map((s)=>s.trim());
}
function parseLineToInt(line){
	return line.split(" ").map((s)=>parseInt(s.trim()));
}
// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.	
	input = getLines(input).map(parseLineToInt);
	if(input[0][0]==1){
		console.log('Hello World');
	}else{
		console.log(input[1][0]+input[2][0]);
	}
	
}
// Don't edit this line!
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 9420
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
const int maxn = 10000;
const int INF32 = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7 = 1'000'000'007;
const int MOD9 = 1'000'000'009;
const int mod = MOD7;

void ERROR(int num) { cout << "ERROR" << num << endl; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};


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

    int N; ll W;
    cin >> N >> W;
    vector<ll> v(N), w(N);
    rep(i,N) cin >> w[i] >> v[i];

    vector<vector<ll>> dp(N+5,vector<ll>(W+5));
    for(int i = 0; i < N; i++){
        for(ll j = 0; j <= W; j++){
            if(j-w[i]>=0) dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i]);
            else dp[i+1][j] = dp[i][j];
        }
    }
    
    cout << dp[N][W] << endl;
}

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

int main(void){
	int N;
	vector<int> chairs;

	cin >> N;
	for(int i=0;i<N;i++){
		int H;
		cin >> H;
		chairs.push_back(H);
	}

	int kabe  = 0;
	for(int i=0;i<N - 1;i++){
		int l = chairs.at(i);
		int r = chairs.at(i+1);
		if (r - l < -1 || r < kabe){
			cout << "No" << endl;
			return 0;
		}	
		int tmp;
		if(r - l < 0){
			tmp = r;	
		}else{
			tmp = r - 1;
		}
		kabe = max(kabe,tmp);
	}
	cout << "Yes" << endl;

	return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <algorithm>
#include <string>

int A[500002];

int main(void) {
	std::string S;
	std::cin >> S;
	int N = S.length() + 1;
	S = '>' + S + '<';

	int owPos = 1; //overwrite position
	int pos = 1;
	while (pos <= N) {
		if ((S[pos-1]=='>') && (S[pos]=='<')) {
			A[pos+1] = 1;
			A[pos] = 0;
			for (int i = pos-1; i >= owPos; i--) {
				A[i] = std::max(A[i], A[i+1]+1);
			}
			owPos = pos+1;
		} else if (S[pos]=='<') {
			A[pos+1] = A[pos]+1;
			owPos = pos+1;
		} else { // '[pos] == '>'

		}
		pos++;
	}

	long long ans = 0;
	for (int i = 1; i <= N; i++) ans += A[i];

	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 2840
#include <inttypes.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
    intmax_t A, B;

    scanf("%jd%jd", &A, &B);

    for (size_t i = 1; i <= 10000; i++) {
        if ((((i * 8) / 100) == A) && (((i * 10) / 100) == B)) {
            printf("%jd\n", i);
            return 0;
        }
    }

    puts("-1");

    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <assert.h>
#include <math.h>
#include <stack>
#include <queue>
#include <list>
using namespace std;

// #define __DEBUG__

#ifdef __DEBUG__
bool debug_disabled = false;
#else
bool debug_disabled = true;
#endif

#define dbg if (debug_disabled) {} else cerr

void solve() {
    string s;
    cin >> s;
    if (s == "ABC") cout << "ARC" << endl;
    else cout << "ABC" << endl;
}

int main() {
    cout.setf(ios::fixed, ios::floatfield);
    cout.setf(ios::showpoint);
    cout.precision(12);
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int T = 1;
    // cin >> T;
    for (int i = 1; i <= T; ++i) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 3652
n = int(input())
num = []
while n>0:
  num.append(n%10)
  n //= 10

ans = 0
for i in num:
  if i == 7:
    ans+=1
    break
  else:
    ans = 0
    
if ans >= 1:
  print("Yes")
elif ans==0:
  print("No")

Measured memory_bytes: 9036
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
int main(){
    string s;
    cin >> s;
    string t;
    cin >> t;
    t.pop_back();
    if(s == t) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3620