akhauriyash/Code-Regression huggingface dataset:
#define DEBUG 0

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

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------


int main() {
    int H,W,A,B;
    cin >> H >> W >> A >> B;

    int i,j;
    for (i = 0; i < H; i++) {
        for (j = 0; j < W; j++) {
            if ((i < B) && (j < A)) printf("0");
            else if ((i >= B) && (j >= A)) printf("0");
            else printf("1");
        }
        printf("\n");
    }

    return 0;
}



Measured memory_bytes: 1280
#include <iostream>
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;

int main() {
  ll n, q;
  cin >> n >> q;
  dsu uf(n);

  while (q--) {
    ll t, u, v;
    cin >> t >> u >> v;
    if (t == 0) {
      uf.merge(u, v);
    } else if (t == 1) {
      if (uf.same(u, v)) {
        cout << 1 << endl;
      } else {
        cout << 0 << endl;
      }
    }
  }
  
}


Measured memory_bytes: 4000
// ※※※ 解答不能 ※※※
// LHiC氏.
// https://atcoder.jp/contests/keyence2019/submissions/4060579
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
const LL MOD = 1e9 + 7;

LL pw(LL a, LL b){
    LL ans = 1;
    while(b){
        while(!(b & 1)) b >>= 1, a = (a * a) % MOD;
        ans = (ans * a) % MOD, --b;
    } return ans;
}

int main(){
    LL h, w, k;
    scanf("%lld %lld %lld", &h, &w, &k);
    LL p = 1, q = 1;
    repx(i, 1, h + w + 1) p = (p * i) % MOD;
    repx(i, 1, h + w + 1 - k) q = (q * i) % MOD;
    p = p * pw(q, MOD - 2) % MOD;
    LL go = h * w % MOD * pw(h + w, MOD - 2) % MOD * pw(h + w - 1, MOD - 2) % MOD * 2 % MOD;
    LL ans = (k * p) % MOD;
    rep(i, k){
        LL cnt = k - i;
        ans = (ans + p * cnt % MOD * (1 + i * go % MOD)) % MOD;
    }
    printf("%lld\n", ans);
    return 0;
}

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

int main() {
    int A[3][3]; 
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> A[i][j];
        }
    }

    int N;
    cin >> N;

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

    bool bingo[3][3];

    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < N; k++) {
                if (A[i][j] == B[k]) {
                  bingo[i][j] = true;
                  break;
                } else {
                  bingo[i][j] = false;
                }
            }
        }
    }

    // for (int i = 0; i < 3; i++) {
    //   for (int j = 0; j < 3; j++) {
    //       if (bingo[i][j]) {
    //         cout << 1 << " ";
    //       } else {
    //         cout << 0 << " ";
    //       }
        
    //   } cout << endl;
    // }

    bool flag = false;
    // 縦を調べる
    for (int i = 0; i < 3; i++) {
        int cnt = 0;
        for (int j = 0; j < 3; j++) {
            if (!bingo[i][j]) {
                break;
            } else {
                cnt++;
            }
        }
        if (cnt == 3) {
            flag = true;
            break;
        }
    }

    // 横を調べる
    for (int i = 0; i < 3; i++) {
      int cnt = 0;
      for (int j = 0; j < 3; j++) {
        if (!bingo[j][i]) {
          break;
        } else {
          cnt++;
        }
      }
      if (cnt == 3) {
        flag = true;
        break;
      }
    }

    // 斜めを調べる
    int cnt = 0;
    for (int i = -1; i < 2; i++) {
        if (!bingo[1-i][1-i]) {
            break;
        } else {
            cnt++;
        }
    }
    if (cnt == 3) {
      flag = true;
    }

    // 斜めを調べる
    cnt = 0;
    for (int i = -1; i < 2; i++) {
        if (!bingo[1+i][1-i]) {
            break;
        } else {
            cnt++;
        }
    }
    if (cnt == 3) {
      flag = true;
    }

    // 出力
    if (flag) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define pii pair<int, int>
typedef unsigned long long uLL;
typedef long long LL;
using namespace std;
constexpr int MAXN = 1e6 + 6;;
string s;
int val[MAXN];
LL tot;
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0);
	cin >> s;
	reverse(s.begin(), s.end());
	for (int i = 0; i < s.size(); i++) val[i] = s[i] - '0';
	for (int i = 0; i < s.size(); i++) {
		if(val[i] < 5) tot += 1LL * val[i];
		else if(val[i] > 5){
			tot += 10LL - val[i];
			val[i + 1]++, val[i] = 0;
		}
		else {
			if(val[i + 1] >= 5) val[i + 1]++, val[i] = 0;
			tot += 5;
		}
		if(val[i + 1] >= 10) val[i + 1] -= 10, val[i + 2]++;
	}
	tot += val[s.size()] + val[s.size() + 1];
	cout << tot << endl;
	return 0; 
}

Measured memory_bytes: 5276
parseInt(x) = parse(Int, x)
chompString(x) = String(chomp(x))
ncut(x,n) = x>n?x-n:x

function main()
	n = readline() |> parseInt
	s = Array{String,1}()
	for i in 1:n
		push!(s,chompString(readline()))
	end
	count = 0
	for k in 1:n
		flg = 0
		for i in 1:n
			for j in 1:n
				if s[i][j] != s[ncut(j+k,n)][ncut(i+n-k,n)]
					flg = 1
				end
			end
		end
		if flg == 0
			count += 1
		end
	end
	print(n*count)
end

main()

