akhauriyash/Code-Regression huggingface dataset:
<?php
$s = str();
echo $s[0] != $s[1] || $s[1] != $s[2] ? "Yes" : "No";
function str(){
  return trim(fgets(STDIN));
}
function ints(){
  return array_map("intval", explode(" ", trim(fgets(STDIN))));
}
function int(){
  return intval(trim(fgets(STDIN)));
}
function chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}
function chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}

function o(...$val){
    if(count($val)==1)$val = array_shift($val);
    $trace = debug_backtrace();
    echo $trace[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0){
            echo "empty array";
        }elseif(!is_array(current($val))){
            echo "array: ";
            echo implode(" ", addIndex($val))."\n";
        }else{
            echo "array:array\n";
            if(isCleanArray($val)){
                foreach($val as $row)echo implode(" ", addIndex($row))."\n";
            }else{
                foreach($val as $i => $row)echo "[".$i."] ".implode(" ", addIndex($row))."\n";
            }
        }
    }else{
        echo $val."\n";
    }
}
function addIndex($val){
    if(!isCleanArray($val)){
        $val = array_map(function($k, $v){return $k.":".$v;}, array_keys($val), $val);
    }
    return $val;
}
function isCleanArray($array){
    $clean = true;
    $i = 0;
    foreach($array as $k => $v){
        if($k != $i++)$clean = false;
    }
    return $clean;
}
/**
 * 座圧対象の配列を渡すと以下の値を返す
 * ・圧縮された配列
 * ・復元用のMap
 * ・圧縮用のMap
 **/
function atsu($array){
    $a = array_flip($array);
    $fuku = array_flip($a);
    sort($fuku);
    $atsu = array_flip($fuku);
    foreach($array as $i => $val)$array[$i] = $atsu[$val];
    return [$array, $fuku, $atsu];
}
//配列の最大公約数
function gcdAll($array){
    $gcd = $array[0];
    for($i = 1; $i < count($array); $i++){
        $gcd = gcd($gcd, $array[$i]);
    }
    return $gcd;
}

//最大公約数
function gcd($m, $n){
    if(!$n)return $m;
    return gcd($n, $m % $n);
}

//配列の最小公倍数
function lcmAll($array){
    $lcm = $array[0];
    for($i = 1; $i < count($array); $i++){
        $lcm = lcm($lcm, $array[$i]);
    }
    return $lcm;
}

//最小公倍数
function lcm($a, $b) {
    return $a / gcd($a, $b) * $b;
}
//ビットカウント-1の数を数える
function popcount($x){
    $con = 0;
    while ($x) {
        $x &= $x-1;
        ++$con;
    }
    return $con;
}

Measured memory_bytes: 4728
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<complex>

