akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdlib.h>

int main(void){

  char c,d;
  int i;
  
  std::cin >> c;
  i=(int)c;
  //std::cout << i;

  if (i<97){
    d='A';
  }
  else{
    d='a';
  }
  std::cout << d;;
  
  return(0);
}

Measured memory_bytes: 3564
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MASS_MAX		100000									// 最大マス数

// 内部変数
static FILE *szpFpI;											// 入力
static int si1Mass[D_MASS_MAX];									// マス
static int siMCnt;												// マス数
static int siSCnt;												// 選択マス数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
#endif

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	int i;
	char lc1Buf[1024], lc1Out[1024];

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// マス数・選択マス数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d%d", &siMCnt, &siSCnt);

	// マス - 取得
	for (i = 0; i < siMCnt; i++) {
		fscanf(szpFpI, "%d", &si1Mass[i]);
	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 初期選択範囲・選択範囲外・最大値
	long long llIn = 0;
	for (i = 0; i < siSCnt; i++) {
		llIn += si1Mass[i];
	}
	long long llOut = 0;
	for (i = siSCnt; i < siMCnt; i++) {
		if (si1Mass[i] > 0) {
			llOut += si1Mass[i];
		}
	}
	long long llMax = llOut;
	if (llIn > 0) {
		llMax += llIn;
	}

	// 範囲移動
	for (i = 0; i < siMCnt - siSCnt; i++) {
		llIn -= si1Mass[i];
		llIn += si1Mass[i + siSCnt];
		if (si1Mass[i] > 0) {
			llOut += si1Mass[i];
		}
		if (si1Mass[i + siSCnt] > 0) {
			llOut -= si1Mass[i + siSCnt];
		}
		long long llSum = llOut;
		if (llIn > 0) {
			llSum += llIn;
		}

		// 最大値 - 更新
		if (llMax < llSum) {
			llMax = llSum;
		}
	}

	// 結果 - セット
	sprintf(lc1Out, "%lld\n", llMax);

	// 結果 - 表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}



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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main () {
	int n, m, c;
	cin >> n >> m >> c;
	vector<int> b(m);
	rep(i, m) cin >> b[i];
	int ans = 0;
	rep(i, n) {
		int sum = 0;
		rep(j, m) {
			int a; cin >> a;
			sum += a * b[j];
		}
		if (sum + c > 0) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <cstdio>
#include <climits>
#include <cmath>
#include <array>
#include <functional>
#include <sstream>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const double eps=1e-9;
const int inf=1e9;
typedef pair<int,int> P;
struct Point
{
  double x,y;
  Point(){x=0;y=0;}
  Point(double d_x,double d_y){x=d_x,y=d_y;}
  double operator*(Point obj){return obj.x*x+obj.y*y;}
  double operator%(Point obj){return obj.y*x-obj.x*y;}
  Point operator*(double b){Point tmp;tmp.x=x*b;tmp.y=y*b;return tmp;}
  Point operator/(double b){Point tmp;tmp.x=x/b;tmp.y=y/b;return tmp;}
  Point operator+(Point obj){Point tmp;tmp.x=x+obj.x;tmp.y=y+obj.y;return tmp;}
  Point operator-(){Point tmp;tmp.x=-x;tmp.y=-y;return tmp;}
  Point operator-(Point obj){Point tmp;tmp.x=x-obj.x;tmp.y=y-obj.y;return tmp;}
  Point operator-=(Point obj){x-=obj.x;y-=obj.y;return *this;}
  Point operator+=(Point obj){x+=obj.x;y+=obj.y;return *this;}
  Point operator/=(double b){x=x/b;y=y/b;return *this;}
  Point operator*=(double b){x=x*b;y=y*b;return *this;}
  double size(){return hypot(x,y);}
  Point unit(){return Point(x/size(),y/size());}
  Point normal(){return Point(y,-x);}
  double atan(){return atan2(y,x);}
};

bool operator<(Point a,Point b){return a.x!=b.x?a.x<b.x:a.y<b.y;}
bool operator>(Point a,Point b){return b<a;}
bool operator<=(Point a,Point b){return !(b<a);}
bool operator>=(Point a,Point b){return !(a<b);}
bool operator==(Point a,Point b){return (a-b).size()<eps;}
bool operator!=(Point a,Point b){return !(a==b);}

bool equal(double a,double b){return abs(a-b)<eps;}
double cross(Point a,Point b){return a%b;}
double dot(Point a,Point b){return a*b;}

int ccw(Point a,Point b,Point c)
{
  b=b-a;
  c=c-a;
  if(b%c>0) return +1;
  else if(b%c<0)return -1;
  else if(b*c<0) return +2;
  else if(b.size()<c.size()) return -2;
  else return 0;
}

int n,m;
int dp[20005][256];

int main(int argc,char const* argv[])
{
  int n,m;
  
  while(1)
    {
      cin >> n >> m;
      if(!n) break;
      vi C(m);
      vi x(n);
      fill_n((int *)dp,sizeof(dp)/sizeof(int),inf);
      for(int i=0;i<m;i++)
	{
	  cin >> C[i];
	}
      for(int i=0;i<n;i++)
	{
	  cin >> x[i];
	}
      dp[0][128]=0;
      for(int i=0;i<n;i++)
	{
	  for(int j=0;j<256;j++)
	    {
	      if(dp[i][j]==inf){continue;}
	      for(int k=0;k<m;k++)
		{
		  int yn=j+C[k];
		  if(yn>255) yn=255;
		  else if(yn<0) yn=0;
		  int err=(x[i]-yn)*(x[i]-yn);
		  dp[i+1][yn]=min(dp[i+1][yn],dp[i][j]+err);
		}
	    }
	}
      cout << *min_element(dp[n],dp[n]+256) << endl;
    }
  return 0;
}
      



Measured memory_bytes: 23164
#include <stdio.h>
 
int main(void) {
	int n, x = 0, max = 0;
	char s;
	scanf("%d\n", &n);
	for( int i = 0; i < n; i++ ) {
		scanf("%c", &s);
		if(s == 'I') x++;
		else x--;
		if(x > max) max = x;
	}
	printf("%d\n", max);
	return 0;
}

Measured memory_bytes: 128
// 解き直し.
// ABC 118 解説.
// https://img.atcoder.jp/abc118/editorial.pdf
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
const int MATCH[9] = {2, 5, 5, 4, 5, 6, 3, 7, 6};
int dp[12321];
struct match{
    int n; // マッチ棒で表現する数字.
    int u; // 数字1文字を構成するのに必要なマッチの使用本数.
    bool operator<(const match& rhs) const {
        return (u < rhs.u) || ((u == rhs.u) && (n > rhs.n));
    }
};

int main(){
    
    // 1. 入力情報取得.
    int N, M;
    scanf("%d %d", &N, &M);
    // 第一成分: 数字一つ作成するのに必要なマッチ棒の本数.
    // 第二成分: 作成する数字.
    vector<match> A;
    FOR(i, 0, M){
        int a;
        scanf("%d", &a);
        match m;
        m.n = a, m.u = MATCH[a - 1];
        A.push_back(m);
    }
    
    // 2. 初期化, sort.
    FOR(i, 0, N + 1) dp[i] = -123454321;
    sort(A.begin(), A.end());
    // for(auto &a : A) printf("%d %d\n", a.u, a.n);
    
    // 3. 解説通り.
    // dp[i]: ちょうどi本のマッチ棒を使って, 条件を満たす整数を作る場合の最大桁数.
    dp[0] = 0;
    FOR(i, 1, N + 1) for(auto &a : A) if(i >= a.u) dp[i] = max(dp[i], dp[i - a.u] + 1);
    // printf("dp[%d]=%d\n", N, dp[N]);
    
    // 4. dp の 結果をもとに, 出力.
    while(N > 0){
        // 4-1. 最上位の桁 を 抽出.
        int d = 0;
        for(auto &a : A){
            // a.n が 最上位の桁 に使えるかどうかは, 
            // dp[N - a.u] = dp[N] - 1 であるかを確認すれば良い, とのこと.
            if(N - a.u >= 0 && dp[N - a.u] == dp[N] - 1) d = max(d, a.n);
        }
        // 4-2. 最上位の桁が確定したので, 未使用のマッチ棒の本数 N を デクリメント.
        N -= MATCH[d - 1];
        printf("%d", d);
    }
    return 0;
    
}

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

using namespace std;
typedef long long ll;

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    ll n,k;
    cin>>n>>k;

    vector<ll> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }

    int dp[k+1];
    for(int i=0;i<=k;i++){
        dp[i]=-1;
    }
    dp[0]=0;
    for(ll i=1;i<=k;i++){
        int c=0;
        int d=0;
        for(ll j:v){
            if(i-j>=0){
                if(dp[i-j]==1){
                    c++;
                }
                else if(dp[i-j]==0){
                    d++;
                }
            }
        }
        if(d==0){
            dp[i]=0;
        }
        else{
            dp[i]=1;
        }
    }

    if(dp[k]==1){
        cout<<"First"<<endl;
    }
    else{
        cout<<"Second"<<endl;
    }


    return 0;
}

Measured memory_bytes: 640
const INF: usize = 1 << 30;
fn solve() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let m: usize = sc.read();
    let l: usize = sc.read();

    let mut dist = vec![vec![INF; n]; n];
    for _ in 0..m {
        let a: usize = sc.read::<usize>() - 1;
        let b: usize = sc.read::<usize>() - 1;
        let c: usize = sc.read::<usize>();
        dist[a][b] = c;
        dist[b][a] = c;
    }
    for k in 0..n {
        for i in 0..n {
            for j in 0..n {
                if dist[i][k] + dist[k][j] < dist[i][j] {
                    dist[i][j] = dist[i][k] + dist[k][j];
                }
            }
        }
    }
    let mut v_dist = vec![vec![INF; n]; n];

    for i in 0..n {
        for j in 0..n {
            if dist[i][j] <= l {
                v_dist[i][j] = 1;
            }
        }
    }

    for k in 0..n {
        for i in 0..n {
            for j in 0..n {
                if v_dist[i][k] + v_dist[k][j] < v_dist[i][j] {
                    v_dist[i][j] = v_dist[i][k] + v_dist[k][j];
                }
            }
        }
    }

    let q: usize = sc.read();
    for _ in 0..q {
        let s: usize = sc.read::<usize>() - 1;
        let t: usize = sc.read::<usize>() - 1;
        if v_dist[s][t] >= INF {
            println!("-1");
        } else {
            println!("{}", v_dist[s][t] - 1);
        }
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| solve())
        .unwrap()
        .join()
        .unwrap();
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 8828
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

//Cleaning Robot
public class Main{

	static int min;
	static boolean[] used;
	static int[][] dist;
	
	static void dfs(int[] order, int k){
		if(k==order.length){
			int s = 0;
			int from = 0;
			for(int i=0;i<order.length;i++){
				s += dist[from][order[i]];
				from = order[i];
			}
			min = Math.min(min, s);
			return;
		}
		for(int i=1;i<=order.length;i++){
			if(!used[i]){
				used[i] = true;
				order[k] = i;
				dfs(order, k+1);
				used[i] = false;
			}
		}
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[][] move = {{1,0},{-1,0},{0,1},{0,-1}};
		while(true){
			int w = sc.nextInt();
			int h = sc.nextInt();
			if((w|h)==0)break;
			char[][] m = new char[h][w];
			int id = 1;
			Map<Integer, Integer> ref = new HashMap<Integer, Integer>();
			for(int i=0;i<h;i++){
				char[] s = sc.next().toCharArray();
				for(int j=0;j<w;j++){
					m[i][j] = s[j];
					if(m[i][j]=='*'){
						ref.put(i*w+j, id++);
					}
					if(m[i][j]=='o'){
						ref.put(i*w+j, 0);
					}
				}
			}
			dist = new int[id][id];
			for(int[]a:dist)Arrays.fill(a, Integer.MAX_VALUE);
			for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					if(m[i][j]=='o'||m[i][j]=='*'){
						int from = ref.get(i*w+j);
						boolean[][] visited = new boolean[h][w];
						visited[i][j] = true;
						int step = 0;
						List<int[]> list = new ArrayList<int[]>();
						list.add(new int[]{i, j});
						while(!list.isEmpty()){
							List<int[]> next = new ArrayList<int[]>();
							for(int[] a:list){
								if(ref.containsKey(a[0]*w+a[1])){
									dist[from][ref.get(a[0]*w+a[1])] = step;
								}
								for(int k=0;k<4;k++){
									int ni = a[0] + move[k][0];
									int nj = a[1] + move[k][1];
									if(0<=ni&&ni<h&&0<=nj&&nj<w&&m[ni][nj]!='x'&&!visited[ni][nj]){
										visited[ni][nj] = true;
										next.add(new int[]{ni, nj});
									}
								}
							}
							list = next;
							step++;
						}
					}
				}
			}
			boolean f = true;
			for(int i=0;i<id;i++)if(dist[0][i]==Integer.MAX_VALUE)f = false;
			if(!f){
				System.out.println(-1);
				continue;
			}
			min = Integer.MAX_VALUE;
			used = new boolean[id];
			used[0] = true;
			dfs(new int[id-1], 0);
			System.out.println(min);
		}
	}
}

