akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

template<typename T> //最大公約数
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T> //最小公倍数
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

struct edge
{
    int to, cost;
};


int main(){
    int V,E,r; cin >> V >> E >> r;
    vector<vector<edge> > g(V);
    vector<int> Cost(V, MM);
    for (int i = 0; i < E; i++){
        int s,t,d; cin >> s >> t >> d;
        edge now; now.to = t; now.cost = d;
        g[s].push_back(now);
    }

    queue<int> que;
    que.push(r);
    Cost[r] = 0;
    while (que.size()){
        int pos = que.front();
        que.pop();
        for (int i = 0; i < g[pos].size(); i++){
            edge To = g[pos][i];
            if (Cost[pos] + To.cost < Cost[To.to]){
                Cost[To.to] = Cost[pos] + To.cost;
                que.push(To.to);
            }
        }
    }
    for (int i = 0; i < V; i++){
        if (Cost[i] == MM) cout << "INF" << endl;
        else cout << Cost[i] << endl;
    }
}


Measured memory_bytes: 12288
function Main(arg)
{
  var N = arg.split("\n")[0].split(" ")[0] - 0;
  var T = arg.split("\n")[0].split(" ")[1] - 0;
  var t = arg.split("\n")[1].split(" ").map(Number);

  var ans = 0;
  for (var i = 1; i < N; i++) {
    if (t[i] - t[i - 1] < T) {
      ans += t[i]- t[i - 1];
    }
    else {
      ans += T;
    }
  }

  console.log(ans+T);
  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 34200
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define vpll vector <pll>
#define pb push_back


int main()
{
    ll t,n,a,s=0;
    cin>>t>>n;
    while(n--)
    {
        cin>>a;
        s+=a;
    }
    if(t>=s)
        cout<<t-s;
    else
        cout<<"-1";
    return 0;
}



Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int n;
 cin>>n;
 int f=0;
 while(n)
 {
 	int d=n%10;
 	n/=10;
 	if(d==7)
 	f=1;
 }
 if(f==1)
 cout<<"Yes"<<endl;
 else
 cout<<"No"<<endl;
 return 0;
}


Measured memory_bytes: 3636
import java.util.*;
public class Main {
        public static long sum(long x){
            return x*(x+1)/2;
        }
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        
		long a = sc.nextLong();
		long ans = 0;
        for(long i=1;i<=a;i++){
        ans+=i*sum(a/i);}
        
		System.out.println(ans);
	}
}


Measured memory_bytes: 35708
#include<iostream>
using namespace std;
int main(){

  int time[5];
  int truetime[5];
  int sum=0;
  int max=999;
  int ans=999;
  for(int i=0;i<=4;i++){
    cin>>time[i];
    truetime[i]=time[i];
    if(time[i]%10!=0){
    
      time[i]/=10;
      time[i]++;
      time[i]*=10;
    }
    sum+=time[i];
  }
  for(int i=0;i<=4;i++){
  
    max=sum-time[i]+truetime[i];
    if(max<ans)ans=max;
  }
  cout<<ans;
  return 0;
}

Measured memory_bytes: 3488
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long c=0,ans=0,i;
    string s;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
      if(s[i]=='?')
      {
          s[i]='D';
      }
    }
    cout<<s<<endl;


}

Measured memory_bytes: 3756
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define N 200001
#define ll long long
#define int ll 
#define pi pair<int , int>
#define pip pair<pair ,int>
#define mp make_pair 
#define f first
#define s second
#define mod 1000000007
ll Mod(ll x, ll y, int p) 
{ll res = 1; x = x % p;
while (y > 0) 
{if(y & 1) res = (res*x) % p; 
y = y>>1;x = (x*x) % p; 
}return res; 
}
int* getlps(string pattern){
 int len = pattern.length();
 int * lps = new int[len];
 lps[0] = 0;
 int i = 1 , j = 0;
 while(i < len){
  if(pattern[i] == pattern[j]){
	  lps[i] = j+1;
   i++;
   j++;
  }
  else{
		if(j != 0){
		 j = lps[j-1];
		}
		else{
		 lps[i] = 0;
		 i++;
		}
  }
 }
 return lps;
}
class Triplet{
 public:
 int x ;
 int y ;
 int gcd;
};
Triplet extendedEuclid(int a , int b){
 if(b == 0){Triplet ans; ans.gcd = a;ans.x = 1;ans.y = 0;return ans;}
 Triplet smallAns = extendedEuclid(b , a%b);
 Triplet ans;
 ans.gcd = smallAns.gcd;
 ans.x = smallAns.y;
 ans.y = smallAns.x - (a/b)*smallAns.y;
 return ans;
}
int mmInverse(int a , int m){
 Triplet ans = extendedEuclid(a , m);
 return ans.x;
}
int ncr(int n , int r){
	int x = 1;
   for(int i = 0 ; i < r ; i++){
          x = ((x%mod)*(n-i)%mod + mod)%mod;
          x%= mod;
   }
   int den = 1;
   for(int i = 1 ; i <= r ; i++){
       den = ((den%mod)*(i)%mod + mod)%mod;
          den%= mod;
   }
   return (x*mmInverse(den , mod) + mod)%mod;
}
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n , a , b;
cin>>n>>a>>b;
// 
int ans = Mod(2 , n , mod) - 1;
// nca - ncb
cout<<(ans - ncr(n , a) - ncr(n , b)+mod)%mod<<endl;
}



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

