akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

class Main{
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]){
        HashMap<Integer,Integer> c=new HashMap<>();
        String S=sc.next();
        for(int i=0;i<S.length();i++){
            c.put((int)S.charAt(i),1);
        }
        for(int i=(int)'a';i<=(int)'z';i++){
            if(!c.containsKey(i)){
                System.out.printf("%c",i);
                return;
            }
        }
        System.out.println("None");
    }
}

Measured memory_bytes: 39276
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
a.append(n+1)
cnt=1
b=[]
for i in range(n):
    if a[i]==a[i+1]:
        cnt+=1
    else:
        b.append(cnt)
        cnt=1
b.sort()
ans=0
if len(b)>k:
    ans=sum(b[:len(b)-k])
print(ans)

Measured memory_bytes: 24748
#include <iostream>
#include <string>
#include <sstream>
#include <limits>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>

using namespace std;

// 隣接リストを用いたグラフ構造
template <typename Vertex, typename Edge>
struct Graph
{
	// 頂点
	vector<Vertex> vertices;
	// 第i頂点を始点とする有向辺の終点
	vector<unordered_map<int, Edge>> edges;

	// n個の頂点を事前に生成する
	void resize (size_t n)
	{
		vertices.resize(n);
		edges.resize(n);
	}

	// 頂点n個分のメモリ領域を事前に確保する
	void reserve (size_t n)
	{
		vertices.reserve(n);
		edges.reserve(n);
	}

	// 位数（頂点数）
	size_t order ()
	{
		return vertices.size();
	}

	// サイズ（辺の数）
	size_t size ()
	{
		return accumulate(edges.begin(), edges.end(), static_cast<size_t>(0), [](size_t sum, unordered_map<int, Edge> &edge){ return sum + edge.size(); });
	}

	// 頂点を追加する
	void addVertex (const Vertex &vertex)
	{
		vertices.push_back(vertex);
		edges.emplace_back();
	}

	// 有向辺を追加する
	void addEdge (int from, int to, const Edge &edge)
	{
		edges[from][to] = edge;
	}

	// 有向辺を削除する
	void removeEdge (int from, int to)
	{
		edges[from].erase(to);
	}
};

// 使用例（Dijkstra法）
struct Dijkstra : public Graph<nullptr_t, int>
{
	vector<int> weight;

	void dijkstra (int from)
	{
		weight.resize(order());
		fill(weight.begin(), weight.end(), numeric_limits<int>::max());

		auto compare = [this] (int l, int r) { return weight[l] > weight[r]; };
		priority_queue<int, vector<int>, decltype(compare)> fixed(compare);

		weight[from] = 0;
		fixed.push(from);

		while (!fixed.empty())
		{
			int vertex = fixed.top();
			fixed.pop();

			// to = { first: dest_index, second: edge_weight }
			for (auto to : edges[vertex])
			{
				if (weight[to.first] <= weight[vertex] + to.second) continue;

				weight[to.first] = weight[vertex] + to.second;
				fixed.push(to.first);
			}
		}
	}
};

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

	Dijkstra dijkstra;
	dijkstra.resize(n);

	for (int i=0; i<n; ++i)
	{
		int u, k; cin >> u >> k;
		for (int j=0; j<k; ++j)
		{
			int v, c; cin >> v >> c;

			dijkstra.addEdge(u, v, c);
		}
	}

	dijkstra.dijkstra(0);

	for (int i=0; i<n; ++i)
	{
		cout << i << " " << dijkstra.weight[i] << endl;
	}

	return 0;
}



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

using namespace std;
using ll =long long;
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
#define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
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; }
static const ll INF = 1LL << 60;
//Write From this Line

int main()
{
	int x, y, z;
	cin >> x >> y >> z;
	cout << z <<" " <<  x << " " <<  y << endl;
}


Measured memory_bytes: 256
def compare(x, y): 
    for i in range(6):
        order = [0, 0, 0]
        for j in range(3):
            if {x[j], x[-j-1]} != {y[z[i][j]], y[-z[i][j]-1]}:
                break
            if x[j] == y[z[i][j]]:
                order[j] = 1 
                if x[j] == x[-j-1]:
                    order[j] = 2 
        else:
            if 2 in order:
                return True
                break
            if z[i][3] in [0, 3] and sum(order) % 2:
                return True
                break
            if z[i][3] == 1 and not sum(order) % 2:
                return True
                break
    return False

n = int(input())
x = [[] for i in range(n)]
for i in range(n):
    x[i] = list(map(int, input().split()))
