akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
using namespace std;

class Result {
public:
    int group, power;
    Result(int g = -1, int p = -1) :group(g), power(p) {}
    bool operator<(const Result r) const {
        if(group != r.group) return group < r.group;
        return power < r.power;
    }
};

int h, w, s;
int u[32][32];
Result memo[32][32][32][32];
int memo_sum[32][32][32][32];

int sum(int x1, int y1, int x2, int y2) {
    if(memo_sum[x1][y1][x2][y2] != -1) return memo_sum[x1][y1][x2][y2];
    int sum = 0;
    for(int y = y1; y <= y2; ++y) for(int x = x1; x <= x2; ++x) sum += u[x][y];
    return memo_sum[x1][y1][x2][y2] = sum;
}

Result dfs(int x1, int y1, int x2, int y2) {
    if(memo[x1][y1][x2][y2].group != -1) return memo[x1][y1][x2][y2];
    Result result(1, s - (sum(0, 0, w - 1, h - 1) - sum(x1, y1, x2, y2)));

    for(int j = x1; j < x2; ++j) {
        if(sum(0, 0, w - 1, h - 1) - sum(x1, y1, j, y2) > s) continue;
        if(sum(0, 0, w - 1, h - 1) - sum(j + 1, y1, x2, y2) > s) continue;
        Result r1 = dfs(x1, y1, j, y2);
        Result r2 = dfs(j + 1, y1, x2, y2);
        result = max(result, Result(r1.group + r2.group, min(r1.power, r2.power)));
    }

    for(int i = y1; i < y2; ++i) {
        if(sum(0, 0, w - 1, h - 1) - sum(x1, y1, x2, i) > s) continue;
        if(sum(0, 0, w - 1, h - 1) - sum(x1, i + 1, x2, y2) > s) continue;
        Result r1 = dfs(x1, y1, x2, i);
        Result r2 = dfs(x1, i + 1, x2, y2);
        result = max(result, Result(r1.group + r2.group, min(r1.power, r2.power)));
    }

    return memo[x1][y1][x2][y2] = result;
}

int main() {
    while(cin >> h >> w >> s, h | w | s) {
        for(int y1 = 0; y1 < h; ++y1) for(int x1 = 0; x1 < w; ++x1) for(int y2 = 0; y2 < h; ++y2) for(int x2 = 0; x2 < w; ++x2) memo[x1][y1][x2][y2].group = -1;
        for(int y1 = 0; y1 < h; ++y1) for(int x1 = 0; x1 < w; ++x1) for(int y2 = 0; y2 < h; ++y2) for(int x2 = 0; x2 < w; ++x2) memo_sum[x1][y1][x2][y2] = -1;
        for(int y = 0; y < h; ++y) for(int x = 0; x < w; ++x) cin >> u[x][y];

        Result result = dfs(0, 0, w - 1, h - 1);
        cout << result.group << " " << result.power << endl;
    }
}

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

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	
	long long int ans = 1;
	long long int bb = 1;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		ans *= 3;
		if (a[i] % 2 == 0) {
			bb *= 2;
		}
	}

	cout << ans - bb << endl;

	return 0;
}

Measured memory_bytes: 256
# AOJ 0556: Tile
# Python3 2018.6.30 bal4u

N, K = int(input())-1, int(input())
for i in range(K):
	a, b = map(int, input().split())
	a, b = a-1, b-1
	if a > N>>1: a = N-a
	if b > N>>1: b = N-b
	if a > b: a = b
	print(a%3+1)


Measured memory_bytes: 5620
#include<stdio.h>

int fibonacci(int);
int dp[44];

int main(){
  int n,i;

  for(i=0;i<=44;i++){
    dp[i]=-1;
  }

  scanf("%d",&n);

  printf("%d\n",fibonacci(n));

  return 0;
}

int fibonacci(int n){
  if(n==0||n==1)return 1;
  if(dp[n]!=-1)return dp[n];
  return dp[n]=fibonacci(n-2)+fibonacci(n-1);
}
    



Measured memory_bytes: 2752
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define IOS cin.tie(0),ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a <= b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first; printf("\n"); }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first; printf(" "); put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first; printf("\n"); putn(rest...); }

int main() {
	int m, d;
	cin >> m >> d;
	int res = 0;
	FOR(i, 1, m + 1) {
		FOR(j, 1, d + 1) {
			if ((j % 10) >= 2 && j >= 20) {
				if (i == (j / 10) * (j % 10)) {
					res++;
				}
			}
		}
	}
	put(res);
	return 0;
}

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

using namespace std;
using ll=long long;
using ull=unsigned long long;

typedef pair<int,int>Pi;
typedef pair<long long,long long>P;
typedef pair<long long,P>PP;
typedef pair<P,P>PPP;

const long long MOD=1e9+7;
const long long INF=5e18;
const int di[4]={1,0,-1,0};
const int dj[4]={0,1,0,-1};

#define fr first
#define sc second
#define pb push_back
#define eb emplace_back
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()