using namespace std;
using ll = long long;


int main()
{
	int n; cin >> n;
	ll ans = 0;
	for(ll a = 1; a < n; a++) {
		ll cur = (n-1) / a;
		ans += cur;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3620
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var S = nextInt();
  var dp = new Array(2001).fill(0);
  var mod = 1000000007;
  for(var i = 3; i <= S; i++){
    dp[i]++;
    for(var j = 3; j <= i - 3; j++){
      dp[i] += dp[j];
      dp[i] %= mod;
    }
  }
  myout(dp[S]);
}


Measured memory_bytes: 32876
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
#include<map>
using namespace std;


int main() {
    double a, b;
    cin >> a >> b;
    double res = (a+b)/2;
    res += 0.5;
    cout << int(res);
    cout << endl;    
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
 
using namespace std;
 
int main(){
  long N, Ans;

 /* int *P;

  P = new int[N];

  int *TF;

  TF = new int[N];
*/

  int P[200000];
  long MX[200000];

  cin >> N;

  Ans = 1;

  for(long i = 0; i < N; i++) cin >> P[i];

  MX[0]=P[0];
  for(long i = 1; i < N; i++){

  if (P[i]<MX[i-1]) {
    MX[i] = P[i];
    Ans+=1;
  }
  else {
    MX[i]=MX[i-1];
  }
  }


  cout << Ans;
  return 0;
}

Measured memory_bytes: 2560
import Control.Monad

main :: IO()
main = do
    css <- replicateM 3 $ map read . words <$> getLine
    putStrLn $ calcAns css
        where
            calcAns [cs1,cs2,cs3] = if all (==0) (init ds1) && all (==0) (init ds2) then "Yes" else "No"
                where
                    cs1' = zipWith (-) cs1 cs3
                    cs2' = zipWith (-) cs2 cs3
                    ds1 = f cs1'
                    ds2 = f cs2'
                    f [a,b,c] = [a-c,b-c,c]

Measured memory_bytes: 508
package main

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

var scanner = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 0x100000)

// SplitSpace 空白で分割設定
func SplitSpace() {
	scanner.Split(bufio.ScanWords)
}

// NextLine 標準入力から１行読み込む
func NextLine() string {
	scanner.Scan()
	return scanner.Text()
}

// NextInt 標準入力から数値を一つ読み込む
func NextInt() int {
	n, _ := strconv.Atoi(NextLine())
	return n
}

// ReadLine 標準入力から長めの1行を読み込む
func ReadLine() string {
	buf := make([]byte, 0, 0x100000)
	for {
		line, isPrefix, err := rdr.ReadLine()
		if err != nil {
			panic(err)
		}
		buf = append(buf, line...)
		if !isPrefix {
			break
		}
	}
	return string(buf)
}

func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//================

func main() {
	SplitSpace()
	n := NextInt()
	k := NextInt()
	h := make([]int, n)
	for i := 0; i < n; i++ {
		h[i] = NextInt()
	}
	sort.Ints( h )
	cnt := 0
	for i := 0; i < n-k; i++ {
		cnt += h[i]
	}

	fmt.Println(cnt)
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
//一括include
using namespace std;
int main()
{
    string s;
    cin >> s;
    int n = s.size();
    int f = 0;
    int e = 0;

    for (int i = 0; i < n; i++)
    {
        if (s[i] == 'A')
        {
            f = i;
            break;
        }
    }
    for (int i = n; i > 0; i--)
    {
        if (s[i] == 'Z')
        {
            e = i;
            break;
        }
    }
    cout << e - f + 1 << endl;
}


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

using namespace std;

#define PB push_back
#define f first
#define s second
#define what_is(x) cerr << #x << " is " << x << endl;

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

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int a;
    cin >> a;
    cout << a + a*a + a*a*a;
    return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	int n,k;
	string s;
	cin >> n >> k >> s;
	vector<int> v(n),a(n);
	for(int i=0;i<n;i++){
		v[i] = s[i]-'A';
	}
	a[0]=0;
	if(v[0]==1)a[1]=1;
	else a[1]=2;
	for(int i=2;i<n;i++){
		if(((v[i-1]+i-1)%2)==0){
			a[i]= a[i-1]+2;
		}else{
			a[i]= a[i-1]+1;
		}
	}
	int x=0;
	for(int i=1;i<n;i++){
		if(k<a[i]){
			x=i-1;
			break;
		}
		if(i==(n-1)){
			x=n-1;
		}
	}
	if(x!=(n-1)){
		for(int i=0;i<(n-x);i++){
			v[i] = (v[i+x]+x)%2;
		}
		for(int i=n-x;i<n;i++){
			v[i] = (n-1-i)%2;
		}
		if((k-a[x])!=0){
			v[0] +=1;
		}
	}else{
		v[0]= (v[n-1]+n-1)%2;
		for(int i=1;i<n;i++){
			v[i] = (n-1-i)%2;
		}
		if((k-a[n-1])!=0){
			if(n%2==0)v[0]=1;
			else if((k-a[n-1])%2!=0){
				if(v[0]==0)v[0]=1;
				else v[0]=0;
			}
		}
	}
	for(int i=0;i<n;i++){
		if(v[i]==1)cout << "B";
		else cout << "A";
	}
	cout << endl;
	return 0;
}

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

using namespace std;

int main() {
  string S;
  cin >> S;

  uint64_t sum = 0;
  uint last = S.size() - 1;
  for (uint b = 0; b < (1 << last); b++) {
      uint tb = b;
      uint i = 0, j = 1;
      while (j < S.size()) {
          if (tb & 1) {
              sum += stoll(S.substr(i, j - i));
              i = j;
          }
          tb >>= 1;
          j++;
      }
      sum += stoll(S.substr(i, j - i));
  }

  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 764
# -*- coding: utf-8 -*-      
import sys

n = int(input())
tprev = 0
tdiff = 0
pos = [0, 0]
for i in range(n):
    t, x, y = list(map(int,input().split()))
    tdiff = t - tprev
    if(tdiff>=abs(x-pos[0])+abs(y-pos[1])):
        if((tdiff-(abs(x-pos[0])+abs(y-pos[1])))%2 == 0):
            tprev = t
            pos = [x, y]
        else:
            print('No')
            sys.exit()
    else:
        print('No')
        sys.exit()
else:
    print('Yes')
        

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,h) for(int i = 0; i < h; ++i)
#define rep1(i,h) for(int i = 0; i <= h; ++i)
#define rep2(i,k,h) for(int i = k; i < h; ++i)
#define rep3(i,k,h) for(int i = k; i <= h; ++i)
#define INF LLong_MAX // long long INF
#define inf INT_MAX // int inf

typedef pair<int,int> int_pair;
typedef pair<string,string> string_pair;



int main() {
    int a,b;
    cin >> a >> b;
    if(a ==1 && b == 2) {
        cout << 3 << endl;
    }
    if(a ==2 && b == 1) {
        cout << 3 << endl;
    }
    if(a ==2 && b == 3) {
        cout << 1 << endl;
    }
    if(a ==3 && b == 2) {
        cout << 1 << endl;
    }
    if(a ==1 && b == 3) {
        cout << 2 << endl;
    }
    if(a ==3 && b == 1) {
        cout << 2 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n = s.size();
  int c = 0;
  for(int i  =0; i < n; i++){
    if(s[i] == 'o')
      c++;
  }
  int rem = 15 - n;
  if(c + rem >= 8)
    cout << "YES";
  else
    cout << "NO";
return 0;
}

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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define pb push_back
#define mp make_pair
#define INF 999999999
#define MOD 1000000007
#define sp ' '


//typedef
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<long, long> pll;
typedef map<int, int> mint;
typedef set<int> sint;
typedef vector<int> vint;
typedef vector<char> vchr;
typedef vector<long long> vll;
typedef vector<string> vstr;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll a, ll b, ll c){ll ans=1; rep(i, b){ans=ans*a%c;} return ans;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T>
void dpp(T n){cerr << n << endl;}
template<typename T>
void vpp(T a){rep(i,a.size()){cout << a[i] << endl;}}
template<typename T>
void vdp(T a){rep(i,a.size()){cerr << a[i] << endl;}}

const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ddx[8] = {1,0,-1,0,1,-1,-1,1};
const int ddy[8] = {0,1,0,-1,1,1,-1,-1};




template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}


vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.pb(buffer);
    }
    return v;
}