z = [[0, 1, 2, 3], [0, 2, 1, 1], [1, 0, 2, 1], [2, 0, 1, 0], [1, 2, 0, 0], [2, 1, 0, 1]] 
different = True
for i in range(n):
    for j in range(i+1, n, 1): 
        if compare(x[i], x[j]):
            break
    else:
        continue
    print('No')
    break
else:
    print('Yes')

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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++) {
        cin >> a[i];
    }
    ll cnt=0;
    map<ll,ll> mp;
    for(ll i = 0; i < n; i++) {
        cnt+=mp[-(a[i]-i)];
        mp[a[i]+i]++;
    }
    cout << cnt << "\n";

    return 0;
}

Measured memory_bytes: 27312
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderC
{
    static void Main()
    {
        var sc = new Scanner();

        long n = sc.NextLong();
        long k = sc.NextLong();

        long answer = n % k;
        answer = Math.Min(answer, k - answer);

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define vi vector<int>
#define vl vector<ll>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x
#define bit(n) (1<<(n))

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;++i)
#define FORVEC(i, v) for(int i = 0;i < sz(v);++i)

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

#define fil0(i,n) cout<<swet(n)<<setfill('0')<<i<<resetiosflags(ios_base::floatfield)
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define possible(n) cout<<((n)?"possible":"impossible")<<endl
#define Possible(n) cout<<((n)?"Possible":"Impossible")<<endl

int mod(int a){
	return abs(a)%2;
}


int div(int a){
	if(a<0){
		return (-a)/2+mod(a);
	}else{
		return -(a/2);
	}
}


int main(){
	int n;
	string s;
	cin>>n;
	if(!n){
		cout<<0<<endl;
		return 0;
	}
	while(n){
		if(mod(n)){
			s='1'+s;
		}else{
			s='0'+s;
		}
		n=div(n);
	}
	cout<<s<<endl;
	return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE RecursiveDo        #-}
{-# LANGUAGE BangPatterns       #-}
{-# LANGUAGE OverloadedStrings  #-}
{-# LANGUAGE NumericUnderscores #-}

import Control.Monad
import Data.List
import Data.Char
import qualified Data.ByteString.Char8 as C8

spendOneDay :: [Int] -> [Int] -> [Int]
spendOneDay [a, b, c] [d, e, f] = [h, i, j]
  where h = d + max b c
        i = e + max a c
        j = f + max a b

main = do
  n <- readLn
  h <- replicateM n $ unfoldr (C8.readInt . C8.dropWhile isSpace) <$> C8.getLine
  print $ maximum $ foldl spendOneDay [0, 0, 0] h


Measured memory_bytes: 51928
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"

using namespace std;
typedef long long ll;

int main()
{
  int n;
  cin >> n;
  cout << "Christmas ";
  for (int i = 0; i < 25 - n; i++)
  {
    cout << "Eve ";
  }
  cout << "\n";
}

Measured memory_bytes: 256
while True:
    H,W = map(int, input().split())
    if H == 0 and W == 0:
        break
    else:
        for j in range(H):
            for i in range(W):
                if j == 0 or j == H-1:
                    print("#", end="")
                elif i == 0 or i == W-1:
                    print("#", end="")
                else:
                    print(".", end="") 
            print()
        print('\n', end='')


Measured memory_bytes: 7008
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
using namespace std;
typedef long long ll;
#define INF LLONG_MAX/3
#define inf INT_MAX/3
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
int gcd(int a, int b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}
int lcm(int a, int b) {
	return a / gcd(a, b)*b;
}
bool prime(int p) {
	for (int i = 2;i <= sqrt(p);i++) {
		if (p%i == 0)return false;
	}
	return true;
}
int comb(int a, int b) {
	if (b == 0 || a == b)return 1;
	if (b == 1)return a % MOD;
	return (comb(a - 1, b - 1) + comb(a - 1, b)) % MOD;
}
// Library End !

int main() {
	int n,z,w,a[2010];
	cin>>n>>z>>w;
	rep(i,n)cin>>a[i];
	if(n==1)cout<<abs(a[0]-w)<<endl;
	else cout<<max(abs(a[n-1]-w),abs(a[n-2]-a[n-1]))<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
int main(){
    double a,b,c,PI=3.1415926535;
  scanf("%lf %lf %lf",&a,&b,&c);
  printf("%.5f\n",a*b*sin(c*PI/180)/2);
  printf("%.5f\n",sqrt(a*a+b*b-2*a*b*cos(c*PI/180))+a+b);
  printf("%.5f\n",b*sin(c*PI/180));
  return 0;
}


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

using namespace std;

int main(){
	string s;
	cin>>s;
	int i=0,n=0,x=0;
	cin>>n;
	string a;
	while(i<n){
		cin>>a;
		a=a+a;
		if(a.find(s)!=string::npos){
			x++;
		}
	i++;
	}
	cout<<x<<endl;
return 0;
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
using namespace std;
int c[1000005];

//n以下の整数について最小の素因数を求めた結果の配列を返す
//min_factor[i]はiを割り切る最小の数（iの素因数のうち最小のもの）
//min_factor[i] == iならiは素数（i=0, 1のときを除く）
vector<int> sieve(int n){
    //素数候補を管理する配列
    vector<int> min_factor(n+1);
    //2以上の数を一度素数候補に入れる
    for(int i = 0; i <= n; i++) min_factor[i] = i;
    //それぞれの数について最小の素因数を求める
    for(int i = 2; i*i <= n; i++){
        if(min_factor[i] == i){
            for(int j = 2; i*j <= n; j++){
                if(min_factor[i*j] > i){
                    min_factor[i*j] = i;
                }
            }
        }
    }
    return min_factor;
}

//配列min_factorを使ってmを素因数分解する
//配列ansにはmの素因数が小さい順に格納される
vector<int> factor(vector<int> &min_factor, int m){
    vector<int> ans;
    while(m > 1){
        ans.push_back(min_factor[m]);
        m /= min_factor[m];
    }
    return ans;
}

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i=0;i<n;i++)cin >> a[i];
    sort(a,a+n);
    vector<int> min_factor = sieve(a[n-1]);
    int flag=0;
    for(int i=0;i<n;i++){
        vector<int> ans = factor(min_factor, a[i]);
        int pre=1;
        for(auto u:ans){
            if(u!=pre)c[u]++;
            if(c[u]==n){
                cout << "not coprime";
                return 0;
            }
            if(c[u]>1)flag++;
            pre=u;
        }
    }
    if(flag==0){
        cout << "pairwise coprime";
        return 0;
    }
    else{
        cout << "setwise coprime";
        return 0;
    }
}

Measured memory_bytes: 14824
#include <iostream> 
#include <string>
#include <vector>

using namespace std;
int main() {
    int sum = 0;
    string S;
    cin >> S;
    for (int i = 0; i < S.size() - 1; i++) {
        if (S[i] == S[i+1]) {
            if (S[i] == '1') { 
                S[i+1] = '0';
            } else if (S[i] == '0') {
                S[i+1] = '1';
            }
            sum++;
        }
    }
    cout << sum << endl;
    return 0;
}

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

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using mii = map<int, int>;
using msi = map<string, int>;
using pii = pair<int, int>;

struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<Edge>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    
    cin >>a >>b;
    cout << (a+b-1)/b << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int cnt;

void merge(int *, int, int, int);
void mergeSort(int *, int, int);

int main()
{
  int i, n, right, left;
  int *S;

  cnt = 0;

  scanf("%d",&n);
  S = (int *)malloc(sizeof(int) * n);
  if(S == NULL) exit(0);
  for(i = 0;i < n;i++){
    scanf("%d",&S[i]);
  }

  mergeSort(S,0,n);

  for(i = 0;i < n;i++){
    printf("%d",S[i]);
    if(i != (n - 1)) printf(" ");
  }
  printf("\n");
  printf("%d\n",cnt);

  free(S);

  return 0;
}

void merge(int *A,int left,int mid,int right)
{
  int i, j, k, n1, n2;
  int *R, *L;

  n1 = mid - left;
  n2 = right - mid;

  L = (int *)malloc(sizeof(int) * (n1 + 1));
  if(L == NULL)           exit(0);

  R = (int *)malloc(sizeof(int) * (n2 + 1));
  if(R == NULL)           exit(0);

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

  L[n1] = 1000000000;
  R[n2] = 1000000000;

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

void mergeSort(int *A,int left,int right)
{
  int mid;

  if((left + 1) < right){
    mid = (left + right)/2;
    mergeSort(A,left,mid);
    mergeSort(A,mid,right);
    merge(A,left,mid,right);
  }
}



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

ans = False
# cnt (0, 1, 2, ..., N - 1)
cnt = [0 for i in range(0, N)]
for _ in range(M):
    a, b = map(int, input().split())
    if a == 1:
        cnt[b] += 1
        if cnt[b] == 2:
            ans = True
            break
    elif b == N:
        cnt[a] += 1
        if cnt[a] == 2:
            ans = True
            break

if ans:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Measured memory_bytes: 52464
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt()-1;
    int b = sc.nextInt()-1;
    int c = sc.nextInt()-1;
    int d = sc.nextInt()-1;
    String ss = sc.next();
    int cd = Math.max(c,d);
    String s = ss.substring(a,cd+1);
    if(s.contains("##")){
      System.out.println("No");
      return;
    }
    if(c<d){
      System.out.println("Yes");
    }else{
      s = ss.substring(b-1, Math.min(ss.length(),d+2));
      if(s.contains("...")){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }
  }
}


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

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

    static class AProgrammingEducation {
        public void solve(int testNumber, LightScanner in, PrintWriter out) {
            out.println(in.ints() == 1 ? "Hello World" : (in.ints() + in.ints()));
        }

    }

    static class LightScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public LightScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

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

        public int ints() {
            return Integer.parseInt(string());
        }

    }
}



Measured memory_bytes: 21328
from bisect import *
n = int(input())
x = list(map(int, input().split()))
l = int(input())
q = int(input())

dp_plus = [[0]*(n+1) for i in range(30)]
dp_minus = [[0]*(n+1) for i in range(30)]

for i in range(n):
    now = x[i]
    reach = now + l
    dp_plus[0][i+1] = bisect_right(x, reach)

for i in range(n):
    now = x[i]
    reach = now - l
    dp_minus[0][i+1] = bisect_left(x, reach) + 1



for i in range(29):
    for j in range(1, n+1):
        dp_plus[i+1][j] = dp_plus[i][dp_plus[i][j]]
        dp_minus[i+1][j] = dp_minus[i][dp_minus[i][j]]


for _ in range(q):
    a, b = map(int, input().split())
    ans = 1
    if a < b:
        for i in range(29, -1, -1):
            if dp_plus[i][a] < b:
                a = dp_plus[i][a]
                ans += pow(2, i)

    else:
        for i in range(29, -1, -1):
            if dp_minus[i][a] > b:
                a = dp_minus[i][a]
                ans += pow(2, i)

    print(ans)


Measured memory_bytes: 116988
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String A = sc.next();
        BigDecimal BigA = new BigDecimal(A);
        String B = sc.next();
        BigDecimal BigB = new BigDecimal(B);
        System.out.println(BigA.multiply(BigB).setScale(0, RoundingMode.DOWN));
        sc.close();
    }
}

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

int main(){
	int x,y;	cin>>x>>y;
	if(y&1){
		cout<<"No"<<endl;
	}
	else{
		if(y>=(2*x) && y<=(4*x)){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
}


Measured memory_bytes: 3632
using System;

namespace atcoderA
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string n = Console.ReadLine();
            string n1 = n.Replace("1", "a");
            string n2 = n1.Replace("9", "1");
            string n3 = n2.Replace("a", "9");
            Console.WriteLine(n3);
        }
    }
}