string s;
char now='$';
stack<char>st;
int ans;

void input(){
	cin>>s;
	return;
}

void solve(){
    now=s[0];
	for(int i=1;i<s.size();i++){
        if(now=='$'){
            now=s[i];
        }
        else if(now!='$'){
            if(s[i]!=now){
                ans+=2;
                if(st.empty()){
                    now='$';
                    continue;
                }
                now=st.top();
                st.pop();
            }
            else st.push(s[i]);
        }
    }
    cout<<ans<<endl;
	return;
}

int main(){
	input();
	solve();
	return 0;
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static List<int>[] toX;
        static List<int>[] toY;
        static bool[] visitedX;
        static bool[] visitedY;
        static long[] cnt;

        static void Main(string[] args)
        {
            var N = ReadInt();
            toX = new List<int>[(int)Math.Pow(10, 5) + 1].Select(l => l = new List<int>()).ToArray();
            toY = new List<int>[(int)Math.Pow(10, 5) + 1].Select(l => l = new List<int>()).ToArray();
            visitedX = new bool[(int)Math.Pow(10, 5) + 1];
            visitedY = new bool[(int)Math.Pow(10, 5) + 1];
            for (int i = 0; i < N; i++)
            {
                var input = ReadArrayInt();
                var x = input[0];
                var y = input[1];
                toX[x].Add(y);
                toY[y].Add(x);
            }
            var ans = 0L;
            for (int i = 0; i < toX.Count(); i++)
            {
                if (visitedX[i]) continue;
                cnt = new long[2];
                Dfs(i, 0);
                ans += cnt[0] * cnt[1];
            }
            for (int i = 0; i < toY.Count(); i++)
            {
                if (visitedY[i]) continue;
                cnt = new long[2];
                Dfs(i, 1);
                ans += cnt[0] * cnt[1];
            }

            Console.WriteLine(ans - N);
            Console.ReadLine();
        }

        static void Dfs(int v, int xy) //x=0,y=1
        {
            if (xy == 0)
            {
                if (visitedX[v]) return;
                visitedX[v] = true;
                cnt[0]++;
                for (int i = 0; i < toX[v].Count(); i++) Dfs(toX[v][i], 1);
            }
            else if (xy == 1)
            {
                if (visitedY[v]) return;
                visitedY[v] = true;
                cnt[1]++;
                for (int i = 0; i < toY[v].Count(); i++) Dfs(toY[v][i], 0);
            }
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 39320
#include <stdio.h>
#define mod 1000000007

int main(void){
    int n, m, tmp, i, ans;
    scanf("%d %d", &n, &m);
    int a[n+1];
    for(i = 0; i <= n; ++i){
        a[i] = -1;
    }
    for(i = 0; i < m; ++i){
        scanf("%d", &tmp);
        a[tmp] = 0;
    }
    a[0] = 1;
    if(a[1] < 0){a[1] = 1;}
    for(i = 2; i <= n; ++i){
        if(a[i] < 0){
            a[i] = (a[i-1] + a[i-2]) % mod;
        }
    }

    printf("%d\n", a[n]);
    return 0;
}

Measured memory_bytes: 512
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        k: usize,
        x: usize
    }
    println!("{}", if k * 500 >= x {"Yes"} else {"No"});
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define ces(d) cout<<" "<<endl;

int main() {
 int N;
 int A[100000];
 int color=100000;
 int ans=0;
 cin >> N;
 fx(N){
 cin>>A[x];	
 if(x>0&&A[x-1]==A[x]){
 	A[x]=color-ans;
 	ans++;
 }
 }
 
 ce(ans);
 
}

Measured memory_bytes: 256
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N,M=get_i
ks=array(M)
M.times do|i|
    ks[i]=get_i
end
p=get_i
ans=0
(2**N).times do|bit|
    switch=array(N,false)
    N.times do|i|
        unless (bit&(2**i)).zero?
          switch[i]=true
        end
    end
    flag=true
    M.times do|i|
        val=0
        ks[i][0].times do|k|
          if switch[ks[i][k+1]-1]
              val+=1
          end       
        end
        if val%2!=p[i]
            flag=false
            break
        end
    end
    if flag
        ans+=1
    end
end
puts ans

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

int main(){
  int n; string s;
  cin >> n >> s;
  int res = 0;
  for(int i=0; i<=n-3; ++i){
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){
      ++res;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
use std::io::stdin;
use std::str::FromStr;

fn main(){
    let v: Vec<i64> = get_vec();
    let ans = vec![1, 9, 7, 4]
        .iter()
        .map(|y| v.contains(y))
        .fold(true, |acc, y| acc && y);
    if ans {
        println!("YES");
    } else {
        println!("NO");
    }
}

#[allow(dead_code)]
fn get_line() -> String {
    let mut s = String::new();
    match stdin().read_line(&mut s){
        Ok(_) => {s.trim().to_string()}
        Err(_) => String::new()
    }
}

#[allow(dead_code)]
fn get_vec<T: std::str::FromStr>() -> Vec<T> {
    let line = get_line();
    line.split_whitespace().filter_map(|x| x.parse().ok()).collect()
}

#[allow(dead_code)]
fn get_one<T: FromStr + Copy>() -> T {
    let v = get_vec();
    v[0]
}

#[allow(dead_code)]
fn get_pair<T: FromStr + Copy>() -> (T, T) {
    let v = get_vec();
    (v[0], v[1])
}

#[allow(dead_code)]
fn get_triple<T: FromStr + Copy>() -> (T, T, T) {
    let v = get_vec();
    (v[0], v[1], v[2])
}

#[allow(dead_code)]
fn get_chars() -> Vec<char> {
    get_line().chars().collect()
}


Measured memory_bytes: 4352
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 100010






int main() {
	vector<int>a;
	long long dp[N];
	long long dp2[N];
	int n, k;
	int x, y, z;
	long long s, ans;
	bool v = true;
	ans = 0;
	scanf("%d %d", &n,&k);
	f(i, n) {
		scanf("%d", &x);
		a.push_back(x);
	}
	sort(a.begin(), a.end(),greater<int>());
	f(i, N)dp[i] = 0;
	dp[k] = 1;
	f(i, n) {
		f(j, N)dp2[j] = 0;
		for (int j = N-1; j >= 0; j--) {
				dp2[j] += dp[j] * (n - i - 1);
				dp2[j] = dp2[j] % MOD;
				dp2[(j%a[i])] += dp[j];
				dp2[(j%a[i])] = dp2[(j%a[i])] % MOD;
		}
		f(j, N)dp[j] = dp2[j];
	}
	ans = 0;
	f(i, N) {
		ans += (dp[i] * i);
		ans %= MOD;
	}
	printf("%lld\n", ans);


	return 0;
}


Measured memory_bytes: 1792
n,t = map(int,input().split())
data=[]

for i in range(n):
    data.append(list(map(int,input().split())))
    
data.sort(key=lambda x:x[1])

pos = len(data)
for i in range(len(data)):
    if data[i][1] >t:
        pos = i
        break
        
if pos==0:
    print('TLE')
else:
    new = data[:pos]
    new.sort(key=lambda x:x[0])
    print(new[0][0])
    

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a);i<(b);++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
#define INF 1000000000000000
#define MOD 1000000007
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
template<typename T> void invec(vector<T> &A){for(T& a:A) cin >> a;} 

int N; 
void out(string s, int mojisu){
    if (s.size() == N) cout << s << "\n";
    else 
        rep(i, 0, mojisu+1)
            out(s + (char)('a' + i), (i < mojisu ? mojisu : mojisu + 1));
}

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

cin >> N;

out("a", 1);


return 0;
}
// コンテスト前はtemplate振り返り。
// 書いて考える．場合分け．情報整理．
// 問題文から考える。自分ができることから考えっる。
// 単純に分かる量から．愚直解を実装して研究．
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，分割，次にDP(小さい問題から大きな問題)
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性→二分探索。逆から考える。
// 存在判定：構成方法，入力の特徴
// 構築問題。極端解を試す。
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// コーナーケース。境界値。数表出力プログラム作る
// 実行エラー：vector添え字超え．0割り．



Measured memory_bytes: 1536
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;
typedef std::pair<LL, LL> P;
struct edge { LL to, cost; };

const LL inf = 11234567890;
LL K;
LL d[112345];
std::vector<edge>G[112345];

void dijkstra(int s)
{
	std::priority_queue<P, std::vector<P>, std::greater<P>>que;
	std::fill(d, d + K + 1, inf);
	d[s] = 0;
	que.push(P(0, s));
	while (!que.empty())
	{
		P p = que.top(); que.pop();
		LL v = p.second;
		if (d[v] < p.first) { continue; }
		rep(i, G[v].size())
		{
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost)
			{
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}

int main()
{
	in >> K;

	rep(i, K)
	{
		G[i].push_back({ (i + 1) % K,1 });
		G[i].push_back({ (i * 10) % K, 0 });
	}
	dijkstra(1);

	out << d[0] + 1 << std::endl;
	return 0;
}

Measured memory_bytes: 9464
program prob4
    implicit none
    integer(8) A, B, C
    integer(16) ans
    read(*,*) A, B, C

    if(mod(A,2)==0 .or. mod(B,2)==0 .or. mod(C,2)==0)then
        write(*,*) 0
    else
        ans = A*B
        if(A*C < ans)then
            ans = A*C
        end if
        if(B*C < ans)then
            ans = B*C
        end if

        write(*,*) ans
    end if

    stop
end program prob4

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  int x = (n+1000-1)/1000;
  int ans = x*1000 - n;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
#define N 220005
using namespace std;
int n,a[N],f[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i++){
		if (f[a[i]-1]){
			f[a[i]]=f[a[i]-1]+1;
		} else f[a[i]]=1;
	}
	int ans=0;
	for (int i=1;i<=n;i++) ans=max(ans,f[i]);
	printf("%d\n",n-ans);
}

Measured memory_bytes: 1920
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vi v(n);
	REP(i, n)cin >> v[i];
	sort(ALL(v));
	UNIQUE(v);
	cout << v.size() << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:String,
    b:String,
    }
    let mut a=a.chars().collect_vec();
    a.sort();
    let mut b=b.chars().collect_vec();
    b.sort();
    b.reverse();
    for i in 0..min(a.len(),b.len()) {
        if a[i]>b[i] {println!("No");exit(0)}
        else if a[i]<b[i] {println!("Yes");exit(0)}
    }
    println!("{}",if a.len()>=b.len(){"No"}else{"Yes"});
}