Measured memory_bytes: 110212
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <memory.h>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#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 mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main() {
	int n; cin >> n;
	getchar();
	while (n--) {
		string s; getline(cin, s);
		rep(a, 26) rep(b, 26) {
			string t = s;
			rep(i, t.size()) if (isalpha(t[i])) t[i] = (a * (t[i] - 'a') + b) % 26 + 'a';
			if(t.find("that") != -1 || t.find("this") != -1) {
				cout << t << endl;
				goto next;
			}
		}
		next:;
	}
	
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define dbg(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;

ll gcd(ll a,ll b){
  while(b!=0){
    a%=b;
    swap(a,b);
  }
  return a;
}

int main(){
  ll a,b;
  cin>>a>>b;
  ll g=gcd(a,b);
  int cnt=1;
  for(ll i=2;i*i<=g;i++){
    if(g%i)continue;
    while(g%i==0)g/=i;
    cnt++;
  }
  if(g!=1)cnt++;
  cout<<cnt<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        boolean flag = false;
        for(int i=0; i<=x; i++){
            if(4*i + 2*(x-i) == y){
                flag = true;
            }
        }
        if(flag){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}

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

using namespace std;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn  = 5e3;
const ll mod =998244353;
const ld PI = acos((ld)-1);

#define pb push_back
#define endl '\n'
#define dokme(x) return(cout << x , 0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ms(x , y) memset(x , y , sizeof x);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
ll pw(ll a, ll b, ll md = mod){ll res = 1;while(b){if(b&1){res=(a*res)%md;}a=(a*a)%md;b>>=1;}return(res);}

int n , k;
ll c[maxn][maxn];
ll C(ll r , ll n){
    if(r>n)return(0);
    return(c[n][r]);
}
ll ans[maxn];

int main(){
    migmig
    cin >> k >> n;
    for(int i = 0 ; i < 5000 ; i ++)c[i][0] = 1;
    for(int i = 1 ; i < 5000 ; i ++)
        for(int j = 1 ; j <= i ; j ++)
            c[i][j] = (c[i-1][j-1] + c[i-1][j])%mod;
    for(int i = 2 ; i <= k + 1 ; i ++){
        for(int j = 0 ; j <= i/2 ; j ++){
            if(j%2)
                ans[i] = (ans[i] - C(j , i / 2 ) * C(n - j * 2 , k + n - j * 2 - 1)% mod + mod ) % mod;
            else
                ans[i] = (ans[i] + C(j , i / 2 ) * C(n - j * 2 , k + n - j * 2 - 1)% mod) % mod;
        }
    }
    for(int i = 2 ; i <= k*2 ; i ++ )
        cout << ((i>=k+2)? ans[2*k+2-i] : ans[i]) << endl;
    return(0);
}

Measured memory_bytes: 193920
#include <iostream>
#include <cmath>
#include <complex>
#include <iomanip>
#include <algorithm>
using namespace std;

typedef complex<long double> xy;
long eps = 1e-9;
long double dot_product(xy a,xy b) {return (conj(a)*b).real();}
long double cross_product(xy a,xy b) {return (conj(a)*b).imag();}
long double dist_lp(xy a1,xy a2,xy p){
    if(dot_product(a2-a1,p-a1)<eps) return abs(p-a1);
    if(dot_product(a1-a2,p-a2)<eps) return abs(p-a2);
    return abs(cross_product(a2-a1,p-a1))/abs(a2-a1);
}

bool is_online(xy a1,xy a2,xy p){
    return abs(a1-p)+abs(a2-p)<=abs(a1-a2)+eps;    
}

bool is_intersected(xy a1, xy a2, xy b1, xy b2){
    if(is_online(a1,a2,b1) || is_online(a1,a2,b2)) return true;
    if(is_online(b1,b2,a1) || is_online(b1,b2,a2)) return true;
    return (cross_product(a2-a1,b1-a1)*cross_product(a2-a1,b2-a1)<-eps) && 
    (cross_product(b2-b1,a1-b1)*cross_product(b2-b1,a2-b1))<-eps;
}

long double dist_ll(xy a1,xy a2,xy b1,xy b2){
    if(is_intersected(a1,a2,b1,b2)) return 0;
    return min({dist_lp(a1,a2,b1),dist_lp(a1,a2,b2),dist_lp(b1,b2,a1),dist_lp(b1,b2,a2)
    ,abs(a1-b1),abs(a1-b2),abs(a2-b1),abs(a2-b2)});   
}

int N;
long double sx,sy,gx,gy,mi_x,mi_y,ma_x,ma_y;
long double h;


int main(){
    while(cin>>N && N>0){
        long double ans = 1e9;
        cin >> sx >> sy >> gx >> gy;
        xy s = xy(sx,sy),g = xy(gx,gy);
        for(int i=1;i<=N;i++){
            cin >> mi_x >> mi_y >> ma_x >> ma_y >> h;
            if((mi_x<=sx && sx<=ma_x && mi_y<=sy && sy<=ma_y || 
            mi_x<=gx && gx<=ma_x && mi_y<=gy && gy<=ma_y)) ans = 0;
            long double d = min({dist_ll(s,g,xy(mi_x,mi_y),xy(mi_x,ma_y)),
            dist_ll(s,g,xy(mi_x,ma_y),xy(ma_x,ma_y)),
            dist_ll(s,g,xy(ma_x,ma_y),xy(ma_x,mi_y)),
            dist_ll(s,g,xy(ma_x,mi_y),xy(mi_x,mi_y))});
            if(d<=h) ans = min(ans,d);
            else ans = min(ans,(h*h+d*d)/(2.0*h));
        }
        cout << fixed;
        cout << setprecision(10) << ans << endl;
    }
}


Measured memory_bytes: 3292
# ある時点の重複番組数を前からカウントして、最大値が答え
# s順に並べて、ループごとに重複数を増やしつつ、
# 終了キューにtを追加
# 番組追加するごとに終了キューの中身をチェック
# 同じチャンネルだったら、終了キューt <= 現在時刻 のときに終了キューから外せる
# 違うチャンネルだったら、終了キューt < 現在時刻となる
# チャンネルごとにheapqを持つ

N,C = map(int,input().split())
import heapq
endq = [[] for i in range(C)]
for i in range(C):
  heapq.heapify(endq[i])
progs = [None] * N
for i in range(N):
  s,t,c = map(int,input().split())
  progs[i] = [s,t,c-1]

progs = sorted(progs,key = lambda x:x[0])

ans = 0
cur = 0

for i in range(N):
  s,t,c = progs[i]
  # 時刻sに終了する番組をチェックする
  # まず同チャンネルのものが時刻sに終了していたら、それを外すことが出来る
  while endq[c]:
    endt = heapq.heappop(endq[c])
    if endt <= s:
      cur -= 1
    else:
      heapq.heappush(endq[c],endt)
      break
  
  # 他のチャンネルをチェックする
  for endc in range(C):
    if endc == c:
      continue # 同じチャンネルはチェック済み
    while endq[endc]:
      endt = heapq.heappop(endq[endc]) # 各チャンネルのキューから取り出す
      if endt < s:
        cur -= 1
      else:
        heapq.heappush(endq[endc],endt)
        break
  # 今回の番組を格納する
  cur += 1
  heapq.heappush(endq[c],t)
  if cur > ans:
    ans = cur

print(ans)

Measured memory_bytes: 22180
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, m) = (v[0], v[1]);
    let mut graph = vec![vec![]; n];
    for i in 0..m {
        let v = read_vec::<usize>();
        let (a, b) = (v[0] - 1, v[1] - 1);
        graph[a].push(b);
        graph[b].push(a);
    }
    let q = read::<usize>();
    let mut queries = vec![];
    for i in 0..q {
        let v = read_vec::<usize>();
        queries.push((v[0] - 1, v[1], v[2] as i64));
    }
    let mut color = vec![0; n]; // -1 is uncolorerd
    let mut checked = vec![-1i64; n]; // 0 is unchecked;
    for &(v, d, c) in queries.iter().rev() {
        let mut que = VecDeque::new();
        que.push_back((v, 0));
        while let Some((cur_v, dist)) = que.pop_front() {
            checked[cur_v] = (d - dist) as i64;
            if color[cur_v] == 0 {
                color[cur_v] = c;
            }
            if dist + 1 <= d {
                for &next_v in graph[cur_v].iter() {
                    if checked[next_v] >= (d - (dist + 1)) as i64 {
                        continue;
                    }
                    que.push_back((next_v, dist + 1));
                }
            }
        }
    }
    for i in 0..n {
        println!("{:?}", color[i]);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 22612
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
    public static void main(String[] args) throws IOException{


        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String word = br.readLine();
        String key = br.readLine();
        word = word + word.substring(0, key.length() - 1);

        if(bmStringSearch(word,key)){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }

    }

    private static boolean bmStringSearch(String word, String key){
    	 int[] table = new int[Character.MAX_VALUE];

         for(int i=0;i<table.length;i++){
         	table[i] = key.length();
         }
         for(int i=0;i<key.length();i++){
         	table[key.charAt(i)] = key.length() - i - 1;
         }

         int wordIndex = key.length() - 1;
         while(wordIndex < word.length()){
         	int keyIndex = key.length() -1;

         	while(word.charAt(wordIndex) == key.charAt(keyIndex)){
         		if(keyIndex == 0){
         			return true;
         		}
         		wordIndex--;
         		keyIndex--;
         	}

         	if(table[word.charAt(wordIndex)] > key.length()-keyIndex){
         		wordIndex += table[word.charAt(wordIndex)];
         	}else{
         		wordIndex += key.length() - keyIndex;
         	}
         }

         return false;
    }


}

Measured memory_bytes: 24796
#include <bits/stdc++.h>
using namespace std;
int h, w;
vector<vector<char>> s;
vector<vector<int>> sb;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, -1, 0, 1};

