akhauriyash/Code-Regression huggingface dataset:
n,x=map(int,input().split())
a=list(map(int,input().split()))
b=[abs(x-i) for i in a]
from fractions import gcd
def lcm(x,y):
  return x * y // gcd(x,y)
def list_lcm(list):
  c=1
  for i in list:
    c=lcm(c,i)
  return c
def list_gcd(list):
    c=list[0]
    for i in list:
        c=gcd(c,i)
    return c
print(list_gcd(b))

Measured memory_bytes: 14252
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int k=sc.nextInt();
		if(k==3||k==5||k==7)
			System.out.print("YES");
		else
			System.out.print("NO");
		
		
	}

}


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

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

using namespace std;

typedef long long ll;
typedef long double ld;

using P = pair<int, int>;

static const long long MOD = 1000000007;
static const long long LINF = (ll)(1e18+99);
static const int INF = 1e9+99;

ll ans;
vector<ll> A;
int n;

int main(void) {
    cin >> n;
    rep(i, 0, n) {
        int a;
        cin >> a;
        A.pb(a);
    }

    sort(all(A), greater<ll>());
    int j=0, i=0;
    while (i<n) {
        ans += A[j];
        i++;
        if (i%2==0) j++;
    }
  
    cout << ans - A[0]<< "\n";
    return 0;
}



Measured memory_bytes: 5348
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
const ll MOD = 998244353;
const int inf = 1e9 + 10;
const ll INF = 4e18;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0}, dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int a[n], b[n];
	rep(i, n) cin >> a[i] >> b[i];
	sort(a, a + n);
	sort(b, b + n, greater<int>());
	if (n % 2) {
		int l = a[n / 2], r = b[n / 2];
		cout << r - l + 1 << endl;
	} else {
		int ls = a[n / 2 - 1], ll = a[n / 2], rs = b[n / 2], rl = b[n / 2 - 1];
		int l = ls + ll, r = rs + rl;
		cout << r - l + 1 << endl;
	}
	return 0;
}

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

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

   double d = 0.0;
   for(int i = 0; i < n; ++i) {
      double x, h;
      cin >> x >> h;
      d = max(d, h / x);
   }

   cout << fixed << setprecision(10) << d * t << endl;
}


Measured memory_bytes: 3292
#include <bits/stdc++.h>
using namespace std;
string a;
int dsum,n;
inline int s_to_int(string s)
{
	int r=0;
	for(int i=0;i<s.size();i++)
	{
		r=r*10+(s[i]-'0');
	}
	return r;
}
inline int sum_of_digits(string s)
{
	int r=0;
	for(int i=0;i<s.size();i++)
	{
		r+=(s[i]-'0');
	}
	return r;
}
int main()
{
	cin>>a;
	n=s_to_int(a);
	dsum=sum_of_digits(a);
	if(n%dsum==0)
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
long n;
cin>>n;
double p[n];
for(long i=0;i<n;i++)
cin>>p[i];
double dp[n+1][n+1];
for(int i=0;i<n;i++)
{
for(int j=0;j<n+1;j++)
dp[i][j]=0.00;
}
dp[0][0]=1.00;
for(int i=1;i<=n;i++)
{
dp[i][0]=(1.00-p[i-1])*dp[i-1][0];
//cout<<p[i]<<" "<<dp[i][0]<<" "<<dp[i-1][0]<<endl;
}
for(int i=1;i<n+1;i++)
{
for(int j=1;j<n+1;j++)
dp[i][j]=p[i-1]*dp[i-1][j-1]+(1.00-p[i-1])*dp[i-1][j];
}
double  ans=0.00;
/*for(int i=0;i<n+1;i++)
{
for(int j=0;j<n+1;j++)
cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
}
*/
for(int i=n/2+1;i<=n;i++)
ans=dp[n][i]+ans;
cout<<setprecision(11)<<ans<<endl;
return 0;
}



Measured memory_bytes: 70528
N = gets.to_i
F_CACHE = [1]
M_CACHE = [1]
MOD = 10 ** 9 + 7

class Integer
  def mod_pow(n, mod)
    x = self
    res = 1

    while n > 0
      res = res * x % mod if n[0] == 1
      x = x * x % mod
      n >>= 1
    end

    res
  end

  def mod_inverse(mod)
    mod_pow(mod - 2, mod)
  end
end

def extgcd(a, b)
  if b.zero?
    [1, 0, a]
  else
    x, y, d = extgcd(b, a % b)

    [y, x - (a / b) * y, d]
  end
end

def mod_inverse(a, m)
  x, y, _ = extgcd(a, m)
  (m + x % m) % m
end

(1..(N + 1)).inject(1) do |res, n|
  v = (res * n) % MOD

  F_CACHE << v
  M_CACHE << v.mod_inverse(MOD)

  v
end

class Integer
  def mod_combination(k, mod)
    return 1 if k.zero?
    return 0 if self < k

    # (self - k + 1..self).inject(:*) / k.factorial
    self.factorial * M_CACHE[k] * M_CACHE[self - k]
    # self.factorial * mod_inverse(k.factorial, MOD) * mod_inverse((self - k).factorial, MOD)
  end

  def permutation(k)
    return 1 if k.zero?

    (self - k + 1..self).inject(:*)
  end

  def factorial
    return F_CACHE[self] if F_CACHE[self]
    return 1 if self.zero?

    (1..self).inject(:*)
  end
end

A = gets.split.map(&:to_i)
counter = Hash.new
l = r = -1