Measured memory_bytes: 11348
#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;

mat dp;
lli n,m,q;

int main(){
  cin >> n >> m >> q;
  dp = mat(n+1, vll(n+1));
  for(lli i = 0;i < m;i++){
    lli l,r;
    cin >> l >> r;
    dp[l][r]++;
  }
  for(lli i = 0;i <= n;i++) for(lli j = 1;j <= n;j++) dp[i][j] += dp[i][j-1];
  for(lli j = 0;j <= n;j++) for(lli i = 1;i <= n;i++) dp[i][j] += dp[i-1][j];
  for(lli i = 0;i < q;i++){
    lli p,q;
    cin >> p >> q;
    cout << dp[q][q]-dp[p-1][q]-dp[q][p-1]+dp[p-1][p-1] << endl;
  }
}


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

int main() {
  int N, S;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int A, B, C;
    cin >> A >> B;
    C = B - A + 1;
    S += C;
  }
  cout << S << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double EPS = 1e-8;

int main(){
  int N;
  while(~scanf("%d",&N)){

    for(int i=0;i<N;i++){
      int c,a,n;

      int count = 0;
      scanf("%d %d %d",&c,&a,&n);
      
      while(c >= 1 && a >= 1 && n >= 1){
	c--;
	a--;
	n--;
	count++;
      }

      while(a >= 1 && c >= 2){
	a--;
	c -= 2;
	count++;
      }

      while(c >= 3){
	  c -= 3;
	  count++;
      }
      printf("%d\n",count);
    }
  }
}

