akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<iomanip>

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

const int MOD = 1e9 + 7;
const int MAX = 1e9;
const ll LLMAX = 1e18;
const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const double PI = acos(-1.0);

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

// グループ
int main() {
    int x, y; cin >> x >> y;

    int a[] = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};

    if (a[x] == a[y]) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 3560
package main

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

func getNextLine(scanner *bufio.Reader) string {
	var buffer string
	for {
		line, isPrefix, _ := scanner.ReadLine()
		buffer += string(line)
		if isPrefix == false {
			break
		}
	}
	return buffer
}

func getIntList(scanner *bufio.Reader) []int {
	list := strings.Split(getNextLine(scanner), " ")
	l := len(list)
	result := make([]int, l)
	for i := 0; i < l; i++ {
		result[i], _ = strconv.Atoi(list[i])
	}
	return result
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := bufio.NewReader(fp)
	writer := bufio.NewWriter(os.Stdout)

	var n int
	fmt.Sscan(getNextLine(scanner), &n)
	ss := getIntList(scanner)

	max := 0
	for c := 1; c < n; c++ {
		score := 0
		for x := 0; x*c < n-1; x++ {
			a := n - 1 - x*c
			if a <= c {
				break
			}
			if (n-1)%c == 0 && n-1 <= 2*x*c {
				break
			}
			score += ss[x*c] + ss[n-1-x*c]
			if max < score {
				max = score
			}

		}
	}

	fmt.Fprintln(writer, max)

	writer.Flush()
}


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

int main()
{
	int D, N;
	cin >> D >> N;
	int base = pow(100, D);
	if (N <100)
	{
		cout << base * N << endl;
	}
	else {
		cout << base * 101 << endl;
	}
	return 0;
}


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

//?????°???????????????????????????????????§?????????????????????
//???????????????????????¨?????????????????????????¬????????????¨?????????????¢?????????????
//?????????????????????????????§?????????push???????????¨??????????????¨???????????????
//??????????¶???????????????????????????????????????????????????????????????§??????????????????

struct team{
    long long n,p,time;
};

bool operator<(const team& t1,const team& t2){
    if(t1.p==t2.p){
        return t1.n > t2.n;
    }
    return t1.p < t2.p;
}

priority_queue<team> q;
team tea[100001];

int main() {

    long long n,r,l;

    cin >> n >> r >> l;

    /*for(int i=0;i<r;i++){
        cout << rec[i].d << " " << rec[i].t << " " << rec[i].x << endl;
    }*/

    for(int i=1;i<=n;i++){
        tea[i].n = i;
        tea[i].p = 0;
        tea[i].time = 0;
        q.push(tea[i]);
    }

    int d,t,x,btime=0,bnum=1;
    team tmp;
    for(int i=0;i<r;i++){
        cin >> d >> t >> x;
        tea[bnum].time += t - btime; //?????°???????????????????????????????????§????????????????????????????¢??????????
        tea[d].p += x; //????????????
        q.push(tea[d]); //???????????\
        while(!q.empty()){
            tmp = q.top();
            if(tmp.p == tea[tmp.n].p){ //?????°????????´???????????£????????????
                bnum = tmp.n; //?????§????????????????????????????¨????
                break;
            }
            q.pop(); //??????
        }
        btime = t; //????????????????¨????
    }

    tea[bnum].time += l - btime ; //??????????????£???????????????????????????????¶????


    int ans=1;

    for(int i=1;i<=n;i++){
        ans = tea[i].time > tea[ans].time ? i : ans;
    }

    cout << ans << endl;

    return 0;
}

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

