akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<numeric>
#include<limits>
#include <cstdint>
#include<stack>
#include<queue>
using namespace std;
#define ll long long int
#define rep(N) for(ll i=0;i<N;i++)
#define rep2(N1,N2) for(ll i=0;i<N1;i++)for(ll j=0;j<N2;j++)
#define rep3(N1,N2,N3)for(ll i=0;i<N1;i++)for(ll j=0;j<N2;j++)for(ll k=0;k<N3;k++)
#define For(i,N) for(ll i=0;i<N;i++)

void yn(bool b) {
	if (b)printf("yes\n");
	else printf("no\n");
}

void Yn(bool b) {
	if (b)printf("Yes\n");
	else printf("No\n");
}

void YN(bool b) {
	if (b)printf("YES\n");
	else printf("NO\n");
}

int ctoi(char c) {
	return c - '0';
}

ll kai(ll x) {
	ll a = 1;
	if (x <= 0)
		return 1;
	else {
		for (ll i = 0; i < x; i++)
			a = a * (i + 1);
		return a;
	}
}

ll rui(ll x, ll y) {
	ll a = 1;
	for (ll i = 0; i < y; i++)
		a = a * x;
	return a;
}
const int nmax = 150;
int cccc[nmax][nmax];
ll comb(ll n, ll k) {
	if (n < k) {
		cout << "error n<k" << endl;
		return -1;
	}
	if (cccc[n][k] > 0)return cccc[n][k];
	if (k == 0 || n == k)return 1;
	return cccc[n][k] = comb(n - 1, k - 1) + comb(n - 1, k);
}

ll keta(ll a) {
	ll i = 1;
	while (1) {
		if (a < pow((ll)10, i))
			return i;
		i++;
	}
}
vector<ll> v;
ll n, m;
//m進数全探索
ll inc(ll a = n - 1) {
	if (a == 0 && v[0] == m) {
		v[0] = -1;
		return v[0];
	}
	if (v[a] == m) {
		v[a] = 0;
		inc(a - 1);
		return v[a];
	}
	else {
		++v[a];
		return v[a];
	}
}

ll mod = 1000000007;

ll modpowl(ll a, ll b) {
	if (b == 0) {

		return 1;
	}
	if (b == 1) {

		return a;
	}
	if (b >= 2) {
		if (b % 2 == 0) {
			ll c = modpowl((a*a) % mod, b / 2);
			c = c % mod;

			return c;
		}
		else {
			ll c = (modpowl((a*a) % mod, b / 2) % mod)*a;
			c = c % mod;

			return c;
		}
	}
}
ll gyo(ll N, ll A, ll B, ll y) {
	if (A != y && B != y)
		return y;
	else if (A == y)
		return B;
	else
		return A;
}

ll retsu(ll N, ll A, ll B, ll x) {
	if (A != x && B != x)
		return x;
	else if (A == x)
		return B;
	else
		return A;
}

pair<ll,ll> tenchi(ll x, ll y) {
	return make_pair(y, x);
}
int main() {
	cout.precision(20);
	ll N;
	cin >> N;
	vector<ll>P(N + 1);
	rep(N) { 
		cin >> P[i + 1];
	}
	ll ans = 0;
	ll min=P[1];
	rep(N) {
		if (min >= P[i+1]) {
			min = P[i+1];
			ans++;
	}
	}
	cout << ans;
}




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