Measured memory_bytes: 2172
def resolve():
    N, K = list(map(int, input().split()))
    S = list(input())
    base = 0
    prev = S[0]
    for i in range(1, N):
        if prev == S[i]:
            base += 1
        prev = S[i]
    
    print(min(base+2*K, N-1))


if '__main__' == __name__:
    resolve()


Measured memory_bytes: 69712
//  Created by Sengxian on 2017/7/1.
//  Copyright (c) 2017年 Sengxian. All rights reserved.
//  
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
inline int readInt() {
	int n = 0, ch = getchar();
	while (!isdigit(ch)) ch = getchar();
	while (isdigit(ch)) n = n * 10 + ch - '0', ch = getchar();
	return n;
}

const int MAX_N = 100000 + 3;
int n, m, a[MAX_N];
vector<int> vec1[MAX_N], vec2[MAX_N];
int cnt[MAX_N];
ll sum[MAX_N], decc[MAX_N];

int main() {
	n = readInt(), m = readInt();
	for (int i = 0; i < n; ++i) a[i] = readInt() - 1;
	
	ll res = 0;
	for (int i = 0; i < n - 1; ++i) {
		if (a[i + 1] > a[i]) {
			vec1[a[i + 1]].push_back(a[i]);
		} else {
			cnt[a[i]]++;
			vec2[a[i + 1]].push_back(a[i]);
		}
		res += (a[i + 1] - a[i] + m) % m;
	}
	
	multiset<int> s;
	ll ss = 0;
	for (int i = m - 1; i >= 0; --i) {
		for (int j = 0; j < (int)vec1[i].size(); ++j)
			s.insert(vec1[i][j]), ss += vec1[i][j];
		while (!s.empty() && *s.rbegin() >= i) ss -= *s.rbegin(), s.erase(--s.end());
		decc[i] = (ll)(i - 1) * s.size() - ss;
	}
	
	for (int i = 1; i < m; ++i) sum[i] = sum[i - 1] + (ll)cnt[i] * i, cnt[i] += cnt[i - 1];
	for (int i = 1; i < m; ++i) decc[i] += (ll)cnt[i - 1] * (i - 1) - sum[i - 1];
	
	ss = 0;
	for (int i = m - 1, cc = 0; i >= 0; --i) {
		for (int j = 0; j < (int)vec2[i].size(); ++j)
			ss += vec2[i][j], ++cc;
		decc[i] += (ll)(m + i - 1) * cc - ss;
	}
	
	printf("%lld\n", res - *max_element(decc, decc + m));
	
	return 0;
}