struct xydata {
    int x, y;
};

int bfs(int sx, int sy, int gx, int gy) {
    sb = vector<vector<int>>(h, vector<int>(w, 1000));
    xydata first;
    first.x = sx;
    first.y = sy;
    queue<xydata> que;
    que.push(first);
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            sb.at(i).at(j) = 1000;
        }
    }
    sb.at(first.y).at(first.x) = 0;

    while(!que.empty()) {
        xydata now = que.front();
        que.pop();
        if(now.x == gx && now.y == gy) {
            break;
        }
        for(int i = 0; i < 4; ++i) {
            xydata next;
            next.x = now.x+dx.at(i);
            next.y = now.y+dy.at(i);
            if(next.x >= 0 && next.x < w && next.y >= 0 && next.y < h) {
                if(s.at(next.y).at(next.x) == '.') {
                    if(sb.at(next.y).at(next.x) == 1000) {
                        sb.at(next.y).at(next.x) = sb.at(now.y).at(now.x) + 1;
                        que.push(next);
                    }
                }
            }
        }
    }
    return sb.at(gy).at(gx);
}

int main() {
    cin >> h >> w;
    s = vector<vector<char>>(h, vector<char>(w, '.'));
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            cin >> s.at(i).at(j);
        }
    }

    int maxlen = 0;
    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            if(s.at(i).at(j) == '.') {
                for(int k = 0; k < h; ++k) {
                    for(int l = 0; l < w; ++l) {
                        if(i == k && j == l) {
                        
                        }else {
                            if(s.at(k).at(l) == '.') {
                                // cout << j << i << l << k << " ";
                                int len = bfs(j, i, l, k);
                                // cout << len << endl;
                                maxlen = max(maxlen, len);
                            }
                        }
                    }
                }
            }
        }
    }
    
    cout << maxlen << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cstring>