Measured memory_bytes: 1188
S = int(input())
MOD = 10**9+7

# 両端を含めるから桁数+1になる
dp = [0]*(S+1)

#
dp[0] = 1
for i in range(1, S+1):
    for j in range(0, (i-3)+1):
        dp[i] += dp[j]
        dp[i] %= MOD
print(dp[S])


Measured memory_bytes: 9116
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()

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

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) { return a * b / GCD(a, b); }


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

    priority_queue<pair<int, int>> q;

    rep(i, N) {
        int A;
        cin >> A;
        q.push({A, 1});
    };

    rep(i, M) {
        int B, C;
        cin >> B >> C;
        q.push({C, B});
    }

    ll ans = 0;

    rep(i, N) {
        auto p = q.top();
        q.pop();
        ans += p.first;
        p.second--;
        if (p.second > 0) q.push(p);
    }

    cout << ans << endl;
}

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

int calc(int x, int y, int z)
{
  return x * x + y * y + z * z + x * y + y * z + z * x;
}

int main()
{
  int N;
  cin >> N;
  int result[10050] = {0};

  for (int x = 1; x <= 105; x++)
  {
    for (int y = 1; y <= 105; y++)
    {
      for (int z = 1; z <= 105; z++)
      {
        int tmp = calc(x, y, z);
        if (tmp < 10050)
        {
          result[tmp] += 1;
        }
      }
    }
  }

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

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll k,a,b; cin>>k>>a>>b;
	if(a<=b)
	{
		if(a>=k)
		{
			cout<<1<<'\n';
		}
		else
		{
			cout<<-1<<'\n';
		}
		return 0;
	}
	ll tmp = 2LL*((max(k-a,0LL)+a-b-1)/(a-b))+1;
	ll tmp2 = 2LL*((k+a-b-1)/(a-b));
	cout<<min(tmp,tmp2)<<'\n';
}