Measured memory_bytes: 9600
// Give me My Shotgun

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

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

#define PB push_back
#define F first
#define S second
#define _sz(x) (int)x.size()

#define debug(x) cerr << #x << " = " << x << endl

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

const int MAX_N = -1 ;
const int inf = 2e9 + 19 ;

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

int main() {
        ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;
        int n ;
        cin >> n ;
        while (isPrime(n) == false)
                n ++ ;
        cout << n ;
        return (0) ;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	var s, t string
	fmt.Scan(&n, &s, &t)

	var ret string
	for i := 0; i < n; i++ {
		ret += s[i : i+1]
		ret += t[i : i+1]
	}

	fmt.Println(ret)

}

Measured memory_bytes: 512
#include<stdio.h>
int main(void){
  int c[6];
  int k;
  int tmp;
  while(scanf("%d,%d,%d,%d,%d",&c[1],&c[2],&c[3],&c[4],&c[5])!=EOF){
    while(c[1]>c[2] || c[2]>c[3] || c[3]>c[4] || c[4]>c[5]){
      for(k=1;k<=4;k++){
        if(c[k]>c[k+1]){
          tmp = c[k];
          c[k] = c[k+1];
          c[k+1] = tmp;
        }
      }
    }
    if((c[1]==c[2] && c[2]==c[3] && c[3]==c[4])||(c[2]==c[3] && c[3]==c[4] && c[4]==c[5])){
      printf("four card\n");
    }else if((c[1]==c[2] && c[2]==c[3] && c[4]==c[5])||(c[1]==c[2] && c[3]==c[4] && c[4] == c[5])){
      printf("full house\n");
    }else if((c[1]+1==c[2] && c[2]+1==c[3] && c[3]+1==c[4] && c[4]+1==c[5]) || (c[1]==1 && c[2]==10 &&  c[3]==11 && c[4]==12 && c[5]==13)){
      printf("straight\n");
    }else if((c[1]==c[2] && c[2]==c[3]) || (c[2]==c[3] && c[3]==c[4]) || (c[3]==c[4] && c[4] == c[5])){
      printf("three card\n");
    }else if((c[1]==c[2] && c[3]==c[4]) || (c[1]==c[2] && c[4]==c[5]) || (c[2]==c[3] && c[4]==c[5])){
      printf("two pair\n");
    }else if(c[1]==c[2] || c[2]==c[3] || c[3]==c[4] || c[4]==c[5]){
      printf("one pair\n");
    }else{
      printf("null\n");
    }
  }
  return 0;
}