int main(void) {
    int H,N;
    cin>>H>>N;
    for (int i = 0; i < N; i++)
    {
        int A;
        cin>>A;
        H -= A;
    }
    if (H <= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

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

template<typename T> 
map<T, Int> factorize(T x){
  map<T, Int> res;
  for(Int i=2;i*i<=x;i++){
    while(x%i==0){
      x/=i;
      res[i]++;
    }
  }
  if(x!=1) res[x]++;
  return res;
}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n);
  for(Int i=0;i<n;i++) cin>>a[i];
  sort(a.begin(),a.end());

  vector<Int> ans(n);

  Int m=0;
  map<Int, Int> r;

  vector<vector<Int> > G(n*20);
  for(Int i=0;i<n;i++){
    auto x=factorize(a[i]);
    for(auto p:x){
      if(!r.count(p.first)) r[p.first]=m++;
      G[i].emplace_back(n+r[p.first]);
      G[n+r[p.first]].emplace_back(i);
    }
  }
  
  vector<Int> used(n+m,0),post(n,0);
  for(Int t=0;t<n;t++){
    vector<Int> cs(n+m,-1);
    Int color=0;
    for(Int i=0;i<n+m;i++){
      if(used[i]||~cs[i]) continue;
      queue<Int> q;
      cs[i]=color;
      q.emplace(i);
      while(!q.empty()){
	Int v=q.front();q.pop();
	for(Int u:G[v]){
	  if(used[u]||~cs[u]) continue;
	  cs[u]=color;
	  q.emplace(u);
	}
      }
      color++;
    }
    
    Int idx=-1;
    for(Int i=0;i<n;i++){
      if(used[i]||post[i]) continue;
      idx=i;
      break;
    }
    
    used[idx]=1;
    ans[t]=idx;
    
    for(Int i=0;i<n;i++){
      if(cs[idx]!=cs[i]) continue;
      if(__gcd(a[idx],a[i])>1) post[i]=0;
      else if(a[idx]<a[i]) post[i]=1;
    }
  }


  vector<Int> b(n);
  for(Int i=0;i<n;i++) b[i]=a[ans[i]];
  
  vector<vector<Int> > H(n);
  for(Int i=0;i<n;i++)
    for(Int j=i+1;j<n;j++)
      if(__gcd(b[i],b[j])>1) H[i].emplace_back(j);

  vector<Int> indeg(n);
  for(Int i=0;i<n;i++)
    for(Int j:H[i]) indeg[j]++;
  
  using P = pair<Int, Int>;
  priority_queue<P> pq;
  for(Int i=0;i<n;i++)
    if(!indeg[i]) pq.emplace(b[i],i);

  vector<Int> c;
  while(!pq.empty()){
    P p=pq.top();pq.pop();
    c.emplace_back(p.first);
    for(Int u:H[p.second]){
      indeg[u]--;
      if(!indeg[u]) pq.emplace(b[u],u);
    }
  }
  
  assert((Int)c.size()==n);
  for(Int i=0;i<n;i++){
    if(i) cout<<" ";
    cout<<c[i];
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 15232
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#define rep(i, n) for(i = 0; i < n; i++)
//#define int long long
using namespace std;

int a, b;

signed main() {
	cin >> a >> b;
	
	for (int x = 1; x <= 499500; x++) {
		for (int i = 1; i < 999; i++) {
			int left = i * (i + 1) / 2;
			int right = (i + 1) * (i + 2) / 2;
			if (left - x == a && right - x == b) {
				cout << x << endl;
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
using ll = long long;

int main(){
    ll X;
    ll rtx;
    cin >> X;
    rtx = pow(X,0.250) + 1;
    for(ll i = -rtx;i <= rtx;i++){
        for(ll j = -rtx;j < rtx;j++){
            if(abs(i - j) == 0||X % (i - j) == 0 || X % (j - i) == 0){
                if(X == (pow(i,5) - pow(j,5))){
                    cout << i << " " << j << endl;
                    return 0;
                }
                else if (X == (pow(j, 5) - pow(i, 5))){
                    cout << j << " " << i << endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3964
# 4 3 16
n = gets.to_i
arr = [
  1,
  6,
  6**2,
  6**3,
  6**4,
  6**5,
  6**6,
  9,
  9**2,
  9**3,
  9**4,
  9**5,
]
aaa = [
  1,
  6,
  6**2,
  6**3,
  6**4,
  6**5,
  6**6,
  9,
  9**2,
  9**3,
  9**4,
  9**5,
]
# sss = Time.now.to_f
cnt = 0
# p arr
while !arr.any?{|a|a==n}
  arr = arr.product(aaa).map{|(a,b)|n<a+b ? 1 : a+b }.uniq
  # p arr.size
  cnt += 1
end
p cnt+1
# eee = Time.now.to_f
# p eee - sss


Measured memory_bytes: 117172
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
#define INF (1<<29)


int g[10001];
int dp[10001][2];


int main(){
	int t,n;
	string s;
	cin>>t;
	while(t--){
		cin>>n>>s;
		memset(g,0,sizeof(g));
		if(s[0]=='Y')g[0]|=1;
		for(int i=1;i<2*n-1;i+=2){
			if(s[i]=='Y'||s[i+1]=='Y')g[1+i/2]|=1;
		}
		if(s[2*n-1]=='Y')g[n]|=1;
		
		if(s[2*n]=='Y')g[0]|=2;
		for(int i=2*n+1;i<4*n-1;i+=2){
			if(s[i]=='Y'||s[i+1]=='Y')g[1+(i-2*n)/2]|=2;
		}
		if(s[4*n-1]=='Y')g[n]|=2;

		if(g[0]&2){
			dp[0][0]=3;
			dp[0][1]=2;
		}else if(g[0]&1){
			dp[0][0]=1;
			dp[0][1]=1;
		}else{
			dp[0][0]=0;
			dp[0][1]=1;
		}
		for(int i=0;i<n;i++){
			if(g[i+1]==3){
				dp[i+1][0]=min(dp[i][0]+4,dp[i][1]+3);
				dp[i+1][1]=min(dp[i][0]+3,dp[i][1]+3);
			}else if(g[i+1]==1){
				dp[i+1][0]=min(dp[i][0]+2,dp[i][1]+2);
				dp[i+1][1]=min(dp[i][0]+2,dp[i][1]+2);
			}else if(g[i+1]==2){
				dp[i+1][0]=min(dp[i][0]+4,dp[i][1]+3);
				dp[i+1][1]=min(dp[i][0]+3,dp[i][1]+2);
			}else{
				dp[i+1][0]=min(dp[i][0]+1,dp[i][1]+2);
				dp[i+1][1]=min(dp[i][0]+2,dp[i][1]+1);
			}
		}
		cout<<dp[n][0]<<endl;
	}
	return 0;
}

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

int main(){

    int N, K;
    cin >> N >> K;
    if((N+1)/2 >= K)cout << "YES"<<endl;
    else cout << "NO"<<endl;

    return 0;
}

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

namespace AtCoder
{
    class Program
    {
        static int GetSum(int a,int b)
        {
            int m = 5,sum=0;
            for(int i = m; i >=0; i--)
            {
                sum += (a / (int)Math.Pow(10, i)) + (b / (int)Math.Pow(10, i));
                a -= (a / (int)Math.Pow(10, i))*(int)Math.Pow(10,i);
                b -= (b / (int)Math.Pow(10, i))*(int)Math.Pow(10,i);
            }
            return sum;
        }

        static void Main()
        {
            IO io = new IO();

            //ここから

            int n = io.ReadLineToInt();

            int a = n-2, b = 2, min = int.MaxValue,sum=0;

            for(int i = 0; i < n / 2 +1; i++)
            {
                sum = GetSum(a-i, b+i);
                if (min > sum)
                {
                    min = sum;
                }
            }

            //ここまで
            Console.Write(min);
            Console.ReadKey();
        }
    }

    //IOを担う関数群
    public class IO
    {
        //stringの入力
        public string ReadLineToString()
        {
            return Console.ReadLine();
        }

        //intの入力
        public int ReadLineToInt()
        {
            return int.Parse(Console.ReadLine());
        }

        //空白区切りの複数の文字列の入力をstring[]にして返す
        public string[] ReadLineToStringArray()
        {
            return Console.ReadLine().Split(' ').ToArray();
        }


        //空白区切りの複数の整数の入力をint[]にして返す
        public int[] ReadLineToIntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        //空白区切りの複数の文字列の入力をList<string>で受け取る
        public List<string> ReadLineToStringList()
        {
            return Console.ReadLine().Split(' ').ToList();
        }

        //空白区切りの複数の整数の入力をList<int>で受け取る
        public List<int> ReadLineToIntList()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToList();
        }

    }

}


Measured memory_bytes: 11220
function Main(inputs) {
	const inputline = inputs.split("\n").map(x => parseInt(x, 10));
  	const line = inputline[0];
  
  	function base26(number) {
    	let remainder26 = number % 26;
    	let division26 = Math.floor(number / 26) ;
    	let output = (remainder26 != 0) ? String.fromCharCode(64 + remainder26) : (--division26, 'Z');
      	return output = (division26 != 0) ? base26(division26) + output : output;
	}
  
  	console.log(base26(line).toLowerCase());
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29564
#pragma GCC optimize("O3")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x, a;
    cin >> x >> a;
    if(x < a) cout << 0;
    else cout << 10;
    return 0;
}

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

int main() {
  int N;
  int K;
  cin >> N >> K;
  
  int x = 1;
  
  for (int i = 0; i < N; i++) { 
    if (2 * x < x + K) {
      x *= 2;
    }
    else {
      x += K;
    }
  }
  
  cout << x << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();

        switch (N%10) {
            case 2:
            case 4:
            case 5:
            case 7:
            case 9:
                System.out.println("hon");
                break;
            case 0:
            case 1:
            case 6:
            case 8:
                System.out.println("pon");
                break;
            case 3:
                System.out.println("bon");
                break;
        }
    }
}


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

int main() {
  int n; cin >> n;
  while (n--) {
    string s; cin >> s;
    sort(begin(s), end(s));
    string l = s;
    sort(begin(s), end(s), greater<int>());
    string r = s;
    cout << stoi(r) - stoi(l) << endl;
  }
  return 0;
}



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

//満点解法
//ナップサック問題として考える
public class Main {

	void run() {
		Scanner sc = new Scanner(System.in);

		// input
		int n = sc.nextInt();
		int a = sc.nextInt();

		int[] x = new int[n + 1];
		x[0] = -1;
		for (int i = 1; i <= n; i++) {
			x[i] = sc.nextInt();
		}

		int max = a;
		for (int i = 0; i < n; i++) {
			max = Math.max(max, x[i]);
		}
		int X = max * n;

		// dp[j][k][s]:x1~xjまでk枚選んだ時の和がsになるような選び方の総数
		// 0<=j<=n, 0<=k<=n, 0<=s<=X
		long[][][] dp = new long[n + 1][n + 1][X + 1];

		dp[0][0][0] = 1;

		for (int j = 0; j <= n; j++) {
			for (int k = 0; k <= n; k++) {
				for (int s = 0; s <= X; s++) {
					if (j == 0 && k == 0 && s == 0) {
						continue;
					}
					long count = 0;
					if (s >= x[j] && k >= 1 && j >= 1) {
						// x[j]を選ばない
						count += dp[j - 1][k][s];
						// x[j]を選ぶ
						count += dp[j - 1][k - 1][s - x[j]];
					} else if (s < x[j] && j >= 1) {
						// x[j]を選べない
						count += dp[j - 1][k][s];
					}
					dp[j][k][s] = count;
				}
			}
		}

		// debug
		/*
		 * for (int j = 0; j <= n; j++) { for (int k = 0; k <= n; k++) {
		 * System.out.println("j:" + j + " k:" + k);
		 * System.out.println(Arrays.toString(dp[j][k])); } }
		 */

		long sum = 0;
		for (int k = 1; k <= n; k++) {
			sum += dp[n][k][k * a];
		}

		System.out.println(sum);
	}

	public static void main(String[] args) {
		new Main().run();
	}

}


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

using namespace std;


bool check(vector <vector <char> > &a,int x,int y,int k)
{   unordered_set <int> s1,s2;
    for(int i=5;i>=0;i--)
        {
            if(x>=pow(2,i))
                {
                   s1.insert(i);
                   x-=pow(2,i);
                }

        }
    for(int i=5;i>=0;i--)
        {
            if(y>=pow(2,i))
                {   s2.insert(i);
                    y-=pow(2,i);
                }
        }
    int ans=0;
    for(int i=0;i<a.size();i++)
        {
            for(int j=0;j<a[0].size();j++)
                {
                    if(ans>k)
                        return false;
                    if(s1.find(i)!=s1.end() && s2.find(j)!=s2.end() && a[i][j]=='#')
                        {
                            ++ans;
                        }
                }
        }
       //cout<<(ans)<<'\n';
    return (ans==k);
}


int main()
{
    int h,w,k;
    cin>>h>>w>>k;
    int ans=0;
    vector <vector <char> > a;
    a.resize(h,vector <char>(w,'#'));
    for(int i=0;i<h;i++)
        {
            for(int j=0;j<w;j++)
                {
                    cin>>a[i][j];
                }
        }
    //cout<<(check(a,3,3,2))<<" ";
    for(int i=0;i<pow(2,h);i++)
    {
        for(int j=0;j<pow(2,w);j++)
            {
                if(check(a,i,j,k)==true)
                    ++ans;
            }
    }
    cout<<ans<<'\n';
    return 0;
}

Measured memory_bytes: 4008
#include <stdio.h>

int main(void) {
	char banmen[6][10]={
		"..rr....",
		"..rr....",
		"ggyybbww",
		"ggyybbww",
		"..oo....",
		"..oo...."
	};
	char query[200];
	char t1,t2;
	int i;
	scanf("%s",query);
	for(i=0;query[i];i++) {
		switch(query[i]) {
			case 'U':
				t1=banmen[2][0];
				t2=banmen[2][1];
				banmen[2][0]=banmen[2][2];
				banmen[2][1]=banmen[2][3];
				banmen[2][2]=banmen[2][4];
				banmen[2][3]=banmen[2][5];
				banmen[2][4]=banmen[2][6];
				banmen[2][5]=banmen[2][7];
				banmen[2][6]=t1;
				banmen[2][7]=t2;

				t1=banmen[0][2];
				banmen[0][2]=banmen[1][2];
				banmen[1][2]=banmen[1][3];
				banmen[1][3]=banmen[0][3];
				banmen[0][3]=t1;
				break;
			case 'F':
				t1=banmen[1][2];
				t2=banmen[1][3];
				banmen[1][2]=banmen[3][1];
				banmen[1][3]=banmen[2][1];
				banmen[3][1]=banmen[4][3];
				banmen[2][1]=banmen[4][2];
				banmen[4][3]=banmen[2][4];
				banmen[4][2]=banmen[3][4];
				banmen[2][4]=t1;
				banmen[3][4]=t2;

				t1=banmen[2][2];
				banmen[2][2]=banmen[3][2];
				banmen[3][2]=banmen[3][3];
				banmen[3][3]=banmen[2][3];
				banmen[2][3]=t1;
				break;
			case 'R':
				t1=banmen[0][3];
				t2=banmen[1][3];
				banmen[0][3]=banmen[2][3];
				banmen[1][3]=banmen[3][3];
				banmen[2][3]=banmen[4][3];
				banmen[3][3]=banmen[5][3];
				banmen[4][3]=banmen[3][6];
				banmen[5][3]=banmen[2][6];
				banmen[3][6]=t1;
				banmen[2][6]=t2;

				t1=banmen[2][4];
				banmen[2][4]=banmen[3][4];
				banmen[3][4]=banmen[3][5];
				banmen[3][5]=banmen[2][5];
				banmen[2][5]=t1;
				break;
			case 'D':
				t1=banmen[3][6];
				t2=banmen[3][7];
				banmen[3][6]=banmen[3][4];
				banmen[3][7]=banmen[3][5];
				banmen[3][4]=banmen[3][2];
				banmen[3][5]=banmen[3][3];
				banmen[3][2]=banmen[3][0];
				banmen[3][3]=banmen[3][1];
				banmen[3][0]=t1;
				banmen[3][1]=t2;

				t1=banmen[4][2];
				banmen[4][2]=banmen[5][2];
				banmen[5][2]=banmen[5][3];
				banmen[5][3]=banmen[4][3];
				banmen[4][3]=t1;
				break;
			case 'B':
				t1=banmen[0][2];
				t2=banmen[0][3];
				banmen[0][2]=banmen[2][5];
				banmen[0][3]=banmen[3][5];
				banmen[2][5]=banmen[5][3];
				banmen[3][5]=banmen[5][2];
				banmen[5][3]=banmen[3][0];
				banmen[5][2]=banmen[2][0];
				banmen[3][0]=t1;
				banmen[2][0]=t2;

				t1=banmen[2][6];
				banmen[2][6]=banmen[3][6];
				banmen[3][6]=banmen[3][7];
				banmen[3][7]=banmen[2][7];
				banmen[2][7]=t1;
				break;
			case 'L':
				t1=banmen[4][2];
				t2=banmen[5][2];
				banmen[4][2]=banmen[2][2];
				banmen[5][2]=banmen[3][2];
				banmen[2][2]=banmen[0][2];
				banmen[3][2]=banmen[1][2];
				banmen[0][2]=banmen[3][7];
				banmen[1][2]=banmen[2][7];
				banmen[3][7]=t1;
				banmen[2][7]=t2;

				t1=banmen[2][0];
				banmen[2][0]=banmen[3][0];
				banmen[3][0]=banmen[3][1];
				banmen[3][1]=banmen[2][1];
				banmen[2][1]=t1;
				break;
		}
	}
	for(i=0;i<6;i++)puts(banmen[i]);
	return 0;
}

Measured memory_bytes: 524
#include<stdio.h>

int main(void) {
	char alpha;

	//英小文字または、英大文字を入力
	scanf("%c", &alpha);
	//結果を出力
	//大文字なら"A"を出力
	if (0x41 <= alpha && alpha <= 0x5a) {
		printf("A\n");
	}
	//小文字なら"a"を出力
	else if (0x61 <= alpha && alpha <= 0x7a) {
		printf("a\n");
	}
	else {}

	return 0;
}

Measured memory_bytes: 1544
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main()
{
	int N, ans = 0, mochi;
	map<int, bool> X;

	cin >> N;
	rep(i, N) {
		cin >> mochi;
		if (!X[mochi]) {
			X[mochi] = 1;
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
} 

Measured memory_bytes: 256
def readinput():
    n=int(input())
    sList=[]
    for _ in range(n):
        sList.append(input())
    return n,sList

def main(n,sList):
    hist={}
    for s in sList:
        if s in hist.keys():
            hist[s]+=1
        else:
            hist[s]=1
    hList=sorted(list(hist.items()), key=lambda x:x[1], reverse=True)
    #print(hList)
    hvalue=hList[0][1]
    ss=[]
    i=0
    while(i<len(hList) and hList[i][1]==hvalue):
        ss.append(hList[i][0])
        i+=1
    ss.sort()
    for s in ss:
        print(s)    

if __name__=='__main__':
    n,sList=readinput()
    main(n,sList)


Measured memory_bytes: 50664
#include <iostream>
#include <cstdint>

using namespace std;

int main()
{
    uint64_t N, M;

    cin >> N >> M;

    if (N >= M / 2)
    {
        cout << M / 2 << endl;
        return 0;
    }

    uint64_t res = M - 2 * N;
    cout << res / 4 + N << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MOD 1000000007
long int SUM(long int a,long int b){return (a%MOD+b%MOD+MOD)%MOD;}//a+b
long int PROD(long int a,long int b){return a%MOD*(b%MOD)%MOD;}//a*b
int main(){
  long int n,m,x[100000],y[100000],i,j,sx=0,sy=0;
  scanf("%ld%ld",&n,&m);
  for(i=0;i<n;i++)scanf("%ld",&x[i]);
  for(i=0;i<m;i++)scanf("%ld",&y[i]);
  for(i=1;i<n;i++)sx=SUM(sx,PROD(x[i]-x[i-1],PROD(i,n-i)));
  for(i=1;i<m;i++)sy=SUM(sy,PROD(y[i]-y[i-1],PROD(i,m-i)));
  printf("%ld",PROD(sx,sy));
}


Measured memory_bytes: 1664
N = int(input())
graph = []
for _ in range(N):
	graph.append(list(map(int, input().strip())))

def check(graph):
	queue = [0]
	dists = [None] * N
	dists[0] = 0
	while queue:
		cur = queue.pop()
		dist = dists[cur] + 1
		col = graph[cur]
		for i in range(N):
			c = col[i]
			if c == 1:
				d = dists[i]
				if d == None:
					dists[i] = dist
					queue.append(i)
				else:
					if d % 2 != dist %2:
						return False
					elif d > dist:
						dists[i] = dist
						queue.append(i)
	return True

def search(graph, start):
	queue = [start]
	dists = [None] * N
	dists[start] = 0
	while queue:
		cur = queue.pop()
		dist = dists[cur] + 1
		col = graph[cur]
		for i in range(N):
			c = col[i]
			if c == 1:
				d = dists[i]
				if d == None or d > dist:
					dists[i] = dist
					queue.append(i)
	return max(dists)

if check(graph):
	diam = 0
	for i in range(N):
		d = search(graph, i)
		if d > diam:
			diam = d
	print(diam + 1)
else:
	print(-1)


Measured memory_bytes: 45404
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
int main(){
int n;
  cin>>n;
ll h,w,a,b;
  cin>>h>>w;
  vector<pair<ll,ll>> p(n);
  rep(i,n){
    cin>>a>>b;
    p[i]=mk(a,b);
  }
  int ans=0;
  rep(i,n){
    if(p[i].first>=h&&p[i].second>=w) ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func stringifyArray(arr []int) string {
	return strings.TrimRight(fmt.Sprintf("%+v", arr)[1:], "]")
}

var infty = 1000000000

type nodeKey int

type DirectedGraphNode struct {
	key       nodeKey
	adjacents []*DirectedGraphNode
	visited   bool
	d         int
	parent    *DirectedGraphNode
}

type DirectedGraph struct {
	nodes []DirectedGraphNode
}

func (g *DirectedGraph) setAdjacency(l, r nodeKey) {
	g.nodes[l].adjacents = append(g.nodes[l].adjacents, &g.nodes[r])
}

func newDirectedGraph(nNodes int) *DirectedGraph {
	graph := DirectedGraph{}
	graph.nodes = make([]DirectedGraphNode, nNodes)
	for iNodes := 0; iNodes < nNodes; iNodes++ {
		graph.nodes[iNodes].key = nodeKey(iNodes)

		graph.nodes[iNodes].visited = false
		graph.nodes[iNodes].d = infty
		graph.nodes[iNodes].parent = nil
	}
	return &graph
}

type QueueEntry struct {
	node *DirectedGraphNode
	next *QueueEntry
}

type Queue struct {
	head, tail *QueueEntry
}

func (q *Queue) enqueue(node *DirectedGraphNode) {
	entry := QueueEntry{}
	entry.node = node

	if q.tail == nil {
		q.head = &entry
		q.tail = &entry
		return
	}

	q.tail.next = &entry
	q.tail = q.tail.next
}

func (q *Queue) dequeue() *QueueEntry {
	if q.head == nil {
		return nil
	}
	poped := q.head
	q.head = q.head.next
	if q.head == nil {
		q.tail = nil
	}
	return poped
}

func (q *Queue) isEmpty() bool {
	return q.head == nil
}

func fillDistancesByBreadthFirstSearch(g *DirectedGraph, startNode *DirectedGraphNode) {
	startNode.visited = true
	startNode.d = 0

	queue := Queue{}
	queue.enqueue(startNode)
	for !queue.isEmpty() {
		u := queue.dequeue().node
		for _, adjacent := range u.adjacents {
			if !adjacent.visited {
				adjacent.visited = true
				adjacent.d = u.d + 1
				adjacent.parent = u
				queue.enqueue(adjacent)
			}
		}
		u.visited = true
	}
}

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

	nNodes := nextInt()
	g := newDirectedGraph(nNodes + 1)

	for iNode := 0; iNode < nNodes; iNode++ {
		nodeKeyLeft := nodeKey(nextInt())
		nAdj := nextInt()
		for iAdj := 0; iAdj < nAdj; iAdj++ {
			nodeKeyRight := nodeKey(nextInt())
			g.setAdjacency(nodeKeyLeft, nodeKeyRight)
		}
	}

	// fmt.Println(g)
	fillDistancesByBreadthFirstSearch(g, &g.nodes[1])
	// fmt.Println(g)

	for iNode := 1; iNode <= nNodes; iNode++ {
		node := g.nodes[iNode]
		distance := node.d
		if distance == infty {
			distance = -1
		}
		fmt.Println(node.key, distance)
	}
}



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

string to_string(string s) { return '"' + s + '"'; }
string to_string(char c) { string s = "'"; s += c; return s + "'"; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } 
template <typename A>
string to_string(A v) {
    bool first = true; 
    string res = "{";
    for (const auto &x : v) {
        if (!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}"; 
    return res;
}
istream_iterator<string> eos;
void dbg_out(istream_iterator<string> it) { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(istream_iterator<string> it, Head H, Tail... T) {
    cerr << *it << " = " << to_string(H);
    if(++it != eos) cerr << ", ";
    dbg_out(it, T...);
}
#ifdef LOCAL
    #define dbg(...) { string _s = #__VA_ARGS__; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); dbg_out(_it, __VA_ARGS__); }
#else
    #define dbg(...)
#endif

#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define MP make_pair
#define sz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define nl "\n"
typedef pair<int, int> pii;
typedef vector <int> vi;

pii dir[8] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {1, 1}, {-1, -1} , {-1, 1}, {1, -1} };

const int inf = (1LL << 60), mod = 1e9+7, nn = 2002;
int n;
vector <pii> a;
int dp[nn][nn];

void solve(){
    cin >> n;
    fr(i, 0, n){
        int x; cin >> x;
        a.eb(x, i+1);
    }
    sort(a.rbegin(), a.rend());

    // dp[i][j] -> ans upto i elements where j left position is used
    // left_used + right_used is fixed

    for(int i = 1; i <= n; i++) {
        for(int j = 0; j <= i; j++) {
            int left_used = 0, right_used = 0;
            if(j != 0) left_used = a[i-1].ff * abs(a[i-1].ss - j) + dp[i-1][j-1];
            if(j == i) {
                dp[i][j] = left_used;
                continue;
            }
            int r = n - (i - j) + 1;
            right_used = a[i-1].ff * abs(a[i-1].ss - r) + dp[i-1][j];
            dp[i][j] = max(left_used, right_used);
        }
    }
    int ans = 0;
    for(int j = 1; j <= n; j++) {
        ans = max(ans, dp[n][j]);            // any j may be optimum for n elements
    }
    cout << ans << nl;
}

int32_t main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int tc = 1; tc <= T; tc++){
        // cout << "Case #" << tc << ": ";
        solve();
    }
    return 0;
}


Measured memory_bytes: 26276
#include <iostream>
#include <stdio.h>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <time.h>
#include <stdlib.h>
#include <algorithm>

#include <chrono>

#define INF 1e9
#define LL_INF 1e18

#define nmax 1000010

#define fst first
#define snd second
#define pb push_back
#define SZ(x) ((int)(x.size()))

#define MOD 1000000007
#define MOD1 998244353
#define MOD2 666013
#define P1 255
#define P2 2059

using namespace std;

typedef long long int ll;

typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

int n, lcm;
int a[10010], pr[nmax];
int idx[nmax];
bool not_p[nmax];

vector <pii> p[10010];

int my_pow(int x, int p)
{
    int sol = 1;

    while (p > 0)
    {
        if (p % 2 == 1) sol = (1LL * sol * x) % MOD;

        p /= 2;
        x = (1LL * x * x) % MOD;
    }

    return sol;
}

int compute_lcm()
{
    for (int i = 1; i <= n; i++) {

        int x = a[i];

        for (int j = 2; j * j <= x; j++)
            if (x % j == 0) {

                int l = 0;

                while (x % j == 0) { l++; x /= j; }

                p[i].pb({ j, l });
            }

        if (x > 1) p[i].pb({ x, 1 });

        for (int j = 0; j < SZ(p[i]); j++)
            pr[p[i][j].fst] = max(pr[p[i][j].fst], p[i][j].snd);
    }

    int answer = 1;

    for (int i = 1; i <= nmax; i++)
        if (pr[i] > 0) answer = (1LL * answer * my_pow(i, pr[i])) % MOD;

    return answer;
}

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

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

    for (int i = 2; i <= nmax - 10; i++)
        if (!not_p[i]) {

            for (int j = 2 * i; j <= nmax - 10; j += i) not_p[j] = true;
        }

    lcm = compute_lcm();

    int answer = 0;

    for (int i = 1; i <= n; i++) {

        int cur = 1;

        for (int j = 0; j < SZ(p[i]); j++)
            cur = (1LL * cur * my_pow(p[i][j].fst, p[i][j].snd)) % MOD;
        
        answer = (answer + (1LL * lcm * my_pow(cur, MOD - 2)) % MOD) % MOD;
    }

    printf("%d", answer);

    // IMPORTANT!!!!!
    // Are you missing something????
    // check limits, int or ll

    return 0;
}

Measured memory_bytes: 6272
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define INF 1e18
#define pi 3.14159265358979323846264338327950
typedef pair<int,int> pr;
signed main()
{
    SPEED;
    double a,b,h,m;
    cin>>a>>b>>h>>m;
    double ang=((h+m/60)/12-m/60)*2*pi;
    double dist=a*a+b*b-2*a*b*cosl(ang);
    cout<<fixed<<setprecision(9)<<sqrt(dist);
}
    

Measured memory_bytes: 4176
# -*- coding: utf-8 -*-

def foo 開始位置, 移動回数, 単位
  最適回数, 余り距離 = 開始位置.abs.divmod 単位
  if 単位 - 余り距離 < 余り距離
    余り距離 = 単位 - 余り距離
    最適回数 += 1
  end

  超過回数 = 移動回数 - 最適回数
  if 超過回数 <= 0
    (開始位置.abs - 移動回数 * 単位).abs
  else
    if 超過回数.even?
      余り距離
    else
      [
        (余り距離 + 単位).abs,
        (余り距離 - 単位).abs,
      ].min
    end
  end
end

puts foo(*gets.split.map(&:to_i))


Measured memory_bytes: 14476
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
using ll = long long int;

const int N_MAX = 305;
ll H[N_MAX];

int n, k;
ll dp[N_MAX][N_MAX];
const ll INF = 1E+15;

int main(){
    cin >> n >> k;
    H[0] = 0;
    for(int i = 1; i <= n; i++){
        cin >> H[i];
    }
    for(int j = 1; j <= n; j++)dp[j][0] = INF;
    dp[0][0] = 0;
    for(int i = 1; i <= n-k; i++){
        for(int j = i; j <= n; j++){
            dp[j][i] = INF;
            for(int l = i-1; l < j; l++){
                dp[j][i] = min(dp[j][i], dp[l][i-1] + max(0LL, H[j]-H[l]));
            }
        }
    }
    ll ans = INF;
    for(int j = n-k; j <= n; j++)ans = min(ans, dp[j][n-k]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4360
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define Little 1
const long long INF = 1LL<<60;
#define pairint pair<int,int>
signed main(){
  int x=0,y=100,z=0,w=0,n=0,m=0,o=0;
string s;
std::cin >> s;
if(s=="ABC")std::cout << "ARC" << '\n';
else std::cout << "ABC" << '\n';
}


Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char str[maxn];

int main(void) {
    while(~scanf("%s", str)) {
        for(int i = 0; str[i]; ++i) {
            if(i & 1) continue;
            putchar(str[i]);
        }
        puts("");
    }
}


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

#define MAXV 1000000007

int main() 
{
	int h, w;
    cin >> h >> w;
    
    char a[h][w];
    for(int i=0; i<h; ++i)
    	for(int j=0; j<w; ++j)
    		cin >> a[i][j];
    
    int paths[h][w];
    paths[0][0] = 1;

    // base case
    for(int i=1; i<h; ++i)
    {
        if(a[i][0] == '#')
    			paths[i][0] = 0;
    	else
    	    paths[i][0] = paths[i-1][0];
    }
    
    for(int i=1; i<w; ++i)
    {
        if(a[0][i] == '#')
    			paths[0][i] = 0;
    	else
    	    paths[0][i] = paths[0][i-1];
    }
    
    for(int i=1; i<h; ++i)
    {
    	for(int j=1; j<w; ++j)
    	{
    	    if(a[i][j] == '#')
    			paths[i][j] = 0;
    		else
    		    paths[i][j] = (paths[i-1][j] + paths[i][j-1]) % MAXV;
    	}
    }

    cout << paths[h-1][w-1] << "\n";
	return 0;
}


Measured memory_bytes: 5120
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
int sum[4500][4500] = {};
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x, y; 
    char c;
    cin >> x >> y >> c;
    if (c == 'W') y += k;
    x %= 2 * k;
    y %= 2 * k;
    for (int u = 0; u < 2; u++) {
      for (int v = 0; v < 2; v++) {
        sum[x + u * (2 * k)][y + v * (2 * k)]++;
      }
    }
  }
  for (int i = 0; i < 4200; i++) {
    for (int j = 0; j < 4200; j++) {
      sum[i][j + 1] += sum[i][j];
    }
  }
  for (int j = 0; j < 4200; j++) {
    for (int i = 0; i < 4200; i++) {
      sum[i + 1][j] += sum[i][j];
    }
  }
  int ans = 0;
  for (int i = 0; i < 2 * k; i++) {
    for (int j = 0; j < 2 * k; j++) {
      ans = max(ans, sum[i][j] + sum[i + k][j + k] - sum[i][j + k] - sum[i + k][j] + sum[i + k][j + k] + sum[i + k + k][j + k + k] - sum[i + k + k][j + k] - sum[i + k][j + k + k]);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 76032
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#include<complex>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
typedef complex<double> P;
P pin(){
	double x,y;
	cin>>x>>y;
	P p(x,y);
	return p;
}
void PIN(P* a,int i){
	rep(i,2)a[i]=pin();
}
double dot(P a,P b){
	return real(conj(a)*b);
}
double cross(P a,P b){
	return imag(conj(a)*b);
}
int main(){
	P a[2];
	PIN(a,2);
	int n;
	cin>>n;
	rep(i,n){
		P p2=pin();
		P p=a[1]-a[0];
		P t=a[0]+dot(p2-a[0],p)*p/norm(p);
		P ans=(t-p2)*2.0+p2;
		printf("%.9f %.9f\n",real(ans),imag(ans));
	}
		


}

Measured memory_bytes: 1268
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>


#define int long long
using namespace std;

typedef pair<int, int> P;

int Pow[100000];
int POW(int x) {
	if (x) {
		return POW(x - 1) * 2;
	}
	else {
		return 1;
	}
}
int A, B;
int a[100000], b[100000];
int x[100000], y[100000];
int ans;

signed main()
{
	for (int i = 0; POW(i) < 1e+13; i++) {
		Pow[i] = POW(i);
	}
	cin >> A >> B;
	/*for (int i = 0; i < 45; i++) {
		if (A&(1LL << i)) {
			a[i]++;
		}	
		if (B&(1LL << i)) {
			b[i]++;
		}
	}*/


	for (int i = 2; POW(i) < 4e+12; i++) {
		x[i] = A % Pow[i];
		y[i] = B % Pow[i];

		if (x[i] >= Pow[i - 1]) {
			if (y[i] >= Pow[i - 1]) {
				if ((x[i] - y[i]) % 2 == 0) {
					ans += Pow[i - 1];
				}
			}
			else {
				if (x[i] % 2 == 1) {
					ans += Pow[i - 1];
				}
			}
		}
		else {
			if (y[i] >= Pow[i - 1]) {
				if (y[i] % 2 == 0) {
					ans += Pow[i - 1];
				}
			}
		}
	}

	int Tem = 0;
	int i;
	i = x[2];
	while (i <= y[2] + 4) {
		if (i % 2) {
			Tem++;
		}
		i++;
	}
	ans += Tem % 2;

	cout << ans << endl;

	//system("pause");

	return 0;
}



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

signed main(){

	int n,res=1;
	cin >> n;
	int ans=0;
	while(n>=res){
		ans+=res;
		res*=2;
	}
	cout << ans;
}

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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
static const int INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int n, k;
    cin >> n >> k;

    vector<int> a(n, INF);
    int atmp, variety=0;
    for(int in=0;in<n;in++) {
        cin >> atmp; atmp--;
        if(a.at(atmp)==INF) { 
            a.at(atmp) = 1;
            variety++;
        }
        else a.at(atmp)++; 
    }

    sort(a.begin(), a.end());

    int ans = 0;
    for(int in=0;in<variety-k;in++) {
        ans += a.at(in);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
int main(void){
  while(1){
      char a = '\n';
      scanf("%c", &a);
     
       if('a' <= a && a <= 'z'){
           a = a - 32;
       }else if('A' <= a && a <= 'Z'){
           a = a + 32;
       }
 
      printf("%c", a);
      if(a == '\n') break;
   }
   
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
/*
template<class... T>
ostream& operator<<(ostream& os, tuple<T...>& t) {
	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {
		if (i) os << " ";
		os << get<0>(t);
	}
	return os;
}
*/
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

const ll mod = 1e4;

ll dp[501][500][2][11][3] = {0};

bool check(const string& s) {
	int n = s.size();
	vector<int> v;
	REP(i, n) {
		v.pb(s[i]-'0');
	}
	vector<int> d(n-1);
	REP(i, n-1) {
		d[i] = v[i+1]-v[i];
	}
	REP(i, n-1) {
		if (d[i] == 0) return false;
	}
	REP(i, n-2) {
		if ( d[i] * d[i+1] > 0 ) {
			return false;
		}
	}
	return true;
}

ll add(ll a, ll b) {
	if (a < 0) a += mod;
	if (b < 0) b += mod;
	if (a + b >= mod) return a + b - mod;
	return a + b;
}

int M;
ll f(const string& s) {
	int n = s.size();
	vector<int> v(n);
	REP(i, n) v[i] = s[i]-'0';

	fill(dp[0][0][0][0], dp[500][499][1][11], 0);
	dp[0][0][1][0][2] = 1;

	REP(i, n) REP(j, M) REP(k, 2) REP(pd, 11) REP(ud, 3) {
		if (dp[i][j][k][pd][ud] == 0) continue;
		int l = 0, r = 10;
//		if (i == 0) {
//			l = 1;
//		}
		if (k == 1) {
			r = v[i]+1;
		}
		for (int d = l; d < r; ++d) {
			int ni = i + 1;
			int nj = (j * 10 + d) % M;
			int nk = k == 1 && d == r-1 ? 1 : 0;
			int nud = d > pd ? 1 : 0;
			if (ud == 2 && pd == 0) {
				if (d == 0) nud = 2, nk = 0;
				else nud = 2;
			}
			else if (ud == 2) {
				if (d == pd) continue;
			}
			else {
				if (d == pd) continue;
				if (ud == nud) continue;
			}
//			cout << dp[i][j][k][pd][ud] << endl;
//			cout << i << " " << j << " " << k << " " << pd << " " << ud << endl;
//			cout << "->" << ni << " " << nj << " " << nk << " " << d << " " << nud << endl;
			dp[ni][nj][nk][d][nud] = add(dp[ni][nj][nk][d][nud], dp[i][j][k][pd][ud]);
		}
	}
	ll res = 0;
	REP(j, 2) REP(k, 11) REP(l, 3) {
		if (dp[n][0][j][k][l] == 0) continue;
//		cout << n << " " << 0 << " " << j << " " << k << " " << l << endl;
		res = add(res, dp[n][0][j][k][l]);
	}
	return res;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	string A, B; cin >> A >> B;
	cin >> M;
	ll ans = 0;
	if ( check(A) ) ++ans;
	ans = add(ans, -f(A));
	ans = add(ans, f(B));
//	cout << f("5") << endl;
//	cout << f("10") << endl;
	cout << ans << endl;
}

Measured memory_bytes: 132388
import java.util.Scanner;

public class Main {
	static int[] insertSort(int[] x) {
		int v,j;
		for(int i = 0;i < x.length;i++) {
			v = x[i];
			j = i - 1;
			while(j >= 0 && x[j] > v) {
				x[j + 1] = x[j];
				j--;
			}
			x[j + 1] = v;
			show(x);
		}
		return x;
	}
	static void show(int[] x) {
		for(int i = 0;i < x.length;i++) {
			System.out.print(x[i]);
			if(i + 1 != x.length) System.out.print(" ");
			else System.out.println();
		}
	}
	public static void main(String[] args) {
		Scanner number = new Scanner(System.in);
		int a  = number.nextInt();
		int[] x = new int[a];
		for(int i = 0;i < a;i++) {
			x[i] = number.nextInt();
		}
		insertSort(x);
	}
}



Measured memory_bytes: 34312
//#include "stdafx.h"
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int a, b;
	string str;
	cin >> a >> b;
	cin >> str;

	bool isOK = true;

	for (int i = 0; i < a + b + 1; i++)
	{
		if (i == a)
		{
			if (str[i] != '-') isOK = false; 
		}
		else
		{
			if (!('0' <= str[i] && str[i] <= '9')) isOK = false;
		}
	}
	cout << (isOK ? "Yes" : "No") << endl;

	return 0;
}



Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define LL long long
#define MOD 1000000007
#define INF 2000000000000
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
ll N, M, K, H, W, L, R, l, r, u, d, sum, Q;
LL ans;
LL no;
bool b, bb[100001];
string s, t;

int main() {
	cin >> s>>N;
	string sb, sf;
	LL con = 0;
	for (int i = 0; i < N; i++) {
		cin >> M;
		if (M == 1)con++;
		if (M == 2) {
			cin >> K >> t;
			if (K == 1) {
				if (con % 2 == 0)sf = t+sf;
				else sb = sb+t;
			}
			if (K == 2) {
				if (con % 2 == 0)sb = sb+t;
				else sf = t+sf;
			}
		}
	}
	s = sf + s + sb;
	if (con % 2 == 1)reverse(s.begin(), s.end());
	cout << s<<endl;
	return 0;
}



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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  LL x, y;
  cin >> x >> y;
  if(x > y) swap(x, y);
  if(x == 1){
	cout << (y==1? 1: y-2) << endl;
  }
  else{
	cout << max(x-2,0ll) * max(y-2, 0ll) << endl;
  }

  return 0;
}


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

int main() {
	string str;
	cin >> str;
	for(int i=0; i<str.size(); i++){
		if(i%2==0){
			if(str.at(i) == 'L'){
				cout << "No" << endl;
				return 0;
			}
		}else{
			if(str.at(i) == 'R'){
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}

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

int main(void){
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;

    int min_result{A*X+B*Y};

    for(int c{0}; c<=2*max(X, Y); c+=2){
        int result = C*c + A*(max(0, X-c/2)) + B*(max(0, Y-c/2));
        if( result < min_result){
            min_result = result;
        }
    }

    cout << min_result << endl;
}


Measured memory_bytes: 3644
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

int main() {
    int a;
    string s;
    cin >> a >> s;
    if (a>=3200) cout << s << endl;
    else cout << "red" << endl;
    return 0;
}























Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < (ll) b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= (ll) b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
 
const ll MAX= 3e3+100;

ll a[MAX],n,s,dp[MAX][MAX][3],mod=998244353;

int main(){
	fastio;
	cin>>n>>s;
	f(i,1,n+1) cin>>a[i];
	dp[0][0][0]=1;
	f(i,0,n){
		f(j,0,s+1){
			
			dp[i+1][j][0]=(dp[i+1][j][0]+dp[i][j][0])%mod;
			dp[i+1][j][1]=(dp[i+1][j][1]+dp[i][j][0]+dp[i][j][1])%mod;
			dp[i+1][j][2]=(dp[i+1][j][2]+dp[i][j][0]+dp[i][j][1]+dp[i][j][2])%mod;
		
			if(j+a[i+1]<=s) {
				dp[i+1][j+a[i+1]][1]=(dp[i+1][j+a[i+1]][1]+dp[i][j][0]+dp[i][j][1])%mod;
				dp[i+1][j+a[i+1]][2]=(dp[i+1][j+a[i+1]][2]+dp[i][j][0]+dp[i][j][1])%mod;
			}
			
		}
	}
	cout<<dp[n][s][2]<<endl;
  	return 0;	
}

Measured memory_bytes: 219392
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  bool flg = true;
  for (int i = 0; i < S.size(); i++){
    for (int j = i + 1; j < S.size(); j++){
      if (S[i] == S[j]) flg = false;
    }
  }
  if (flg) cout << "yes";
  if (!flg) cout << "no";
}

Measured memory_bytes: 256