Measured memory_bytes: 256
n=int(input())
t=list(map(int,input().split()))
m=int(input())
ans=[0]*m

for i in range(1,m+1):
    total=0
    p,x=map(int,input().split())
    for j in range(1,n+1):
        if j==p:
            total+=x
        else:
            total+=t[j-1]
    
    else:
        ans[i-1]+=total

for i in ans:
    print(i)

Measured memory_bytes: 8952
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    vl h(n);
    rep(i, n) {
        cin >> h[i];
    }

    vl dp(n, INF);  // dp[i] : 足場iにたどりつく最小コスト
    dp[0] = 0;
    rep(i, n) {
        exrep(j, 1, 2) {
            if(i+j < n) {
                chmin(dp[i+j], dp[i] + abs(h[i] - h[i+j]));
            }
        }
    }
    
    out(dp[n-1]);
    re0;
}

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

int N;
int C[1010],S[1010],F[1010];

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N - 1; i++)scanf("%d%d%d",C + i,S + i,F + i);

    for(int i = 0; i < N - 1; i++)
    {
        int now = 0;
        for(int j = i; j < N - 1; j++)
        {
            now = max(now,S[j]);
            if(now % F[j] != 0)now = now - now % F[j] + F[j];
            now += C[j];
        }
        printf("%d\n",now);
    }
    printf("0\n");
    return 0;
}


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

using namespace std;

int main()
{
	string line;
	cin >> line;
	reverse(line.begin(), line.end());

	vector<string> tokens{ "dream", "dreamer", "erase", "eraser" };
	transform(tokens.begin(), tokens.end(), tokens.begin(), [](string token) {
		reverse(token.begin(), token.end()); 
		return token; 
	});

	bool is_solved = true;
	for (int i = 0; i < line.size(); ) {
		bool was_chopped = false;
		for (string token : tokens) {
			int len = token.size();
			if (line.substr(i, len) != token) continue;
			was_chopped = true;
			i += len;
		}

		if (!was_chopped) {
			is_solved = false;
			break;
		}
	}

	string ans = is_solved ? "YES" : "NO";
	cout << ans << endl;
	
	return 0;
}

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

#define REP(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ALL(c) c.begin(), c.end()
#define SZ(c) (int) c.size()
#define DBG1(x) cout<<#x<<" = "<<x<<"\n"
#if USE_CP_REDIR
#define CP \
    freopen("input.txt","r", stdin); \
    freopen("output.txt","w", stdout);
#endif

using ll = long long;
const ll MOD = 1'000'000'007;
const int MN = 1'000'000;

int main()
{
ios::sync_with_stdio(false);
#ifdef CP
    CP;
#endif
int n;
cin >> n;
vector<int> a(n);
ll ans = 0;
REP(i, 0, n)
{
    cin >> a[i];
    if(i > 0){
        ll st = max(0, a[i-1] - a[i]);
        ans += st;
        a[i] += st;
    }
}
cout << ans << endl;

}

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