Measured memory_bytes: 580
import java.util.Scanner;
public class Main{
    

     public static void main(String []args){
         String x = new Scanner(System.in).nextLine();
		
		String array1[]=x.split("\\s+");
		long N =Long.parseLong(array1[0]);
		long A=Long.parseLong(array1[1]);
		long B=Long.parseLong(array1[2]);
		CoubtBalls(N,A,B);
		

     }
     public static void CoubtBalls(long N,long A,long B)
     {
         long result=0;
         long temp=0;
         if(N%(A+B) > A) 
         {
             temp=A;
         }
         else 
         {
            temp= N%(A+B);
         }
         result=((N/(A+B))*A)+temp;
         System.out.print(result);
     }
     
}

Measured memory_bytes: 23892
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    int t, a, b; cin >> t >> a >> b;
    cout << (t * a < b ? t * a : b);
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = input().strip()
    stock_l = 0
    left = ""
    right = ""
    for i in range(N):
        if s[i] == "(":
            stock_l += 1
        else:
            if stock_l > 0:
                stock_l -= 1
            else:
                left += "("
    print(left + s + ")" * stock_l)



if __name__ == "__main__":
    main()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define FLASH cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define pb push_back
#define int long long
#define fr(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define FILEIO freopen("/home/aman/Desktop/Kachda/input.txt", "r", stdin); freopen("/home/aman/Desktop/Kachda/output.txt", "w", stdout);

using namespace std;

signed main()
{
    
    FLASH
    int n, x;
    cin>>n>>x;

    if(x == 2*n - 1 || x == 1)  return cout<<"No\n", 0;
    cout<<"Yes\n";
    int cur = 2;

    fr(i,1,2*n)
    {
        if(i != n - 1 && i != n && i != n + 1)
        {
            if(cur == x) cur++;
            cout<<cur<<"\n";
            cur++;
        }  
        else
        {
            if(i == n - 1) cout<<1<<"\n";
            if(i == n) cout<<x<<"\n";
            if(i == n + 1) cout<<2*n - 1<<"\n";
        }
        
    }
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define siz(v) (ll)(v).size()
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define repi(i, x, n) for (int i = x; i < (ll)(n); i++)
#define lb lower_bound
#define ub upper_bound
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};
//cin.tie(0);ios::sync_with_stdio(false);

string s;

vector<int> Zalgo(string &s)
{
    int ssize = (int)s.size();
    int j = 0; //調査済み部分の先端を調べたときのi
    vector<int> res(ssize, 0);
    res[0] = 0;

    for (int i = 1; i < ssize; i++)
    {
        int &k = res[i]; //参照なので書き換わる
        if (j + res[j] <= i)//比較結果を再利用できない場合
        {
            k = 0;
        }
        else //できる場合(前調べた部分に含まれる場合)
        {            
            k = min(res[j] + j - i, res[i - j]);
            //すでに調べて分かっている部分は初期値とする
            //はみ出している場合、完全に再利用できる場合（たぶん）
        }

        while (i + k < ssize && s[k] == s[i + k])
            k++;

        if (j + res[j] < i + res[i])
            j = i; //新しく調べた場所がさらに先なら更新
    }

    //res[0] = ssize;
    return res;
}