using i8 = std::int8_t;
using u8 = std::uint8_t;
using i16 = std::int16_t;
using u16 = std::uint16_t;
using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
using i128 = __int128_t;
using u128 = __uint128_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

template<usize N, typename T, T M>
struct factorial_mod {
	constexpr factorial_mod() : mod(), inv_mod() {
		mod[0] = 1;
		for (isize i = 0; i < N; ++i) {
			mod[i + 1] = (mod[i] * (T(i) + 1)) % M;
		}
		inv_mod[N] = power(mod[N], M - 2);
		for (isize i = N - 1; i >= 0; --i) {
			inv_mod[i] = (inv_mod[i + 1] * (T(i) + 1)) % M;
		}
	}

	constexpr auto power(T a, T b) const -> T {
		T r = 1;
		while (b > 0) {
			if ((b & 1) != 0) r = (r * a) % M;
			a = (a * a) % M;
			b >>= 1;
		}
		return r;
	}

	constexpr auto comb(T n, T r) const -> T {
		if (r < 0 || r > n || n < 0) {
			return 0;
		} else {
			return (((mod[n] * inv_mod[r]) % M) * inv_mod[n - r]) % M;
		}
	}

	constexpr auto H(T n, T r) -> T {
		return comb(n + r - 1, r);
	}

	T mod[N + 1];
	T inv_mod[N + 1];
};

constexpr i64 MOD = 1000000007;
factorial_mod<2000020, i64, MOD> fmod;

auto main() -> i32 {
	i32 k;
	char s[1000001];
	scanf("%d%s", &k, s);
	i32 n = std::strlen(s);
	i64 ans = 0;
	for (i32 i = n; i <= n + k; ++i) {
		ans = (ans + fmod.power(25, i - n) * fmod.power(26, n + k - i) % MOD * fmod.comb(i - 1, n - 1)) % MOD;
	}
	printf("%ld\n", ans);
	return 0;
}


Measured memory_bytes: 33928
const fs = require("fs");
const input = fs.readFileSync(process.stdin.fd, "utf8");

const innes = input.split("\n")[1].split(" ").map(n => parseInt(n));

const num = innes.filter((inn, i) => {
  let others = innes.slice(0, i+1);
  let mins = others.filter(other => other <= inn).length
  return mins == others.length;
}).length

console.log(num);


Measured memory_bytes: 7372
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const int MOD = 1e9+7;


#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((int)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<int>>

using namespace std;


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

    int N,M;
    cin >> N >> M;

    if(N  == M){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    

    return 0;
}

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

using namespace std;

typedef long long int lli;

const lli MAX_N = 200000;

int main(int argc, char const *argv[]) {
  lli n, m;
  cin >> n >> m;
  bool tf1[MAX_N+1]={false}, tfn[MAX_N+1]={false};
  for (size_t i = 0; i < m; i++) {
    lli a, b;
    cin >> a >> b;
    if (a==1) tf1[b-1] = true;
    if (b==n) tfn[a-1] = true;
  }
  bool tf = false;
  for (size_t i = 0; i < n; i++) {
    if (tf1[i] && tfn[i]) {
      tf = true;
      break;
    }
  }
  if (tf) cout << "POSSIBLE" << endl;
  else cout << "IMPOSSIBLE" << endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const long long INF = 1e18;
# define len(x) ((int)(x).size())
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define foreps(i, m, n) for(int i = m;i < n;i++)
# define ALL(x) (x).begin(), (x).end()
# define rall(x) (x).rbegin(), (x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    int N, M; cin >> N >> M;
    vector<ll> X(M);
    rep(i, M) cin >> X[i];
    sort(ALL(X));

    vector<ll> diffs;
    foreps(i, 1, M) diffs.push_back(X[i] - X[i - 1]);
    sort(ALL(diffs), greater<ll>());

    ll ans = X.back() - X[0];
    for (int i = 0; i < min(len(diffs), N - 1); i++) ans -= diffs[i];
    cout << ans << endl;
}