int main(){
	int a,b;
	cin >> a >> b;
	cout << "a ";
	if(a<b) cout << "< ";
	if(a==b) cout << "== ";
	if(a>b) cout << "> ";
	cout << "b" << endl;
	
	
	return 0;
}



Measured memory_bytes: 3108
#include<stdio.h>
#define MAX 2000

int check(int, int);

int n, q, A[MAX];

int main(){
  int i, m[MAX];

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

  scanf("%d", &q);
  for(i = 0; i < q; i++){
    scanf("%d", &m[i]);
  }

  for(i = 0; i < q; i++){
    if(check(0, m[i]) == 0){
      printf("yes\n");
    }
    else if(check(0, m[i]) == 1){
      printf("no\n");
    }
  }
  return 0;
}

int check(int i, int m){
  if(m == 0)return 0;

  if(i >= n)return 1;

  if(check(i+1, m) == 0)return 0;

  return check(i+1, m - A[i]);
}


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

	int main(){
		
		char number[3];
		cin>>number[0]>>number[1]>>number[2];
		if (number[0]=='7'|| number[1]=='7' || number[2]=='7')
			cout << "Yes"<<endl;
			else cout<< "No"<< endl;
	}

Measured memory_bytes: 3036
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;

vector<ll> sil(2000010), inv(2000010);

ll Pot(ll p, ll w)
{
    if (w == 0)
        return 1;
    if (w % 2 == 0)
    {
        ll pol = Pot(p, w / 2);
        return pol * pol % MOD;
    }
    return Pot(p, w - 1) * p % MOD;
}

ll C(ll n, ll k)
{
    return sil[n] * inv[n - k] % MOD * inv[k] % MOD;
}

ll Ile(ll a, ll b)
{
    ll w = C(a + b + 2, b + 1) - 1;
    if (w < 0)
        w += MOD;
    return w;
}

int main()
{
    ios_base::sync_with_stdio(0);
    sil[0] = 1;
    inv[0] = 1;
    for (ll i = 1; i < 2000010; ++i)
    {
        sil[i] = (sil[i - 1] * i) % MOD;
        inv[i] = Pot(sil[i], MOD - 2);
    }
    ll a1, a2, b1, b2;
    cin >> a1 >> b1 >> a2 >> b2;
    ll odp = Ile(a2, b2) % MOD;
    odp -= Ile(a2, b1 - 1);
    if (odp < 0)
        odp += MOD;
    odp -= Ile(a1 - 1, b2);
    if (odp < MOD)
        odp += MOD;
    odp = (odp + Ile(a1 - 1, b1 - 1)) % MOD;
    cout << odp;
    return 0;
}


Measured memory_bytes: 31488
#### import ####
import sys
sys.setrecursionlimit(10**7)
import math
from collections import defaultdict

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

X,Y = II()
counter = 1
while 1:
  X = 2*X
  if X>Y:
    break
  else:
    counter += 1
    
print(counter)

Measured memory_bytes: 38384
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main () {
    int n;
    cin >> n;
    vector <double> v(n);
    rep(i,n) {cin >> v[i];}
    sort(v.begin(),v.end());
    for(int i =1;i < n;i++) {
       v[i]  = (double)(v[i]+v[i-1])/2;
    }
    cout << v[n-1] << endl;
}

Measured memory_bytes: 384
lst = input().split()
A = int(lst[0])
B = int(lst[1])
C = int(lst[2])

K = int(input())

count = 0
while count < K:
   if not A < B:
      B = B * 2
      count = count + 1
   elif not B < C:
      C = C * 2
      count = count + 1
   else:
      count = K

if A < B < C:
   print('Yes')
else:
   print('No')

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

const int N = 1e5 + 10;

void doc() {
}
void solve() {
    int n;
    cin >> n;
    string a,b,c;
    cin >> a >> b >> c;
    int Res = 0;
    for (int i = 0; i < n; i++) {
        if (a[i] == b[i] && a[i] == c[i]) continue;
        if (a[i] == b[i] || a[i] == c[i] || b[i] == c[i]) {
            Res++;
            continue;
        }
        Res += 2;
    }
    cout << Res;
}
int main(){
    doc();
	solve();
}


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