Measured memory_bytes: 12000
N,K=map(int,input().split(" "))
A=input()
A=A.rstrip().split(" ")
list1=[0]*(N+1)
for i in range(N):
    list1[int(A[i])-1]+=1
list1.sort(reverse=True)
#print(list1)

for j in range(K):
    list1[j]=0
    
print(sum(list1))

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

int N, K;
int var = 0;     //数字の種類
int num = 0;  //残す数
vector<int> A;
map<int, bool> e;


int main(){
  cin >> N >> K;
  A.resize(N+1);

  int v;
  for(int i = 0; i < N; i++){
    cin >> v; A[v]++;
    if(e.count(v));
    else{ e[v] = true; var++; }
  }

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

  int i = 0;
  while(var > K){
    if(A[i] == 0){ i++;  continue; }
    num += A[i++];
    var--;
  }

  cout << num << endl;
  return 0;
}

  
    

Measured memory_bytes: 10368
import java.util.*;
public class Main {
  static String[] WDAYS = new String[] { "SUN","SAT","FRI","THU","WED","TUE","MON" };
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    for (int i = 0; i < WDAYS.length; i++) {
      if (a.equals(WDAYS[i])) {
        System.out.println(i == 0 ? 7 : i);
        return;
      }
    }
    System.out.println(-1);
  }
}