Measured memory_bytes: 4952
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll gcd(ll a,ll b)
{
  if(b==0)
    return a;
  return (gcd(b,a%b));
}
int main()
{
  ll a,b;
  cin>>a>>b;
  ll ans=a*b;
  ll k=gcd(a,b);
  ans/=k;
  cout<<ans<<"\n";
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
 char s[10];
 int t=0;
 int i;
 int sum[10];
  
 scanf("%s", s);
 for(i=0;i<10;i++){
   sum[i]=0;
 }
  
 int j=0;
  
 for(i=0;i<10;i++)
   if(s[i]=='A')
     sum[j]++;
   else if(s[i]=='T')
     sum[j]++;
   else if(s[i]=='C')
     sum[j]++;
   else if(s[i]=='G')
     sum[j]++;
   else j++;
 
  t=sum[0];
 for(i=1;i<10;i++)
  if(t<sum[i])
   t=sum[i];
  
  printf("%d",t);
   return 0;
}
    

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define mod 1000000007

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;} 
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    ll x,y,a,b,c;
    cin >> x >> y >> a >> b >> c;
    vector<ll> aka(a);
    vector<ll> midori(b);
    vector<ll> nasi(c);
    rep(i,a) cin >> aka[i];
    rep(i,b) cin >> midori[i];
    rep(i,c) cin >> nasi[i];
    sort(aka.begin(),aka.end());
    sort(midori.begin(),midori.end());
    sort(nasi.begin(),nasi.end(),greater<ll>());
    
    ll aa=a-x;
    ll bb=b-y;
    ll cc=0;
    while(1){
        if(aka[aa]>=nasi[cc]&&midori[bb]>=nasi[cc]){
            break;
        }
        if(aa>=a&&bb>=b) break;
        if(cc>=c) break;
        if(aa<a&&bb<b){
            if(aka[aa]>=midori[bb]){
                midori[bb]=nasi[cc];
                cc++;
                bb++;
            }else{
                aka[aa]=nasi[cc];
                aa++;
                cc++;
            }
        }else if(aa>=a){
            while(1){
                if(bb>=b||cc>=c) break;
                if(midori[bb]<nasi[cc]){
                    midori[bb]=nasi[cc];
                    bb++;
                    cc++;
                }else{
                    break;
                }
            }
            break;
        }else{
            while(1){
                if(aa>=a||cc>=c) break;
                if(aka[aa]<nasi[cc]){
                    aka[aa]=nasi[cc];
                    aa++;
                    cc++;
                }else{
                    break;
                }
            }
            break;
        }
    }
    
    ll ans=0;
    for(ll i=a-x;i<a;i++) ans+=aka[i];
    for(ll i=b-y;i<b;i++) ans+=midori[i];
    
    cout << ans << endl;


    return 0;
}











Measured memory_bytes: 2560
package main

import (
	"container/heap"
	"fmt"
)

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	jobs := make(map[int][]Job)
	var a, b int
	for i := 0; i < n; i++ {
		fmt.Scan(&a, &b)
		jobs[a] = append(jobs[a], Job{i, a, b})
	}

	pq := make(PriorityQueue, 0)
	heap.Init(&pq)

	ans := 0
	for i := 1; i <= m; i++ {
		for _, job := range jobs[i] {
			item := Item{job: job, priority: job.pay}
			heap.Push(&pq, &item)
		}
		if pq.Len() > 0 {
			item := heap.Pop(&pq).(*Item)
			ans += item.job.pay
		}
	}
	fmt.Println(ans)
}

// Job .
type Job struct {
	i, days, pay int
}

// Item .
type Item struct {
	job      Job
	priority int
	index    int
}

// PriorityQueue .
type PriorityQueue []*Item

func (pq PriorityQueue) Len() int { return len(pq) }

func (pq PriorityQueue) Less(i, j int) bool {
	return pq[i].priority > pq[j].priority
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

// Push .
func (pq *PriorityQueue) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Item)
	item.index = n
	*pq = append(*pq, item)
}

// Pop .
func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}


Measured memory_bytes: 15488
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define Max 100001
#define inf 1000000000000000
using namespace std;
int n,m,flag;
int first[Max * 2],nextv[Max * 2],u[Max * 2],v[Max * 2],s[Max * 2];
long long vis[2][Max],l = 0,r = inf,ans;
void dfs(int from,int tag,long long va) {
    if(flag)return;
    int k = first[from];
    while(k != -1) {
        if(flag)return;
        int vtag = (tag == 1);
        int to = v[k];
        long long lva = s[k] - va;
        if(vis[vtag][to] != inf) {
            if(vis[vtag][to] == lva) {
                k = nextv[k];
                continue;
            }
            else {
                flag = 1;
                return;
            }
        }
        vis[vtag][to] = lva;
        if(vtag)r = min(r,lva);
        else l = max(l,-lva);
        if(r - l <= 1){
            flag = 1;
            return;
        }
        dfs(to,-tag,lva);
        k = nextv[k];
    }
}
int main() {
    scanf("%d%d",&n,&m);
    memset(first,-1,sizeof(first));
    for(int i = 1;i <= n;i ++) {
        vis[0][i] = vis[1][i] = inf;
    }
    for(int i = 0;i < m;i ++) {
        scanf("%d%d%d",&u[i],&v[i],&s[i]);
        u[i + m] = v[i];
        v[i + m] = u[i];
        s[i + m] = s[i];
        nextv[i] = first[u[i]];
        first[u[i]] = i;
        nextv[i + m] = first[u[i + m]];
        first[u[i + m]] = i + m;
    }
    dfs(1,1,0);///dfs遍历所有点和第一个点的关系，如果有冲突flag为1 冲突就是说得到于同一点的同一关系的值不同比如a1 + a2 = 3 和 a1 + a2 = 4
    if(!flag) {///遍历后无冲突
        long long temp = -1;
        for(int i = 1;i <= n;i ++) {
            if(vis[0][i] != inf && vis[1][i] != inf) { ///可以确定a1
                long long d = vis[1][i] - vis[0][i];
                if(d % 2) {
                    flag = 1;
                    break;
                }
                temp = d / 2;
            }
        }
        if(!flag) {
            if(temp != -1) {
                ans = 1;
            }
            else if(r - l - 1 > 0)ans = r - l - 1;
        }
    }
    printf("%lld",ans);
    return 0;
}