signed main()
{
    int n,ans=0;
    cin >> n;
    cin >> s;

    rep(i,n){
        string t=s.substr(i,n-i);
        vector<int> v=Zalgo(t);
        rep(j,siz(v)){
            ans=max(ans,min(v[j],j));
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void)
{
  long long int x;
  long long int y=100;
  int i;

  scanf("%lld",&x);

  for(i=1;i>0;i++)
  {
    y*=1.01;
    if(y>=x) break;
  }

  printf("%d\n",i);

  return 0;
}

Measured memory_bytes: 1736
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N = input()
K = int(input())

dp = [[[0]*(K+2) for j in range(2)] for i in range(len(N) + 1)]
dp[0][1][0] = 1

for i in range(len(N)):
    for k in range(K+1):
        dp[i+1][0][k] += dp[i][0][k]
        dp[i+1][0][k+1] += dp[i][0][k]*9

        if N[i] != "0":
            dp[i+1][0][k] += dp[i][1][k]
            dp[i+1][0][k+1] += dp[i][1][k]*(int(N[i])-1)
            dp[i+1][1][k+1] += dp[i][1][k]
        else:
            dp[i+1][1][k] += dp[i][1][k]

print(dp[-1][0][K] + dp[-1][1][K])

Measured memory_bytes: 77464
while 1:
  i = input()
  if i==0: break
  x = map(int, raw_input().split())
  
  n = 32
  c = 0
  while n:
    n -= (n-1) % 5
    print n
    n -= min(x[c], n)
    c = (c+1) % i
    print n

Measured memory_bytes: 4204
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
const int p = 1000005;
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int a[n];
	rep(i, n) cin >> a[i];
	ll ans = 0;
	rep(i, n - 1) {
		if (a[i + 1] < a[i]) {
			ans += a[i] - a[i + 1];
			a[i + 1] = a[i];
		}
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 4424
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

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

A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
C=[2]

if (x in A and y in A) or (x in B and y in B) or (x in C and y in C):
	print("Yes")
	
else:
	print("No")

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-9;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int ans[2525];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  int n, x, y;
  cin>>n>>x>>y;
  --x;--y;
  vi g[2525];
  REP(i, n-1){
    g[i].push_back(i+1);
    g[i+1].push_back(i);
  }
  g[x].push_back(y);
  g[y].push_back(x);
  REP(i, n){
    int d[2525];
    bool used[2525];
    REP(j, n){
      d[j]=0;
      used[j]=false;
    }
    queue<int> que;
    que.push(i);
    used[i]=true;
    while(que.size()){
      int s=que.front();que.pop();
      for(auto t : g[s]){
        if(used[t]){
          continue;
        }
        used[t]=true;
        d[t]=d[s]+1;
        que.push(t);
      }
    }
    REP(j, n){
      ++ans[d[j]];
    }
  }
  FOR(i, 1, n){
    cout<<ans[i]/2<<'\n';
  }
  return 0;
}


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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = getInt(sc);
		int k = getInt(sc);
		int q = getInt(sc);

		Map<Integer, Integer> answerMap = new HashMap<>();
		for (int i = 0; i < q; i++) {
			int responder = getInt(sc);
			if (answerMap.containsKey(responder)) {
				answerMap.replace(responder, answerMap.get(responder) + 1);
			} else {
				answerMap.put(responder, 1);
			}
		}
		for (int i = 1; i <= n; i++) {
			int point = 0;
			if (answerMap.containsKey(i)) {
				point = answerMap.get(i);
			}

			if (point > q - k) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
	}

	/**
	 * *汎用メソッド<br>
	 * 入力した配列に対する順列を取得
	 *
	 * @param numArray
	 * @return
	 */
	private static List<Integer[]> getPermutation(int[] numArray) {
		List<Integer[]> permutation = new ArrayList<>();
		Integer[] ans = new Integer[numArray.length];
		boolean[] used = new boolean[numArray.length];

		return buildPermutaion(permutation, numArray, ans, used, 0);
	}

	/**
	 * *汎用メソッド(内部)<br>
	 * 入力した配列に対する順列を作成
	 *
	 * @param list
	 * @param numArray
	 * @param ans
	 * @param used
	 * @param depth
	 * @return
	 */
	private static List<Integer[]> buildPermutaion(List<Integer[]> list, int[] numArray, Integer[] ans, boolean[] used,
			int depth) {

		// 全部使い切った時=>できた順列を返す
		if (depth == numArray.length) {
			list.add(ans.clone());
			return list;
		}
		// 使い切っていない場合

		for (int i = 0; i < numArray.length; i++) {
			if (used[i]) {
				continue;
			}
			ans[depth] = numArray[i];
			used[i] = true;
			list = buildPermutaion(list, numArray, ans, used, depth + 1);

			used[i] = false;
		}

		return list;
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をlongで返却
	 *
	 * @return
	 */
	public static long getLong(Scanner sc) {

		return Long.parseLong(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をintで返却
	 *
	 * @return
	 */
	public static int getInt(Scanner sc) {

		return Integer.parseInt(sc.next());
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をStringで返却
	 *
	 * @return
	 */
	public static String getString(Scanner sc) {

		return sc.next();
	}

	/**
	 * *汎用メソッド <br>
	 * スキャナーからの入力値をint配列で返却
	 *
	 * @return
	 */
	public static int[] getIntArray(Scanner sc) {
		String line = "";
		// 直前にnext()を実行していると改行コードだけ取ってしまうのでその対策
		while (line.equals("")) {
			line = sc.nextLine();
		}

		String[] strArray = line.split(" ");
		int[] intArray = new int[strArray.length];
		for (int i = 0; i < strArray.length; i++) {
			intArray[i] = Integer.parseInt(strArray[i]);
		}
		return intArray;
	}

}

class Status {
	int row = 0;
	int col = 0;
	int candies = 0;

	public Status(int row, int col, int candies) {
		this.row = row;
		this.col = col;
		this.candies = candies;
	}
}


Measured memory_bytes: 59272
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int n=getInt();
		int[][]f=REPS(n).mapToObj(o->INS(n).toArray()).toArray(int[][]::new);

		for(int k=0;k<n;++k) {
			for(int i=0;i<n;++i) {
				for(int j=0;j<n;++j) {
					if(f[i][j]>f[i][k]+f[j][k]) {
						System.out.println(-1);
						return;
					}
				}
			}
		}

		long sum=0;
		for(int i=0;i<n;++i)
			for(int j=0;j<n;++j)
				sum+=f[i][j];

		//System.out.println(sum);

		for(int i=0;i<n;++i){
			for(int j=0;j<n;++j)if(i!=j){
				for(int k=0;k<n;++k)if(i!=k&&j!=k){
					//System.out.println(i+" "+j+" "+k);
					if(f[i][j]==f[i][k]+f[j][k]) {
					//	System.out.println(i+" "+j+" "+k);
						sum-=f[i][j];
//						System.out.println(-1);
						break;
					}
				}
			}
		}
		System.out.println(sum/2);
	}
}

Measured memory_bytes: 50620
#include <iostream>
#include <iterator>
#include <cstdio>
#include <array>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
#include <bitset>
#include <chrono>

using namespace std;
using lli = long long int;
using ulli = unsigned long long int;

namespace atcoder {
	void judge_outer(bool judge_exp, string ok = "Yes", string ng = "No") {
		if (judge_exp) {
			cout << ok << endl;
		} else {
			cout << ng << endl;
		}
	}

	int ncr(int left, int right) {
		right = min(left - right, right);
		int ans = 1;
		for (int i = 1; i <= right; i++) {
			ans = ans * (left - right + i) / i;
		}
		return ans;
	}

	const int LIMIT = 1000000256;
	const int tenfive = 100100;
}

using namespace atcoder;


int main(void) {
	int num[3][120];
	int stk = 1;
	for (int i = 0; i < 3; i++) {
		stk = 1;
		for (int j = 0; j < i; j++)stk *= 100;
		for (int j = 0; j < 120; j++) {
			num[i][j] = stk * j;
		}
	}
	int a, b;
	cin >> a >> b;
	if (b == 100)b = 101;
	cout << num[a][b] << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define F first
#define S second
#define en "\n"
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
const int loose = 0;
const int tight = 1;



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

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

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

	string s;
	cin >> s;

	cout << string(s.size(), 'x') << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const ll MOD=1000000007,INF=1ll<<60;
int dx[]={0,0,1,-1},dy[]={-1,1,0,0};

int X,Y,Z,K,t;

signed main() {
    IOS();
    cin>>X>>Y>>Z>>K;
    vint a[3];
    rep(i,0,X){
        cin>>t;
        a[0].pb(t);
    }
    sort(all(a[0]));
    reverse(all(a[0]));
    rep(i,0,Y){
        cin>>t;
        a[1].pb(t);
    }
    sort(all(a[1]));
    reverse(all(a[1]));
    rep(i,0,Z){
        cin>>t;
        a[2].pb(t);
    }
    sort(all(a[2]));
    reverse(all(a[2]));
    
    vint b;
    rep(i,0,X){
        rep(j,0,Y){
            b.pb(a[0][i]+a[1][j]);
        }
    }
    sort(all(b));
    reverse(all(b));
    
    vint ans;
    rep(i,0,min(K,(int)b.size())){
        rep(j,0,Z){
            ans.pb(b[i]+a[2][j]);
        }
    }
    sort(all(ans));
    reverse(all(ans));
    rep(i,0,K){
        cout<<ans[i]<<endl;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 43256
#include <cstdio>
#include <cmath>
struct point{
	double x, y;
	point(double _x = 0, double _y = 0){ x = _x, y = _y; }
	void read(){ scanf("%lf%lf", &x, &y); }
	void print(char ch = '\n'){ printf("%.10lf %.10lf", x, y), putchar(ch); }
	point operator + (const point &rhs) const { return point(x + rhs.x, y + rhs.y); }
	point operator - (const point &rhs) const { return point(x - rhs.x, y - rhs.y); }
}A, B, C, D, E;
int q;
point cross_point(point a, point b, point c, point d){
	double k1, b1, k2, b2, x, y;
	if (a.x == b.x){
		k2 = (c.y - d.y) / (c.x - d.x), b2 = c.y - k2 * c.x;
		x = a.x, y = k2 * x + b2;
	}
	else if (c.x == d.x){
		k1 = (a.y - b.y) / (a.x - b.x), b1 = a.y - k1 * a.x;
		x = c.x, y = k1 * x + b1;
	}
	else{
		k1 = (a.y - b.y) / (a.x - b.x), b1 = a.y - k1 * a.x;
		k2 = (c.y - d.y) / (c.x - d.x), b2 = c.y - k2 * c.x;
		x = (b2 - b1) / (k1 - k2), y = k1 * x + b1;
	}
	return point(x, y);
}
int main(){
	scanf("%d", &q);
	for (register int i = 1; i <= q; ++i){
		A.read(), B.read(), C.read(), D.read();
		E = cross_point(A, B, C, D);
		E.print();
	}
}


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

using namespace std;

#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;


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

	map<int, int> a;
	int tmp = 0;
	for (int i = 0; i < n; i++) {
		cin >> tmp;
		a[tmp]++;
	}
	int ans = 0;

	for (auto it = a.begin(); it != a.end(); ++it) {
		if (it->second > it->first) {
			ans += it->second-it->first;
		} else if (it->second < it->first) {
			ans += it->second;
		}
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 4736
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using ll = long long;
using namespace std;

int main() {
  int h, w;
  cin >> h >> w;
  char c[h][w];
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> c[i][j];
    }
  }

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cout << c[i][j];
    }
    cout << endl;
    for (int j = 0; j < w; j++) {
      cout << c[i][j];
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long k = in.nextLong();
        if (n > k) {
            n = n % k;
        }
        System.out.println(k - n > n ? n : k - n);
    }
}

Measured memory_bytes: 21844
S=input()
T=input()
An=[]
for alfa in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'):
    S1=S+alfa
    if S1==T:
        An.append("Yes")

if len(An) > 0:
    print('Yes')
else:
    print('No')    
    

Measured memory_bytes: 9128
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define mod 100000000
#define Fi(n) for(ll i=0;i<n;i++)
#define Fj(n) for(ll j=0;j<n;j++)
#define Fiab(a,b) for(ll i=a;i<b;i++)
#define Fjab(a,b) for(ll j=a;j<b;j++)
#define sexy ios_base::sync_with_stdio(false);cin.tie(NULL);
#define txti freopen("input.txt", "r", stdin);
#define txto freopen("output.txt", "w", stdout);

bool sortmahstyle(const pair<int,int> &a,  const pair<int,int> &b) 
{ 
   
    if(a.second<b.second)
        return true;
        
    return false;
    
} 

//ll x[5001],y[26];
int main() {
sexy    
//txti
//txto
        //ll t =1;
        
        
        string s,t;
        cin>>s>>t;
        ll n = t.length();
        if( t.substr(0,n-1) == s)
            cout<<"Yes\n";
        else
            cout<<"No\n";
        
        
        
        
    return 0;
}

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

typedef pair<int, int> P;

int main() {
    int h, w;
    cin >> h >> w;

    vector<vector<char>> maze(h, vector<char>(w));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; ++j) {
            cin >> maze[i][j];
        }
    }

    int INF = 1000000000;

    int dx[4] = {1, 0, -1, 0};
    int dy[4] = {0, 1, 0, -1};

    int ans = 0;
    for (int sx = 0; sx < h; ++sx) {
        for (int sy = 0; sy < w; ++sy) {
            if (maze[sx][sy] == '.') {
                for (int gx = 0; gx < h; ++gx) {
                    for (int gy = 0; gy < w; ++gy) {
                        if (maze[gx][gy] == '.') {
                            int d[h][w];

                            queue<P> que;

                            for (int i = 0; i < h; i++) {
                                for (int j = 0; j < w; ++j) {
                                    d[i][j] = INF;
                                }
                            }

                            que.push(P(sx, sy));
                            d[sx][sy] = 0;

                            while (que.size()) {
                                P p = que.front();
                                que.pop();

                                if (p.first == gx && p.second == gy) {
                                    break;
                                }

                                for (int i = 0; i < 4; i++) {
                                    int nx = p.first + dx[i], ny = p.second + dy[i];

                                    if (0 <= nx && nx < h && 0 <= ny && ny < w && maze[nx][ny] != '#' &&
                                        d[nx][ny] == INF) {
                                        que.push(P(nx, ny));
                                        d[nx][ny] = d[p.first][p.second] + 1;
                                    }
                                }
                            }
                        ans = max(ans, d[gx][gy]);
                        }
                    }
                }
            }
        }
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
    int d,g;
    cin>>d>>g;
    int c[d],p[d];
    int ans=INT_MAX;
    for(int i=0;i<d;i++)
    {
        cin>>p[i]>>c[i];
    }
    for(int i=0;i!=(1<<d);++i)
    {
        int sum = 0, cnt = 0;
        for(int j=0;j!=d;++j)
        {
           if(i&(1<<j))
           {
               sum += 100 * (j + 1)*p[j] + c[j];
               cnt += p[j];
           }
        }
        if (sum >= g)
            ans = min(ans, cnt);
        else {
            for (int j = d - 1; j != -1; --j) {
                if (!(i&(1 << j))) {
                    if (sum + 100 * (j + 1)*p[j] >= g) {
                        ans = min(ans, cnt + (g - sum - 1) / (100 * (j + 1)) + 1);
                        break;
                    }
                    else break;
                }
            }
        }
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256