Measured memory_bytes: 20688
#import math
#import bisect
#import numpy as np
#import itertools
#import copy
#import collections
import sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    s = input()
    ss = list(set(s))
    flag = False

    if len(ss) == 2:
        a = s.count(ss[0])
        b = s.count(ss[1])
        if a == b == 2:
            flag = True

    if flag:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define endl '\n'
#define forn(i, n) for(int i=0;i<n;i++)
#define lli long long int
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back

using namespace std;

const int MAXN = 1000001;

int n;
int M[MAXN];
int out[MAXN];
int parent[MAXN];
vector<int> lista[MAXN];

int dfs(int u,int p) {
	forn(i, lista[u].size()) {
		int v = lista[u][i];
		if(v != p) {
			parent[v] = u;
			out[u]++;
			dfs(v, u);
		}
	}
}

int maxMatching() {
	queue<int> q;
	forn(i, n) {
		if(!out[i])
			q.push(i);
		M[i] = -1;
	}

	int ans = 0;
	while(!q.empty()) {
		int u = q.front();
		q.pop();

		if(u != parent[u] && M[ parent[u] ] == -1) {
			M[ parent[u] ] = u;
			M[u] = parent[u];
			ans++;

			u = parent[u];
			if(u != parent[u]) {
				out[ parent[u] ]--;
				if(!out[ parent[u] ])
					q.push(parent[u]);
			}
		}
	}

	return ans;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int a,b;
	cin>>n;
	forn(i, n - 1) {
		cin>>a>>b;
		a--,b--;
		lista[a].pb(b);
		lista[b].pb(a);
	}
	dfs(0, -1);
	int ans = maxMatching();

	if(ans * 2 == n) cout<<"Second"<<endl;
	else cout<<"First"<<endl;
	return 0;
}