int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    ll a[n], b[n];
    rep(i, n){
        cin >> a[i] >> b[i];
    }

    ll cnt = 0;
    rep(i, n){
        if(b[n-i-1] == 1 or a[n-i-1] == 0 or (a[n-i-1]+cnt)%b[n-i-1] == 0) continue;
        cnt += b[n-i-1]-((a[n-i-1]+cnt)%b[n-i-1]);
        dpp(cnt);
    }

    ppp(cnt);

    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)
#define Graph vector<vecctor<ll>>
#define pairs vector<pair<ll,ll>>
#define pb push_back



using namespace std;
using ll = long long;
const ll INF = 1e18;
const double PI = acos(-1);

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;
}



int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    ll n,ans = 0;
    string s;
    cin >> n >> s;
    vector<vector<ll>> num(10);
    rep(i,n){
        int index = s[i]-'0';
        num[index].pb(i);
    }
    cerr << "ここは" << endl;
    rep(i,10){
        if(num[i].size() <= 1)continue;
        sort(num[i].begin(),num[i].end());
    }
    rep(i,10){
        rep(j,10){
            rep(k,10){
                if(num[i].empty() || num[j].empty() || num[k].empty())continue;
                if(num[i][0] < num[k][num[k].size()-1] && num[i][0] < num[j][num[j].size()-1] && num[k][num[k].size()-1] > num[j][0]){
                    for(ll x : num[j]){
                        if(x < num[k][num[k].size()-1] && x > num[i][0]){
                            ans++;
                            break;
                        }
                    }
                }
            }
        }
    }

    cout << ans << endl;

    
    





    return 0;
}