using  ll = long long;
using ull = unsigned long long;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define rep(i,n) REP(i,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep(i,n) RREP(i,n)
#define mp make_pair
#define fi first
#define sc second

ll M,K;
bool used[1 << 20];
int main(){
  cin >> M >> K;
  ll N = (1 << M);

  if (K >= N) {
    printf("-1\n");
    return 0;
  }

  if (M == 1) {
    if (K >= 1)
      printf("-1\n");
    else
      printf("0 0 1 1\n");
    return 0;
  } 

  if (K == 0) {
    rep (i,N) {
      printf("%d %d ", i, i);
    }
    printf("\n");
    return 0;
  }

  ll p = 0;
  rep(i,N/4) {
    while(used[p])p++;
    ll a = p;
    ll q = a + 1;
    while(used[q] || (a ^ K) == q)q++;
    ll b = q;

    used[a] = used[b] = used[a ^ K] = used[b ^ K] = true;
    
    printf("%lld %lld %lld %lld %lld %lld %lld %lld ", a, a ^ K, b, b ^ K, a ^ K, a, b ^ K, b);
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define MAX 200010

using namespace std;

int gotown(long long int& count, int *townmap, int *route, int index)
{
  vector <int> path;
  long long int towntime = 1;
  while (route[index] == 0 && count != 0){
    path.push_back(index);
    route[index] = towntime;
    index = townmap[index];
    towntime++;
    count--;
  }
  return ((count == 0)? index : path[(count % (towntime - route[index])) + route[index] - 1]); 
}

int main(void)
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int townnum, townmap[MAX], route[MAX] = {0};
  long long int count;
  cin >> townnum >> count;
  for (int i = 1; i <= townnum; i++)
    cin >> townmap[i];
  cout << gotown(count, townmap, route, 1) << '\n';
  return 0;
}


Measured memory_bytes: 5804
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[3001][3001] = {};
bool used[3001][3001] = {};
ll a[3001] = {};

ll solve(int l, int r, bool turn){
  if(l>r) return 0;
  if(used[l][r]) return dp[l][r];

  used[l][r] = true;
  ll ret;
  if(turn){
    ret = max(a[l] + solve(l+1, r, !turn), a[r] + solve(l, r-1, !turn));
  }else{
    ret = min(-a[l] + solve(l+1, r, !turn), -a[r] + solve(l, r-1, !turn));
  }
  dp[l][r] = ret;
  return dp[l][r];
}

int main(){
  int n;
  cin >> n;
  for(int i=0; i<n; i++)
    cin >> a[i];
  cout << solve(0, n-1, true) << endl;
}


Measured memory_bytes: 78464
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

ll a[1234],ans=0ll;
vector<ll> v;

int main(void){
	int n,m=0,c,k,i,j;
	a[0] = 0ll;
	cin >> n;
	cin >> k;
	for(i=0; i<n; ++i){
		cin >> a[i+1];
		a[i+1] += a[i];
	}
	for(i=0; i<n; ++i){
		for(j=i; j<n; ++j){
			v.push_back(a[j+1]-a[i]);
			++m;
		}
	}
	for(i=60; i>=0; --i){
		c = 0;
		for(j=0; j<m; ++j){
			if(v[j]&(1ll<<i)){
				++c;
			}
		}
		if(c>=k){
			ans += (1ll<<i);
			for(j=0; j<m; ++j){
				if(!(v[j]&(1ll<<i))){
					v[j] = 0ll;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 6512
import sys


n,u,v = [int(_) for _ in input().split()]
dic = {}
for i in range(n-1):
    a,b = [int(_) for _ in input().split()]
    if a in dic:
        dic[a].append(b)
    else:
        dic[a] = [b]
    if b in dic:
        dic[b].append(a)
    else:
        dic[b] = [a]
# print(dic)
que = []
seen = {}
dic2 = {}
way = {}
ans_l = []
for i in range(1,n+1):
    seen[i] = 0
    dic2[i] = 0
    way[i] = 0
# print(seen)
que.append(v)
seen[v] = 1
while len(que) != 0:
    tem_v = que.pop()
    d = dic2[tem_v]
    if len(dic[tem_v]) == 1 and seen[dic[tem_v][0]] == 1:
        ans_l.append((tem_v, d))
        # print(tem_v, dic[tem_v])
    for node in dic[tem_v]:
        if seen[node] == 0:
            que.append(node)
            seen[node] = 1
            dic2[node] = d + 1
# print(dic2)
# print(seen)
ans_l = sorted(ans_l, reverse=True, key=lambda x: x[1])
# print(ans_l)
d_taka = dic2[u]
# print(d_taka)
que.append(u)
way[u] = 1
while len(que) != 0:
    tem_u = que.pop()
    d = dic2[tem_u]
    for node in dic[tem_u]:
        if dic2[node] < d:
            que.append(node)
            way[node] = 1
# print(way)
for i in range(len(ans_l)):
    node, tem_d = ans_l[i]
    que.append(node)
    while len(que) != 0:
        tem_u = que.pop()
        d = dic2[tem_u]
        if way[tem_u] == 1:
            ans = tem_u
        else:
            for node2 in dic[tem_u]:
                if way[node2] == 1:
                    ans = node2
                if dic2[node2] < d and way[node2] == 0:
                    que.append(node2)
    # print('ans', ans)
    if dic2[ans] * 2 > d_taka:
        print(tem_d - 1)
        sys.exit()



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

int main() {
  int N;
  cin >> N;
  vector<int> p(N);
  for(int i=0 ;i<N ;i++){
    cin >> p.at(i);
  }
  
  int min=1000000;
  int sum;
  
  for(int i=1;i <= 100;i++){
    for(int j=0 ;j<N ;j++){
      sum += (i-p.at(j)) * (i-p.at(j));
    }
    if(sum <= min){
      min = sum;
    }
    
   sum = 0;
  }
  
  cout << min << endl;
	return 0;
}


Measured memory_bytes: 3640
import numpy as np

A_init = 500
B_init = 100
C_init = 50

A_n = int(input())
B_n = int(input())
C_n = int(input())

X = int(input())

cnt = 0
for a in range(A_n+1):
    if A_init * a <= X:
        for b in range(B_n+1):
            if (A_init * a + B_init * b) <= X:
                for c in range(C_n+1):
                    if (A_init * a + B_init * b + C_init * c) == X: cnt += 1
            else:
                break
    else:
        break
# print(np.count_nonzero([k+[i for i in All_list] == X for k in All_list]))
print(cnt)

Measured memory_bytes: 26964
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
const int INF=1e9;
struct edge{
    int to,cost;
    edge(int a,int b):to(a),cost(b){}
    edge(){}
};
struct data{
    int At,cost;
    data(int a,int b):At(a),cost(b){}
    data(){}
    bool operator>(const data &d)const{
        return cost>d.cost;
    }
};
vector<vector<edge> >E;
int all;
int dijkstra(int s){
    vector<int>D(all,INF);
    priority_queue<data,vector<data>,greater<data> >Q;
    Q.push(data(s,0));
    while(!Q.empty()){
        int At=Q.top().At,cost=Q.top().cost;
        Q.pop();
        if(D[At]<=cost)continue;
        D[At]=cost;
        for(int i=0;i<E[At].size();i++){
            edge e=E[At][i];
            Q.push(data(e.to,e.cost+cost));
        }
    }
    int sum=0;
    for(int i=0;i<all;i++)sum+=D[i];
    return sum;
}
int main(){
    int n;
    while(cin>>n,n){
        E.clear();
        E.resize(10);
        all=0;
        for(int i=0;i<n;i++){
            int a,b,c;
            cin>>a>>b>>c;
            all=max(max(a,b),all);
            E[a].push_back(edge(b,c));
            E[b].push_back(edge(a,c));
        }
        all++;
        int Min=INF,p;
        for(int i=0;i<all;i++){
            int latte=dijkstra(i);
            if(Min>latte){
                Min=latte;
                p=i;
            }
        }

        cout<<p<<" "<<Min<<endl;

    }
}

Measured memory_bytes: 1204
/* ***********************************************
Author        :taciturnity
Created Time  :2020/2/21 8:23:51
File Name     :TEST.cpp
************************************************ */

#include <iostream>
#include <vector>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f3f
#define bug puts("--------------")
const int N = 1e5 + 10;
const ll mod = 1e9 + 7 ;
using namespace std;
int main(){
    int a,b;
    cin >> a >>b;
    int s = 0;
    while(a){
        a /= b;
        s ++;
    }
    cout <<s<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,(int)v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define Endl cout << endl
#define SIZE(s) (int)s.size()
#define Cout(n) cout<<(n)<<endl

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const double pi = acos(-1.0);

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

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<v.size(); i++) {
		if (i)ost << ", ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

int main()
{
    ll a,b,c;
	cin >> a >> b >> c;
	cout << (a+b+c>=22?"bust\n":"win\n");
    return 0;
}


Measured memory_bytes: 256
//
//  second.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define ALL(x) (x).begin(), (x).end()
#define INF 1000000

int bfs(int n, vector<vector<int>> M, int pcol, int N);

vector<int> colors, check;

int main()
{
    int H,W;
    cin >> H >> W;
    
    vector<char> cond(H*W + 1);
    
    for (int i=1; i<=H*W; i++) {
        cin >> cond[i];
    }
    
    vector<vector<int>> dist(H*W + 1);
    for (int i=1; i<=H*W; i++) {
        dist[i].assign(H*W + 1, INF);
    }
    
    for (int i=1; i<=H*W; i++) {
        if(cond[i] == '.'){
            dist[i][i] = 0;
            if(i % W != 0 && cond[i+1] =='.'){
                dist[i][i + 1] = 1;
                dist[i + 1][i] = 1;
            }
            if( i + W <= H*W && cond[i + W] == '.'){
                dist[i][i + W] = 1;
                dist[i + W][i] = 1;
            }
        }
    }
    
    
    for (int k=1; k <= H*W; k++) {
        for (int i=1; i <= H*W; i++) {
            for (int j=1; j <= H*W; j++) {
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }
    
    
    
    int ans=0;
    
    for (int i=1; i <= H*W; i++) {
        for (int j=1; j <= H*W; j++) {
            if(cond[i] == '.' && cond[j] == '.'){
                ans = max(ans, dist[i][j]);
            }
        }
    }
    
    cout << ans << endl;
    
    
    return 0;
}


Measured memory_bytes: 896
#include<iostream>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

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

    int r=0,b=0;
    rep(i,n){
        if(s[i] == 'R')++r;
        else ++b;
    }
    if(r > b)cout<<"Yes";
    else cout<<"No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[200010];
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++)scanf("%d",&a[i]);
	for(int i=0;i+k<n;i++){
		if(a[i+k]>a[i])printf("Yes\n");
		else printf("No\n");
	}
} 

Measured memory_bytes: 4548
program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: i, j, ans,rm
    character(7):: keyence = 'keyence'
    character(100):: s
    logical:: tvs

    read*, s
    j=1
    tvs=.false.
    ans=0
    
    do rm = 0, len_trim(s)
        do i=1,len_trim(s)-rm
            if (s(1:i) // s(i+rm:) == keyence) then
                print*, 'YES'
                stop
            end if
        end do
    end do

    print*, 'NO'

end program name

Measured memory_bytes: 256
import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  n <- readLn :: IO Int
  v <- map (read::String->Int) . words <$> getLine
  c <- map (read::String->Int) . words <$> getLine
  let jewel = subsequences $ zipWith (-) v c
  (print . maximum . map sum) jewel

Measured memory_bytes: 5112
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> P;
typedef priority_queue<P,vector<P>,greater<P>> P_queue;

const ll MOD=998244353;
const ll mod=1000000007;
const ll INF=1e18;
const double PI=3.1415926535897932;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};

#define REP(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());
#define ADD(a,b) a=(a+b)%mod


int main(){
    ll N; cin>>N;
    vec d(N);
    rep(i,N) cin>>d[i];
    sort(ALL(d));
    if(d[0]==0) cout<<0<<endl;
    else{
        ll ans=1;
        for(int i=N-1;i>=0; i--){
            if(d[i]>INF/ans){
                ans=-1; break;
            }
            ans*=d[i];
        }
        cout<<ans<<endl;
    }
}


Measured memory_bytes: 4028
#include <iostream>
using namespace std;
int tj(int x){
	if(x%2==0){
		if(x==2)return 1;
		return tj(x/2)+1;
		}
		else return 0;
}
int main() {
	int n;
	cin>>n;
	int num[n];
	for(int i=0;i<n;i++){
		cin>>num[i];
	}
	int ans=0;
	for(int i=0;i<n;i++){
		ans+=tj(num[i]);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
n = int(input())
k = int(input())

x = list(map(int, input().split()))

ans = 0

for i in range(len(x)):
    if k - x[i] <= x[i]:
        ans += 2 * (k - x[i])

    else:
        ans += 2 * x[i]

print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
int h,w;
int mp[1001][1001];
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};

int used[1001][1001],mem[1001][1001];

int dfs(int y,int x){
  
  if(used[y][x]++) return mem[y][x];
 
  int &res=mem[y][x]=0;
  for(int i=0;i<4;i++){
    int nx=x+dx[i],ny=y+dy[i];
    if(nx<0||nx>=w||ny<0||ny>=h||mp[y][x]<mp[ny][nx]) continue;
    int r=dfs(ny,nx);
    if(r==0)r=ny*w+nx+1;
    if(r==-1) res=-1;
    if(r&&res&&res!=r) res=-1;
    else if(r) res=r;
  }
  return res;
}

typedef pair<int,int> P;
P A[1001*1001];
int main(){
  
  cin>>h>>w;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++) cin>>mp[i][j],A[i*w+j]=P(mp[i][j],i*w+j);
  
  sort(A,A+h*w);

  int ans=0;
  for(int i=0;i<h*w;i++) 
    if(dfs(A[i].second/w,A[i].second%w)==-1)ans++;
  
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 22588
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#define ll long long
#define mod 1000000007
#define maxn 410
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static char buff[20],len; len=0;
	if(x<0)putchar('-'),x=-x;
	for(;x;x/=10)buff[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buff[--len]+'0');
}
inline void writeln(ll x)
{
	write(x); putchar('\n');
}
inline void writesp(ll x)
{
	write(x); putchar(' ');
}
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
char mp[maxn][maxn];
int fa[maxn*maxn],cnt[maxn*maxn][2];
int n,m;
int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
void merge(int x,int y){int fx=find(x),fy=find(y); fa[fx]=fy;}
int main()
{
	n=read(); m=read();
	for(int i=0;i<n;i++)
		scanf("%s",mp[i]);
	for(int i=0;i<n*m;i++)
		fa[i]=i;
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			for(int k=0;k<4;k++){
				int x=i+dx[k],y=j+dy[k];
				if(x<0||x>=n||y<0||y>=m)continue;
				if(mp[x][y]!=mp[i][j])merge(i*m+j,x*m+y);
			}
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			++cnt[find(i*m+j)][mp[i][j]=='#'];
	ll ans=0;
	for(int i=0;i<n*m;i++)
		ans+=1ll*cnt[i][0]*cnt[i][1];
	writeln(ans);
}

Measured memory_bytes: 2176
num_max = 28

syusseki = Array.new
i = 0

while line = gets.chomp.to_i
  syusseki[i] = line
  i += 1

  if i >= num_max then
    break
  end
end

k = 0
j = 1
absence = Array.new
while j <= 30
  i = 0
  findflg = false
  while i < num_max
    if syusseki[i] == j then
      findflg = true
      break
    end
    i += 1
  end
  
  if findflg != true then
    absence[k] = j
    k += 1
  end
  j += 1
 
end

puts absence

Measured memory_bytes: 8704
#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> vec(H, vector<char>(W));
  for(int i=0; i<H; i++) {
    for(int j=0; j<W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  int cnt=0, cnt2=0;
  for(int i=0; i<H; i++) {
    for(int j=0; j<W; j++) {
      if(vec.at(i).at(j)=='.'||vec.at(i).at(j)=='0') {
        cnt++;
      }
      if(j==W-1&&cnt==W) {
        for(int k=0; k<W; k++) {
          vec.at(i).at(k)='0';
        }
      }
    }
    cnt=0;
  }
  for(int i=0; i<W; i++) {
    for(int j=0; j<H; j++) {
      if(vec.at(j).at(i)=='.'||vec.at(j).at(i)=='0') {
        cnt++;
      }
      if(j==H-1&&cnt==H) {
        cnt2++;
        for(int k=0; k<H; k++) {
          vec.at(k).at(i)='0';
        }
      }
    }
    cnt=0;
  }
  for(int i=0; i<H; i++) {
    for(int j=0; j<W; j++) {
      if(vec.at(i).at(j)!='0') {
        cout << vec.at(i).at(j);
        cnt++;
      }
      if(W-cnt2==cnt) {
        cout << endl;
        cnt=0;
      }
    }
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int c;
    int cflag=0;
    int fflag=0;
    string s;
    cin>>s;
    c=s.size();
    for(int i=0;i<c;i++)
    {
        if(s[i]=='C')
        {
            cflag=1;
            for(int j=i+1;j<c;j++)
            {
                if(s[j]=='F')
                {
                    cout<<"Yes";
                    return 0;
                }
            }

        }



    }

        cout<<"No";

    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define N 100000
#define Ai 100000

int A[N];
int n;

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

  a=partition(0,n-1);

  for(i=0;i<n-1;i++){
    if(i==a){
      printf("[");
    }
    printf("%d",A[i]);
    if(i==a){
      printf("]");
    }
    printf(" ");
  }
  printf("%d\n",A[n-1]);
  
  return 0;
}

int partition (int p, int r){
  int ch,x,i,j;
  x=A[r];
  i=p-1;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i++;
      ch=A[i];
      A[i]=A[j];
      A[j]=ch;
    }
  }
  ch=A[i+1];
  A[i+1]=A[r];
  A[r]=ch;

  return i+1;
}
  

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

int n, p = 0;
int dp[120][100];

bool is_prime(int n){
	for(int i = 2; i * i <= n; i++)if(n % i == 0)return false;
	return true;
}

int main(){
	cin >> n;
	dp[0][1] = 1;
	for (int i = 2; i <= n; i++){
		if (is_prime(i) == false)continue;
		int cnt = 0;
		for (int j = 1; j <= n; j++){
			int a = j;
			while (a % i == 0)cnt++, a /= i;
		}
		for (int j = 0; j <= cnt; j++){
			for (int k = 1; k * (j + 1) <= 75; k++){
				dp[i][k * (j + 1)] += dp[p][k];
			}
		}
		p = i;
	}
	cout << dp[p][75] << endl;
}

Measured memory_bytes: 256
/*B - Tap Dance*/

#include <bits/stdc++.h>

using namespace std;

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	string cad;
	cin >> cad;

	bool easily = true;

	for (int i = 0; i < cad.size(); ++i)
	{
		if((i + 1) % 2 == 0 and cad[i] == 'R'){
			easily = false;
			break;
		}

		if((i + 1) % 2 == 1 and cad[i] == 'L'){
			easily = false;
			break;
		}
	}

	if(easily)
		cout << "Yes";
	else
		cout << "No";


	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

char upper(char c){
	return c-0x20;
}

char lower(char c){
	return c+0x20;
}

void unique_vector(vector<int>& v){
	sort(all(v));
	v.erase(unique(all(v)), v.end());
}

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

//ユークリッドの互除法
//最大公約数
ll gcd(ll x, ll y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

//最小公倍数
ll lcm(ll x, ll y){
	ll g = gcd(x,y);
	return x/g*y;
}

ll myPow(ll x, ll n, ll m){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}
int main() {
    ll n,m,d;cin>>n>>m>>d;
    if(d){
        printf("%.12f\n",2.0*(n-d)/(n*n)*(m-1));
    }else{
        printf("%.12f\n",1.0/n*(m-1));
    }
}



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

string expand(string s) {
    string ret = "";
    for (auto c : s) {
        if ('0' < c && c <= '9') {
            for (int i = 0; i < c - '0'; i++) {
                ret += '.';
            }
        } else {
            ret += c;
        }
    }
    return ret;
}

string compress(string s) {
    string ret = "";
    int cnt = 0;
    for (auto c : s) {
        if (c == '.') cnt++;
        else {
            if (cnt) {
                ret += (cnt + '0');
                cnt = 0;
            }
            ret += c;
        }
    }
    if (cnt) ret += (cnt + '0');
    return ret;
}

int main() {
    string s;
    while (cin >> s, s != "#") {
        vector<string> mp;

        int delim_idx = 0;
        for (int i = 0; i < s.size(); i++) {
            if (s[i] == '/') {
                mp.push_back(expand(s.substr(delim_idx, i - delim_idx)));
                delim_idx = i + 1;
            }
        }
        mp.push_back(expand(s.substr(delim_idx)));

        int a, b, c, d; cin >> a >> b >> c >> d;
        a--, b--, c--, d--;
        mp[a][b] = '.';
        mp[c][d] = 'b';
        for (int i = 0; i < mp.size(); i++) {
            if (i) cout << '/';
            cout << compress(mp[i]);
        }
        cout << endl;
    }
}



Measured memory_bytes: 3140
using System; 
using System.Text; 
using System.Collections.Generic;
using System.Linq; 
using E = System.Linq.Enumerable; 

class Program {
     static int[] Quest;
     static int G;
     static int D;
     static int ans;
     static bool ok;
     static void Main(string[] args) {
     //入力を受け取る
     var DG = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
     
     D = DG[0];
     G = DG[1];
     
     Quest = new int[D+1];
     var bonuses = new int[D+1];
     
     for(int i = 1;i <= D ;i++){
         var PC = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
         
         var P = PC[0];
         var C = PC[1];
         Quest[i]   = P;
         bonuses[i] = C;
     }
     
     ans = int.MaxValue;
     for(int i = 0;i < Math.Pow(2,D);i++){
         ok = true;
         var point = 0;
         var step  = 0;
         //フラグが立っていればステップとボーナスを加算
         for(int j=0;j < D;j++){
             if((i&(int)Math.Pow(2,j)) != 0){
                 point += 100*(j+1)*Quest[j+1]+bonuses[j+1];
                 step  += Quest[j+1];
             }
         }
      //   Console.WriteLine(step+" "+point);
         //フラグ情報とポイントを渡し、残りのステップを計算
         step += AddRestStep(i,point);
         
        //Console.WriteLine(step+" "+point);
    
         if(ok && ans > step){
             ans = step;
         }
         
     }
     
     
        Console.WriteLine(ans);
     }
     
     static int AddRestStep(int flag,int point){
         var step = 0;
         
         for(int j = D;G > point && j > 0;j--){
             //ボーナスフラグが立っていなければ
             if((flag&(int)Math.Pow(2,j-1)) == 0){
                var comp = point+100*j*(Quest[j]-1);
                if(comp < G){
                    point = comp;
                    step  += Quest[j]-1;
                }else{
                    step  +=　(G-point-100*j)/(100*j)+1;
                    point = G;
                    break;
                }         
             }
         }
         
         if(point >= G){
             return step;
         }else{
             ok = false;
             return step;
         }
         
     }
}
     
     
     
     
     


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
using ll = long long; 
using vpii = vector<pair<int, int>>;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
ll inf = 1e10;

ll gcd(ll a, ll b){
  return (b != 0) ? gcd(b, a%b) : a;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<ll> a(n+1);
  rep(i, n) cin >> a[i];
  a[n] = 1e9+1;
  sort(a.begin(), a.end());
  ll ans = 0;
  ll cnt = 0;
  ll tmp = a[0];
  rep(i,n+1){
    if(tmp == a[i]) cnt++;
    else{
      if(cnt < tmp) ans += cnt;
      else if(cnt > tmp) ans += (cnt-tmp);
      cnt = 1;
      tmp = a[i]; 
    }
  }
  
  cout << ans << "\n";
}  

Measured memory_bytes: 1024
#include <stdio.h>
#include <math.h>

int main(){

	int a,b,c;
	
	scanf("%d %d",&a,&b);
	
	if (b<10) {
		c = a * 10 + b;
	} else if (b == 100) {
		c = a * 1000 + b;
	} else {
		c = a * 100 + b;
	}

	if (sqrt(c) == (int)sqrt(c)) {
		printf("Yes");
	} else {
		printf("No");
	}

	return 0;
}

Measured memory_bytes: 128
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

void solve() {
    vector<int> v(3);
    for (int i = 0; i < 3; i++) cin >> v[i];

    sort(v.begin(), v.end());
    
    int ans = 0;

    ans += (v[2] - v[0]) / 2;
    v[0] += ((v[2] - v[0]) / 2) * 2;
    ans += (v[2] - v[1]) / 2;
    v[1] += ((v[2] - v[1]) / 2) * 2;

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

    if (v[0] == v[1] && v[1] != v[2]) ans += 1;
    if (v[0] != v[1] && v[1] == v[2]) ans += 2;

    cout << ans << '\n';
}

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

    solve();

    return 0;
}

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

int main(){
  int sx,sy,tx,ty;
  cin >> sx >> sy >> tx >> ty;
  int dx=tx-sx;
  int dy=ty-sy;
  cout << string(dy,'U')+string(dx,'R');
  cout << string(dy,'D')+string(dx,'L');
  cout << 'L'+string(dy+1,'U')+string(dx+1,'R')+'D';
  cout << 'R'+string(dy+1,'D')+string(dx+1,'L')+'U';
  cout << endl;
  return 0;
}


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

int main() {
  int m, d, c = 0;
  cin >> m >> d;
  if (m < 4 || d < 22) {
    cout << 0 << endl;
    return 0;
  }

  for (int i = 4; i <= m; i++) {
    for (int j = 22; j <= d; j++) {
      if ((j / 10) < 2 || (j % 10) < 2) continue;
      if ((j / 10) * (j % 10) == i) {
        c++;
      }
    }
  }

  cout << c << endl;

  return 0;
}

Measured memory_bytes: 256
N = int(input())

if N % 2 == 0:
    M = N*N//2 - N
    print(M)
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if i + j != N+1:
                print(i, j)
else:
    M = (N*N+1)//2 - N
    print(M)
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if i + j != N:
                print(i, j)

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

int main() {
    int a, b, k;
    cin >> a >> b >> k;
    set<int> ans;
    for(int i = a; i < min(a + k, b); ++i) {
        ans.insert(i);
    }
    for(int i = max(a, b - k + 1); i <= b; ++i) {
        ans.insert(i);
    }

    for(auto x : ans) {
        cout << x << endl;
    }
}


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

typedef long long ll;

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

    ll a[n+2], b[n+2];
    a[0] = 0, b[0] = 0;

    int x;
    for(int i = 1; i <= n; i++){
        cin >> x;
        a[i] = a[i-1] + x;
        b[i] = b[i-1] + max(0, x);
    }
    b[n+1] = b[n];

    ll score = LLONG_MIN;
    for(int r = k; r <= n; r++){
        int l = r-k+1;
        ll center = max(0ll, a[r]-a[l-1]);
        ll lefthand = b[l-1] - b[0];
        ll righthand = b[n+1]-b[r];
        score = max(score, center+lefthand+righthand);
    }

    cout << score << endl;

    return 0;
}

Measured memory_bytes: 1792
N = gets.to_i
s_list = N.times.map { gets.chomp.chars }
prefix_to_count =
  s_list
    .group_by { |s| s[0] }
    .map { |(k, v)| [k, v.size] }
    .to_h
ans = 0
[
  prefix_to_count['M'],
  prefix_to_count['A'],
  prefix_to_count['R'],
  prefix_to_count['C'],
  prefix_to_count['H']
].compact.combination(3).each do |counts|
  ans += counts.reduce(1, &:*)
end
puts ans


Measured memory_bytes: 49204
N = int(input())
D = [list(map(int,input().split())) for _ in range(N)]
flag = 0
for i in range(N-2):
    if D[i][0]==D[i][1] and D[i+1][0]==D[i+1][1] and D[i+2][0]==D[i+2][1]:
        flag = 1
        break
if flag==1:
    print("Yes")
else:
    print("No")

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

int N, G[10], A[10]; long double T[10];

long double getans(vector<int>RR) {
	long double UPLIM = 3.14159265358979, FinalAns = 0; if (RR.size() >= 4) UPLIM *= 2.0L;

	do {
		for (int i = 0; i < RR.size(); i++) A[i] = RR[i] * RR[(i + 1) % RR.size()];

		long double L = 0, R = 1000000, M, ret = 0;
		for (int j = 0; j < 50; j++) {
			M = (L + R) / 2;
			long double sum = 0, rem = 0;
			for (int k = 0; k < RR.size(); k++) { T[k] = acos(min(1.0L, 1.0L * M / A[k])); }
			for (int k = 0; k < RR.size(); k++) { sum += T[k]; rem += 0.5L * A[k] * sin(T[k]); }

			if (sum > UPLIM) { L = M; }
			else {
				R = M; ret = max(ret, rem);
			}
		}
		FinalAns = max(FinalAns, ret);

	} while (next_permutation(RR.begin(), RR.end()));
	return FinalAns;
}

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) cin >> G[i];
	sort(G, G + N);

	long double D = 0;
	for (int i = 0; i < (1 << N); i++) {
		vector<int>C; for (int j = 0; j < N; j++) { if ((i / (1 << j)) % 2 == 1) C.push_back(G[j]); }
		
		if (C.size() >= 3) D = max(D, getans(C));
	}
	printf("%.15Lf\n", D);
	return 0;
}


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

char table[6][5] = {
	{'a','b','c','d','e'},
	{'f','g','h','i','j'},
	{'k','l','m','n','o'},
	{'p','q','r','s','t'},
	{'u','v','w','x','y'},
	{'z','.','?','!',' '}
};

int main(){
	string s;
	while( cin >> s ){
		string ans;
		if( s.size()%2 ){
			cout << "NA" << endl;
		}else{
			bool flag = false;
			for(int i=1 ; i < s.size() ; i+=2 ){
				int y = s[i-1]-'0'-1;
				int x = s[i]-'0'-1;
				if( y < 0 || x < 0 || y >= 6 || x >= 5 ){
					flag = true;
					break;
				}
				ans += table[y][x];
			}
			if( flag )
				cout << "NA" << endl;
			else
				cout << ans << endl;
		}
	}
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
}

void solve() {
    int a, b, c; cin >> a >> b >> c;
    int ans = 0;
    if (a%2 != b%2) {
        if (a%2 == c%2) ++a;
        else ++b;
        ++c; ++ans;
    } else if (a%2 != c%2) {
        if (a%2 == b%2) ++a;
        else ++c;
        ++b; ++ans;
    } else if (b%2 != c%2) {
        if (b%2 == a%2) ++b;
        else ++c;
        ++a; ++ans;
    }
    int v[3] = {a, b, c};
    sort(v, v+3);
    cout << ans+(v[1]-v[0])/2+(v[2]-v[1]);
}

int main() {
    init();
    int t = 1; //scanf("%d", &t);
    while (t--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 

int main()
{

  int a,b,c,x,y;
  
  scanf("%d%d",&a,&b);
  if(a>=b)
    {
      x = a;
      y = b;
    }
  else
    {
      x = b;
      y = a;
    }
  
  while(y!=0)
    {
      c = x%y;
      x = y;
      y = c;
    }
  printf("%d\n",x);

  


  
  return 0;
}
 



Measured memory_bytes: 2068
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int i, n = 0;
    int L, R, d;
    //printf("数値を入力してね\n");
    scanf("%d%d%d", &L, &R, &d);
    /*
    scanf("%d", &L);
    scanf("%d", &R);
    scanf("%d", &d);
     */
    //printf("%d %d %d\n", L, R, d);
    for(i = L;i<=R;i++){
        if(i%d==0){
            //printf("%d\n", i);
            n++;
        }
    }
    printf("%d\n", n);
    return 0;
}


Measured memory_bytes: 2120
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll a,b;
  cin >> a >> b;
  if(a <= b)cout << a << endl;
  else cout << a - 1 << endl;
}

Measured memory_bytes: 3640
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
#define int long long
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279; //円周率
/*---------------------便利な関数--------------------------------------*/
int fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}

int gcd(int a, int b) {        //最大公約数
    if (b == 0) return a;
    return gcd(b, a % b);
}

int lcm(int a, int b) {      //最小公倍数
    return a * b / gcd(a, b);
}

int keta(int n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}

int ketasum(int n) {    //各桁の和
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/*-------------ここまで---------------------------------------------*/

//C++(GCC9.2.1)

signed main() {
    //宣言
    int h, n;
    cin >> h >> n;
    vector<int> vec(n);
    int sum = 0;
    rep(i, n) {
        cin >> vec[i];
        sum += vec[i];
    }
    if (h > sum) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 4000
#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define LOCAL 1

#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define dbg(...) cout<<#__VA_ARGS__ ": ["; for(auto e: __VA_ARGS__){cout<<e<<", ";} cout<<"]\n"
#define dbg1(...) cout<<#__VA_ARGS__ " "<< __VA_ARGS__ 
#else
#define dbg(...) 1;
#define dbg1(...) 1;
#endif

typedef long long ll;
typedef unsigned long long ull;
constexpr int R=5e6+69, INF=2e9+6969;

int qq;

int main()
{
	string s;
	cin >> s;
	vector <int> v(4);
	for(int i=0;i<4;++i)
	{
		v[i]=s[i]-'0';
	} 
	for(int i=0;i<8;++i)
	{
		int sum = v[0];
		for(int j=0;j<3;++j)
		{
			int cur = v[j+1];
			if(i&(1<<j)) cur*=-1;
			sum+=cur;
		}
		if(sum==7)
		{
			printf("%d", v[0]);
			for(int j=0;j<3;++j)
			{
				printf("%c", ((i&(1<<j)) ? '-' : '+'));
				printf("%d", v[j+1]);
			}
			printf("=7\n");
			break;
		}
	}
	return 0;
}


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

#define MAX 2
int main(void)
{
	int i=1;
	int in[MAX];
	while (1) {
		for (i = 0; i < MAX; i++) {
			cin >> in[i];
		}
		if ((in[0] == in[1]) && (in[0] == 0)) {
			break;
		}

		if (in[0] > in[1]) {
			cout << in[1] << " " << in[0] << endl;
		}
		else {
			cout << in[0] << " " << in[1] << endl;
		}
	}

	return 0;
}



Measured memory_bytes: 3088
#include<iostream>
#include<algorithm>
using namespace std;
int n,a[100000];
int main(){
  cin>>n;
  for(int i=0;i<n;i++)cin>>a[i];
  int tmp=a[n-1],i=-1;
  for(int j=0;j<n-1;j++){
    if(a[j]<=tmp){
      i++;
      swap(a[i],a[j]);
    }
  }
  swap(a[i+1],a[n-1]);
  for(int j=0;j<n;j++){
    if(j)cout<<" ";
    i+1==j?cout<<'['<<a[j]<<']':cout<<a[j];
  }cout<<endl;
  return 0;
}

Measured memory_bytes: 3440
N, x = map(int, input().split())
a = list(map(int, input().split()))
count = 0

for i in range(N-1):
    if a[i] + a[i+1] > x:
        count += a[i] + a[i+1] - x
        if a[i] <= x:
            a[i+1] = x - a[i]
        else:
            a[i+1] = 0
            a[i] = x

print(count)


Measured memory_bytes: 14052
import math

def include_tax(v,p):
    return v * (100+p) // 100

def exclude_tax(v,p):
    return int(math.ceil(v * 100.0 / (100+p)))

while True:
    x,y,s = map(int,input().split())
    if x == 0: break
    mx = 0
    for a1 in range(1,s):
        b1 = include_tax(a1,x)
        b2 = s - b1
        if b2 <= 0: continue
        a2 = exclude_tax(b2,x)
        if b2 != include_tax(a2,x): continue
        c1 = include_tax(a1,y)
        c2 = include_tax(a2,y)
        mx = max(mx, c1+c2)
    print(mx)

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define lfs <<fixed<<setprecision(10)<<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = n - 1; i >= (ll)(m); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>v,ll n){cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
template<typename T>
void emp(map<T,ll>&m, T x){m.emplace(x,0).first->second++;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main(){
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n;cin>>n;
  rep(i,0,n){
    ll x=(i+1)*(i+2)/2;
    if(x>=n){
      buf=x;
      res=i;
      break;
    }
  }
  cout<<res+1<<endl;
  buf-=n;
  rrep(i,res+1,1){
    if(buf>=i)buf-=i;
    else cout<<i<<endl;
  }
  return 0;
}

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

using namespace std;

const int N = 1e5 + 5;
const int INF = 2e9;

int h[N];
int n , k;

int mem[N];

int dp(int i){
    // base case
    if(i == n-1) return 0;

    if(mem[i] != -1) return mem[i];

    int ans = INF;
    // try to jump 1 or 2 or ,,,, or k stones
    for(int j = 1 ; j <= k ; j ++){
            if(i + j <= n-1){
                    ans = min(ans , abs(h[i] - h[i + j]) + dp(i + j));
            }
    }

    mem[i] = ans;
    return mem[i];
}

main(){

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

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

    memset(mem , -1 , sizeof mem);
    printf("%d\n" , dp(0));

    return 0;
}


Measured memory_bytes: 5760
import java.util.Scanner;

public class Main{

    static boolean isPrime(int n){
        if(n == 2){
            return true;
        }else if(n < 2 || n % 2 == 0){
            return false;
        }else{
            int x = 3;
            while(x <= Math.sqrt((double)n)){
                if(n%x == 0)    return false;
                x += 2;
            }
            return true;
        }
    }
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        int n = Integer.parseInt(in.next());
        int count = 0;

        for(int i = 0; i < n; i++){
            if(isPrime(Integer.parseInt(in.next()))) count++;
        }

        System.out.println(count);
    }
}


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

using namespace std;


int main(){

    int x = 0;
    int N;
    int count_max = 0;
    string S;

    cin >> N >> S;

    for (int i = 0; i < N; ++i) {

        if(S[i] == 'I'){
            x++;
        } else if(S[i] == 'D'){
            x--;
        }

        if(count_max <= x){
            count_max = x;
        }
    }

    cout << count_max << endl;

    return 0;
}

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

using namespace std;

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

    set<string> st;

    for(int i = 1; i <= K; i++){
        for(int j = 0; j < s.size()-i+1; j++){
            string sub = s.substr(j, i);
            st.insert(sub);
        }
    }
    vector<string> vt;
    for(auto itr = st.begin(); itr != st.end(); itr++){
        vt.push_back(*itr);
    }
    sort(vt.begin(), vt.end());
    cout << vt[K-1] << endl;
    return 0;
}


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

namespace Atcoder070_D_NoNeed
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputFirstLine = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int N = inputFirstLine[0], K = inputFirstLine[1];
            var cards = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();

            Console.WriteLine(new NoNeed().GetNoNeedCardsCount(K, cards));
            //Console.ReadKey();
        }
    }

    class NoNeed
    {
        public int GetNoNeedCardsCount(int target, List<int> cards)
        {
            var orderCards = cards.OrderByDescending(x => x).ToArray();

            int sum = 0, index = -1;

            for (int i = 0; i < orderCards.Length; i++)
            {
                sum += orderCards[i];
                if (sum >= target)
                {
                    sum -= orderCards[i];
                    index = i;
                }
            }

            if (index == -1) return orderCards.Length;

            return orderCards.Length - index - 1;
        }
    }
}


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

void solve() {

    string s1, s2;
    cin >> s1;
    cin >> s2;
    if (s1.length() == s2.length() - 1) {
        bool check = true;
        for (int i = 0; i < s1.length(); i++) {
            if (s1[i] != s2[i]) {
                check = false;
                break;
            }
        }
        if (!check) {
            cout << "No";
        }
        else {
            if (isalpha(s2[s1.length()])) {
                cout << "Yes";
            }
            else {
                cout << "No";
            }
        }
    }
    else {
        cout << "No";
    }
}

int main() {

    solve();
    return 0;
}


Measured memory_bytes: 3624