Measured memory_bytes: 32384
package main
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)

func Factorial(N int) (F, Finv, Inv []int) {
  F = make([]int, N + 1)
  Finv = make([]int, N + 1)
  Inv = make([]int, N + 1)
  F[0] = 1
  F[1] = 1
  Finv[0] = 1
  Finv[1] = 1
  Inv[0] = 1
  Inv[1] = 1
  for i := 2; i < N + 1; i++ {
    F[i] = F[i - 1] * i % p
    Inv[i] = p - Inv[p % i] * (p / i) % p
    Finv[i] = Finv[i - 1] * Inv[i] % p
  }
  return
}

func Comb(F, Finv *[]int, A ...int) int {
  S := SumInt(A...)
  C := (*F)[S]
  for _, a := range A {
    C *= (*Finv)[a]
    C %= p
  }
  return C
}

const p = 998244353

func Solve() {
  var N, M, K int
  NextInt(&N, &M, &K)
  F, Finv, _ := Factorial(MaxInt(N, M))
  k := 1
  for 1 << uint(k) <= N { k++ }
  P := make([]int, k)
  P[0] = M - 1
  for i := range P[1:] { P[i + 1] = P[i] * P[i] % p }
  Pow := func(k int) int {
    a := 1
    for i := 0; 0 < k; i++ {
      if k % 2 == 1 { a = a * P[i] % p }
      k /= 2
    }
    return a
  }
  ans := 0
  for k := 0; k <= K; k++ {
    ans += (M * Pow(N - 1 - k) % p) * Comb(&F, &Finv, N - k - 1, k) % p
    ans %= p
  }
  Write(ans)
}

func main() {
  Solve()
  Output()
}

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}
func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

Measured memory_bytes: 6720
#include<stdio.h>
#define N 500000
int A[N],n;

void maxHeapify(int i){
    int l,r,largest,temp=0;
    l = 2*i;
    r = 2*i+1;

    if(l <= n && A[l] > A[i] ){
        largest = l;
    }
    else{
        largest = i;
    }

    if(r <= n && A[r] > A[largest]){
        largest = r;
    }

    if(largest != i){
        temp = A[i];
        A[i] = A[largest];
        A[largest] = temp; 
        maxHeapify(largest);
    }
}

/*int buildMaxHeap(){
    int i;
    for (i= N/2; i>0; i--){
        maxHeapify(i);
    }
}
*/

int main(){
    int i;

    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d",&A[i]);
    }
    for(i=n/2; i>0;i--){
         maxHeapify(i);
    }
    for(i=1;i<=n;i++){
        printf(" %d",A[i]);
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 3664
N = int(input())
s = list([(input()) for i in range(N)])
M = int(input())
t = list([(input()) for i in range(M)])

S = {}
T = {}
p = 0

for i in s:
    if i not in S:
        S[i] = 1
    else:
        S[i] += 1
for i in t:
    if i not in T:
        T[i] = 1
    else:
        T[i] += 1

for i in S:
    if i not in T:
        p = max(p, S[i])
    else:
        if S[i] > T[i]:
            p = max(p, S[i] - T[i])
print(p)       

Measured memory_bytes: 3064
n=int(input())
L=list(sorted(map(int,input().split())))
ans=0

for i in range(n-2):
    a=L[i]
    for j in range(i+1,n-1):
        b=L[j]
        high=n-1
        low=j+1
        if L[high]<a+b:
            ans+=n-j-1
            continue
        if L[low]>=a+b:
            continue
        while high-low>1:
            now=(high+low)//2
            c=L[now]
            if c<a+b:
                low=now
            else:
                high=now
        ans+=low-j
print(ans)

Measured memory_bytes: 44524
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<utility>
#include<queue>
#include<tuple>
#include<stdio.h>
#define rep(i, n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	string s;
	cin>>s;
	if(s[2]==s[3] && s[4]==s[5]){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
package main

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

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	k := getNextInt(scanner)
	pp := make([]int, n)
	for i := 0; i < n; i++ {
		pp[i] = getNextInt(scanner)
	}
	sort.Ints(pp)
	var ans int
	for i := 0; i < k; i++ {
		ans += pp[i]
	}
	fmt.Fprintln(writer, ans)
}


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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define per(i, b) per2(i, 0, b)
#define per2(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define ALL(c) (c).begin(), (c).end()
#define SZ(x) ((int)(x).size())

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}

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

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

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