Measured memory_bytes: 3888
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;

const ll MOD = 1000000007;

int main() {
    int n; cin >> n;
    vector<ll> da(n);
    rip(i,n,0) cin >> da[i];
    ll ans = 0;
    rip(i,n,0) {
        ans += da[i];
    }
    ans %= MOD;
    ans = ans*ans;
    rip(i,n,0){
        ans -= da[i]*da[i]%MOD;
        if(ans < 0) ans += MOD;
    }
    if(ans&1) ans = (ans+MOD)/2;
    else ans /= 2;
    cout << ans%MOD << endl;
}

Measured memory_bytes: 4820
/* Work 3_2
 * AtCoder ∴
 * cy_an */

#include <stdio.h>

int main(void){
    int num, num1;   // 変数宣言,nの1の位をn1
    scanf("%d", &num); // nを入力
    num1 = num % 10;

    switch(num1){
        case 2 :
        case 4 :
        case 5 :
        case 7 :
        case 9 : printf("hon\n"); break; // 2, 4, 5, 7, 9のとき"hon"を出力
        case 0 :
        case 1 :
        case 6 :
        case 8 : printf("pon\n"); break; // 0, 1, 6, 8のとき"pon"を出力
        case 3 : printf("bon\n"); break; // 3のとき"bon"を出力
    }
    return 0;
}

Measured memory_bytes: 1620
#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }




// ***************************************


int main(){
    
    string S, T;
    cin >> S >> T;
    ll cnt = 0;
    REP(i, S.size()){
        if (S[i] != T[i]) cnt++;
    }

    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 3912
#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<complex>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int MAX_N = 100000;
int N;
ll x[MAX_N+1], y[MAX_N+1];
int a, b;
ll D;
bool rm[MAX_N+1];
set<pll> s1;
set<pll> s2;
vector<pll> v1;
vector<pll> v2;
map<pll, int> id;

int main() {
  cin >> N >> a >> b;
  for (int i = 1; i <= N; ++i) cin >> x[i] >> y[i];
  D = (abs(x[a]-x[b])+abs(y[a]-y[b]));

  for (int i = 1; i <= N; ++i) {
    int tx = x[i], ty = y[i];
    x[i] = tx - ty;
    y[i] = tx + ty;
  }


  for (int i = 1; i <= N; ++i) {
    s1.insert(pll(x[i], y[i]));
    s2.insert(pll(y[i], x[i]));
    id[pll(x[i], y[i])] = i;
  }

  queue<int> que;
  que.push(a);

  while (!que.empty()) {
    int v = que.front(); que.pop();
    if (rm[v]) {continue;}
    rm[v] = true;

    auto ite = s1.lower_bound(pll(x[v]-D, y[v]-D));

    while (ite != s1.end()) {
      if (ite->fi != x[v]-D || ite->sc > y[v]+D) break;
      pll tp = *ite;
      que.push(id[*ite]);
      s1.erase(ite++);
    }

    ite = s1.lower_bound(pll(x[v]+D, y[v]-D));
    while (ite != s1.end()) {
      if (ite->fi != x[v]+D || ite->sc > y[v]+D) break;
      que.push(id[*ite]);
      s1.erase(ite++);
    }

    ite = s2.upper_bound(pll(y[v]-D, x[v]-D));
    while (ite != s2.end()) {
      if (ite->fi != y[v]-D || ite->sc >= x[v]+D) break;
      que.push(id[pll(ite->sc, ite->fi)]);
      s2.erase(ite++);
    }

    ite = s2.upper_bound(pll(y[v]+D, x[v]-D));
    while (ite != s2.end()) {
      if (ite->fi != y[v]+D || ite->sc >= x[v]+D) break;
      que.push(id[pll(ite->sc, ite->fi)]);
      s2.erase(ite++);
    }

  }


  for (int i = 1; i <= N; ++i) {
    if (rm[i]) {
      v1.push_back(pll(x[i], y[i]));
      v2.push_back(pll(y[i], x[i]));
    }
  }

  sort(all(v1));
  sort(all(v2));

  ll ans = 0;
  for (int v = 1; v <= N; ++v) {
    if (rm[v]) {
      ans += upper_bound(all(v1), pll(x[v]-D, y[v]+D)) - lower_bound(all(v1), pll(x[v]-D, y[v]-D));

      ans += upper_bound(all(v1), pll(x[v]+D, y[v]+D)) - lower_bound(all(v1), pll(x[v]+D, y[v]-D));

      ans += lower_bound(all(v2), pll(y[v]+D, x[v]+D)) - upper_bound(all(v2), pll(y[v]+D, x[v]-D));

      ans += lower_bound(all(v2), pll(y[v]-D, x[v]+D)) - upper_bound(all(v2), pll(y[v]-D, x[v]-D));
    }
  }

  cout << ans / 2 << endl;

  return 0;
}



Measured memory_bytes: 24160
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cstdio> 
using namespace std; 
int main(){
	char s[30];
	cin >> s;
	for(int i=0; i<sizeof(s); i++){
		if(s[i] == ','){
			s[i] = ' ';
		}
	}
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){

  int i, j, n, m[100][100], p[100], a, l, k, q=0;

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

    if(i < n - 1) scanf("%d%d", &p[i], &a);
    else scanf("%d%d", &p[i], &p[i + 1]);

   }

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

     for(j = 1; j <= n; j++){

      m[i][j] = 0;

    }
   }

  for(l = 2; l <= n; l++){

    for(i = 1; i <= n - l + 1; i++){
      j = i + l - 1;
      m[i][j] = 100000;
      for(k = i; k < j; k++){
     q = m[i][k] + m[k + 1][j] + p[i - 1]*p[k]*p[j];
     if(m[i][j] > q) m[i][j] = q;
      }
    }
  }

  printf("%d\n", m[1][n]);

   return 0;
}

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

 
int main() {
  string S;
  cin >> S;
  if(S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)) {
      cout << "Bad" << endl;
  }
  else {
    cout << "Good" << endl;
  }

  return 0;
}


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