Measured memory_bytes: 15872
#include<stdio.h>
char d[30][30]={0};
int c;
void f(int y,int x){
  if(d[y][x]-'.')return;
  c++;
  d[y][x]=0;
  f(y+1,x);
  f(y,x+1);
  f(y-1,x);
  f(y,x-1);
}
int main(){
  int w,h,x,y,i,j;
  while(scanf("%d %d",&w,&h),w,h){
    for(i=0;i<30*30;i++)d[i/30][i%30]=0;
    for(i=c=0;i<h;i++){
      for(j=0;j<w;j++){
	scanf(" %c",&d[i+1][j+1]);
	if(d[i+1][j+1]=='@')d[y=i+1][x=j+1]='.';
      }
    }
    f(y,x);
    printf("%d\n",c);
  }
  return 0;
}

Measured memory_bytes: 612
#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
/****************************/
int main()
{
	int n,k;
	cin>>n>>k;
	if((k-2*n)%2==0&&k<=4*n&&k>=2*n)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	 } 
	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); if( a < b ) { System.out.println("a < b"); }else if( a > b ){ System.out.println("a > b"); }else{ System.out.println("a == b"); } } } 


Measured memory_bytes: 26280
#include <stdio.h>

int main(void)
{
	char s[7];

	scanf("%s", s);

	if (s[0] == 'S') //晴れの日の場合
	{
		printf("Cloudy\n");
	}
	else if (s[0] == 'C') //曇りの日の場合
	{
		printf("Rainy\n");
	}
	else //雨の日の場合
	{
		printf("Sunny\n");
	}

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d; cin >> a >> b >> c >> d;
    while(c>0 and a>0){
        c-=b;
        a-=d;
    }
    cout << ((c>0)? "No" : "Yes");
}


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

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()

#define MOO(i, a, b) for(int i=a; i<b; i++)
#define M00(i, a) for(int i=0; i<a; i++)
#define MOOd(i,a,b) for(int i = (b)-1; i >= a; i--)
#define M00d(i,a) for(int i = (a)-1; i>=0; i--)

#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define finish(x) return cout << x << '\n', 0;
#define dbg(x) cerr << ">>> " << #x << " = " << x << "\n";
#define _ << " _ " <<

template<class T> bool ckmin(T& a, const T& b) {return b < a ? a = b, 1 : 0;}
template<class T> bool ckmax(T& a, const T& b) {return a < b ? a = b, 1 : 0;}

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ld,ld> pd;
typedef complex<ld> cd;

const int MX = 300005;
int h, w, m;
int iCnts[MX];
int jCnts[MX];

int main() { FAST
    cin >> h >> w >> m;
    set<pi> stuff;
    M00(i, m) {
        int x, y; cin >> x >> y;
        x--; y--;
        iCnts[x]++;
        jCnts[y]++;
        stuff.insert(mp(x,y));
    }
    vector<pi> iarr; M00(i, h) if(iCnts[i] > 0) iarr.pb(mp(iCnts[i], i));
    vector<pi> jarr; M00(j, w) if(jCnts[j] > 0) jarr.pb(mp(jCnts[j], j));
    int mxi = 0, mxj = 0;
    for(pi p: iarr) ckmax(mxi, p.f);
    for(pi p: jarr) ckmax(mxj, p.f);
    int ans = mxi + mxj;
    vi inI, inJ;
    for(pi p: iarr) if(p.f == mxi) inI.pb(p.s);
    for(pi p: jarr) if(p.f == mxj) inJ.pb(p.s);
    if((ll)sz(inI) * (ll)sz(inJ) > (ll)m) {
        finish(ans);
    } else {
        bool good = 0;
        for(int i: inI) {
            for(int j: inJ) {
                if(!stuff.count(mp(i, j))) good = 1;
            }
        }
        if(!good) ans--;
        finish(ans);
    }
}



Measured memory_bytes: 28728
#include <stdio.h>
  int main(){
   int a,b,n,m,i,j,k;
   int c,d[100];
   for(i=0;i<100;i++){
	   d[i] = 0;
   }
   scanf("%d",&n);
   scanf("%d %d",&a,&b);
   scanf("%d",&c);
   for(i=0;i<n;i++){
	   scanf("%d",&d[i]);
	   
   }
   for(j=0;j<n;j++){
	   for(k=0;k<n-1;k++){
		   if(d[k]<d[k+1]){
              m = d[k+1];
			  d[k+1] =d[k];
			  d[k] = m;
		   }
	   }
   }
   for(i=0;i<n;i++){
	   if(c/(a+i*b)<d[i]/b){
		 c += d[i];
	   }else{
		   int y = c/(a+i*b);
		   printf("%d\n",y);
		   break;
	   }
   }
   return 0;
  }

Measured memory_bytes: 596
s=input()
count=1
ps=s[0]
i=1
while i<len(s):
  if s[i]!=ps:
    count+=1
    ps=s[i]
    i+=1
  elif i==len(s)-1:
    break
  else:
    count+=1
    ps=s[i:i+2]
    i+=2
print(count)

Measured memory_bytes: 3500
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const double PI=3.14159265358979323846;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

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

template<class T> void dump(const vector<T> &v)
{
	REP(i, SZ(v)-1){ cout << v[i] << " "; }
	cout << v[SZ(v)-1] << endl;
}