A.each_with_index do |a, i|
  if counter[a]
    l = counter[a]
    r = i
    break
  else
    counter[a] = i
  end
end

1.upto(N + 1) do |k|
  puts ((N + 1).mod_combination(k, MOD) - (l + N - r).mod_combination(k - 1, MOD)) % MOD
end


Measured memory_bytes: 19764
#include<bits/stdc++.h>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
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;
}


ll gcd(ll n, ll m) {
    ll tmp;
    while (m!=0) {
        tmp = n % m;
        n = m;
        m = tmp;
    }
    return n;
}
 
ll lcm(ll n, ll m) {
    return abs(n) / gcd(n, m)*abs(m);//gl=xy
}

using namespace std;
 
void solve(){
	double a, b, h, m;
	cin >> a >> b >> h >> m;
	double x = h * 30 + m * 0.5;
	double y = m * 6.0;
	double z = abs(x - y);
	double ans = sqrt(a * a + b * b - a * b * 2.0*cos((z * acos(-1.0)) / 180.0));
	cout << ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);
    solve();
    return 0;
}


Measured memory_bytes: 4140
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}

int main(void){
	int n, i, j;
	int p[8];
	char u[8];
	scanf("%d", &n);

	int k[8];
	k[0]=0; k[1]=1;
	for(i=2; i<n; i++) k[i]=k[i-1]*i;

	for(i=0; i<n; i++){
		scanf("%d", p+i);
		u[i]=0;
	}
	int a=0;
	for(i=0; i<n; i++){
		int s=0;
		for(j=0; j<p[i]-1; j++) if(u[j]==0) s++;
		a += s*k[n-i-1];
		u[p[i]-1]=1;
	}

	for(i=0; i<n; i++){
		scanf("%d", p+i);
		u[i]=0;
	}
	int b=0;
	for(i=0; i<n; i++){
		int s=0;
		for(j=0; j<p[i]-1; j++) if(u[j]==0) s++;
		b += s*k[n-i-1];
		u[p[i]-1]=1;
	}

	printf("%d\n", a>b?a-b:b-a);
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#define llint long long
#define inf ((llint)1e18)

using namespace std;

llint n, m, l, Q;
llint G[305][305];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> m >> l;
	llint a, b, c;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			if(i == j) G[i][j] = 0;
			else G[i][j] = inf;
		}
	}
	for(int i = 1; i <= m; i++){
		cin >> a >> b >> c;
		G[a][b] = G[b][a] = c;
	}
	
	for(int k = 1; k <= n; k++){
		for(int i = 1; i <= n; i++){
			for(int j = 1; j <= n; j++){
				G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
			}
		}
	}
	
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			if(i == j) G[i][j] = 0;
			else{
				if(G[i][j] > l) G[i][j] = inf;
				else G[i][j] = 1;
			}
		}
	}
	
	for(int k = 1; k <= n; k++){
		for(int i = 1; i <= n; i++){
			for(int j = 1; j <= n; j++){
				G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
			}
		}
	}
	
	llint s, t;
	cin >> Q;
	for(int q = 0; q < Q; q++){
		cin >> s >> t;
		if(G[s][t] >= inf) cout << -1 << "\n";
		else cout << G[s][t]-1 << "\n";
	}
	flush(cout);
	
	return 0;
}


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

const int md = 1e9+7;

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

    int N, K;
    cin >> N >> K;
    
    vector<int> arr(N);
    for (int i = 0; i < N; i++) {
        cin >> arr[i];
    }

    vector<vector<int>> dp(K+1, vector<int>(N+1));
    for (int i = 0; i <= N; i++) {
        dp[0][i] = 1;
    }

    for (int i = 1; i <= N; i++) {
        for (int j = 1; j <= K; j++) {
            int res = dp[j-1][i];
            res = (res + dp[j][i-1]) % md;
            
            if (j > arr[i-1]) {
                res = (res - dp[j - 1 - arr[i-1]][i-1]);
                if (res < 0) res += md;
            }
            dp[j][i] = res;
        }
    }

    cout << dp[K][N] << "\n";
}



Measured memory_bytes: 45184
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define ALL(x) (x).begin(),(x).end()
const long long MOD = 1000000007;
const long long INF = 1LL << 60;

int main(){
	string A1, B1, C1;
	cin >> A1 >> B1 >> C1;
	queue<char> A;
	queue<char> B;
	queue<char> C;
	for(int i = 0; i < A1.length(); i++)A.push(A1[i]);
	for(int i = 0; i < B1.length(); i++)B.push(B1[i]);
	for(int i = 0; i < C1.length(); i++)C.push(C1[i]);
	bool AA = true, BB = false, CC = false;
	
	while(true){
		if(AA){
			if(A.empty()){
				cout << 'A' << endl;
				return 0;
			}
			
			char S = A.front();
			A.pop();
			if(S == 'a'){
				continue;
			}else if(S == 'b'){
				AA = false;
				BB = true;
			}else if(S == 'c'){
				AA = false;
				CC = true;
			}
		}
		
		else if(BB){
			if(B.empty()){
				cout << 'B' << endl;
				return 0;
			}
			
			char S = B.front();
			B.pop();
			if(S == 'a'){
				AA = true;
				BB = false;
			}else if(S == 'b'){
				continue;
			}else if(S == 'c'){
				BB = false;
				CC = true;
			}
		}
		
		else if(CC){
			if(C.empty()){
				cout << 'C' << endl;
				return 0;
			}
			
			char S = C.front();
			C.pop();
			if(S == 'a'){
				AA = true;
				CC = false;
			}else if(S == 'b'){
				BB = true;
				CC = false;
			}else if(S == 'c'){
				continue;
			}
		}/*else{
			cout << "ALL_FALSE" << endl;
			return 0;
		}*/
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(i,x,n) for(int i=x;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=200005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        string S;cin>>S;
        int now=0;
        
        for(int i=0;i<S.size();i++){
            if(S[i]=='(') now++;
            else if(S[i]==')') now--;
            else if(S[i]=='*'){
                cout<<now<<endl;
                return 0;
            }
        }
    }
}



Measured memory_bytes: 3232
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)


