akhauriyash/Code-Regression huggingface dataset:
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let X = xs[0].split('');
   let Y = xs[1].split('');
   Y.pop();
   let count = 0
   for(let i=0; i<Y.length; i++){ 
     if(X[i]==Y[i]){
   	  count++;	
     }
   }
   if(X.length==count){
     console.log('Yes');
   }else{
     console.log('No');
   }
   
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

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

int main () {
  string S ;
  cin >> S ;
  
  if(S[5]=='1'){
    cout << "TBD" << endl ;
  } else if(S[6] >= '5' ) {
    cout << "TBD" << endl ;
  } else {
    cout << "Heisei" << endl ;
  }
}

Measured memory_bytes: 256
n,m = map(int, input().split())

routes = [[] for i in range(n)]
for i in range(m):
    x,y = map(int, input().split())
    routes[x-1].append(y-1)
    routes[y-1].append(x-1)


rooms = [0 for i in range(n)] # 行ったら1,まだなら0
marks = [0 for i in range(n)] # 部屋におく道標
rooms_rate = [[0]] # ０回目、１回目、２回目、３回目…に行ける部屋
rooms[0] = 1

turn = 0
for i in rooms_rate:
    newrate = []
    for j in rooms_rate[turn]: #(turn)回目に行けた部屋から行ける部屋を調べる
        for k in routes[j]: 
            if (rooms[k] == 0): #行ったことのない部屋なら
                rooms[k] = 1
                marks[k] = j # 道標をセット
                newrate.append(k)
    rooms_rate.append(newrate)
    if (len(newrate) == 0): #新しく行けなくなったら終わり
        break
    turn = turn + 1


if(all(rooms) == True):
    print('Yes')
    for i in range(1,n):
        print(str(int(marks[i]) + 1))

else:
    print('No')

Measured memory_bytes: 37420
package main

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

const (
	MAX_N  = 41
	MAX_AB = 10
)

type medicine struct {
	A, B, C int
}

var N, Ma, Mb int
var medicines [MAX_N]medicine
var dp [MAX_N][MAX_N * MAX_AB][MAX_N * MAX_AB]int

func IntGcd(a, b int) int {
	if a < b {
		b, a = a, b
	}
	if b == 0 {
		return a
	}
	return IntGcd(b, a%b)

}
func memo(pos, ma, mb int) int {
	if ma != 0 && mb != 0 {
		gcd := IntGcd(ma, mb)
		// fmt.Println(ma, mb, gcd)
		if (ma/gcd) == Ma && (mb/gcd) == Mb {
			return 0
		}
	}
	if pos >= N {
		return 11451419
	}
	if dp[pos][ma][mb] >= 0 {
		return dp[pos][ma][mb]
	}
	res := 11451419
	// fmt.Println(medicines[pos])
	res = IntMin(res, memo(pos+1, ma+medicines[pos].A, mb+medicines[pos].B)+medicines[pos].C)
	res = IntMin(res, memo(pos+1, ma, mb))
	dp[pos][ma][mb] = res
	return res
}
func init() {
	for i := 0; i < MAX_N; i++ {
		for j := 0; j < MAX_N*MAX_AB; j++ {
			for k := 0; k < MAX_N*MAX_AB; k++ {
				dp[i][j][k] = -1
			}
		}
	}
}
func main() {
	fsc := NewFastScanner()
	N, Ma, Mb = fsc.NextInt(), fsc.NextInt(), fsc.NextInt()
	for i := 0; i < N; i++ {
		var tmp medicine
		a, b, c := fsc.NextInt(), fsc.NextInt(), fsc.NextInt()
		tmp.A = a
		tmp.B = b
		tmp.C = c
		medicines[i] = tmp
	}
	// fmt.Println(medicines)
	// fmt.Println(dp)
	res := memo(0, 0, 0)
	if res >= 11451419 {
		res = -1
	}
	fmt.Println(res)
}