template<class T> void dump(int w, int h, const vector<T> &v)
{
	REP(j, h){
		REP(i, w-1){ cout << v[j * w + i] << " "; }
		cout << v[j * w + w-1] << endl;
	}
}

template<class T> struct Matrix
{
	T w, h;
	vector<T> A;
	Matrix(T w_, T h_) : w(w_), h(h_), A(w * h) {}
	T get(T x, T y) const { return A[y * w + x]; }
};

template<class T> void input(Matrix<T> &m)
{
	REP(j, m.h){
		REP(i, m.w){
			cin >> m.A[j * m.w + i];
		}
	}
}

template<class T> Matrix<T> prod(const Matrix<T> &a, const Matrix<T> &b)
{
	Matrix<T> m(b.w, a.h);

	REP(j, m.h){
		REP(i, m.w){
			ll c = 0;
			REP(k, a.w){
				c += a.A[j * a.w + k] * b.A[k * b.w + i];
			}
			m.A[j * m.w + i] = c;
		}
	}

	return m;
}

void dump(const Matrix<ll> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%lld ", m.A[j * m.w + i]); }
		printf("%lld\n", m.A[j * m.w + m.w-1]);
	}
}

void dump(const Matrix<double> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%f ", m.A[j * m.w + i]); }
		printf("%f\n", m.A[j * m.w + m.w-1]);
	}
}

int main()
{
	int diff = 'a' - 'A';

	string s;
	getline(cin, s);

//	cout << s << endl;
//	cout << s.length() << endl;

	REP(i, s.length()){
		char c = s[i];

		if(c == 0)
			break;

		if('A' <= c && c <= 'Z'){
			c += diff;
		}
		else if('a' <= c && c <= 'z'){
			c -= diff;
		}

		cout << c;
	}

	cout << endl;

	return 0;
}



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

int main()
{
  int n;cin>>n;
  int a[n],b[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[a[i]-1]=i+1;
  }
  sort(a,a+n);
  for(int i=0;i<n;i++)cout<<b[a[i]-1]<<' ';
  cout<<endl;
  return 0;
}


Measured memory_bytes: 1536
// abc158_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    string S;
    cin >> S;
    
    if (S == "AAA" || S == "BBB"){
        print("No");
    } else {
        print("Yes");
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl

using namespace std;
using ll = long long;

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}


int main() {
    long long a, b, c;
    cin >> a >> b >> c;
    long long d = c - (a + b);

    if (c - (a + b) < 0) cout << "No" << endl;
    else Yes((4*a*b)<(d*d));
}


Measured memory_bytes: 256
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new HashMap<>();
		Map<String, Integer> map1 = new HashMap<>();
		Map<String, Integer> map2 = new HashMap<>();
		Set<String> set = new HashSet<>();
		for(char c = 'a' ; c <= 'z' ; c++) {
			map.put(String.valueOf(c), 0);
			map1.put(String.valueOf(c), 0);
		}
		for(char c = 'a' ; c <= 'z' ; c++) {
			map2.put(String.valueOf(c), 100000);
		}
		for(int i = 0 ; i < n ; i++) {
			String s = sc.next();
			for(int j = 0 ; j < s.length() ; j++) {
				for(char c = 'a' ; c <= 'z' ; c++) {
					if(s.charAt(j) == c) {
						map.put(String.valueOf(c), map.get(String.valueOf(c)) + 1);
						map1.put(String.valueOf(c), map.get(String.valueOf(c)) + 1);
						set.add(String.valueOf(c));
						break;
					}
				}
			}
			for(String key : map.keySet()) {
				if(map.get(key) != 0 && map.get(key) < map2.get(key)) {
					map2.put(key, map.get(key));
				}
			}
			for(String key : map2.keySet()) {
				boolean found = false;
				for(String key2 : set) {
					if(key.equals(key2)) {
						found = true;
					}
				}
				if(!found) {
					map2.put(key, 0);
				}
			}
			for(String key : map.keySet()) {
				map.put(key, 0);
			}
			set = new HashSet<>();
		}
		StringBuilder sb = new StringBuilder();
		for(String key : map2.keySet()) {
			if(map2.get(key) == 100000) continue;
			for(int i = 0 ; i < map2.get(key) ; i++) {
				sb.append(key);
			}
		}
		System.out.println(sb.toString());
	}
}


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

int main()
{
	int n;
	double a, t = 0;
	
	cin >> n;

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

		t += 1 / a;
	}

	cout << setprecision(12) << 1 / t << endl;

	return 0;
}

Measured memory_bytes: 256
H,W = map(int,input().split())

HW = [list(input()) for i in range(H)]

def isPaintable(i, j):
    if i - 1 >=0 :
        if HW[i-1][j] == '#':
            return True
    if j - 1 >=0 :
        if HW[i][j-1] == '#':
            return True
    if i + 1 < H :
        if HW[i+1][j] == '#':
            return True
    if j + 1 < W :
        if HW[i][j+1] == '#':
            return True
    return False

isOk = True

for i in range(H):
    for j in range(W):
        if HW[i][j] == '#':
            if isPaintable(i,j):
                continue
            else:
                isOk = False
                break

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