map<int,int> m;
int n;
int main(){
    cin >> n;
    REP(i,n) {
        int a;
        cin >> a;
        m[a]++;
    }
    int ans = 0;
    for(const auto& v : m) {
        ans += v.second % 2;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4992
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) int((a).size())
#define out(a) cout<<(a)<<endl;
const int INF=INT_MAX;
const int MAX = 510000;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];

int main(){
  char x;cin>>x;
  rep(i,0,26){
    if(x=='a'+i){
      cout<<'a'<<endl;
      return 0;
    }
  }
  rep(i,0,26){
    if(x=='A'+i){
      cout<<'A'<<endl;
      return 0;
    }
  }
}




Measured memory_bytes: 3620
import sys

c = [list(map(int, input().split())) for _ in range(3)]
if c[0][0] - c[0][1] == c[1][0] - c[1][1] == c[2][0] - c[2][1]:
  if c[0][1] - c[0][2] == c[1][1] - c[1][2] == c[2][1] - c[2][2]:
    if c[0][0] - c[1][0] == c[0][1] - c[1][1] == c[0][2] - c[1][2]:
      if c[1][0] - c[2][0] == c[1][1] - c[2][1] == c[1][2] - c[2][2]:
        print("Yes")
        sys.exit()
print("No")

Measured memory_bytes: 9152
<?php
[$N] = ints();
$A = ints();
$C = array_fill(1, $N, 0);
foreach($A as $a){
    $C[$a]++;
}
echo implode("\n", $C),"\n";

function str(){return trim(fgets(STDIN));}
function ints(){return array_map('intval',explode(' ',trim(fgets(STDIN))));}
function int(){return intval(trim(fgets(STDIN)));}
function chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}
function chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}
function popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}
function o(...$val){
    if(count($val)==1)$val=array_shift($val);
    echo debug_backtrace()[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0)echo "empty array";
        elseif(!is_array(current($val)))echo "array: ",implode(" ", addIndex($val)),"\n";
        else{
            echo "array:array\n";
            if(isCleanArray($val))foreach($val as $row)echo implode(" ", addIndex($row)),"\n";
            else foreach($val as $i => $row)echo "[".$i."] ".implode(" ", addIndex($row)),"\n";
        }
    }else echo $val."\n";
}
function addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.":".$v;}, array_keys($val), $val);}return $val;}
function isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}
// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]
function atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}
function gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}
function gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}
function lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}
function lcm($a, $b) {return $a / gcd($a, $b) * $b;}

function dfs($current, $from = -1, $d = 0){
  global $G, $distance;
  $distance[$current] = $d;
  foreach($G[$current] as $to){
    if($from != $to){
      dfs($to, $current, $d + 1);
    }
  }
}

function loadTree($N = false){
  if($N === false)$N = $GLOBALS['N'];
  return loadGraph($N, $N-1);
}
function loadGraph($N = false, $M = false, $both = true){
  if($N === false)$N = $GLOBALS['N'];
  if($M === false)$M = $GLOBALS['M'];
  $G = array_fill(1, $N, []);
  for($i = 0; $i < $M; $i++){
    $values = ints();
    if(count($values) == 2){
      list($a, $b) = $values;
      $G[$a][] = $b;
      if($both)$G[$b][] = $a;
    }else{
      list($a, $b, $d) = $values;
      $G[$a][] = [$b, $d];
      if($both)$G[$b][] = [$a, $d];
    }
  }
  return $G;
}


Measured memory_bytes: 39132
// Coded by- Rad0n

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define all(a) a.begin(),a.end()
#define lb(a,x) (lower_bound(all(a),x)-a.begin())
#define ub(a,x) (upper_bound(all(a),x)-a.begin())
#define forn(i,n) for(ll i=0;i<ll(n);i++)
#define forr(i,n) for(ll i=ll(n-1);i>=0;i--)
#define fora(i,a,b) for(int i=int(a);i<=int(b);i++)
#define forb(i,a,b) for(int i=int(a);i>=int(b);i--)
#define test int t,o;cin>>o;for(t=1;t<=o;t++)
#define kickstart int t,o;cin>>o;for(t=1;t<=o;t++){cout<<"Case #"<<t<<": ";solve();}
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define o_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
#define o_multiset tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>
using namespace __gnu_pbds;
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ll=long long int;
#define mod 1000000007
mt19937 rng(time(NULL));
double p=3.1415926535897;
void solve()
{
	
	int n,k;
	cin>>n;
	int freq[n+1]={0};
	forn(i,n-1)
	{
		int a;
		cin>>a;
		freq[a]++;
	}
	fora(i,1,n)
	{
		cout<<freq[i]<<endl;
	}

}

int main()
{
	
    ios::sync_with_stdio(0); 
    cin.tie(0); 
    cout.tie(0);
    solve();
}


Measured memory_bytes: 4400
N,Q=map(int,input().split())
l=[[1,0,0]]
for i in range(1,N):
    a,b=map(int,input().split())
    l.append([b,a,0])