long long ans = -1;
long long  cnt=0;
vector<int> adj[300000];
vector<int> vis(300000, 0);

void dfs(int s)
{
    vis[s] = 1;
    cnt++;
    for(int i=0; i<adj[s].size(); i++)
    {
        if(!vis[adj[s][i]])
        {
            dfs(adj[s][i]);
        }
    }
    
}


int main()
{
    int n , m;
    cin>>n>>m;
    map<pair<int, int> , int> mp;
    for(int i=0; i<m; i++)
    {
        int x,y;
        cin>>x>>y;
        x--;
        y--;
        
        if (mp.find({x,y})!=mp.end() or mp.find({y,x})!=mp.end())
          continue;
        else
        {
            adj[x].push_back(y);
            adj[y].push_back(x);
            
            mp[make_pair(x,y)] = 1;
            mp[make_pair(y,x)] = 1;
        }
    }
    for(int i=0; i<n; i++)
    {
        cnt=0;
        if(!vis[i])
          {dfs(i);
            ans = max(ans, cnt);}
    }
    
    cout<<ans<<"\n";
}

Measured memory_bytes: 48816
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

int n, x, y;

int main()
{
	scanf("%d%d%d", &n, &x, &y);
	if((y-x-1)%2 == 1) puts("Alice");
	else puts("Borys");
	return 0;
}

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

int main(){
	int s[31]={0};
	
	for(int i=0; i<28; ++i){
		int a;
		scanf(" %d", &a);
		s[a]=1;	
	}
	
	for(int i=1; i<=30; ++i){
		if(s[i]==0) printf("%d\n", i);
	}
	
	return 0;
}

Measured memory_bytes: 1192
d = {1:{1:'.',2:',',3:'!',4:'?',5:' '},
     2:{1:'a',2:'b',3:'c'},
     3:{1:'d',2:'e',3:'f'},
     4:{1:'g',2:'h',3:'i'},
     5:{1:'j',2:'k',3:'l'},
     6:{1:'m',2:'n',3:'o'},
     7:{1:'p',2:'q',3:'r',4:'s'},
     8:{1:'t',2:'u',3:'v'},
     9:{1:'w',2:'x',3:'y',4:'z'}
}
n = int(raw_input())
for i in range(n):
    mes = raw_input()
    mes = mes.split("0")
    mes=filter(lambda x:len(x)>0,mes)
    l=[]
    for e in mes:
        l.append([e[0], len(e)])
    res=""
    for e in l:
        i=int(e[0])
        if(i==1):
            if e[1]%5==0:x=5
            else:x=e[1]%5
        elif(i==7 or i==9):
            if e[1]%4==0:x=4
            else:x=e[1]%4
        else:
            if e[1]%3==0:x=3
            else:x=e[1]%3
        res=res+d[i][x]

    print res

Measured memory_bytes: 6444
#!/usr/bin/env python3
def main():
  a = [int(input()) for i in range(4)]
  if a[0]>a[1]:
    print(a[1]*a[2]+(a[0]-a[1])*a[3])
  else:
    print(a[0]*a[2])
  