Measured memory_bytes: 9152
#pragma GCC optimize("O3")
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<vector>
#include<sstream>
#include<queue>
#include <iomanip>
#include <fstream>
#include<unordered_set>
#include<stack>
#include <map>
#include<time.h>
#include <chrono>
constexpr auto INF = 9223372036854775807;
typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned long int ul;
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i+=1)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i-=1)
#define endl '\n'
#define N 1000000007 // prime modulo value 
#define all(x) x.begin(),x.end()
using namespace std;
#define MAX 1000001 
#define M 998244353
ll inverse(ll n)
{
	ll modu = M;
	ll m = modu;
	ll a = 0, b = 1;
	if (modu == 1)
		return 0;
	while (n > 1)
	{
		ll quo = n / modu;
		ll temp = modu;
		modu = n % modu, n = temp;
		temp = a; 
		a = b - (quo * a);
		b = temp;
	}
	if (b < 0)
		b += m;
	return b;
}
int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	char n;
	cin >> n;
	cout << (char)(n + 1);
	return 0;
}


Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d %d %d", $N, $A, $B);

$ans = 0;

for ($i = 1; $i <= $N; $i++) {
    $str = strval($i);
    $arr = str_split($str);
    // var_dump($arr);
    $ttl = array_sum($arr);
    // printf("%d %d\n", $i, $ttl);
    if ($ttl >= $A && $ttl <= $B) {
        // printf("%d\n", $i);
        $ans += $i;
    }
}

echo $ans . "\n";


Measured memory_bytes: 4728
fun main(arr:Array<String>) {
    val (n,t) = readLine()!!.split(" ").map { it.toInt() }
    val keiroList = (1..n).map {idx-> readLine()!!.split(" ").map { it.toInt() }.let { listOf(idx, it[0], it[1]) } }.filter { it[2] <= t }.sortedBy { it[1] }
    println(if(keiroList.isEmpty()) "TLE" else keiroList.first()[1])
}


Measured memory_bytes: 37688
#include<bits/stdc++.h>
using namespace std;
const int N=1<<10;
int n,m,sum[2],a[N],c[N],b[N];
bool dp[N],f[N],g[N][N],ans;

void dfs(int u)
{
	sum[c[u]]++;
	for(int v=0;v<n;v++)if(g[u][v])
	{
		if(c[u]==c[v])ans=false;
		if(!~c[v])
		{
			c[v]=!c[u];
			dfs(v);
		}
	}
}

int main()
{
	scanf("%d%d",&n,&m);
	memset(g,true,sizeof(g));
	for(int i=0;i<n;i++)
	{
		g[i][i]=false;
	}
	for(int i=0;i<m;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		u--,v--;
		g[u][v]=g[v][u]=false;
	}
	memset(c,-1,sizeof(c));
	int fsn=0;
	ans=true;
	for(int u=0;u<n;u++)if(!~c[u])
	{
		//printf("u=%d\n",u);
		sum[0]=sum[1]=0;
		c[u]=0;
		dfs(u);
		a[fsn]=sum[0];
		b[fsn]=sum[1];
		fsn++;
	}
	if(!ans)
	{
		puts("-1");
		return 0;
	}
	memset(f,false,sizeof(f));
	f[0]=true;
	for(int i=0;i<fsn;i++)
	{
		memset(dp,false,sizeof(dp));
		for(int j=0;j<n;j++)if(f[j])
		{
			dp[j+a[i]]=dp[j+b[i]]=true;
		}
		swap(f,dp);
	}
	for(int i=n/2;;i--)if(f[i])
	{
		printf("%d\n",i*(i-1)/2+(n-i)*(n-i-1)/2);
		return 0;
	}
	assert(0);
}

Measured memory_bytes: 1280
#include<iostream>
#include<string>
using namespace std;
string stamp;
int main(){
	long long int n,m;
	int i,j,k;
	long long int a=0,b=0,c=0;
	long long int s=0;
	cin>>n;
	cin>>stamp;
	for(i=0;i<n;i++){
		if(stamp[i]=='J')a++;
		if(stamp[i]=='O')b+=a;
		if(stamp[i]=='I')c++,s+=b;
	}
	m=b,a=0,b=0;
	for(i=n-1;i>=0;i--){
		if(stamp[i]=='I')a++;
		if(stamp[i]=='O')b+=a;
	}
	if(m<b)m=b;
	a=0,b=0;
	for(i=0;i<n;i++){
		if(stamp[i]=='J')a++;
		if(stamp[i]=='I')c--;
		if(b<a*c)b=a*c;
	}
	if(m<b)m=b;
	cout<<s+m<<endl;
	return 0;
}

Measured memory_bytes: 3316
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    int r = sc.nextInt();
    System.out.println(r*r);
   

    
    
    
	}
}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x,long long int y) 
{ 
    long long int res = 1;     // Initialize result 
  // x=x;
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x); 
   
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x);  // Change x to x^2 
    } 
    return res; 
}
long long int power(long long int x,long long int y,long long int m) 
{ 
    long long int res = 1;     // Initialize result 
   x=x%m;
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x)%m; 
   
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x)%m;  // Change x to x^2 
    } 
    return res; 
}

long long int gcd(long long int a, long long int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
 } 
 long long int lcm(long long int a, long long int b)  
 { 
     long long int temp;
    
    return (a*b)/gcd(a, b);  
 }
 
int main() {
        long long int t=0,b[1000000]={0};
        string c;
        string s;
       long long int n,m,o=0,l,d=0,i,j,p=0,k,f;
       double pie=3.141592653589793238;
    long long int MOD=1000000007;
    cin>>n>>k;
    
        if(k==n)
       // p++;
       cout<<"Yes"<<"\n";
       else
       cout<<"No"<<"\n";
    
    //cout<<P;
 return 0;
}

Measured memory_bytes: 256