using ll=int64_t;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#ifdef MAROON_LOCAL
#define cerr (cerr<<"-- line "<<__LINE__<<" -- ")
#else
class CerrDummy{}cerrDummy;
template<class T>
CerrDummy& operator<<(CerrDummy&cd,const T&){
	return cd;
}
using charTDummy=char;
using traitsDummy=char_traits<charTDummy>;
CerrDummy& operator<<(CerrDummy&cd,basic_ostream<charTDummy,traitsDummy>&(basic_ostream<charTDummy,traitsDummy>&)){
	return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr<<"reached"<<endl
#define DMP(x) cerr<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))
#define ONE(x) memset(x,-1,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

ll read(){
	ll i;
	scanf("%" SCNd64,&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(ll x,int suc=1){
	printf("%" PRId64,x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341000];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341000];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(b<a)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

signed main(){
	int a=read(),b=read(),c=read();
	int w=max({a,b,c})*3,s=a+b+c;
	if((w-s)&1)w+=3;
	cout<<(w-s)/2<<endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n = int(input())

tmp = 10 ** 24
tmp2 = 1
tmp3 = 1
for i in range(1, 10 ** 6 + 1):
    if n % i == 0 and i + (n / i) < tmp:
        tmp = i + (n // i)
        tmp2 = i
        tmp3 = n // i
print(tmp2 + tmp3 - 2)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <complex>
#include <utility>
#include <algorithm>
using namespace std;

typedef pair<int, int> Point;

int dis(Point a, Point b){
  return abs((a.first - b.first) + (a.second - b.second));
}
int compass(Point a, Point b, Point c){
  if(a.first < b.first && c.second < b.second){ return 1; }
  if(a.second < b.second && c.first > b.first){ return 1; }
  if(a.first > b.first && c.second > b.second){ return 1; }
  if(a.second > b.second && c.first < b.first){ return 1; }
  return -1;
}

int main(void){
  while(true){
    int n;
    cin >> n;
    if(n == 0){ break; }
    ++n;
    
    // ??\??????????????????
    vector<vector<Point> > input(n);
    for(int i = 0; i < n; i++){
      int m;
      cin >> m;
      for(int j = 0; j < m; j++){
        int x, y;
        cin >> x >> y;
        input[i].push_back(Point(x, y));
      }
    }

    // ?????¢??¨???????????????????????????????????????
    vector<vector<int> > poly(n);
    for(int i = 0; i < n; i++){
      for(int j = 1; j < (int)input[i].size(); j++){
        poly[i].push_back(dis(input[i][j - 1], input[i][j]));
        if(j + 1 < (int)input[i].size()){
          poly[i].push_back(compass(input[i][j - 1], input[i][j], input[i][j + 1]));
        }
      }
    }

    // ?????´??????
    for(int i = 1; i < n; i++){
      if(poly[i].size() != poly[0].size()){ continue; }
      if(poly[i] == poly[0]){ cout << i << endl; }
      else{
        reverse(poly[i].begin(), poly[i].end());
        for(int j = 1; j < (int)poly[i].size(); j += 2){ poly[i][j] *= -1; }
        if(poly[i] == poly[0]){ cout << i << endl; }
      }
    }

    cout << "+++++" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3028
#define DEBUG 0
/**
 * File    : C.cpp
 * Author  : Kazune Takahashi
 * Created : 6/16/2019, 9:03:44 PM
 * Powered by Visual Studio Code
 */
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <functional>
#include <random>
#include <chrono>
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
typedef long long ll;
void Yes()
{
  cout << "Yes" << endl;
  exit(0);
}
void No()
{
  cout << "No" << endl;
  exit(0);
}
const int MAX_SIZE = 1000010;
class mint
{
public:
  static ll MOD;
  ll x;
  mint() : x(0) {}
  mint(ll x) : x(x % MOD) {}
  mint operator-() const { return x ? MOD - x : 0; }
  mint &operator+=(const mint &a)
  {
    if ((x += a.x) >= MOD)
    {
      x -= MOD;
    }
    return *this;
  }
  mint &operator-=(const mint &a) { return *this += -a; }
  mint &operator*=(const mint &a)
  {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint &operator/=(const mint &a) { return (*this *= power(MOD - 2)); }
  mint operator+(const mint &a) const { return mint(*this) += a; }
  mint operator-(const mint &a) const { return mint(*this) -= a; }
  mint operator*(const mint &a) const { return mint(*this) *= a; }
  mint operator/(const mint &a) const { return mint(*this) /= a; }
  bool operator<(const mint &a) const { return x < a.x; }
  bool operator==(const mint &a) const { return x == a.x; }
  const mint power(ll N)
  {
    if (N == 0)
    {
      return 1;
    }
    else if (N % 2 == 1)
    {
      return *this * power(N - 1);
    }
    else
    {
      mint half = power(N / 2);
      return half * half;
    }
  }
};
ll mint::MOD = 1e9 + 7;
istream &operator>>(istream &stream, mint &a) { return stream >> a.x; }
ostream &operator<<(ostream &stream, const mint &a) { return stream << a.x; }
mint inv[MAX_SIZE];
mint fact[MAX_SIZE];
mint factinv[MAX_SIZE];
void init()
{
  inv[1] = 1;
  for (int i = 2; i < MAX_SIZE; i++)
  {
    inv[i] = (-inv[mint::MOD % i]) * (mint::MOD / i);
  }
  fact[0] = factinv[0] = 1;
  for (int i = 1; i < MAX_SIZE; i++)
  {
    fact[i] = mint(i) * fact[i - 1];
    factinv[i] = inv[i] * factinv[i - 1];
  }
}
mint choose(int n, int k)
{
  if (n >= 0 && k >= 0 && n - k >= 0)
  {
    return fact[n] * factinv[k] * factinv[n - k];
  }
  return 0;
}
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
// const double epsilon = 1e-10;
// const ll infty = 1000000000000000LL;
// const int dx[4] = {1, 0, -1, 0};
// const int dy[4] = {0, 1, 0, -1};

ll W, H, x, y;

int main()
{
  // init();
  cin >> W >> H >> x >> y;
  double X = ((double)W) * H / 2;
  int ans;
  if (W % 2 == 0 && W / 2 == x && H % 2 == 0 && H / 2 == y)
  {
    ans = 1;
  }
  else
  {
    ans = 0;
  }
  cout << fixed << setprecision(12) << X << " " << ans << endl;
}

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

std::vector<int> GetInput() {
    int n = 0;
    std::vector<int> values;
    std::cin >> n;
    values.resize(n, 0.0);

    for (auto it = values.begin(); it < values.end(); it++) {
        std::cin >> *it;
    }
    return values;
}

void Display(std::vector<int> value) {
    int n = value.size();
    for (int i = 0; i < n; i++) {
        std::cout << value[i];
        if(i == n-1) {
            std::cout << std::endl;
        }
        else {
            std::cout << " ";
        }
    }
}

void InsertionSort(std::vector<int>& values) {
    for (int i = 1; i < values.size(); i++) {
        Display(values);
        int j = i - 1;
        int target_value = values[i];
        while(j >= 0 && target_value < values[j]) {
            values[j+1] = values[j];
            j--;
        }
        values[j+1] = target_value;
    }
    Display(values);
}

int main(int argc, char const* argv[])
{
    std::vector<int> values = GetInput();
    InsertionSort(values);

    return 0;
}

Measured memory_bytes: 3112
#include <vector>
#include <cstdio>
using namespace std;
typedef pair<int,int>pii;
main(){
    int n,x,i;
    for(;scanf("%d%d",&n,&x),n;printf("%d\n",x)){
        vector<pii>v;
        v.push_back(make_pair(x,1));
        for(i=1;i<n;i++){
            pii p=v.back();v.pop_back();
            scanf("%d",&x);
            if(i&1){
                if(x==p.first)
                    v.push_back(make_pair(x,p.second+1));
                else{
                    pii q=make_pair(0,0);
                    if(v.size())q=v.back(),v.pop_back();
                    v.push_back(make_pair(x,q.second+p.second+1));
                }
            }else{
                if(x==p.first)v.push_back(make_pair(x,p.second+1));
                else v.push_back(p),v.push_back(make_pair(x,1));
            }
        }
        for(x=i=0;i<v.size();i++){
            if(!v[i].first)x+=v[i].second;
        }
    }
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

const ll INF = 1LL << 58;
const int MAX_N = 112345;
struct Edge {
  int to;
  ll s;
};
vector<Edge> g[MAX_N];

int vis[2][MAX_N];
ll past[2][MAX_N];

ll ok;
ll mi, ma;
void dfs(int v, ll val, int mul) {
  if (mul == 0) {
    chmax(mi, 1 - val);
  } else {
    chmin(ma, val - 1);
  }

  // cout << v << " " << val << " " << mul << " " << mi << " " << ma << endl;

  if (vis[mul][v]) {
    if (past[mul][v] != val) {
      ok = 0;
    }
    return;
  }
  vis[mul][v] = 1;
  past[mul][v] = val;

  for (Edge e : g[v]) {
    dfs(e.to, e.s - val, 1 - mul);
  }
}

int main2() {
  REP(i, MAX_N) g[i].clear();

  int N = nextInt();
  int M = nextInt();
  REP(i, M) {
    int a = nextInt() - 1;
    int b = nextInt() - 1;
    ll s = nextInt();
    g[a].push_back({b, s});
    g[b].push_back({a, s});
  }

  CLR(vis, 0);
  mi = -INF;
  ma = INF;
  ok = 1;
  dfs(0, 0, 0);
  REP(i, N) {
    if (vis[0][i] && vis[1][i]) {
      if ((past[1][i] - past[0][i]) % 2 != 0) ok = 0;
      else {
        ll t = (past[1][i] - past[0][i]) / 2;
        chmax(mi, t);
        chmin(ma, t);
      }
    }
  }
  ll ans = max(0LL, (ma - mi + 1) * ok);
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 17408
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 20005;
int A[MAXN], B[MAXN], perm[MAXN];
int main()
{
	int n;
	cin>>n;
	for (int i = 1; i <= n; ++i)
	{
		cin>>perm[i];
		A[i] = B[i] = 1000000000;
	}
	int to_sub = n;
	for (int i = n; i >= 1; --i)
	{
		for (int j = 1; j < perm[i]; ++j)
			A[j]-=to_sub;
		for (int j = perm[i]+1; j <= n; ++j)
			B[j]-=to_sub;
		to_sub--;
	}
	for (int i = 1; i <= n; ++i)
		cout<<A[i]<<" ";
	cout<<"\n";
	for (int i = 1; i <= n; ++i)
		cout<<B[i]<<" ";
	cout<<"\n";
	return 0;
}

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

namespace Atcoder1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input1 = Console.ReadLine().Split(' ');
            int days = int.Parse(input1[0]);
            int homeworks = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            int[] eachdays = new int[homeworks];
            for(int i = 0; i < eachdays.Length; i++)
            {
                eachdays[i] = int.Parse(input2[i]);
            }

            int dayResult = 0;
            foreach(int each in eachdays)
            {
                dayResult += each;
            }

            Console.WriteLine(Check(days, dayResult));
        }

        static int Check(int num1, int num2)
        {
            if(num1 - num2 >= 0)
            {
                return num1 - num2;
            } else
            {
                return -1;
            }
        }
    }
}

Measured memory_bytes: 28504
#include <algorithm>  //sort
#include <iostream>
#include <regex>  //正規表現
#include <string>
#include <vector>

using namespace std;

int main() {
  string s;
  cin >> s;
  int l;

  l = s.size();
  int start, end;
  for (int i = 0; i < l; i++) {
    if (s.substr(i, 1) == "A") {
      start = i;
      break;
    }
  }
  for (int i = l - 1; i >= 0; i--) {
    if (s.substr(i, 1) == "Z") {
      end = i;
      break;
    }
  }
  cout << end - start + 1 << endl;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std ;
int main () {
    long N,a[110],x,y;
    x =1;
    y = pow(10,10);
    cin >> N;
    
    for(int i = 0; i < N; i++)
    {
        cin >> a[i];
        if(x <= a[i])x = a[i];
        if(y >= a[i])y = a[i];
    }
    cout << x-y <<endl;
    
} 

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

int main()
{
    vector<int> a(3);
    cin >> a.at(0) >> a.at(1) >> a.at(2);
    std::sort(a.begin(), a.end(), greater<int>());
    cout << a.at(0) - a.at(2) << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;//例: VVI dp(10, vector<int>(10, INF);
typedef priority_queue<int, vector<int>, less<int> > QUE_int;
const int INF = 2 * pow(10, 9) + 1;//+1しないとREになるかも(out of rangeになるんかな?? )

vector<int> dx = { -1, 0, 1, 0, -1, -1, 1, 1 };
vector<int> dy = { 0, -1, 0, 1, -1, 1, -1, 1 };

ll max(ll a, ll b) { return (a > b) ? a : b; }
ll min(ll a, ll b) { return (a < b) ? a : b; }

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = pow(10, 9) + 7;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x%mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		assert(n < mod);
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
};


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




	

int main(void) {
	ll k;
	cin >> k;
	if(k<=9){
		cout << k << endl;
		return 0;
	}

	ll ans = 0;
	queue<ll> q;
	for(int i=1; i<=9; i++) q.push(i);
	ans = 9;
	while(1){
		ll size = q.size();
		ll count = 0;
		for(int loop=0; loop<size; loop++){
			ll num = q.front(); q.pop();
			ll digit = num % 10;
			for(int i=-1; i<=1; i++){
				if(digit+i < 0 || 9<digit+i) continue;
				ll new_num = num*10 + (digit+i);
				q.push(new_num);
				count++;
				if(ans+count == k){
					cout << new_num << endl;
					return 0;
				}
			}
		}
		ans += count;
	}
	
}




Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(a) cout<<#a<<":"<<a<<endl;
const ll INF=0x3f3f3f3f;
const ll N=1e6+7;
const ll mod=1e9+7;
ll maxn,minn;
ll T,n,m;
ll dp[N];
ll w[N];
ll v[N];

ll arr[N],ans[N]; //对应原数组和树状数组

ll lowbit(ll x){
    return x&(-x);
}

void update(ll i,ll k){    //在i位置加上k
    while(i<=n){
        ans[i]=max(ans[i],k);
        i=i+lowbit(i);
    }
}

ll query(ll i){        //求arr[1 - i]的和
    ll res = 0;
    while(i>0){
        res=max(res,ans[i]);
        i =i-lowbit(i);
    }
    return res;
}

int main(){
	cin>>n;
	for(ll i=1;i<=n;i++){
		scanf("%lld",w+i);
	}
	for(ll i=1;i<=n;i++){
		scanf("%lld",v+i);
	}
	for(ll i=1;i<=n;i++){
		dp[i]=v[i]+query(w[i]);
		maxn=max(maxn,dp[i]);
		update(w[i],dp[i]);
	}
	cout<<maxn<<endl;


	return 0;
}





Measured memory_bytes: 14208
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
N,A,B=input_int_list()
r=N//(A+B)
if A==0:
    print(0)
    exit()
    
if N-r*(A+B)<=A:
    ans=N-B*r
else:
    ans=A*(r+1)

print(ans)

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

int main(){
  double n,m,d;
  cin>>n>>m>>d;
  
  double base = 0;
  if( d== 0 ){
    base = 1.0/n;
  }else  if( n-d-d > 0 ){
    base = (1.0/n)*(d/n) + (1.0/n)*(d/n) + (2.0/n)*((n-d-d)/n);
  }else{
    base = 1.0/n;
  }
  
  printf("%.10f\n",base * (m-1.0) );
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
            using namespace std;
            #define int long long
            #define fi first
            #define se second
            #define pi pair<int,int>  
            #define pb push_back

            // dont forget to initialize global variables inside main() ;
            

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

            int tt=1;      
            
            while( tt-- ){

                int r,c,k;cin>>r>>c>>k;
                vector<vector<int> > g(r+1,vector<int>(c+1));

                for(int i=0;i<k;i++){
                    int x,y,z;
                    cin>>x>>y>>z;
                    g[x][y] = z;
                }

                vector<vector<vector<int> > > dp(r+1,vector<vector<int > > (c+1,vector<int >(4)));

                for(int i=1;i<=r;i++){
                    for(int j=1;j<=c;j++){
                        int x=0;int xx=0;
                        for(int l=0;l<4;l++){
                            x = max( x,dp[i-1][j][l] );
                            xx = max( xx , dp[i][j-1][l]);
                        }
                            dp[i][j][0] = max( dp[i][j-1][0],x );
                            if( g[i][j]!=0 )
                                dp[i][j][1] = max( g[i][j] + max( dp[i][j-1][0],x ) , dp[i][j-1][1] ) ;
                            else
                                dp[i][j][1] = dp[i][j-1][1];
                            for(int k=2;k<4;k++){
                                if( g[i][j]!=0 )
                                    dp[i][j][k] = max( g[i][j] + dp[i][j-1][k-1], dp[i][j-1][k] ) ;
                                else
                                    dp[i][j][k] = dp[i][j-1][k];
                            }
                        
                    }
                }

                cout<< max({dp[r][c][0] , dp[r][c][1] , dp[r][c][2] , dp[r][c][3] }) << endl;

            }
            return 0;
        }

                    
     

Measured memory_bytes: 706640
#include<iostream>
using namespace std;
int main(){
	int N,K,R,S,P,te[100000],res[100000],sum=0;
	bool able[3];
	string T;
	cin>>N>>K>>R>>S>>P>>T;
	for(int i=0;i<N;i++){
		if(T[i]=='r')te[i]=0;
		else if(T[i]=='s')te[i]=1;
		else if(T[i]=='p')te[i]=2;
	}
	for(int i=0;i<N;i++){
		res[i]=te[i];
		if(i-K>=0&&res[i]==res[i-K]){
			able[0]=able[1]=able[2]=true;
			able[res[i-K]]=false;
			if(i+K<N)able[te[i+K]]=false;
			for(int j=0;j<3;j++){
				if(able[j])res[i]=j;
			}
		}
	}
	for(int i=0;i<N;i++){
		if(te[i]==res[i]){
			if(te[i]==0)sum+=P;
			else if(te[i]==1)sum+=R;
			else sum+=S;
		}
	}
	cout<<sum;
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <string>
int main() {
  std::string s;
  std::cin >> s;
  int ans = 700;
  for (int i = 0; i < 3; i++) {
    if (s[i] == 'o') ans += 100;
  }
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
static const int64_t INFL = 0x3F3F3F3F3F3F3F3FLL;
typedef int64_t ll;
struct Solution {
    void solve(std::istream& in, std::ostream& out) {
        ll x;
        in >> x;
        ll mt = INFL;
        for (ll t = x; t >= 1; t--) {
            if (x > t * (t - 1) / 2) {
                mt = t;
                break;
            }
        }
        out << mt << '\n';
    }
};
void solve(std::istream& in, std::ostream& out) {
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}
#include <fstream>
#include <iostream>
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    istream& in = cin;
    ostream& out = cout;
    solve(in, out);
    return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  rep(i, 1, n + 1) if(i % 5 != 0 && i % 3 != 0) ans = ans + i;
  cout << ans << endl;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	string S;
	cin >> S;

	ll mod = 998244353;
	ll kotae = 0;
	ll kari = N * 2;
	ll kosuu = 0;
	rep(i, N) {
		kosuu = kosuu * 2 % mod;
		if (S[i] == '1') kosuu++;
	}
	kosuu = (kosuu + 1) % mod;
	kotae = kari * kosuu % mod;

	ce(kotae);

	ll are[400200] = {};
	for (int i = 2; i <= N * 2 / 3; i += 2) {

		if (N % i == i / 2) {
			ll dp[200001][2] = {};
			dp[0][0] = 1;

			rep(j, i / 2) {
				if (S[j] == '1') {
					dp[j + 1][0] += dp[j][0];
					dp[j + 1][1] += dp[j][0];
					dp[j + 1][1] += dp[j][1];
					dp[j + 1][1] += dp[j][1];
				}
				else {
					dp[j + 1][0] += dp[j][0];
					dp[j + 1][1] += dp[j][1];
					dp[j + 1][1] += dp[j][1];
				}
				dp[j + 1][0] %= mod;
				dp[j + 1][1] %= mod;
			}

			ll kazu = (are[i] + dp[i / 2][1]) % mod;

			int OK = 1;
			for (int j = i / 2; j < N; j++) {
				if (j / (i / 2) % 2 == 0) {
					if (S[j] == '1') {
						if (S[j % (i / 2)] == '0') break;
					}
					else {
						if (S[j % (i / 2)] == '1') {
							OK = 0;
							break;
						}
					}
				}
				else {
					if (S[j] == '1') {
						if (S[j % (i / 2)] == '1') break;
					}
					else {
						if (S[j % (i / 2)] == '0') {
							OK = 0;
							break;
						}
					}
				}
			}

			if (OK) kazu = (kazu + 1) % mod;

			for (int j = i + i + i; j <= N; j += i + i) {
				are[j] = (are[j] - kazu + mod) % mod;
			}

			kotae = (kotae - kazu * (kari - i + mod) % mod + mod) % mod;
		}
	}

	co(kotae);


	Would you please return 0;
}

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

using namespace std;

#define TRACE(x) x
#define WATCH(x) TRACE( cout << #x" = " << x << endl)
#define PRINT(x) TRACE(printf(x))
#define WATCHR(a, b) TRACE( for(auto c = a; c != b;) cout << *(c++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end()); } )

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define sz(v) (int) (v).size()
#define rep(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define pb push_back
#define mp make_pair

using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

constexpr int inf = 0x3f3f3f3f;
constexpr ll MOD = 1e9 + 7LL;
constexpr double tol = 1e-8;

void buff() { ios::sync_with_stdio( false ); cin.tie(nullptr); }

vector< long long > dp[2];

int main() 
{
    buff();
    int n, k;
    cin >> n >> k;
    vector< int > a(n);
    for(int& x : a) cin >> x;

    for(int i = 0; i < 2; ++i) dp[i].assign( k + 1, 0LL );
    for(int i = 0; i <= a[0]; ++i) dp[0][i] = 1LL;
    
    for(int i = 1; i < n; ++i)
    {
        int cur = ( i & 1 );
        int opo = cur ^ 1;
        fill( all(dp[cur]), 0 );
        vector< ll > acc(k + 1);
        partial_sum( all(dp[opo]), acc.begin() );
        
        for(int q = 0; q <= k; ++q)
        {
            long long resp = (acc[q] % MOD);
            int mn = max(0, q - a[i] );
            if( mn > 0 ) resp = ( resp + MOD - (acc[ mn - 1 ]%MOD) ) % MOD;
            dp[cur][q] = resp; 
        }
    }

    cout << dp[!(n&1)][k] << '\n';
    
    return 0;
}



Measured memory_bytes: 2672
import math
a,b,x = map(int,input().split())
s = a*a*b
if x*2 < s :
    ans = 90 - math.degrees(math.atan(2*x/(a*b*b)))
elif x == s :
    ans = 0
else :
    ans = 90 - math.degrees(math.atan(a**3/(s-x)/2))
print(ans)

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

int main() {
	int n;cin>>n;
	int t[n],v[n];
	for(int i=0;i<n;i++)cin>>t[i];
	for(int i=0;i<n;i++)cin>>v[i];
	int first[n],last[n+1];
	last[n]=0;
	int exspeed=0;
	for(int i=0;i<n;i++){
		if(exspeed+t[i]<=v[i]){
			first[i]=exspeed+t[i];
		}else{
			first[i]=v[i];
		}
		exspeed=first[i];
	}
	exspeed=0;
	for(int i=n-1;i>=0;i--){
		if(exspeed+t[i]<=v[i]){
			last[i]=exspeed+t[i];
		}else{
			last[i]=v[i];
		}
		exspeed=last[i];
	}
	int speed[n+1];
	exspeed=0;
	for(int i=0;i<n;i++){
		if(first[i]<=last[i+1]){
			speed[i]=first[i];
		}else{
			speed[i]=last[i+1];
		}
	}
	double ans=0;
	exspeed=0;
	for(int i=0;i<n;i++){
		if(exspeed+t[i]==speed[i]){
			ans+=double(exspeed+speed[i])*t[i]/2;
		}else{
			if(t[i]>=v[i]-exspeed+v[i]-speed[i]){
				ans+=double(t[i]-2*v[i]+exspeed+speed[i])*v[i]+double(exspeed+v[i])*(v[i]-exspeed)/2+double(v[i]+speed[i])*(v[i]-speed[i])/2;
			}else{
				double ve=double(t[i]+speed[i]+exspeed)/2;
				ans+=double(exspeed+ve)*(t[i]+speed[i]-exspeed)/2/2+(ve+speed[i])*(t[i]+exspeed-speed[i])/2/2;
			}
		}
		exspeed=speed[i];
	}
	cout<<setprecision(15)<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
#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 rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
//const int MAX=;

int N;
double ans;

void input(){
	cin>>N;
	rep(i,N){
		double a;
		cin>>a;
		ans+=1/a;
	}
	ans=1/ans;
  	cout<<fixed;
	cout<<setprecision(12)<<ans;
}

void solve(){

}

void output(){
  
}

int main(){
  input();
  solve();
  output();
}

Measured memory_bytes: 256
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

using P = tuple<ll, ll, ll>;

int main()
{
    IN(ll, N);
    AIN(string, S, N);
    vector<P> T;
    REP(i, N)
    {
        ll d = 0;
        ll m = 0;
        FOR(c, S[i])
        {
            if (c == '(')
            {
                ++d;
            }
            else
            {
                --d;
            }
            if (d < 0)
            {
                CH(max, m, -d);
            }
        }
        ll p;
        if (d >= 0)
        {
            p = -INF;
        }
        else
        {
            p = -(m + d);
        }
        T.push_back({p, m, d});
    }
    SORT(T);
    ll x = 0;
    for (auto [_, m, d] : T)
    {
        if (x < m)
        {
            OUT("No");
            return 0;
        }
        x += d;
    }
    YES(x == 0);
}

Measured memory_bytes: 59044
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;

lli mod197 = 1000000007LL;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {

  lli A,B,C;
  cin >> A >> B >> C;
  
  COUT(min(C,B / A));
  
	return 0;
}


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

using namespace std;

bool ok;
vector<int> ans;
vector<int> a;

void rec(int sum, vector<int> cnt, vector<int> v) {
  
  if(sum == 0) {
    ans = v;
    ok = true;
    return;
  }
  
  for(int i=1; i<=13; i++) {
    if(cnt[i] && sum % i == 0) {
      v.push_back(i);
      cnt[i] --;
      rec(sum-i, cnt, v);
      if(ok) return;
      cnt[i] ++;
      v.pop_back();
    }
  }
  
}

int main() {
  int n;
  
  while(cin >> n && n) {
    vector<int> a(n);
    vector<int> cnt(14, 0);
    int sum = 0;
    for(int i=0; i<n; i++) {
      cin >> a[i];
      cnt[a[i]] ++;
      sum += a[i];
    }
    
    ok = false; rec(sum, cnt, vector<int>());
    
    if(ok) {
      reverse(ans.begin(), ans.end());
      int const N = ans.size();
      for(int i=0; i<N; i++) {
	if(i) cout << " " << ans[i];
	else cout << ans[i];
      }
      cout << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
  
  return 0;
}

Measured memory_bytes: 1240
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int N, K;

	cin >> N >> K;

	int ans = -1e9;
	vector<int> D(N), jewels;

	for (int i = 0; i < N; i++)
	{
		int v;
		cin >> D[i];
	}
	//s個取り出し最大K-s個負の宝石を入れるとする。
	for (int s = 0; s <= K && s <= N; s++) {

		//左側l個,右側s個とる
		for (int l = 0; l <= s; l++)
		{
			jewels.clear();
			for (int i = 0; i < l; i++) {
				jewels.push_back(D[i]);
			}
			for (int i = 0; i < s - l; i++) {
				jewels.push_back(D[N - 1 - i]);
			}		
			//ソートして負のものを詰めなおす
			sort(jewels.begin(), jewels.end());
			int count = 0;
			for (int i = 0; i< jewels.size(); i++) {
				if (i < K - s && jewels[i] < 0) continue;
				count += jewels[i];
			}
			if (ans < count) ans = count;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

typedef pair<int, int> P;
#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 1234567890

const int maxn = 2e5 + 10;


//initialization here
//


//
//initialization finish


// your function is here
//



//
// your function finished



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

	// your code is here
	//
	
	string a, b, c; cin >> a >> b >> c;

	cout << a[0] << b[0] << c[0] << endl;
	
	//
	// your code finished

	return 0;
}

Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

import heapq

def dijkstra(s,n,w,cost):
    #始点sから各頂点への最短距離
    #n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0
    
    while True:
        v = -1
        #まだ使われてない頂点の中から最小の距離のものを探す
        for i in range(n):
            if (not used[i]) and (v == -1):
               v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
               break
        used[v] = True
               
        for j in range(n):
               d[j] = min(d[j],d[v]+cost[v][j])
    return d

def warshall_floyd(n,d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d





x,y,a,b,c = m()

al = []

p = l()

q = l()

r = l()

p = [[p[i],1] for i in range(a)]

q = [[q[i],2] for i in range(b)]

r = [[r[i],3] for i in range(c)]



al = []

for i in range(a):
    al.append(p[i])


for i in range(b):
    al.append(q[i])

for i in range(c):
    al.append(r[i])

al.sort(reverse = True)
ans = 0
coa = 0
cob = 0
coc = 0
i = 0

while i <= a+ b+ c:
    on = al[i]
    if on[1] == 1:
        if coa == x:
            i += 1
            continue
        else:
            coa += 1
            ans += on[0]

    elif on[1] == 2:
        if cob == y:
            i += 1
            continue
        else:
            cob += 1
            ans += on[0]

    else:
        coc += 1
        ans += on[0]
    
    if coa + cob + coc == x+y:
        print(ans)
        exit()
    
    i += 1



    

Measured memory_bytes: 121316
N = int(input())
a_list = sorted(list(map(int, input().split())))
a_max = a_list[-1]

count = [0] * (a_max+1)

for a in a_list:
  for j in range(a, a_max+1, a):
    count[j] += 1
  
ans = 0
for a in a_list:
  if count[a] == 1:
    ans += 1
print(ans)

Measured memory_bytes: 32236
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); ++i)
typedef long long ll;
using namespace std;

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



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

int main() {
	int D, C[26];
	cin >> D;
	for (int i = 0; i < 26; i++) cin >> C[i];
	vector<int> L(26, -1);
	vector<vector<int> > S(D, vector<int>(26));
	for (int i = 0; i < D; i++) {
		for (int j = 0; j < 26; j++) cin >> S[i][j];
	}
	for (int i = 0; i < D; i++) {
		long long MAX = -1000000000000000, ID = -1;
		for (int j = 0; j < 26; j++) {
			if (MAX < S[i][j] + C[j] * 15 * (i - L[j]) / 2) MAX = S[i][j] + 15 * C[j] * (i - L[j]) / 2, ID = j;
		}
		L[ID] = i;
		cout << ID + 1 << endl;
	}
}

Measured memory_bytes: 3684
#include <iostream>
using namespace std;
int main(void) {
	long long a, b, s, x;
	while (cin >> a >> b) {
		x = 0;
		s = a + b;
		while (s >= 1) {
			x++;
			s = s / 10;
		}
		cout << x << endl;
	}
	return 0;
}

Measured memory_bytes: 2960
MOD = 10**9 + 7
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)] + [N + 1]
dp = [0] * (N + 1)
dp[0] = 1
s = -1

for broken in a:
    for j in range(s + 1, broken):
        if j > s + 1:
            dp[j] += dp[j - 1] % MOD
        if j > 1:
            dp[j] += dp[j - 2] % MOD
        dp[j] %= MOD
    s = broken

print(dp[-1])

Measured memory_bytes: 82332
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
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;}

// 0 false, 1 true 
// string to int : -48
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    //std::cout << std::fixed << std::setprecision(15);
    long double a, b, c;
    cin >> a >> b >> c;

    if(a + b + 2 * sqrtl((long double)a * (long double) b) < c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    /*
    long double tmp_a = sqrtl((long double)a);
    long double tmp_b = sqrtl((long double)b);
    long double tmp_c = sqrtl((long double)c);
    */

    /*
    if(sqrtl((long double)c) - sqrtl((long double)a) - sqrtl((long double)b) > 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    */

    /*
    if(a + b + (2 * sqrt(a*b)) < c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    */

    
    /*
    double tmp_a = sqrt(a);
    double tmp_b = sqrt(b);
    double tmp_c = sqrt(c);
    
    cout << tmp_a << endl;
    cout << tmp_b << endl;
    cout << tmp_c << endl;
    
    if(tmp_a + tmp_b < tmp_c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    double x = 1000000000 * 1000000000;
    cout << x << endl;
    */
    

}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [SL() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if len(args) > 0 else [default for _ in range(n)]

dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
MOD = 1000000007
INF = float("inf")

sys.setrecursionlimit(1000000)

class UnionFind:
    def __init__(self, N): self.N, self.root, self.rank = N, [-1] * N, [0] * N
    def __repr__(self): return '\n'.join(f"{r}: {self.members(r)}" for r in self.roots())

    def find(self, x):
        while self.root[x] >= 0: x = self.root[x]
        return x

    def union(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y: return
        if self.rank[x] > self.rank[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
        if self.rank[x] == self.rank[y]: self.rank[y] += 1

    def same(self, x, y): return self.find(x) == self.find(y)
    def count(self, x): return -self.root[self.find(x)]
    def members(self, x): return [i for i in range(self.N) if self.same(x, i)]
    def roots(self): return [i for i, x in enumerate(self.root) if x < 0]
    def num_of_groups(self): return len(self.roots())
    def all_groups(self): return {r: self.members(r) for r in self.roots()}


def main():
    N, Q = LI()
    TUV = LIR(Q)

    uf = UnionFind(N+1)

    for t, u, v in TUV:
        if t == 0:
            uf.union(u, v)
        else:
            print(int(uf.same(u, v)))

if __name__ == '__main__':
    main()

Measured memory_bytes: 109968