if __name__=='__main__':main()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  ll n,k;cin >> n >> k;
  ll cnt_k = 0;
  ll tk = k;
  while(tk<=n){
    ++cnt_k;
    tk +=k;
  }
  ll cnt_kh = 0;
  if(k%2 ==0){
    ll tkh = k/2;
    while(tkh<=n){
      ++cnt_kh;
      tkh +=k;
    }
  }
  ll out = 0;
  out += cnt_k*cnt_k*cnt_k;
  out += cnt_kh*cnt_kh*cnt_kh;
  cout << out << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector<string> S(N);
	for(int i = 0; i < N; i++) cin >> S[i];
	queue<int> q;
	vector<int> part(N, -1);
	part[0] = 0;
	q.push(0);
	while(!q.empty()) {
		for(int i = 0; i < N; i++) if(part[i] == -1 && S[q.front()][i] == '1') {
			part[i] = 1-part[q.front()];
			q.push(i);
		}
		q.pop();
	}
	for(int i = 0; i < N; i++) for(int j = 0; j < N; j++) if(S[i][j] == '1' && part[i] == part[j]) {
		cout << "-1\n";
		return 0;
	}
	int ans = 0;
	for(int i = 0; i < N; i++) {
		vector<int> dist(N, -1);
		dist[i] = 0;
		q.push(i);
		while(!q.empty()) {
			for(int j = 0; j < N; j++) if(dist[j] == -1 && S[q.front()][j] == '1') {
				dist[j] = 1 + dist[q.front()];
				q.push(j);
			}
			q.pop();
		}
		for(int j = 0; j < N; j++) ans = max(ans, dist[j]+1);
	}
	cout << ans << "\n";
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <ctime>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <queue>
#include <utility>
#include <cmath>
using namespace std;