int main() {
    string S, T, U;
    int A, B;
    cin >> S >> T >> A >> B >> U;
    if (U == S)
        --A;
    else
        --B;
    cout << A << " " << B << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return Integer.parseInt(st.nextToken());
    }

    private static String readToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public static void main(String[] args) throws IOException {
        pw.println(solve());
        pw.close();
    }

    private static long solve() throws IOException {
        int N = readInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = readInt();
        }

        Arrays.sort(A);

        long answer = 0;
        PriorityQueue<IntPair> arrangement = new PriorityQueue<>();
        arrangement.add(new IntPair(A[N-1], A[N-2]));
        arrangement.add(new IntPair(A[N-1], A[N-2]));
        answer += A[N-1];

        for (int i = N-3; i >= 0; i--) {
            IntPair top = arrangement.remove();
            answer += Math.min(top.x, top.y);
            arrangement.add(new IntPair(A[i], top.x));
            arrangement.add(new IntPair(A[i], top.y));
        }

        return answer;
    }

    static class IntPair implements Comparable<IntPair> {
        int x;
        int y;

        public IntPair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        public boolean equals(Object o) {
            IntPair intPair = (IntPair) o;
            return x == intPair.x && y == intPair.y;
        }

        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }

        @Override
        public int compareTo(IntPair o) {
            return Integer.compare(Math.min(o.x, o.y), Math.min(x, y));
        }
    }
}


Measured memory_bytes: 64172
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P>IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P> > G;
void g_dir(G &graph, ll a, ll b, ll w = 1){graph[a].push_back(P(b, w));}
void g_undir(G &graph, ll a, ll b, ll w = 1){g_dir(graph, a, b, w);g_dir(graph, b, a, w);}
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}
const ll INF = 1145141919;
const ll MOD = 1000000007;
const ll NUM = 101010;

int main(){

    ll a, b;
    cin >> a >> b;
    stringstream c, d;
    rep(i, a)c << b;
    rep(i, b)d << a;
    cout << min(c.str(), d.str()) << endl;
    
    return 0;
}

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

ll f(ll n, ll r) {
	ll ans = 1;
	for(ll i=1;i<=n;i++) ans = (ans*i) % r;
	return ans;
}