//template
type FastScanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewFastScanner() *FastScanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &FastScanner{r: rdr}
}
func (s *FastScanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *FastScanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *FastScanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *FastScanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *FastScanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *FastScanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

func IntMax(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func Int64Max(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func Float64Max(a, b float64) float64 {
	if a < b {
		return b
	}
	return a
}

func IntMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func Int64Min(a, b int64) int64 {
	if a > b {
		return b
	}
	return a
}
func Float64Min(a, b float64) float64 {
	if a > b {
		return b
	}
	return a
}


Measured memory_bytes: 54528
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<vector<ll>>
#define VV(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;


bool nCr_odd(ll a, ll b){
  while(a!=0&&b!=0){
    if(!(a%2)&&(b%2)) return false;
    a/=2, b/=2;
  }
  return true;
}

ll n;
int main(int argc, char const *argv[]) {
  std::cin >> n;
  vll a(n);
  bool f = false;
  string s;std::cin >> s;
  for(int i=0;i<n;i++) {
    a[i] = s[i]-'1';
    if(a[i]==1) f = true;
  }
  ll ret = 0;
  for(int i=0;i<n;i++) ret = (ret + nCr_odd(n-1, i)*a[i])%2;

  if(ret){
    std::cout << 1 << '\n';
    return 0;
  }
  if(f){
    std::cout << 0 << '\n';
    return 0;
  }
  re(i, n) a[i]/=2;
  ret = 0;
  for(int i=0;i<n;i++) ret = (ret + nCr_odd(n-1, i)*a[i])%2;
  if(ret==1){
    std::cout << 2 << '\n';
    return 0;
  }
  std::cout << 0 << '\n';
  return 0;
}


Measured memory_bytes: 9220
import sys

input = sys.stdin.readline
S = input()
S = S.replace('\n' , '')
tmp = ""
division_count = 0
for s in S:
    if tmp == "":
        tmp = s
        continue
    if tmp == s:
        continue
    else:
        tmp = s
        division_count += 1
print(division_count)

Measured memory_bytes: 9092
MOD = 10 **9 + 7

n,a,b = map(int,input().split())

all = pow(2,n,MOD)
if all:# not 0
  all -=1

for i in (a,b):
  sub = 1
  for j in range(i):
    sub *= n-j
    sub %= MOD
    sub *= pow(j+1,MOD-2,MOD)
    sub %= MOD
  all -= sub
  if all < 0:
    all += MOD
print(all)

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

using namespace std;

#define ll  long long
#define ld  double

#define sz(x)   (int)x.size()
#define all(x)  x.begin(),x.end()

#define pb  emplace_back
#define X   first
#define Y   second

const int   N   = 1005;
const int   M   = 2e5 + 5;

typedef pair<int,int>   ii;

int grundy(int x,int k) {
    if (x % k == 0) return  x / k;
    if (x < k)      return  0;

    int c = x / k;
    int l = c * k;

    if (l + c + 1 < x)  {
        int  q = (x - l - 1) / (c + 1);
        x -= q * (c + 1);
    }
    return  grundy(x - c - 1,k);
}

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

    int n;  cin >> n;
    int S = 0;

    for(int i = 0 ; i < n ; ++i)    {
        int x;  cin >> x;
        int k;  cin >> k;

        S ^= grundy(x,k);
    }
    if (S)  cout << "Takahashi";
    else    cout << "Aoki";
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<string>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<queue>
#include<functional>
#include<iso646.h>
#include<bitset>

#ifndef M_PI
#define M_PI 3.14159265358979
#endif
#define deg_to_rad(deg) (((deg)/360)*2*M_PI)
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;

const ll INF = 1e15;
const ll MOD = 1e9 + 7;

int main() {
	ll i, j;
	string S, T;
	cin >> S >> T;
	cout << T << S << endl;


	return 0;
}


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

using namespace std;

typedef long long ll;
#define mems(p) memset(p,-1,sizeof(p))
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define nl "\n"

const int mxN = 1e5;
const ll MOD = 1e9 + 7;

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

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

int main() {
	fast();
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int needed = 0;
	while (b <= a) {
		b *= 2;
		++needed;
	}
	while (c <= b) {
		c *= 2;
		++needed;
	}
	if (needed > k) {
		cout << "No\n";
	} else {
		cout << "Yes\n";
	}
}

Measured memory_bytes: 3636
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T3;

ll d;
int n,m;
int main(){
	vector<ll> ans;
	while(true){
		cin >> d;
		if(d == 0)break;
		cin >> n >> m;

		vector<ll> dist;
		for(int i = 0;i < n-1;i++){
			ll num;
			cin >> num;
			dist.push_back(num);
		}
		dist.push_back(0LL),dist.push_back(d);

		vector<ll> k(m);
		for(int i = 0;i < m;i++)cin >> k[i];

		ll a = 0;
		sort(dist.begin(),dist.end());
		for(int i = 0;i < m;i++){
			auto p = upper_bound(dist.begin(),dist.end(),k[i]);
			ll pos1 = *p;
			p--;
			ll pos2 = *p;
			a += min(pos1 - k[i],k[i] - pos2);
		}

		ans.push_back(a);
	}

	for(ll a:ans)cout << a << endl;
}




Measured memory_bytes: 3864
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
using namespace std;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int N, A, B;
    cin >> N >> A >> B;
    cout << ((N * A) >= B ? B : (N * A)) << 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;
using ll = long long;

constexpr ll INF = ll(1e+18) + 1;

ll dist(ll a, ll b, ll c, ll d) {
    return abs(a-c) + abs(b-d);
}

int main() {
    int N;
    int t, x, y;
    int bt=0, bx=0, by=0;

    cin >> N;

    rep (i, N) {
        cin >> t >> x >> y;
        
        int dt = abs(t-bt);
        int dx = abs(x-bx);
        int dy = abs(y-by);

        if ((dt >= dx+dy) && ((dt-dx-dy)%2 == 0)) {
            bt = t;
            bx = x;
            by = y;
            continue;
        } else {
            cout << "No" << endl;
            return 0;
        }
        
    }
    cout << "Yes" << endl;

}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define all(v) v.begin(), v.end()

const ll mod=1000000007;

ll countBits(ll in){
  int res=0;
  for(;in>0;in>>=1){
    if((in&0x01)!=0){
      res++;
    }
  }
  return res;
}

template<typename T>
void show2dVector(vector<vector<T>>& v){
  for(int i=0;i<v.size();i++){
    int m=v[i].size();
    cout<<i<<" : ";
    for(int j=0;i<m;i++){
      cout<<v[i][j]<<" ";
    }
    cout<<endl;
  }
}

void bfs(const vector<vector<int>>&g, int v, vector<bool>& seen){
  seen[v]=true;
  cout<<v<<" ";
  for(auto next: g[v]){
    if(seen[next]){
      continue;
    }
    bfs(g,next,seen);
  }
}

bool dfs(vector<vector<int>> &g,int start,int goal,vector<bool>&seen){
  bool res=false;
  seen[start]=true;
  if(start==goal){
    return true;
  }
  for(auto next: g[start]){
    if(seen[next]){
      continue;
    }
    res=dfs(g,next,goal,seen);
    if(res){
      break;
    }
  }
  return res;
}

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);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}

ll powm(ll a,ll n, ll m){
  ll ret=1;
  while(n>0){
    if(n%2==1){
      ret=(ret*a)%m;
    }
    n>>=1;
    a=(a*a)%m;
  }
  return ret;
}

void primeFactor(ll val, map<ll,ll> &primeList){
  if(val<1){
    return;
  }
  for(int i=2;i*i<val;i++){
    while(val%i==0){
      primeList[i]++;
      val/=i;
    }
  }
  if(val!=1){
    primeList[val]=1;
  }
  return;
}

const string yesno(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int n;cin>>n;
  map<char,int> mp;
  for(int i=0;i<n;i++){
    string s;cin>>s;
    if(string("MARCH").find(s[0])!=string::npos){
      mp[s[0]]++;
    }
  }
  int sz=mp.size();
  ll ans=0;
  if(sz<3){
    cout<<0<<endl;
    return 0;
  }
  if(sz==3){
    ans=1;
    for(auto it:mp){
      ans*=it.second;
    }
  }else if(sz==4){
    for(int i=0;i<4;i++){
      int cnt=-1;
      ll val=1;
      for(auto it:mp){
        cnt++;
        if(cnt==i){
          continue;
        }
        val*=it.second;
      }
      ans+=val;
    }
  }else{
    for(int i=0;i<4;i++){
      for(int j=i+1;j<5;j++){
        int cnt=-1;
        ll val=1;
        for(auto it:mp){
          cnt++;
          if(cnt==i||cnt==j){
            continue;
          }
          val*=it.second;
        }
        ans+=val;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3624
/*
...........__________    							 |										    ___  __
.............|       |     						     |											 |   /
.............|       |     						     |									  		 |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
.........  __|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int 				long long
#define ull 				unsigned long long int
#define ld 					long double
#define vi 					vector<int>
#define vii 				vector<pair<int,int>>
#define vvi 				vector<vector<int>>
#define pf 					push_front
#define popb 				pop_back
#define pb 					push_back
#define eb 					emplace_back
#define pii 				pair<int,int>
#define prec(x) 			fixed<<setprecision(15)<<x
#define all(x) 				x.begin(),x.end()
#define rall(x) 			x.rbegin(),x.rend()
#define mset(a,b) 			memset(a,b,sizeof(a))
#define mcpy(a,b) 			memcpy(a,b,sizeof(a))
#define fo0(i,n) 			for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n) 			for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b) 			for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)			for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)			for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
#define inf 1e18
const int mod=1e9+7;
const int N=4e5+10;

void raushan_kumar(){
	int n,a,b;cin>>n>>a>>b;
	map<int,int> m;
	for(int i=1;i<n;i++){
		for(int j=i+1;j<=n;j++){
			int x=abs(j-i);
			int y=abs(i-a)+1+abs(j-b);
			int z=abs(i-b)+1+abs(j-a);
			int t=min({x,y,z});
			m[t]++;
		}
	}
	fo1(i,n-1){
		cout<<m[i]<<endl;
	}
}

int32_t main()
{
	fast;int t=1;
	//cin>>t;
	while(t--){
		raushan_kumar();
	}

}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main(void){
  int a, b, c;
  double s, l, h;
  double pi;

  cin >> a >> b >> c;

  pi = c * (M_PI / 180);

  s = (double)((a * b * sin(pi)) / 2);

  l = (double)(sqrt(a * a + b * b - 2 * a * b * cos(pi)) + a + b);

  h = (double)(sin(pi) * b);

  printf("%lf\n%lf\n%lf\n", s, l, h);

  return 0;
}

Measured memory_bytes: 1192
using System;
using System.Collections.Generic;
using System.Text;

namespace AtTest.D_Challenge
{
    class ABC_058
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            int[] nm = ReadInts();
            long[] xs = ReadLongs();
            long[] ys = ReadLongs();
            long mask = 1000000000 + 7;
            long ySum = 0;
            for (int i = 0; i < nm[1] / 2; i++)
            {
                ySum += (ys[nm[1] - i - 1] - ys[i]) * (nm[1] - i * 2 - 1);
                ySum %= mask;
            }
            //Console.WriteLine(ySum);
            long xSum = 0;
            for(int i = 0; i < nm[0] / 2; i++)
            {
                xSum+= (xs[nm[0] - i - 1] - xs[i]) * (nm[0] - i * 2 - 1);
                xSum %= mask;
            }

            Console.WriteLine((xSum * ySum) % mask);
        }

        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 31324
#include "bits/stdc++.h"
#include <random>

using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007LL
#define llMAX 9223372036854775807LL
#define llMIN -9223372036854775808LL
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll D=365;
vi c(26);
vi last(26,-1);
vvi dat(D, vi(26));  // N * M の2次元配列
vvi AAlist(D, vi(D));  // N * M の2次元配列




ll calcscore(vi &Alist)
{
  for(ll i=0;i<26;i++){
    last[i]=-1;
  }
  

  ll sc=0;
  ll sct=0;
  ll l;
  ll id;
  ll factscore=0;
  for(ll i=0;i<D;i++){
    sc=-922337203685477580LL;
    for(ll j=0;j<26;j++){
      if (Alist[i]==j)continue;
      l=i-last[j];
      sct=l*c[j];
      factscore-=sct;
    }

    id=Alist[i];
    factscore+=dat[i][id];
    last[id]=i;
  }

  return factscore;
}



void makeseed(int xid,int startoffset)
{

  ll sc=0;
  ll sct=0;
  ll maxid=-1;
  ll factscore=0;
  
  for(ll i=0;i<26;i++){
    last[i]=startoffset-1;
  }

  for(ll i=startoffset;i<D;i++){
    sc=-922337203685477580LL;
    maxid=0;
    
    for(ll j=0;j<26;j++){
      ll l=i-last[j];
      
      l*=(l-1-l*5/6);
      sct=l*c[j];
      factscore-=sct;
      sct=dat[i][j]+sct;
      if (sc<sct){
        sc=sct;
        maxid=j;
      }
    }
    factscore+=sc;
    last[maxid]=i;
    AAlist[startoffset][i]=maxid;
    //cout<<(maxid+1)<<endl;
  }


}





int main(){
  ll ans=0;
  ll debug=0;//本番では0に
  cin>>ans;
  ll factscore=0;


  for(ll i=0;i<26;i++){
    cin>>c[i];
  }
  for(ll i=0;i<D;i++){
    for(ll j=0;j<26;j++){
      cin>>dat[i][j];
    }
  }


  for(ll i=0;i<100;i++){
    makeseed(0,i);
  }
  



  for(ll i=1;i<100;i++){
    for(ll j=0;j<i;j++){
      AAlist[i][j]=AAlist[i-1][j];
    }
  }
  
  ll score=-922337203685477580LL;
  ll ansid=0;




  score=-922337203685477580LL;
  
  for(ll i=0;i<100;i++){
    if (score<calcscore(AAlist[i])){
      score=calcscore(AAlist[i]);
    }
  }




  random_device rnd;
  ll loopcnt=0;
  for(ll i=100;i<D;i++){
    ll aaa=rnd()%D;
    ll ref1=rnd()%100;
    ll ref2=rnd()%100;
    loopcnt++;
    if (loopcnt>20000)break;
    for(ll j=0;j<aaa;j++){
      AAlist[i][j]=AAlist[ref1][j];
    }
    
    for(ll j=aaa;j<D;j++){
      AAlist[i][j]=AAlist[ref2][j];
    }

    if (score>calcscore(AAlist[i]))
    {
      i--;
      continue;
    }
    
  }


















  score=-922337203685477580LL;
  ansid=0;
  for(ll i=0;i<D;i++){
    if (score<calcscore(AAlist[i])){
      score=calcscore(AAlist[i]);
      ansid=i;
    }

    if (debug==1){
      cout<<calcscore(AAlist[i])<<endl;
    }

  }



  if (debug==0)
  {
    for(ll i=0;i<D;i++){
      cout<<(AAlist[ansid][i]+1)<<endl;
    }
  }else{
    cout<<calcscore(AAlist[ansid])<<endl;
  }
    

  return 0;
}

/*
1万
36万
92万
*/

Measured memory_bytes: 4776
#include<iostream>
#include<algorithm>

using namespace std;

struct P{
    char name[20];
    int t;
};

const int SIZE = 1000002;
P que[SIZE];
int head, tail, n;

void enqueue(P x){
    que[tail] = x;
    tail = (tail + 1) % SIZE;
}

P deque(){
    P tmp = que[head];
    head = (head + 1) % SIZE;
    return tmp;
}

int main(){
    int elaps = 0;
    int c,i,q;
    P u;

    cin >> n >> q;
    for(int i = 1; i <= n; i++){
        cin >> que[i].name >> que[i].t;
    }
    head = 1, tail = n+1;

    while(head != tail){
        u = deque();
        c = min(u.t, q); // 処理を行う
        u.t -= c;
        elaps += c;
        if(u.t > 0) enqueue(u);
        else    cout << u.name << " " << elaps << endl;
    }

    return 0;
}


Measured memory_bytes: 7504
A = list(map(int, input().split()))
for i in range(2, 0, -1):
  j = 0
  while j < i:
    if A[j+1] < A[j]:
      A[j], A[j+1] = A[j+1], A[j]
    j += 1

print(A[0],A[1],A[2])



Measured memory_bytes: 5596
#include "bits/stdc++.h"
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define all(x) (x).begin(),(x).end()
#define tsort(v) sort((v).begin(), (v).end())
#define trev(v) reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define pop(v) (v).back(); (v).pop_back()
#define el "\n"
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#ifdef tqktmp_1
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
typedef long long lint;

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() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    char in;
    lint ans = 0;
    rep(i, 3){
        cin>>in;
        if(in=='1')ans++;
    }
    co(ans);
}

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

struct Point
{
	int x,y;
	Point(int a=0,int b=0):x(a),y(b){}
	friend Point operator - (const Point &a,const Point &b){return Point(a.x-b.x,a.y-b.y);}
	friend int operator * (const Point &a,const Point &b){return a.x*b.y-a.y*b.x;}
} p[210];
int pw2[210];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&p[i].x,&p[i].y);
	pw2[0]=1;
	for(int i=1;i<=n;i++)
		pw2[i]=(pw2[i-1]<<1)%ha;
	int ans=(pw2[n]-n*(n-1)/2-n-1+ha)%ha;
	for(int i=2;i<n;i++)
		for(int j=i+1;j<=n;j++)
		{
			int sum=0;
			for(int k=1;k<i;k++)
				sum+=((p[k]-p[i])*(p[j]-p[i])==0);
			ans=(ans-pw2[sum]+1+ha)%ha;
		}
	printf("%d\n",ans);
	return 0;
}

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

namespace ConsoleApp15
{
    class Class161
    {
        static void Main()
        {
            var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = ab[0], b = ab[1];
            string ans = "";
            if (a >= b)
            {
                for (int i = 0; i < a; i++)
                    ans += b.ToString();
            }
            else
            {
                for (int i = 0; i < b; i++)
                    ans += a.ToString();
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11348
/*
 Shahadat Hossain
 I.C.T Department
 Comilla University
 Session: 2013-2014
 */

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

typedef long long ll;
typedef unsigned long long ull;

#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define UNIQUE(x)       x.erase(unique(all(x)), x.end())

#define fs              first
#define sc              second
#define pb              push_back

#define sz(x)           (int)x.size()
#define all(v)          v.begin(),v.end()
#define D(x)            cerr << #x " = " << x << '\n'
#define ms(a,b)         memset(a, b, sizeof(a))
#define valid(x,y)      x>=0 && y>=0 && x<n && y<m

#define input           freopen("/Users/shahadat/Desktop/input.txt", "r", stdin)
#define output          freopen("/Users/shahadat/Desktop/output.txt", "w", stdout)

#define endl            '\n'
#define eps             1e-5
#define yes             printf("YES\n")
#define no              printf("NO\n")

#define int             long long

int gcd(int n,int m){return m==0?n:gcd(m,n%m);}
inline int Set(int n,int pos) { return n = n | (1 << pos); }
inline int Reset(int n,int pos) { return n = n & ~(1 << pos); }
inline bool Check(int n,int pos) { return (bool)(n & (1 << pos)); }
inline int Count(ll n) { return __builtin_popcountll(n); }


int32_t main(){
    int n;
    cin >> n;
    
    vector<int> a(n + 1);
    for(int i = 0; i < n + 1; i++)
        cin >> a[i];


    int prev = 0;
    int res = 0;
    for(int i = 0; i < n; i++){
        int temp; cin >> temp;
        res += min(prev, a[i]);
        a[i] -= min(prev, a[i]);
        res += min(a[i], temp);
        temp -= min(a[i], temp);
        prev = temp;
    }
    res += min(prev, a.back());
    cout << res << endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = numeric_limits<ll>::max()/3;
const ll mod = 1e9 + 7;

int main(void){
  int n;
  ll k;
  cin >> n >> k;
  auto a = vector<int>(n);
  for(int i = 0;i < n;++i){
    cin >> a[i];
  }
  ll res = 0LL;
  for(int i = 0;i < n;++i){
    ll numpost = 0;
    for(int j = i+1;j < n;++j){
      if(a[i] > a[j]){
        ++numpost;
      }
    }
    ll numprev = 0;
    for(int j = 0;j < i;++j){
      if(a[i] > a[j]){
        ++numprev;
      }
    }
    //cout << i << " " << numprev << " " << numpost << endl;
    ll delta1;
    delta1 = (k * (k+1) / 2) % mod;
    delta1 = (numpost * delta1) % mod;
    res = (res + delta1) % mod;
    ll delta2;
    delta2 = (k * (k-1) / 2) % mod;
    delta2 = (numprev * delta2) % mod;
    res = (res + delta2) % mod;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

int main()
{
	int a, b;
	while (1){
		scanf("%d %d", &a, &b);
		if (a == 0 && b == 0) break;

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

			for(int j = 0; j < b; j++){
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 1000
#include <bits/stdc++.h>
using namespace std;
#define ALL(A) (A).begin(),(A).end()
#define ll long long
const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b;
	cin >> a >> b;
	cout << max(0,a-2*b) << endl;
}

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

#define ff first
#define ss second
#define mp make_pair

using namespace std;

typedef long long ll;

// uniform_int_distribution<int>
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int v[100005];
ll dp[100005][2];
bool mark[100005][2];
int n;

ll f(int i, int j) {
	if(i == n-1) return j ? -v[i] : v[i];
	if(mark[i][j]) return dp[i][j];
	mark[i][j] = true;

	ll ret = -1e18;
	if(j) ret = max(f(i+1, 1) + v[i], f(i+1, 0) - v[i]);
	else  ret = max(f(i+1, 1) - v[i], f(i+1, 0) + v[i]);

	return dp[i][j] = ret;
}

int main() {

	scanf("%d", &n);

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

	printf("%lld\n", f(0,0));

    return 0;
}

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

int main()
{
    int score[5];
    int sum = 0;

    for (int i = 0; i < 5; i++){
        cin >> score[i];
    }

    for (int i = 0; i < 5; i++){
        if (score[i] < 40){
            score[i] = 40;
        }
        sum += score[i];
    }

    cout << sum / 5 << endl;

    return (0);
}

Measured memory_bytes: 3072
import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    static boolean [][] grid;
    static int [] bishopr = {-1,1,-1,1};
    static int [] bishopc = {1,1,-1,-1};
    static long H,W,cnt;
    static HashMap<String,Integer> map = new HashMap<>();
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        map.put("AC", 0);
        map.put("WA", 0);
        map.put("TLE", 0);
        map.put("RE", 0);
        while(N-->0){
            String n= in.next();
            if(map.containsKey(n))
                map.replace(n, map.get(n)+1);
            
        }
        out.println("AC x "+map.get("AC"));
        out.println("WA x "+map.get("WA"));
        out.println("TLE x "+map.get("TLE"));
        out.println("RE x "+map.get("RE"));
        out.flush();
        }
       static boolean isValid (int r, int c){
           if(r>=0&&r<H&&c>=0&&c<W){
               return true;
           }
           return false;
       }
        private static void dfs(int r, int c) {
            for(int i=0;i<4;i++){
                int nr = bishopr[i] +r;
                int nc = bishopc[i]+c;
                if(isValid(nr, nc)&&!grid[nr][nc]){
                    cnt++;
                    grid[nr][nc] = true;
                    dfs(nr, nc);
                }
            }
        }

        static boolean isEven(long a) {
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
    

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}

Measured memory_bytes: 49308
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        long[] a = r.ll();
        long ans = Math.abs((a[0]-2)*(a[1]-2));
        print(ans);
    }

    static void print(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }

        String s() throws IOException{
            return readLine();
        }

        String[] ss() throws IOException{
            return s().split(" ");
        }

        int Int(String s){
            return Integer.parseInt(s);
        }

        int i() throws IOException{
            return Int(s());
        }

        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
                long Long(String s){
            return Long.parseLong(s);
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long(ss[j]);            
            return ll;
        }
    }
}


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

 int main(){
    int n;
    cin >>n;
    if(n==1 || n==2){
        cout << 0 << endl;
        return 0;
        }
    if(n%2==0){
        n=(n-2)/2;
    }
    else{
        n=n/2;
    }
    cout << n << endl;

 }




Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}

class BIT2d{
	public:
	vvi B2;
	int H,W;
	BIT2d(int h,int w){
		B2=vvi(h+1,vi(w+1));
		H=h,W=w;
	}
	void b2add(int h,int w,int a){
		int i,j;
		for(i=h;i<=H;i+=i&-i){
			for(j=w;j<=W;j+=j&-j)(B2[i][j]+=a) %= MOD;
		}
	}
	int b2sum(int h,int w){
		int s=0,i,j;
		for(i=h;i;i-=i&-i)
			for(j=w;j;j-=j&-j)(s+=B2[i][j]) %= MOD;
		return s;
	}
};

signed main(void) {
    int n,m;
    cin >> n >> m;
    vi a(n),b(m);
    rep(i,n)cin >> a[i];
    rep(i,m)cin >> b[i];
    /*
    vvi dp,sum;
    dp = sum = vvi(n,vi(m,0));
    int ans = 1;
    rep(i,n)rep(j,m){
        if(a[i] == b[j]){
            if(i&&j)dp[i][j] += sum[i-1][j-1]+1;
            else dp[i][j] = 1;
            (ans += dp[i][j]) %= MOD;
            dp[i][j] %= MOD;
        }
        if(i)sum[i][j] += sum[i-1][j];
        if(j)sum[i][j] += sum[i][j-1];
        if(i&&j)sum[i][j] -= sum[i-1][j-1];
        sum[i][j] += dp[i][j];
        sum[i][j] %= MOD;
    }
    */
    BIT2d x(n,m);
    int ans = 1;
    rep(i,n)rep(j,m){
        if(a[i] == b[j]){
            int t = x.b2sum(i,j);
            (ans += t+1) %= MOD;
            x.b2add(i+1,j+1,t+1);
        }
    }
    cout << ans << endl;
}


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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    int n;
    cin >> n;
    if (n % 2 == 0)
    {
        cout << max(0, n / 2 - 1) << endl;
    }
    else
    {
        cout << max(0, n / 2) << endl;
    }
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする

def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds

def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    if N%2!=0:
        print(N//2+1)
        exit()
    print(N//2)





if __name__ == "__main__":
    main()

Measured memory_bytes: 38512
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define mod 1000000007
using namespace std;

int same(string &A)
{
    char c = A[0];
    for(int i=1;i<A.size();i++)
    {
        if(A[i]!=c)return 0;
    }
    return 1;
}


int solve(string A, char mxc)
{

     int c=0;
    while(!same(A))
    {
        string B = A;
        B.pop_back();
        for(int i=0;i<A.size()-1;i++)
        {
         if(A[i]!=mxc)
                B[i]=B[i+1];
         }
         //cout<<B<<'\n';
        A = B;
        c++;
    }
    return c;
}


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

string A;
cin>>A;

int n =A.size();

if(n==1)
{
    cout<<0;
    return 0;
}

if(n==2)
{
    if(A[0]==A[1])
        cout<<0;
    else
        cout<<1;
    return 0;
}
int ans = 9999999;

string B =A;
for(int i=0;i<n;i++)
{
    ans = min(ans ,solve(B,A[i]));
    B=A;
}
cout<<ans;

return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll solve(ll n){
  if(n%2==1)return 0;

  ll ans=0;
  n=n/2;
  while(n){
    ans+=n/5;
    n/=5;
  }
  return ans;
}
int main(){
  ll N;
  cin>>N;
  cout<<solve(N)<<endl;

}

Measured memory_bytes: 256
N = int(input())
B = list(map(int,input().split()))
A = [None for _ in range(N)]

A[0] = B[0]
for i in range(1,N-1):
  A[i] = min(B[i-1],B[i])
A[N-1] = B[N-2]
print(sum(A))

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

int main()
{
	int x;
	cin>>x;
	if(x<=599)
	{
		cout<<8<<"\n";
	}
	else if(x<=799)
	{
		cout<<7<<endl;
	}
	else if(x<=999)
	{
		cout<<6<<endl;
	}
	else if(x<=1199)
	{
		cout<<5<<endl;
	}
	else if(x<=1399)
	{
		cout<<4<<endl;
	}
	else if(x<=1599)
	{
		cout<<3<<endl;
	}
	else if(x<=1799)
	{
		cout<<2<<endl;
	}
	else if(x<=1999)
	{
		cout<<1<<endl;
	}
	return 0;
}

Measured memory_bytes: 3632
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	while(1)
	{
		int n,m;
		bool used[510];
		memset(used,0,sizeof(used));
		used[1]=true;
		cin >> n;
		cin >> m;
		if(n==0&&m==0)break;
		vector<int> f[n+1];
		int ans=0;
		for(int i=0;i<m;i++)
		{
			int a,b;
			cin >> a >> b;
			if(a==1)
			{
				ans++;
				used[b]=true;
			}
			f[a].pb(b);
f[b].pb(a);
		}
		for(int i=0;i<f[1].size();i++)
		{
			for(int j=0;j<f[f[1][i]].size();j++)
			{
				if(!used[f[f[1][i]][j]])
				{
					ans++;
					used[f[f[1][i]][j]]=true;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(void){
	long long a,b,x,ans;
	cin >> a >> b >> x;
	if(a!=0){
		ans = (b/x)-(a-1)/x;
	}else{
		ans = (b/x)+1;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second

using namespace std;

class DebugStream {}LOG;
template <typename T>DebugStream &operator<<(DebugStream &s, const T&) { return s; }
#ifdef DEBUG
#define LOG clog
#endif

typedef long long ll;
typedef pair<ll, ll> ii;
typedef long double ld;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int maxN = 1e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20, bs = 29;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	string s, t, u;
	int a, b;
	cin >> s >> t >> a >> b >> u;
	if(u == s) a--;
	else b--;
	cout << a << ' ' << b << '\n';
}


Measured memory_bytes: 256
i,s,m,a['   '];main(n,k,l){for(;scanf("%d%d",&n,&k)*n;i=s=m=!printf("%d\n",m))for(l=k,memset(a,0,'~~~');i<n;m=i++<l?s:s>m?s:m)scanf("%d",a+k),s+=a[k++]-a[i];}

Measured memory_bytes: 8512
s = input()
n = len(s)
s_back = s[::-1]
s_2 = s[:(n-1)//2]
s_2back = s_2[::-1]
s_3 = s[(n+2)//2:]
s_3back = s_3[::-1]

if s == s_back and s_2 == s_2back and s_3 == s_3back:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<cstdio>

int main(){
	int H1, M1, H2, M2, K;
	scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
	printf("%d\n", (H2 - H1)*60 + M2 - M1 - K);
	return 0;
}

Measured memory_bytes: 1732
#include <stdio.h>


int main(){
    int i,j,k,n;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    }
    int min,x,change=0;
    for (int i = 0; i < n; ++i) {
        min=i;
        for (int j = i;j<n; ++j) {if(a[min]>a[j])min=j;}

        if(i != min){
        x=a[i];
        a[i]=a[min];
        a[min]=x;
        change++;}
    }

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


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

using namespace std;

#define INF 1000
#define MOD 1000000007
#define maxn 1e5
#define PI 3.141592653589793
#define int long long int
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}
signed main()
{
    int N, M;
    cin >> N >> M;
    bool table[N];
    int tab[N];
    fill(table, table + N, false);
    fill(tab, tab + N, 1);
    table[0] = true;
    rep(i, M)
    {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        if (table[x])
        {
            table[y] = true;
        }
        tab[x]--;
        tab[y]++;
        if (tab[x] == 0)
        {
            table[x] = false;
        }
    }
    int ans = 0;
    rep(i, N)
    {
        if (table[i])
        {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1152
{-# LANGUAGE BangPatterns #-}

import           Data.Bifunctor (bimap, first, second)
import qualified Data.List      as L

main :: IO ()
main = do
    [_, a, b] <- fmap read . words <$> getLine
    s         <- getLine
    answer $ solve a b s

type Answer = [Bool]
answer :: Answer -> IO ()
answer = mapM_ (putStrLn . \x -> if x then "Yes" else "No")

solve :: Int -> Int -> String -> Answer
solve a b = (\(_, _, c) -> c []) . L.foldl' f (0, 0, id)
  where
    f (!x, !y, !c) 'a'
      | x < a + b = (succ x, y, c . (True  :))
      | otherwise = (     x, y, c . (False :))
    f (!x, !y, !c) 'b'
      | y < b && x < a + b = (succ x, succ y, c . (True  :))
      | otherwise          = (     x,      y, c . (False :))
    f (!x, !y, !c) 'c'     = (     x,      y, c . (False :))



Measured memory_bytes: 8316
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, a[200005] = {}, b[1000006] = {}, c[1000006] = {}, z = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i], c[a[i]]++;
    for (int i = 1; i <= 1000000; i++) if (c[i]) for (int j = i + i; j <= 1000000; j += i) b[j] = 1;
    for (int i = 1; i <= n; i++) if (!b[a[i]] && c[a[i]] == 1) z++;
    cout << z;
}


Measured memory_bytes: 12252
let () =
  let chenge c n =
    let num = (Char.code c) + n in
    if 90 < num then print_char (Char.chr (num-26))
    else print_char (Char.chr num) in
  Scanf.scanf "%d\n%s\n" @@ fun n s ->
  String.iter (fun c -> chenge c n) s; print_newline ();

Measured memory_bytes: 3764
character(10**5) S
character LastS
integer K
read*,S
read*,K

do i=1,len_trim(S)-1
  if(S(i:i)/="a".and.ichar("z")+1-ichar(S(i:i))<=K)then
    K=K-(ichar("z")+1-ichar(S(i:i)))
    S(i:i)="a"
  endif
end do
LastS=S(len_trim(S):len_trim(S))
S(len_trim(S):len_trim(S))=char(ichar("a")+mod(ichar(LastS)-ichar("a")+K,26) )

print"(A)",trim(S)
end

Measured memory_bytes: 700
#include <iostream>

using namespace std;

int main()
{
	int k, n, i, dl, dr, left, right, max = -1000, min;
	cin>>k>>n;
	int a[n];
	for(i = 0; i<n; i++)
	{
		cin>>a[i];
	}
	for(i = 0; i < n - 1; i++)
	{
		if(i == 0)
			left = n-1;
		else
			left = i - 1;
		right = i + 1;
		if(a[left] > a[i])
		{
			dl = a[left] - a[i];
			dl = k - dl;
		}
		else
		{
			dl = a[i] - a[left];

		}

		if(a[right] > a[i])
		{
			dr = a[right] - a[i];
		}
		else
		{
			dr = a[i] - a[right];
		}
		//scout<<dl<<" "<<a[i]<<dr<<endl;
		if(dl>dr)
		{
			if(max<dl)
			{
				//cout<<"left"<<endl;
				max = dl;
			}
		}
		else
		{
			if(max<dr)
				max = dr;
			
		}
		//cout<<"max"<<max<<endl;
		if(n > 2)
		{
			min = k - max;
		}
		else 
			min = max;
	}
	cout<<min<<endl;
	return 0;
}

Measured memory_bytes: 1024