int main(){
	int ans = 0;
	for(int i = 0; i < 6; i++){
		char a;
		scanf("%c", &a);
		if(a == '1'){
			ans++;
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

using namespace std;
int main()
{
    //freopen("output.txt","w",stdout);
    int n,x;
    cin >> n >> x;
    int anss = 0;
    for(int i = 0;i < n;i++)
    {
        int f;
        scanf("%d",&f);
        anss = __gcd(anss,abs(x-f));
    }
    cout << anss;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int a,b,k;

  scanf("%d %d %d", &a, &b, &k);

  int cnt = 0;
  int i;
  
  for (i = a; i >= 1; i--) {
    if (a % i == 0 && b % i == 0) {
      cnt++;
    }

    if (cnt == k) {
      printf("%d\n", i);
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  vll A(N);
  ll B = 316;
  vll backet(100000/B+1, -1);
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
    if(backet.at(i/B) == -1) backet.at(i/B) = A.at(i);
    else backet.at(i/B) = __gcd(backet.at(i/B), A.at(i));
  }
  auto func = [&](int left, int right){
    ll res = -1;
    while(left < right && left % B != 0){
      if(res == -1) res = A.at(left);
      else res = __gcd(res, A.at(left));
      left++;
    }
    while(left < right && right % B != 0){
      right--;
      if(res == -1) res = A.at(right);
      else res = __gcd(res, A.at(right));
    }
    for(int i = left; i < right; i+=B){
      if(res == -1) res = backet.at(i/B);
      else res = __gcd(res, backet.at(i/B));
    }
    return res;
  };

  ll ans = -1;
  for(int i = 0; i < N; i++){
    ll res = -1;
    if(i == 0) res = func(1, N);
    else if(i == N-1) res = func(0, N-1);
    else res = __gcd(func(0, i), func(i+1, N));
    chmax(ans, res);
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    H = il()

    ret, p = 0, 0
    for n in range(N):
        if p <= H[n]:
            ret += H[n] - p
        p = H[n]
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 10252
#include <bits/stdc++.h>
#define lli long long int
#define inf 2147483647
#define infll LLONG_MAX
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
using namespace std;

int h, w, k;

int solve(vector<string>& s){
    int ans = inf;
    for(int bit = 0; bit < (1<<(h-1)); bit++){
        bool flag = true;
        int n = 0;
        vector<int> div(h, 0);
        for(int i=0; i<h-1; i++){
            if(!(bit & (1<<i))) div[i+1] = div[i];
            else div[i+1] = div[i]+1, n++;
        }
        int sum = 0;
        vector<int> cnt(n+1, 0);
        for(int pos_w = 0; pos_w < w; pos_w++){
            vector<int> sum_l(n+1, 0);
            bool ok = true;
            for(int pos_h = 0; pos_h < h; pos_h++){
                sum_l[div[pos_h]] += s[pos_h][pos_w] - '0';
                cnt[div[pos_h]] += s[pos_h][pos_w] - '0';
                if(sum_l[div[pos_h]] > k) flag = false;
                if(cnt[div[pos_h]] > k) ok = false;
            }
            if(!ok) sum++, cnt = sum_l;
        }
        if(flag) ans = min(ans, n + sum);
    }
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    
    cin >> h >> w >> k;
    vector<string> s(h);
    rep(i, h){
        cin >> s[i];
    }
    cout << solve(s) << endl;
}

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

using namespace std;

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

    int cnt = 0;
    int ans = 0;
    vector<int> vec(N);

    cin >> vec.at(0);

    for(int n = 1; n < N;n++){
        cin >> vec.at(n);
        
        if(vec.at(n-1) >= vec.at(n))
           cnt++;

        if(vec.at(n-1) < vec.at(n) || n == N-1){
           if(ans < cnt)
            ans = cnt;
            cnt = 0;
        }
    }
    cout << ans << endl;
}

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

using namespace std;

int main()
{
    int n,x,t;
    cin >> n >> x >> t;
    int ans=abs(x-t);
    for (int i=1;i<n;i++)
    {
        x=t;
        cin >> t;
        ans=__gcd(ans,abs(x-t));
    }
    cout << ans << endl;
    return 0;
}


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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

typedef long long ll;

using namespace std;

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

    return gcd(b, a % b);
}

int main()
{
    int N;
    cin >> N;
    ll T[N];
    REP(i, N)
    {
        cin >> T[i];
    }

    // 2数の最小公倍数を頭から求めていく
    ll ans;
    if (N == 1)
    {
        ans = T[0];
    }
    else
    {
        ans = (T[0] / gcd(T[0], T[1])) * T[1];
        for (int i = 2; i < N; ++i)
        {
            ans = (ans / gcd(ans, T[i])) * T[i];
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
if __name__ == '__main__':
    W = int(input())
    v = [0]
    w = [0]
    d = []
    m = []
    counter = 1
    result = []
    while W != 0:
        N = int(input())
        v[:] = [0]
        w[:] = [0]
        d[:] = []
        m[:] = []

        """the initialization of array d"""
        for x in range(W + 1):
            temp = [0] * (N + 1)
            d.append(temp)

        for x in range(W + 1):
            temp = [0] * (N + 1)
            m.append(temp)

        """prepare the dataset"""

        for x in range(N):
            i = input().split(',')
            v.append(int(i[0]))
            w.append(int(i[1]))

        """processing"""

        for weight in range(W + 1):
            for kind in range(N + 1):
                if weight != 0 and kind != 0:
                    if w[kind] > weight:
                        d[weight][kind] = d[weight][kind - 1]
                        m[weight][kind] = m[weight][kind - 1]
                    else:
                        if d[weight - w[kind]][kind - 1] + v[kind] > d[weight][kind - 1]:
                            d[weight][kind] = d[weight - w[kind]][kind - 1] + v[kind]
                            m[weight][kind] = m[weight - w[kind]][kind - 1] + w[kind]
                        elif d[weight - w[kind]][kind - 1] + v[kind] == d[weight][kind - 1]:
                            d[weight][kind] = d[weight][kind - 1]
                            if m[weight - w[kind]][kind - 1] + w[kind] < m[weight][kind - 1]:
                                m[weight][kind] = m[weight - w[kind]][kind- 1] + w[kind]
                            else:
                                m[weight][kind] = m[weight][kind - 1]
                        else:
                            d[weight][kind] = d[weight][kind - 1]
                            m[weight][kind] = m[weight][kind - 1]

        result.append("Case " + counter.__str__() + ":")
        result.append(d[W][N])
        result.append(m[W][N])

        W = int(input())
        counter += 1

    for line in result:
        print(line)

Measured memory_bytes: 29508
N = int(input())
S = input()
MAX = 0
res = 0
for i in S:
  if i == 'I':
    res += 1
    MAX = max(MAX,res)
  elif i == 'D':
    res -= 1
    MAX = max(MAX,res)
  else:
    pass
print(MAX)
    
  

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


#define INF 1000000000000


signed main(){
int m,n,k,l;
cin>>n>>m;
vector<vector<int>>a(n);
vector<int>b(n);

rep(i,m){
  cin>>k>>l;
  a[k-1].push_back(l);
  a[l-1].push_back(k);
}

queue<int>q;
q.push(1);
while(!q.empty()){
  int p=q.front()-1;
  q.pop();
  rep(i,a[p].size()){

    if(!b[a[p][i]-1]){
      q.push(a[p][i]);
      b[a[p][i]-1]=p+1;
    }
  }
}
cout<<"Yes"<<endl;
rep(i,n-1){
  cout<<b[i+1]<<endl;
}
}


Measured memory_bytes: 12812
fun main(args: Array<String>) {
    val (N, K) = readInputLine().split(" ").map { it.toInt() }
    
    var ans = K.toLong()
    
    for (i in 2..N) {
        ans *= (K - 1).toLong()
    }

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 36024
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++ << "\n";
        // cout << *t++;
        // if(t != V.end()) cout << " ";
    }
    // cout << endl;
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a, b;

    list<int> v(0);
    auto itr = v.end();

    cin >> n;
    rep(i, n) {
        cin >> a;
        if(a == 0) {
            cin >> b;
            itr = v.insert(itr, b);
        } else if(a == 1) {
            cin >> b;
            advance(itr, b);
        } else {
            itr = v.erase(itr);
        }
    }
    vecout(v);
}



Measured memory_bytes: 34140
// Made by Luis Miguel Baez
// es.luismiguelbaez@gmail.com

#include <bits/stdc++.h>
 
using namespace std;

#define endl '\n'
#define precise(n,k) fixed << setprecision(k) << n
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define uint  unsigned int
#define ll    long long
#define ull   unsigned long long
#define ld    long double

#define pii   pair<int, int>
#define piii  pair<int, pair<int, int>>
#define pll   pair<ll, ll>

#define F  first
#define S  second
#define PB push_back
#define MP make_pair

#define debug(...) "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

string to_string(string s) {
    return '"' + s + '"';
}

string to_string(bool b) {
    return (b ? "true" : "false");
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename T>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for (const T &x : v) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string((T)x);
    }
    res += "}";
    return res;
}

// add templates here

template<class T>
void println(const vector<T> &data) {
    cout << to_string<vector<T>, T>(data) <<endl;
}

template<class T>
void println(const T &data) {
    cout << to_string((T)data) << endl;
}

const int MOD = int(1e9+7);
const int oo  = int(1e9 + 20);
const ll lloo  = (ll)(1e18 + 10);
    
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    vector<int> values(n+1);
    for(int i = 1; i <= n; ++i) {
        cin >> values[i];
    }
    int ans = 0;
    for(int i = 2; i <= n - 1; ++i) {
        if(values[i-1] < values[i] && values[i] < values[i+1]) {
            ans++;
        } else if(values[i-1] > values[i] && values[i] > values[i+1]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3552
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
using lint=long long;
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
signed main(){
  int n,x,y;cin>>n>>x>>y;
  vector<int> a(n+1,0);
  rep1(i,n)cin>>a[i];
  a[0]=a[n];
  int res=abs(a[n-1]-a[n]);
  res=max(res,abs(a[n]-y));
  cout<<res<<"\n";
  return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+50;
int gi(){
    char ch=getchar(); int x=0,q=0;
    while(ch<'0'||ch>'9') q=ch=='-'?1:q,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return q?-x:x;
}
int t[N];
int main(){
    int n=gi(),c=gi(),k=gi();
    for (int i=1; i<=n; ++i) t[i]=gi();
    sort(t+1,t+n+1);
    int ans=0,las=t[1],cnt=1;
    for (int i=2; i<=n; ++i)
	if (las+k<t[i]||cnt==c)
	    ++ans,las=t[i],cnt=1;
	else
	    ++cnt;
    cout<<ans+1;
    return 0;
}


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

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


long long color[300][300];
int done[300][300];
int ans;	
long long col;
int dfs(int x,int y){
	if( x < 0 || x >= 300 || y >= 300 || y < 0 ) return 0;
	if( col != color[x][y] )  return 0;
	if( done[x][y]++ ) return 0;
	dfs(x-1,y);
	dfs(x,y-1);
	dfs(x+1,y);
	dfs(x,y+1);
	
}
int main(){
	int n;
	while(cin >> n&&n){
		ans = 0;
		rep(i,300)rep(j,300) color[i][j]=0,done[i][j]=0;
		vector<int> l(n),t(n),r(n),b(n);
		vector<int> ux,uy;
		
		rep(i,n) {
			cin >> l[i] >> t[i] >> r[i] >> b[i];
			for(int j = -1 ; j <= 1 ; j++) ux.push_back(j+l[i]);
			for(int j = -1 ; j <= 1 ; j++) ux.push_back(j+r[i]);
			for(int j = -1 ; j <= 1 ; j++) uy.push_back(j+t[i]);
			for(int j = -1 ; j <= 1 ; j++) uy.push_back(j+b[i]);
			
		}
		sort(ux.begin(),ux.end());
		sort(uy.begin(),uy.end());
		ux.erase(unique(ux.begin(),ux.end()),ux.end());
		uy.erase(unique(uy.begin(),uy.end()),uy.end());
		rep(i,n){
			l[i] = lower_bound(ux.begin(),ux.end(),l[i]) - ux.begin();
			r[i] = lower_bound(ux.begin(),ux.end(),r[i]) - ux.begin();
			t[i] = lower_bound(uy.begin(),uy.end(),t[i]) - uy.begin();
			b[i] = lower_bound(uy.begin(),uy.end(),b[i]) - uy.begin();
			for(int x = l[i] ; x < r[i] ; x++)
				for(int y = b[i] ; y < t[i] ; y++)
					color[x][y] |= 1ll<<i;
		}

		for(int i = 0 ; i < 300 ; i++){
			for(int j = 0 ; j < 300 ; j++){
				if( !done[i][j] ){
					col = color[i][j];
					ans++;
					dfs(i,j);
				}
			}
		}
		cout << ans << endl;
	}

	
}

Measured memory_bytes: 6468
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a;
  int b,c,d;
  cin>>b;
  a.push_back(b);
    cin>>c;
  a.push_back(c);
    cin>>d;
  a.push_back(d);
sort(a.begin(),a.end());
  cout<<a[0]+a[1];


  return  0;
}

Measured memory_bytes: 256