int main() {
	ll n,m;
	ll r = 1e9+7;
	ll ans = 0;
	cin >> n >> m;
	if (n == m) {
		ans = 2 * f(n,r) * f(n,r) % r;
	}
	else if (n == m+1 || n+1 == m) {
		ans = f(n,r) * f(m,r) % r;
	}
	else ans = 0;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MOD=1000000007;
#define ll long long
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
int main()
{
ll n,i,c=0;
cin>>n;
ll a[n];
for(int j=0;j<n;j++)
cin>>a[j];
for(i=0;i<n-1;i++)
{
	while(a[i]>a[i+1])
	{
		a[i+1]++;
		c++;
	}
}
cout<<c<<endl;
}

Measured memory_bytes: 5208
#include <iostream>

using namespace std;

inline int calc(int y, int m, int d){
    return 21 - d - (y % 3 && ~m & 1) +
           (10 - m) * 20 - (y%3? (5 - m / 2): 0) +
           (999 - y) * 200 - (999 - y - (333 - y / 3)) * 5;
}

int main(){
    int n;
    cin >> n;
    while(n--){
        int y, m, d;
        cin >> y >> m >> d;
        cout << calc(y, m, d) << '\n';
    }
    return 0;
}

Measured memory_bytes: 1160
#include <cstdio>
#include <iostream> 
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
 
using namespace std;
using ll = long long;
using ull = unsigned long long;
 
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(int i = 0; i < n; i++)
#define RREP(i, n) for(int i = n - 1; i >= 0; i--)
#define REP2(i, n, k) for(int i = 0; i < n; i += k)


int main()
{
	int a, b;

	cin >> a >> b;

	int ans = 0;
	for(int i = a; i <= b; i++){
		if(i % 10 == i / 10000 && i / 10 % 10 == i / 1000 % 10){
			ans++;
		}
	}

	cout << ans << endl;
}

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

int main() {
  LL a, b, c;
  cin >> a >> b >> c;

  LL d = a * b * c;
  if (d % 2 == 0) {
    cout << 0 << endl;
  } else {
    LL e = min(a * b, min(b * c, c * a));
    cout << e << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 1e5 + 7;

int a[100005];

signed main()
{
    IO_OP;
    
    int n, l;
    cin >> n >> l;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    bool ok = false;
    int j;
    for (int i = 1; i < n; i++)
        if (a[i] + a[i+1] >= l) {
            ok = true;
            j = i;
        }
    if (!ok) return cout << "Impossible" << endl, 0;
    cout << "Possible" << endl;
    for (int i = 1; i < j; i++)
        cout << i << endl;
    for (int i = n - 1; i >= j; i--)
        cout << i << endl;
    

}



Measured memory_bytes: 1280
#include"stdio.h"
using namespace std;
int main(){
	int a,b,n,i;
	scanf("%d%d",&a,&b);
	if(b>=1&&b<=9) n=10*a+b;
	if(b>=10&&b<=99) n=100*a+b;
	if(b==100) n=a*1000+b;
	for(i=1;i<=316;i++){
		if(i*i==n){printf("Yes\n");return 0;}
		if(i*i>n) break;
	}
	printf("No\n");
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cstring>
#include <set>
using namespace std;

int main() {
    while(true) {
        int N; cin >> N;
        if(N == 0) break;

        static bool card[201];
        memset(card, 0, sizeof card);

        set<int> tar;
        set<int> han;
        for(int i = 0; i < N; i++) {
            int p; cin >> p;
            tar.insert(p);
            card[p] = true;
        }
        for(int i = 1; i <= 2 * N; i++) {
            if(card[i] == false)
                han.insert(i);
        }

#if 0
        cerr << endl << "taro" << endl;
        for(auto it : tar) {
            cerr << it << endl;
        }
        cerr << endl << "hanako" << endl;
        for(auto it : han) {
            cerr << it << endl;
        }
#endif

        bool turn = 0;
        int cur = -1;
        while(true) {
            if(cur == -1) {
                if(turn == 0) {
                    cur = *tar.begin();
                    tar.erase(tar.begin());
                    turn = 1;
                }
                else {
                    cur = *han.begin();
                    han.erase(han.begin());
                    turn = 0;
                }
            }
            else {
                if(turn == 0) {
                    auto it = tar.upper_bound(cur);
                    if(it == tar.end()) {
                        cur = -1;
                    }
                    else {
                        cur = *it;
                        tar.erase(it);
                    }
                    turn = 1;
                }
                else {
                    auto it = han.upper_bound(cur);
                    if(it == han.end()) {
                        cur = -1;
                    }
                    else {
                        cur = *it;
                        han.erase(it);
                    }
                    turn = 0;
                }
            }
            if(tar.size() == 0 || han.size() == 0) break;
        }
        cout << han.size() << endl;
        cout << tar.size() << endl;
    }
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for(Int i = 0; i < (Int)(n); ++i)
#define guard(x) if( not (x) ) continue;
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif

int main() {
   Int v, e;
   std::cin >> v >> e;
   std::vector<Int> ss(e), ts(e);
   rep(i, e) std::cin >> ss[i] >> ts[i];
   std::vector<std::vector<Int>> nexts(v);
   rep(i, e) {
      Int s = ss[i], t = ts[i];
      nexts[s].emplace_back(t);
   }
   std::vector<Int> xs(v, -1);
   Int id = 0;
   std::function<void(Int,Int)> dfs = [&](Int i, Int prev) {
      if( xs[i] != -1 ) return;
      xs[i] = -2;
      for(Int k : nexts[i]) {
         guard( k != prev );
         if( xs[k] == -1 ) {
            dfs(k, i);
         }
      }
      xs[i] = id; id += 1;
   };
   rep(i, v) dfs(i, -1);
   std::vector<Int> ys(v);
   rep(i, v) ys[xs[i]] = i;
   std::reverse(ys.begin(), ys.end());
   rep(i, v) printf("%ld\n", ys[i]);
}



Measured memory_bytes: 4744
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	string data[5]={"afkpuz","bglqv.","chmrw?","dinsx!","ejoty "};
	string s;
	while(cin>>s){
		bool f=false;
		if(s.size()%2!=0){
			cout<<"NA"<<endl;
			continue;
		}
		for(int i=0;i<s.size();i+=2)if(s[i]>'6'||s[i]<'1'||s[i+1]>'5'||s[i]<'1')f=true;
		if(f||s.size()%2==1){
			cout<<"NA"<<endl;
		}else{
			for(int i=0;i<s.size();i+=2)cout<<data[s[i+1]-'0'-1][s[i]-'0'-1];
			cout<<endl;
		}
	}
}

Measured memory_bytes: 1188
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():


    n = I()
    saikoro = []
    for i in range(n):
        a, b = LI()
        saikoro.append((a, b))

    cnt = 0

    for deme in saikoro:
        if len(set(deme)) == 1:
            cnt += 1
        else:
            cnt = 0
        if cnt == 3:
            print("Yes")
            exit(0)

    print("No")

main()


Measured memory_bytes: 68376
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
from heapq import heappop, heappush
from collections import defaultdict
from collections import Counter
from collections import deque
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N, K = map(int, input().split())
A = list(map(int, input().split()))

acc = [0] * (N + 1)
for i in range(1, N + 1):
    acc[i] = acc[i - 1] + A[i - 1] - 1
    acc[i] %= K

mp = defaultdict(int)
ans = 0
q = deque([])
for j in range(N + 1):
    ans += mp[acc[j]]
    mp[acc[j]] += 1
    q.append(acc[j])
    if len(q) == K:
        mp[q[0]] -= 1
        q.popleft()
print(ans)

Measured memory_bytes: 42884
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<utility>
#include<fstream>
#include<queue>
#include <iomanip>
#include<numeric>
#include<set>
#include<map>
#include<functional>
using namespace std;
#define rep(i, k) for (i = 0; i < k; i++) 
typedef long long ll;
typedef pair<ll, ll> l_l;
int i, j;

int main() {
	ll a, b, k, n=0, z = 0;
	ll c[20] = {};
	rep(i, 5) {
		cin >>b;
		if(b==0)z = i+1;
	}
	cout << z;



}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll a;
  cin>>a;
  if(a%2==0) {
cout<<0.50000000<<endl;
  }
else {
  cout<<fixed<<setprecision(7);
cout<<(double)(a/2+1)/a<<endl;
}
}


Measured memory_bytes: 3740
#include<stdio.h>
#include<vector>
#include<utility>
using namespace std;

int main(){
  int n, t;
  scanf("%d%d", &n, &t);

  vector<pair<int, int> > p(n);
  pair<int, int> min(1001, 1001);

  for(int i = 0; i < n; i++){
    scanf("%d%d", &p.at(i).first, &p.at(i).second);
  }

  for(int i = 0; i < n; ++i){
    if(min.first > p.at(i).first && p.at(i).second <= t){
      min.second = p.at(i).second;
      min.first = p.at(i).first;
    }
  }

  if(min.first == 1001){
    printf("TLE\n");
  } else {
    printf("%d\n", min.first);
  }

  return 0;
}


Measured memory_bytes: 256
#include <queue>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MP make_pair
#define ll long long
#define fi first
#define se second
using namespace std;

template <typename T>
void read(T &x) {
    x = 0; bool f = 0;
    char c = getchar();
    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;
    for (;isdigit(c);c=getchar()) x=x*10+(c^48);
    if (f) x=-x;
}

template<typename F>
inline void write(F x)
{
	static short st[30];short tp=0;
	if(x<0) putchar('-'),x=-x;
	do st[++tp]=x%10,x/=10; while(x);
	while(tp) putchar('0'|st[tp--]);
	putchar('\n');
}

template <typename T>
inline void Mx(T &x, T y) { x < y && (x = y); }

template <typename T>
inline void Mn(T &x, T y) { x > y && (x = y); }

const int N = 100;
ll a[N], n;

ll dfs(int l, int r, int xl, int xr) {
	if (r <= l + 1) return 0;
	ll ans = 1e18;
	for (int x = l + 1; x < r; x++)
		Mn(ans, dfs(l, x, xl, xl + xr) + dfs(x, r, xl + xr, xr) + a[x] * (xl + xr));
	return ans;
}

int main() {
	read(n); 
	for (int i = 1;i <= n; i++) read(a[i]);
	printf ("%lld\n", a[1] + a[n] + dfs(1, n, 1, 1));
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main ()
{
	int A, B, C, D, L, R;
	scanf("%d%d%d%d", &A, &B, &C, &D);
	L=A+B;
	R=C+D;
	if (L>R)
	{
		printf("Left");
	}
	else if (L<R)
	{
		printf("Right");
	}
	else
	{
		printf("Balanced");
	}
	return 0;
}

Measured memory_bytes: 2152
import java.util.Scanner;

/**
 * ClassName:App <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason:	 TODO ADD REASON. <br/>
 * Date:     2018年7月17日 上午11:59:39 <br/>
 * @author   SongYapeng
 * @version  
 * @since    JDK 1.8
 * @see 	 
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int nextInt = sc.nextInt();
		System.out.println(nextInt * nextInt * nextInt);
	}
}
	


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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = 1e9+7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI d(n);
	rep(i, n) cin >>d[i];
	sort(all(d));
	
	int ans=0;
	int hf=n/2;
	ans = d[hf] - d[hf-1];
	cout << ans <<"\n";
	return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> TUP;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mp(a,b) make_pair(a,b)
const ll MOD=1000000007;

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*y/gcd(x,y);
}

int main(){
	ll x,a,b; cin>>x>>a>>b;
    if(abs(x-a)<abs(x-b)) cout<<"A"<<endl;
    else cout<<"B"<<endl;
}

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

using namespace std;

#define llong long long int
#define ldouble long double
#define rep(i, n) for (int i = 0; i < n; ++i) 
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

constexpr static int MOD = 1000000000 + 7;
constexpr static int inf = INT_MAX / 2;
constexpr static llong INF = 1LL<<31;
constexpr static int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

llong s(llong x) {
    llong re = 0;
    while (x > 0) {
        re += x % 10;
        x /= 10;
    }
    return re;
}

bool cmp(llong x, llong y) {
    return x * s(y) <= y * s(x);
}

void solve(int K) {
    llong d = 1, cur = 0;
    rep(i, K) {
        llong x = cur + d, y = cur + d * 10;
        if (cmp(x, y)) {
            cur = x;
        } else {
            cur = y;
            d *= 10;
        }
        cout << cur << endl;
    }
}

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    llong k;
    cin >> k;
    solve(k);

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    string s;
    cin >> s;
    if(s == "AAA" || s== "BBB") cout << "No" << endl;
    else        cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#define INF 500050
typedef long long ll;
using namespace std;
string s;
int len;
map<string,int> m;
int a[INF];
bool check(int x) {
	m.clear();
	for(int i=1; i<=len-x+1; i++) {
		string sub = "";
		for(int j=1,k=i-1; j<=x; j++,k++) {
			sub+=s[k];
		}
		if(m[sub]) {
			if(i-m[sub] >= x)	return true;
		}else {
			m[sub] = i;
		}
	}
	return false;
}
int main()
{
	
	cin>>len>>s;
	int l=0,r=len/2;
	while(l<=r)
	{
		int mid = (l+r)>>1;
		if(check(mid)) {
			l = mid + 1;
		}else{
			r = mid - 1;
		}
	}
	cout<<r<<endl;
	return 0;
}

Measured memory_bytes: 19296
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll a,b,c,d;
  cin>>a>>b>>c>>d;
  ll ans=0;
  ans=max({a*c,a*d,b*c,b*d});
  cout<<ans;
}



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

typedef long long ll;
const ll MOD = 1e9+7;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int a,b;
    cin>>a>>b;

    cout<<max(a+b,max(a-b,a*b));
    return 0;
}


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

using namespace std;

#define debug printf("Debug\n");
#define ll long long
#define ull unsigned long long

#define pi acos(-1.0)
#define mod 1000000007

#define p_b push_back
#define m_p make_pair

#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define in_fre  freopen("in.txt", "r", stdin);
#define out_fre freopen("out.txt", "w", stdout);

struct Node{
    ll val,pos;
};
vector<ll>v;


int main(){
    _fastio
    ll H,a;
    cin>>H>>a;

    ll s=0;
    for(ll i=1;i<=H;i++){
        ll x;
        cin>>x;
        v.push_back(x);
    }

    sort(v.begin(),v.end(),greater<ll>());

    if(v.size()<=a) cout<<0<<endl;
    else{
        ll sz=v.size();
        for(ll i=a;i<sz;i++){
            s+=v[i];
        }
        cout<<s<<endl;
    }



    return 0;
}


Measured memory_bytes: 2420
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int N;
int A[100111];
VI G[3111], ord;
bool lose[3111];
bool dp[3111];
int par[3111];

int main() {
    scanf("%d", &N);
    REP (i, N) scanf("%d", A+i);
    REP (i, N-1) {
	int x, y;
	scanf("%d%d", &x, &y);
	x--; y--;
	G[x].push_back(y);
	G[y].push_back(x);
    }

    REP (i, N) {
	int m = A[G[i][0]];
	EACH (e, G[i]) amin(m, A[*e]);
	if (m >= A[i]) {
	    lose[i] = true;
	}
    }

    VI ans;

    REP (s, N) {
	ord.clear(); ord.push_back(s);
	par[s] = -1;
	REP (i_, N) {
	    int v = ord[i_];
	    EACH (e, G[v]) if (*e != par[v]) {
		par[*e] = v;
		ord.push_back(*e);
	    }
	}

	REP (i_, N) {
	    int v = ord[N-1-i_];
	    if (lose[v]) dp[v] = false;
	    else {
		dp[v] = false;
		EACH (e, G[v]) if (*e != par[v]) {
		    if (A[v] > A[*e] && !dp[*e]) dp[v] = true;
		}
	    }
	}

	if (dp[s]) ans.push_back(s+1);
    }

    rprintf("%d", ans.begin(), ans.end());

    return 0;
}



Measured memory_bytes: 640
fn run() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let n: usize = s.trim().len();
    let mut out = String::new();
    for _ in 0..n {
        out.push('x');
    }
    println!("{}", out);
}

fn main() {
    run();
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,A;
ll dp[51][55][2555];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>A;
	dp[0][0][0]=1;
	FOR(i,N) {
		cin>>x;
		memmove(dp[i+1],dp[i],sizeof(dp[i]));
		FOR(j,i+1) FOR(y,2500) dp[i+1][j+1][y+x] += dp[i][j][y];
	}
	
	ll ret=0;
	FOR(x,51) ret+=dp[N][x+1][(x+1)*A];
	cout<<ret<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


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

int main(){
  string s;
  cin >> s;
  bool flag = false;
  for(int i = 0; i < 3; i++){
    if(s[i] == '7') flag = true;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3644