int main()
{
	int x, y, z;
	cin >> x >> y >> z;
	int count = 0;
	for (int i = x; i <= y; i++) {
		if (z%i == 0)count++;
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 3104
//atcoder: a - frog1
#include <iostream>
#include <climits>
#include <vector>
using namespace std;

int main() {
	// your code goes here
	int n;
	cin>>n;
	int h[n];
	for(int i=0;i<n;i++){
		cin>>h[i];
	}
	vector<int>dp(n,INT_MAX);
//	for(int i=0;i<n;i++)cout<<dp[i]<<endl;
	dp[0]=0;
	for(int i=0;i<n;i++){
		for(int j:{i+1,i+2}){
			if(j<n)dp[j]=min(dp[j],dp[i]+abs(h[i]-h[j]));
		}//cout<<dp[i]<<endl;
	}cout<<dp[n-1]<<endl;
	return 0;
}

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

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

    int n,ans=0,s=0,t=0,u=0,v=0,w=0;
    cin >> n;
    vector<int> a(100);

    forx(i,1,n+1){
        int k = i;
        forx(j,2,n+1)while(k>1){
            if(k%j==0){
                a[j]++;
                k /= j;
            }else
                break;
        }
    }

    for(auto q:a){
        if(q>=4)
            s++;
        else if(q>=2)
            t++;
        if(q>=14)
            u++;
        if(q>=24)
            v++;
        if(q>=74)
            w++;
    }
    ans += t * s * (s - 1) / 2;
    ans += s * (s - 1) * (s - 2) / 2;
    ans += w;
    ans += v * (s + t - 1);
    ans += u * (s-1 );
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int,long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;
using U = unordered_map<int,long long>; //mapとの違いはkeyの順番を保持していない

#define sorted(vector) sort(vector.begin(),vector.end()) //O(nlongn)
#define sortedreverce(vector) sort(vector.rbegin(),vector.rend()) //O(nlongn)
#define vmin(vector) *min_element(vector.begin(),vector.end()) //O(N)
#define vmax(vector) *max_element(vector.begin(),vector.end()) //O(N)
#define vsum(vector) accumulate(vector.begin(),vector.end(),0) //O(N)
#define vcount(vector,a) count(vector.begin(), vector.end(),a) //O(N)
#define bisect_left(vector,a) (lower_bound(vector.begin(),vector.end(),a)-vector.begin())
#define bisect_right(vector,a) (upper_bound(vector.begin(),vector.end(),a)-vector.begin())
#define vfind(vector,a) find(vector.begin(), vector.end(), a) != vector.end() //遅いからあんまり使うな
//存在確認はmap!!!!!!!!!!!!!か配列に埋め込んでcontinueで回避
//__gcd(a,b)はコンパイラがGCC時のみ

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    string s;
    cin>>s;
    vector<char> v;
    vector<char> v2;
    for(int i=0  ;i<s.size()  ;i++){
        if (i%2==0){
            v.push_back('1');
            v2.push_back('0');
        }else{
            v.push_back('0');
            v2.push_back('1');
        }
    }
    long long ans=0,ans2=0;
    for(int i=0  ;i<s.size()  ;i++){
        if (v[i]!=s[i]) ans++;
        if (v2[i]!=s[i]) ans2++;
    }
    cout<<min(ans,ans2)<<endl;

}

Measured memory_bytes: 720
/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get_be(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
//get_be biger & equal
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const ll oo=1e9+10;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
//ll a[Max];
ll n;
void solve(){
	string s,t;
	cin>>s>>t;
	rep(i,0,3)if(s[i]==t[i])n++;
	cout<<n; 
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}





Measured memory_bytes: 256
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
const int INF = 1e9+7;

int main(int argc, char **argv)
{
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (a < b && b < c) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using ll = long long;
#define div 1000000007
 
int main()
{
  int n;
  cin >> n;
  vector<ll> a(n);
  vector<ll> b;
  ll sum = 0;
  
  rep(i,n){
    cin >> a[i];
    sum += a[i];
    if(div <= sum){
      sum = sum % div;
    }
    b.emplace_back(sum);
  }
  ll ans = 0;
  rep(i,n-1){
      ans = (ans + a[n-1-i] * b[n-2-i]) % div;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6904
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

int main(){
    string s;
    cin >> s;
    int count = 0, max_count = 0;

    for(int i=0; i<s.size(); i++) {
        if(s[i] == 'R') {
            count++;
        }
        else {
            count = 0;
        }
        max_count = max(count, max_count);
    }
    cout << max_count << endl;
}

Measured memory_bytes: 3624
def examA():
    A = LI()
    A.sort()
    ans = A[2]*10+A[1]+A[0]
    print(ans)
    return

def examB():
    N, M, x, y = LI()
    X = LI()
    Y = LI()
    X.sort(); Y.sort()
    if max(X[-1],x)<min(Y[0],y):
        print("No War")
    else:
        print("War")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 3956
public class Main {


  private static void solve() {
    int x = ni();
    int a = ni();
    
    if (x < a) {
      System.out.println(0);
    } else {
      System.out.println(10);
    }
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

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

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main() { cin.tie(0); ios::sync_with_stdio(false);
    char S[4];
    cin >> S;
    cout << (S[0] == S[2] ? "Yes" : "No") << "\n";
}


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

#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define rrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define rrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std;

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";}
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}

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

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a%b) : a; }

template<typename T>
T lcm(T a, T b) { return a*(b/gcd(a,b)); }

int main(void)
{
    ll a, b;
    cin >> a >> b;
    cout << lcm(a,b) << endl;
    return 0;
} /*atcoder*/



Measured memory_bytes: 3540
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX(X, Y) (((X) > (Y))? (X) : (Y))
#define MIN(X, Y) (((X) < (Y))? (X) : (Y))
int compare_int(const void *a, const void *b){
  return *(long int*)b - *(long int*)a; // 大きい順
}
int compare_int_small(const void *a, const void *b){
  return *(long int*)a - *(long int*)b; // 小さい順
}
// 公約数
long long int gcd(long long int a, long long int b){
  if(b == 0){
    return a;
  }else{
    return gcd(b, a % b);
  }
}
// 最小公倍数 = a * b / 最大公約数
// 公倍数
long long int lcm(long long int a, long long int b){
  return a * b / gcd(a, b);
}

// 15min
int main(void){
  int s;
  int ff, bb;

  scanf("%d", &s);

  ff = s / 100;
  bb = s % 100;

  if(0 < ff && ff < 13 && 0 < bb && bb < 13){
    printf("AMBIGUOUS");
  }else if(0 < bb && bb < 13){
    printf("YYMM");
  }else if(0 < ff && ff < 13){
    printf("MMYY");
  }else{
    printf("NA");
  }
  
    printf("\n");

  return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
main()
{
  int n,k;cin>>n>>k;int a[n];
  for(int i=0;i<n;i++)cin>>a[i];
  sort(a,a+n);
  vector<int>v;int count=1;v.clear();
  for(int i=0;i<n-1;i++)
  {
    if(a[i]!=a[i+1]){v.push_back(count);count=1;}
    else count++;
  }
  v.push_back(count);
//  for(int i=0;i<v.size();i++)cout<<v[i]<<" ";
  sort(v.begin(),v.end());
  //reverse(v.begin(),v.end());
  int sum=0;
  if(v.size()<k)cout<<0;
  else
  {
  for(int i=0;i<v.size()-k;i++)
  {//cout<<v[i]<<" ";
    sum+=v[i];
  }
  cout<<sum;
  }
}


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

using namespace std;
using ll = long long;

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

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

int main(void){
    map<char,bool> right;
    right['y']=right['u']=right['i']=right['o']=right['p']=
    right['h']=right['j']=right['k']=right['l']=
    right['n']=right['m']=true;

    int cnt=0;
    char now=getchar(),before;
    while(before=now,now=getchar(),before!='#'){
        if(now=='\n'){
            cout<<cnt<<endl;
            cnt=0;
            now=getchar();
        }else if(right[before]^right[now]){
            cnt++;
        }
    }

    return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
int main(){
	int N;
	cin>>N;
	V<ll> A(N),B(N);
	rep(i,N) cin>>A[i];
	rep(i,N) cin>>B[i];
	ll Asum=0,Bsum=0;
	rep(i,N) Asum+=A[i],Bsum+=B[i];
	if(Asum<Bsum){
		cout<<-1<<endl;
		return 0;
	}
	ll need = 0;
	int cnt = 0;
	V<ll> cand;
	rep(i,N){
		if(A[i]<B[i]){
			cnt++;
			need += B[i]-A[i];
		}else{
			cand.pb(A[i]-B[i]);
		}
	}
	sort(all(cand),greater<ll>());
	for(ll v:cand){
		if(need<=0) break;
		need -= v;
		cnt++;
		if(need<=0) break;
	}
	cout<<cnt<<endl;
}

Measured memory_bytes: 2936
#include <stdio.h>

int main(void){

  long n,x;
  scanf("%ld %ld", &n, &x);
  long l[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &l[i]);
  }

  long bounce = 0;
  long answer = n+1;
  for (long i = 0; i < n; i++) {
    bounce += l[i];
    if (bounce > x) {
      answer = i+1;
      break;
    }
  }

  printf("%ld\n", answer);

  return 0;
}

Measured memory_bytes: 128