l.sort()
for i in range(Q):
    p,x=map(int,input().split())
    l[p-1][2]+=x
t=[l[0][2]]
for i in range(1,N):
    t.append(t[l[i][1]-1]+l[i][2])
print(*t)

Measured memory_bytes: 56132
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<ll, ll, ll> T;

int H, W, K;
bitset<9> bit;
vector<bitset<9>> pat;

void rec(int cnt){
    if(cnt == W - 1){ pat.push_back(bit); return; }
    if(bit[cnt - 1]) bit[cnt] = false, rec(cnt + 1);
    else{
        bit[cnt] = true, rec(cnt + 1);
        bit[cnt] = false, rec(cnt + 1);
    }
    return;
}

int main(void){
    
    scanf("%d %d %d", &H, &W, &K);
    
    if(W == 1){ printf("1\n"); return 0; }
    
    bit[0] = true, rec(1);
    bit[0] = false, rec(1);
    
    vector<vector<ll>> dp(H + 1, vector<ll>(W + 1, 0));
    dp[0][0] = 1;
    for(int h = 0; h < H; ++h){
       for(int i = 0; i < pat.size(); ++i){
           
           vector<int> v(W, -1);
           for(int j = 0; j < W; ++j){
               if(pat[i][j]) v[j] = j + 1, v[j + 1] = j;
               else if(!~v[j]) v[j] = j;
           }
           
           for(int j = 0; j < W; ++j) dp[h + 1][v[j]] += dp[h][j], dp[h + 1][v[j]] %= MOD;
       } 
    }
    printf("%lld\n", dp[H][K - 1]);
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>

#define LL long long 
using namespace std;

int main(){
	string s;
	LL k,i;
	cin >> s >> k;
	for(i=0;i<s.size();i++){
		if(s[i]!='1'){
			if(i>0 && s[i-1]=='1' && i>=k){
				cout << "1" << endl;
				return 0;
			}else{
				cout << s[i] << endl;
				return 0;
			}
		}
	}
	cout << "1" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  if(a<=b && b<=c) printf("%d %d %d\n",a,b,c);
  else if(b<=a && a<=c) printf("%d %d %d\n",b,a,c);
  else if(b<=c && c<=a) printf("%d %d %d\n",b,c,a);
  else if(a<=c && c<=b) printf("%d %d %d\n",a,c,b);
  else if(c<=a && a<=b) printf("%d %d %d\n",c,a,b);
  else if(c<=b && b<=a) printf("%d %d %d\n",c,b,a);
  return 0;
}

Measured memory_bytes: 596
from math import*;from itertools import*;from bisect import*
N=int(input());p=2;d={};q=[]
while p**2<=N:
 while N%p<1:N//=p;d[p]=d.get(p,0)+1
 p+=1
if N>1:d[N]=d.get(N,0)+1
for l in product(*[[k**i for i in range(v+1)]for k,v in d.items()]):
 a=1
 for n in l:a*=n
 insort(q,a)
print(floor(log10(q[len(q)//2]))+1)

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

int main(){
    string s;
    cin >> s;
    int k = s.size();
    vector<vector<int>> cnt(k, vector<int>(26, 0));
    for (int i = 0; i < k; i++) cnt[i][s[i] - 'a'] = 1;
    vector<vector<int>> acc(k + 1, vector<int>(26, 0));
    for (int i = 0; i < k; i++){
        for (int j = 0; j < 26; j++) acc[i+1][j] = acc[i][j] + cnt[i][j];
    }
    int left = 0;
    int right = 2;
    while(1){
        for (int i = 0; i < 26; i++){
            if ((acc[right][i] - acc[left][i]) * 2 > right - left){
                cout << left + 1 << " " << right << endl;
                exit(0);
            }
        }
        right++;
        if (right > k) break;
        for (int i = 0; i < 26; i++){
            if ((acc[right][i] - acc[left][i]) * 2 > right - left){
                cout << left + 1 << " " << right << endl;
                exit(0);
            }
        }
        left++;
    }
    cout << - 1 << " " << - 1 << endl;
}


Measured memory_bytes: 26880
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ans = 0;
        for(int i=0;i<n;i++){
            if(i%2!=0){
                sc.nextInt();
                continue;
            }
            if(sc.nextInt() % 2 != 0){
                ans++;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 27104
#include <iostream>
using namespace std;
const int MOD = 1000000007;
const int MAX = 100000;

long long mod(long long a) {
	a %= MOD;
	return a >= 0 ? a : a+MOD;
}

long long inverse[MAX+1];
long long factorial[MAX+1];
long long factorial_inverse[MAX+1];

void calc(int n) {
	inverse[1] = 1;
	factorial[0] = factorial[1] = 1;
	factorial_inverse[0] = factorial_inverse[1] = 1;
	for (int i = 2; i <= n; i++) {
		inverse[i] = MOD - inverse[MOD%i] * (MOD/i) % MOD;
		factorial[i] = i * factorial[i-1] % MOD;
		factorial_inverse[i] = inverse[i] * factorial_inverse[i-1] % MOD;
	}
}

long long comb(long long n, long long k) {
	return factorial[n] * (factorial_inverse[k] * factorial_inverse[n-k] % MOD) % MOD;
}

int main() {
	long long n, x, y;
	cin >> n;
	int table[MAX+5] = {};
	for (int i = 1; i <= n+1; i++) {
		int a;
		cin >> a;
		if (table[a] == 0) table[a] = i;
		else {
			x = table[a];
			y = i;
			break;
		}
	}
	calc(n+1);
	for (int k = 1; k <= n+1; k++) {
		long long ans = comb(n+1, k);
		if (n+x-y >= k-1) ans = mod(ans - comb(n+x-y, k-1));
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 6372
n = int(input())
xlist = list(map(int, input().split()))
s = 0
t = 0
min = 0
ave = int(sum(xlist)/len(xlist))
for j in xlist:
  s += (j-ave)**2
  t += (j-ave-1)**2
if s < t:
  print(s)
else:
  print(t)

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

int main()
{
	int n;
	cin >> n;
	int ans = 0, p = 0;
	for(auto i = 0; i < n; ++i){
		int h;
		cin >> h;
		if(h > p){
			ans += (h - p);
		}
		p = h;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	map<string, int> m;

	for(int i = 0; i < n; i++){
		string s;
		cin >> s;
		m.emplace(s,0);
	}
	cout << m.size() << endl;

}


Measured memory_bytes: 19080
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>

using namespace std;

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

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max(0, min(b, d) - max(a, c)) << endl;
}

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

namespace ConsoleApplication70
{
    class Program
    {
        static void Main(string[] args)
        {
            int X, A, B, sum;
            string[] str = Console.ReadLine().Split(' ');
            X = int.Parse(str[0]);
            A = int.Parse(str[1]);
            B = int.Parse(str[2]);
            bool flg = true;
            sum = A - B;
            if(sum >= 0)
            {
                Console.WriteLine("delicious");
                flg = false;
            }
            if (flg)
            {
                sum += X;
                if(sum >= 0)
                { Console.WriteLine("safe"); }
                else if(sum <= 0)
                { Console.WriteLine("dangerous"); }
            }
            
        }
    }
}


Measured memory_bytes: 11092
N,T=list(map(int, input().split()))
t=[0]*N
t=list(map(int, input().split()))

S=T

for i in range(N-1):
    if t[i+1]-t[i]>T:
        S=S+T
    else:
        S=S+(t[i+1]-t[i])

print(S)

Measured memory_bytes: 26732
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


def gcd(a, b):
    if a < b:
        return gcd(b, a)
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return (a*b)//gcd(a, b)


@mt
def slv(N, M, S, T):
    if N < M:
        S, T = T, S
        N, M = M, N

    if gcd(N, M) == 1:
        if S[0] != T[0]:
            return -1
        return N * M

    else:
        c = gcd(N, M)
        ans = lcm(N, M)
        for i in range(0, ans, ans//c):
            j = i // (M//c)
            k = i // (N//c)
            error_print(i, j, k)
            if S[j] != T[k]:
                return -1
        return lcm(N, M)


def main():
    N, M = read_int_n()
    S = read_str()
    T = read_str()
    print(slv(N, M, S, T))


if __name__ == '__main__':
    main()


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

int main(){
  while(true){
    ll n;
    cin>>n;
    if(n==0)break;
    vector<ll> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    ll ave = accumulate(a.begin(), a.end(),0ll)/n;
    int cnt=0;
    for(auto num:a)if(num<=ave)cnt++;
    cout<<cnt<<endl;
  }
  return 0;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
#define x first
#define y second
#define int int long long // 2e9 & 9e18
using namespace std; const int inf = numeric_limits<int>::max();
struct __io{__io(){ios_base::Init i; ios_base::sync_with_stdio(0); cin.tie(0);}} __io; // fast I/O
#ifdef LOCAL // setting up print debugging (yes lol)
template<class K, class V>ostream& operator<<(ostream&s,const pair<K,V>&p){s<<'<'<<p.x<<", "<<p.y<<'>';return s;}
template<class T, class=typename T::value_type, class=typename enable_if<!is_same<T,string>::value>::type>
ostream& operator<<(ostream&s,const T&v){s<<'[';for(auto&x:v){s<<x<<", ";}if(!v.empty()){s<<"\b\b";}s<<']';return s;}
void __prnt(){cerr<<endl;} template<class T, class...Ts>void __prnt(T&&a,Ts&&...etc){cerr<<a<<' ';__prnt(etc...);}
#define print(...) __prnt(__VA_ARGS__)
#else
#define print(...)
#endif

bool ok(vector<int> &a, double x, int k) {
	int k0;
	for (int d : a) {
		k0 = ceil(d / (x )) - 1;
		if (round(d / (k0 + 1)) > x) {
			k0++;
		}
		k -= k0;
	}

	return k >= 0;
}

signed main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    int l = 0;
    int r = 1000000001;
    int m;
    while (l < r - 1) {
    	m = l + (r - l) / 2;
    	if (ok(a, m, k)) {
    		r = m;
    	} else {
    		l = m;
    	}
    }
    cout << r << endl;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<pll> vpll;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back

inline void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

inline void OUT(void){
  cout << "\n";
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  ll N;
  IN(N);
  ll tmp = 0;
  REP(i,N){
    ll p;
    IN(p);
    if(p!=i+1) tmp++;
  }

  if(tmp<=2){
    OUT("YES");
  }else{
    OUT("NO");
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <set>
#include <functional>
#include <list>
#include <bitset>
#include <numeric>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <string>
#include <map>
 
#define INF 1e9
#define MOD 1000000007
#define ll long long
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
typedef unsigned long long ull;
typedef pair<ll, ll> pr;
//ll t[100004],d[100004];
//vector<int>t[100004];
ll num[100004];
pr p[100004];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,k,ti;
    ll d;
    cin>>n>>k;
    for(ll i=0;i<n;i++){
        cin>>ti>>d;
        p[i]=make_pair(d,ti-1);
    //    t[ti-1].push_back(d);
    }
    sort(p,p+n,greater<pr>());
    // for(int i=0;i<n;i++){
    //     sort(t[i].begin(),t[i].end(),greater<ll>());
    // }
    // for(int i=0;i<n;i++){
    //     cout<<p[i].first<<" "<<p[i].second<<endl;
    // }
    ll tmp=0;
    for(ll i=0;i<k;i++){
        tmp+=p[i].first;
        num[p[i].second]++;
    }
    ll s=0;
    for(ll i=0;i<n;i++){
        if(num[i]!=0){
            s++;
        }
    }
    tmp+=s*s;
    ll l=k-1;
    ll r=k;
    ll ans=tmp;
    for(ll i=s+1;i<=k;i++){
    //    cout<<tmp<<endl;
        while(num[p[l].second]==1&&l>0){
            l--;
        }
        if(num[p[l].second]>1){
            while(num[p[r].second]!=0&&r<n-1){
                r++;
            }
        }
        if(num[p[r].second]==0){
            num[p[r].second]++;
            num[p[l].second]--;
            tmp=tmp+p[r].first-p[l].first+2*i-1;
            if(tmp>ans){
                ans=tmp;
            }
          l--;
          r++;
        }
    }
    //cout<<tmp<<endl;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 2560
# -*- coding: utf-8 -*-S
a,b,c = map(str,input().split())

a = list(a)
b = list(b)
c = list(c)

if a[len(a) - 1] == b[0] and b[len(b) - 1] == c[0]:
    print("YES")
else:
    print("NO")


Measured memory_bytes: 2940
<?php
fscanf(STDIN, "%d", $n);
fscanf(STDIN, "%d", $m);
$num = 1;
for ($i = 0; $i < $n; $i++) {
  if ($num < $m) {
    $num = $num * 2;
  } else {
    $num = $num + $m;
  }
}
echo $num;

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

int main() {
  int H, W;
  cin >> H >> W;
  
  vector<char> top(W+2, '#');
  for (int i=0; i<top.size(); i++){
    cout << top.at(i);
  }
  cout << endl;
  for (int j=0; j<H; j++){
     vector<char> pixel(W+2, '#');
  for (int i=1; i<W+1; i++){
    cin >> pixel.at(i);
  }
    for (int i=0; i<pixel.size(); i++){
    cout << pixel.at(i);
    }
    cout << endl;
  }
  for (int i=0; i<top.size(); i++){
    cout << top.at(i);
  }
  
}


Measured memory_bytes: 256
import std.stdio, std.string, std.conv;
import std.algorithm, std.array;
import std.math, core.bitop;
 
auto solve(string s_)
{
    immutable N = s_.to!int();
    immutable xs = readln.split.map!(to!int).array();
    immutable L = readln.chomp.to!int();
    immutable Q = readln.chomp.to!int();
    auto ab = new int[2][Q];
    foreach(ref v;ab) v = readln.split.map!(to!int).array();
    immutable D = (xs[$-1]-xs[0]+L-1)/L;
    immutable M = bsr(D)+((D&D-1)?0:1);
    auto ld = new int[][](N+1,M);
    for(int i=0,j=0; i<N; ++i)
    {
        while(j<i && (xs[i]-xs[j])>L) ld[j++][0]=i-1;
        if(i+1==N) while(j<N) ld[j++][0]=i;
    }
    ld[N-1][0]=N;
    ld[N][]=N;
    foreach(i;1..M) foreach(j;0..N) ld[j][i]=ld[ld[j][i-1]][i-1];
    int[] r; r.reserve(Q);
    foreach(ref v;ab)
    {
        auto a=v[0]-1,b=v[1]-1;
        if(a>b) swap(a,b);
        int d=0;
        while(a<b)
        {
            int lo=0, hi=M;
            while(lo+1<hi)
            {
                immutable m = (lo+hi)/2;
                if(ld[a][m]<=b) lo=m;
                else            hi=m;
            }
            d+=1<<lo;
            a=ld[a][lo];
        }
        r~=d;
    }
    return r.map!(to!string).join("\n");
}

void main(){ for(string s; (s=readln.chomp()).length;) writeln(solve(s)); }

Measured memory_bytes: 21804
def cc
    n = gets.chomp.to_i

    no = 0
    an = gets.chomp.split(/\s/).map{|x| no += 1; [x.to_i, no]}.sort{|a, b| a[0] <=> b[0]}

    an.each do |bn|
        print "#{bn[1]} "
    end
    puts
end

cc

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

int main() {
  long long n,a,b,c;
  cin >> n >> a >> b;
  c = a+b;
  
  long long ans,amari;
  ans = n/c*a;
  amari = n%c;
  
  if(amari<a){
    ans += amari;
  }
  else{
    ans += a;
  }
  cout << ans << endl;
}

  
  

Measured memory_bytes: 256
// AOJ 0564: Bug Party
// 2018.1.27 bal4u

#include <stdio.h>

typedef struct { int a, b; } T;
T tbl[300002], tbl2[300002];
int n;

#define MAX 300002
int que[MAX]; int qsize;

#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

void max_heapify(int i)
{
	int l, r, max;
	int qt;

	l = LEFT(i), r = RIGHT(i);
	if (l < qsize && que[l] > que[i]) max = l; else max = i;
	if (r < qsize && que[r] > que[max]) max = r;
	if (max != i) {
		qt = que[i], que[i] = que[max], que[max] = qt;
		max_heapify(max);
	}
}

int deq()
{
	int t;

//	if (qsize == 0) return 0;
	t = que[0];
	que[0] = que[--qsize];
	max_heapify(0);
	return t;
}

void enq(int t)
{
	int i, max;
	int qt;

	i = qsize++;
	que[i] = t;
	while (i > 0 && que[max = PARENT(i)] < que[i]) {
		qt = que[i]; que[i] = que[max], que[max] = qt;
		i = max;
	}
}

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int f[100002];
void distsort()
{
	int i, x;

	for (i = 0; i < n; i++) f[tbl2[i].b]++;
	for (i = 100000; i > 0; i--) f[i-1] += f[i];
	for (i = 0; i < n; i++) {
		x = tbl2[i].b, tbl[--f[x]] = tbl2[i];
	}
}

int check(int k)
{
	int i;
	long long s;
	
	if (!k) return 1;
	qsize = 0, s = 0;
	for (i = 0; i < k-1; i++) s += tbl[i].a, enq(tbl[i].a);
	for ( ; i < n; i++) {
		if (s + tbl[i].a <= (long long)k*tbl[i].b) return 1;
		s += tbl[i].a, enq(tbl[i].a);
		s -= deq();
	}
	return 0;
}
	
int main()
{
	int i, lo, hi, m;
	
	n = in();
	for (i = 0; i < n; i++) tbl2[i].a = in(), tbl2[i].b = in();
	distsort();

	lo = 0, hi = n+1;
	while (lo + 1 < hi) {
		m = (lo + hi) >> 1;
		if (check(m)) lo = m; else hi = m;
	}
	printf("%d\n", lo);
	return 0;
}



Measured memory_bytes: 7908
#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
	int H, W;
	int *A, *b, *x;
	int i = 0, j = 0;

	cin >> H >> W;

	A = new int[H*W];
	b = new int[W];
	x = new int[H];

	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			cin >> A[i * W + j];
		}
	}

	for (i = 0; i < W; i++) {
		cin >> b[i];
	}

	for (i = 0; i < H; i++) {
		x[i] = 0;
		for (j = 0; j < W; j++) {
			x[i] += A[i * W + j] * b[j];
		}
		cout << x[i] << endl;
	}

	delete[] A;
	delete[] b;
	delete[] x;

	return 0;
}


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

int main() {
    int N; cin >> N;
    vector<long long> L(N);
    for (int i = 0; i < N; ++i) cin >> L[i];
    sort(L.begin(), L.end());

    long long res = 0;
   
    for (int i = 0; i < N; ++i) {
        for (int j = i+1; j < N; ++j) {
          int k = lower_bound(L.begin(), L.end(), L[i] + L[j]) - L.begin();
		  res += max(k - (j+1), 0);
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define bug(x) cout << #x << " = " << x << endl
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define reset(x) memset(x,0,sizeof(x))
#define up(i,l,r) for(int i=l;i<=r;i++)
#define down(i,r,l) for(int i=r;i>=l;i--)
using namespace std;
typedef long long int ll;
bool sugar[3005]={0},water[3005]={0};
int a,b,c,d,e,f,Titotal=0,Tisugar=0,temp;
double density=0.0000;
int main(){
	ios_base::sync_with_stdio(0);
	cin>>a>>b>>c>>d>>e>>f;
	sugar[0]=1;
	water[0]=1;
	up(i,1,f){
        if(i>=100*a) water[i]=water[i]||water[i-100*a];
        if(i>=100*b) water[i]=water[i]||water[i-100*b];
        if(i>=c) sugar[i]=sugar[i]||sugar[i-c];
        if(i>=d) sugar[i]=sugar[i]||sugar[i-d];
	}
	up(i,1,f){
        if(water[i]){
            temp=(i/100)*e;
            down(j,min(temp,f-i),1){
                if(sugar[j]){
                    if(((double)j/(double)(i+j))>density){
                        Titotal=i+j;
                        Tisugar=j;
                        density=(double)j/(double)(i+j);
                    }
                    break;
                }
            }
        }
	}
	if(density==(double)0) Titotal=100*a;
	cout<<Titotal<<" "<<Tisugar<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<cstring>
#include<algorithm>

using namespace std;

int main(void){
  char s[1001][33];
  map<string,int>wd;
  int i=0;

  while(~scanf("%s",&s[i][0])){i++;}

  for(int j=0;j<i;j++)
    wd[s[j]]=0;

  for(int j=0;j<i;j++)
    wd[s[j]]++;

  int ans=0,len=0;
  for(int j=0;j<i;j++){
    ans=max(wd[s[j]],ans);
    len=max(len,(int)strlen(&s[j][0]));
  }

  string s1,s2;
  for(int j=0;j<i;j++){
    if(ans==wd[s[j]])s1=s[j];
    if(len==strlen(s[j]))s2=s[j];
  }
  cout << s1 << " " << s2 << endl;
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
#define ct(a) cout<<a<<endl
static const double pi = 3.141592653589793;
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int INF = 1e9+7;
const int mod= 1e9 + 7;

long long mod_pow(long long x, long long n) {
	if (n == 0) return 1;
	long long res = mod_pow(x*x % mod, n / 2);
	if (n & 1) res = res * x % mod;
	return res;
}


int main(){
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	
	ll N,A,B;
	cin >> N>>A>>B;
	
	ll ans = 1;

	ans = mod_pow(2LL, N);

	ll a = 1;
	ll b = 1;
	
	FOR(i, 0, A) {
		a = (a*(N - i)) % mod;
	}
	ll aa=1;
	FOR(j, 1, A + 1) {
		aa = (aa*j) % mod;
	}
	aa = mod_pow(aa, mod - 2);
	a = (a*aa+mod) % mod;




	FOR(i, 0, B) {
		b = (b*(N - i)) % mod;
	}
	ll bb = 1;
	FOR(j, 1, B + 1) {
		bb = (bb*j) % mod;
	}
	bb = mod_pow(bb, mod - 2);
	b = (b * bb+mod)%mod;

	ans = (ans - a - b -1+2*mod) % mod;
	
	cout << ans << endl;


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;

int main(){
	long double pi=3.1415926535,R,A,B,H,M,ans;
	cin>>A>>B>>H>>M;
	R=(H*60+M)*pi/360-M*pi/30;
	ans = sqrtl(A*A+B*B-2.0*A*B*cosl(R));
	cout<<fixed<<setprecision(10)<<ans<<endl;
}

Measured memory_bytes: 4084
#include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
// using namespace atcoder;
void Main()
{
    ll A, B;
    cin >> A >> B;

    ll N = 100;
    vector<string> S(N);

    rep(i, N/2) S[i] = string(N, '#');
    rep(i, N/2) S[N/2 + i] = string(N, '.');

    rep(i, A - 1) {
        ll x = (2 * i) % N;
        ll y = ((2 * i) / N) * 2;
        S[y][x] = '.';
    }

    rep(i, B - 1) {
        ll x = (2 * i) % N;
        ll y = (N - 1) - ((2 * i) / N) * 2;
        S[y][x] = '#';
    }

    cout << N << " " << N << endl;
    rep(i, S.size()) put(S[i]);
}
signed main(){ Main();return 0;}

Measured memory_bytes: 3652
// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>

// namespace
using namespace std;

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;

// container
#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define SORT(c) sort((c).begin(), (c).end())
#define GSORT(c) sort((c).begin(), (c).end(), greater<typeof((c).front())>())
#define SZ(x) ((int)(x).size())
#define MEMSET(c, v) memset((c), v, sizeof(c))

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// constant
// const ll MOD = 1e9 + 7;
// const int INF = 1e9;
// const ll INF = 1e15;
// const int dx[4] = {0, -1, 1, 0};
// const int dy[4] = {-1, 0, 0, 1};
// const int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const int dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

// debug
#define test(x) cout << #x << " = " << x << endl

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;


// --------------------------------------------------------


int main() {
  int N;
  cin >> N;
  VI vec(100002, 0);

  REP(i, N) {
    int a;
    cin >> a;
    vec[a]++;
  }

  int MAX = 0;
  NREP(i, 100000) {
    MAX = max(MAX, vec[i - 1] + vec[i] + vec[i + 1]);
  }

  cout << MAX << endl;
  return 0;
}

Measured memory_bytes: 640
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

// https://gist.githubusercontent.com/shibh308/f7ab83aa58b95322f0c5a353121bdecb/raw/b19dcf74b08f80f601d7a5792f2578b6ff9155bf/template.cpp
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

#define ALL(obj) (obj).begin(),(obj).end()

#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class... Tail>
void CINT(istream& cins, Tail&&... tail){
    return;
}
template <class Head,class... Tail>
void CINT(istream& cin, Head&& head,Tail&&... tail){
    cin>>head;
    CINT(cin, move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(cin,__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(cin,__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(cin,__VA_ARGS__)

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
    VECCIN(head);
    VT2(move(tail)...);
}

template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
    seco[head]=IN();
    VT3(head,move(tail)...);
}

#define VCEACH(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__);
#define VCREP(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__);

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int,V,greater<int>>

#define pb(a) push_back(a)
#define mp make_pair

class BDigits {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        CIN(n,k);
        int result;
        for(;n>0;){
            n/=k;
            result++;
        }
        COUT(result);
    }
};

int main() {
	BDigits solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

char T[222222];

int main(void) {
	int mareitaso;
	if (scanf("%222221s", T) != 1) return 1;
	for (mareitaso = 0; T[mareitaso] != '\0'; mareitaso++) {
		putchar(T[mareitaso] == '?' ? 'D' : (unsigned char)T[mareitaso]);
	}
	putchar('\n');
	return 0;
}

/*

D → 指数++, 前がPなら指数++
P → なし

Pにすると次で加点される可能性があるが、Dにして今加点しちゃったほうが不利にならない

*/


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

const int N = 81;

int n, m, lev = 6000;
int a[N][N], b[N][N];
bool f[N][N][N * N * 4];

int main() {
	cin >> n >> m;
	int lim = 0;
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) cin >> a[i][j];
	}
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) cin >> b[i][j];
	}
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) 
			lim += max(a[i][j], b[i][j]) - min(a[i][j], b[i][j]);
	}
	lev = min(lev, lim);
	f[0][1][lev] = f[1][0][lev] = 1;
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= m; ++j) {
			for(int k = 0; k <= lev * 4; ++k) {
				if(k + a[i][j] - b[i][j] >= 0)
					f[i][j][k] |= f[i - 1][j][k + a[i][j] - b[i][j]] | f[i][j - 1][k + a[i][j] - b[i][j]];
				if(k - a[i][j] + b[i][j] >= 0) 
					f[i][j][k] |= f[i - 1][j][k - a[i][j] + b[i][j]] | f[i][j - 1][k - a[i][j] + b[i][j]];
			} 
		}
	}
	int ans = 1e7;
	for(int k = 0; k <= lev * 4; ++k) {
		if(f[n][m][k]) ans = min(ans, abs(k - lev));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 166400