akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
from fractions import Fraction
from collections import Counter
import math

import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


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


def read_float():
    return float(buff_readline())


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


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


def read_str_n():
    return readline().strip().split()


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


def mt(f):
    import time

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

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

    return wrap


def fract(a, b):
    if a == 0 and b == 0:
        return (0, 0)
    if b == 0:
        return (1, 0)
    f = Fraction(a, b)
    a = f.numerator
    b = f.denominator
    return a, b


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


@mt
def slv(N, AB):
    adb = Counter()
    for a, b in AB:
        k = fract(a, b)
        adb[k] += 1
    M = Mod(1000000007)
    ans = 1
    done = {(0, 0)}
    for k, v in adb.items():
        if k in done:
            continue
        a, b = k
        kk = fract(-b, a)
        done.add(k)
        done.add(kk)

        n = adb[kk]
        t = M.sub(M.pow(2, v) + M.pow(2, n), 1)
        ans = M.mul(ans, t)
    ans = M.add(ans, adb[(0, 0)])
    return M.sub(ans, 1)


def main():
    N = read_int()
    AB = [read_int_n() for _ in range(N)]
    print(slv(N, AB))


if __name__ == '__main__':
    main()


Measured memory_bytes: 133484
#include<iostream>
#include<algorithm>
using namespace std;
char a[26],b[26];
int i,j,k;
int main()
{ 
  while(cin >> a[i]){
  i++;
  }
  if(a[0]==122&&
a[1]==121&&
a[2]==120&&
a[3]==119&&
a[4]==118&&
a[5]==117&&
a[6]==116&&
a[7]==115&&
a[8]==114&&
a[9]==113&&
a[10]==112&&
a[11]==111&&
a[12]==110&&
a[13]==109&&
a[14]==108&&
a[15]==107&&
a[16]==106&&
a[17]==105&&
a[18]==104&&
a[19]==103&&
a[20]==102&&
a[21]==101&&
a[22]==100&&
a[23]==99&&
a[24]==98&&
a[25]==97
)cout << "-1";
  else if(96<a[25]&&a[25]<123){
    for(i=25;i>=0;i--){
      for(j=25;j>i;j--){if(a[i]<a[j])goto OUT;
                       }
    }
    
    OUT:if(i==0){printf("%c",a[0]+1);goto O;
                }
    else{
    for(j=25;j>i;j--){
      b[25-j]=a[j];
    }
    sort(b,b+25-i);
    for(j=0;j<=26;j++){
    if(a[i]<b[j]){a[i]=b[j];
      break;
                 }
    }
    for(j=0;j<=i;j++){
    cout << a[j];
    }
    }
  }else{
    for(j=0;j<i;j++){
      b[a[j]-97]=1;
    }
    for(j=0;j<25;j++){
      if(b[j]==0){a[i]=j+97;
                  break;
                 }
    }
    for(j=0;j<=i;j++){
    cout << a[j];
    }
  }
  O:;
}

Measured memory_bytes: 256
n, m, x = map(int, input().split())
books = []
ans = float('inf')
for _ in range(n):
    book = list(map(int, input().split()))
    books.append(book)

for i in range(2**n):
    count = [0] * m
    book_price = 0
    for j in range(n):
        if (i >> j) & 1:
            book_price += books[j][0]
            for k in range(1, m+1):
                count[k-1] += books[j][k]
    check = True
    for j in count:
        if j < x:
            check = False
            break
    if check:
        ans = min(ans, book_price)
if ans == float('inf'):
    print('-1')
else:
    print(ans)

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

#define watch(x) cerr << (#x) << ": " << (x) << endl
#define int long long



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

    vector<string> s(h);
    for(int i = 0; i < h; ++i) cin >> s[i];

    vector<vector<int>> sc(h, vector<int>(w, 0));

    for(int i = 0; i < h; ++i) {
        int cur = 0;
        for(int j = 0; j < w; ++j) {
            if(s[i][j] == '.') cur++;
            else cur = 0;
            sc[i][j] += cur;
        }
        cur = 0;
        for(int j = w-1; j >= 0; --j) {
            if(s[i][j] == '.') cur++;
            else cur = 0;
            sc[i][j] += cur;
        }
    }

    for(int j = 0; j < w; ++j) {
        int cur = 0;
        for(int i = 0; i < h; ++i) {
            if(s[i][j] == '.') cur++;
            else cur = 0;
            sc[i][j] += cur;
        }

        cur = 0;
        for(int i = h-1; i >= 0; --i) {
            if(s[i][j] == '.') cur++;
            else cur = 0;
            sc[i][j] += cur;
        }
    }

    int ans = 0;

    for(int i = 0; i < h; ++i) {
        for(int j = 0; j < w; ++j) {
            ans = max(ans, sc[i][j] - 3);
        }
    }

    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 35712
#include<cstdio>
#include<vector>
#include<cstdlib>
const int N=2e5+3,K=18;
std::vector<int>g1[N],g2[N];
int n,rt1,rt2,d1[N],d2[N],fa[N][K],ans;
inline int Lca(int u,int v){
	if(d2[u]<d2[v])std::swap(u,v);
	for(int j=K-1;~j;j--)if(d2[fa[u][j]]>=d2[v])
	  u=fa[u][j];
	if(u==v)return u;
	for(int j=K-1;~j;j--)if(fa[u][j]!=fa[v][j])
	  u=fa[u][j],v=fa[v][j];
	return fa[u][0];
}
void Dfs2(int u){
	int v;
	for(int j=1;j<K;j++)fa[u][j]=fa[fa[u][j-1]][j-1];
	for(int i=0;i<g2[u].size();i++)if((v=g2[u][i])!=fa[u][0])
	  d2[v]=d2[u]+1,fa[v][0]=u,Dfs2(v);
}
void Dfs1(int u,int fa){
	int v;
	if(d1[u]>=d2[u])return;
	for(int i=0;i<g1[u].size();i++){
	  v=g1[u][i];
	  if(d2[u]+d2[v]-2*d2[Lca(u,v)]>2)exit(0*puts("-1"));
	}
	ans=std::max(ans,d2[u]);
	for(int i=0;i<g1[u].size();i++)if((v=g1[u][i])!=fa)
	  d1[v]=d1[u]+1,Dfs1(v,u);
}
int main(){
	int u,v;
	scanf("%d%d%d",&n,&rt1,&rt2);
	for(int i=1;i<n;i++)
	  scanf("%d%d",&u,&v),g1[u].push_back(v),g1[v].push_back(u);
	for(int i=1;i<n;i++)scanf("%d%d",&u,&v),g2[u].push_back(v),g2[v].push_back(u);
	Dfs2(rt2);
	Dfs1(rt1,0);
	printf("%d\n",ans*2);
	return 0;
}

Measured memory_bytes: 54260
#include <iostream>
#include <string>
#include <vector>
using namespace std;
void inverse(vector<int> &v){
    int length = v.size();
    for(int i = 0; i < length / 2; ++i){
        int tmp = v[i];
        v[i] = v[length - i - 1];
        v[length - i - 1] = tmp;
    }
}
int main(){
    int n, k, c;
    cin >> n >> k >> c;
    string s;
    cin >> s;
    vector<int> choose;
    for(int i = 0; i < n; ++i){
        char d = s[i];
        if(d == 'o'){
            choose.push_back(i);
            if(choose.size() == k){
                break;
            }
            i += c;
        }
    }
    vector<int> choose_1;
    for(int i = n - 1; i >= 0; --i){
        char d = s[i];
        if(d == 'o'){
            choose_1.push_back(i);
            if(choose_1.size() == k){
                break;
            }
            i -= c;
        }
    }
    inverse(choose_1);
    for(int i = 0; i < k; ++i){
        if(choose[i] == choose_1[i]){
            cout << choose[i] + 1 << endl;
        }
    }
    return 0;
}

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

const ll MAX_N = 1LL << 20;
//与えられた要素数より大きくすること 配列範囲

const ll INT_INF = 1LL << 31;
//INF定義,問題により指定があるときは注意

ll n; //要素数が与えられた時、それ以上の最小の２＾k数が欲しい
ll dat[2*MAX_N - 1][30]; //SUM のサイズは2*MAX_N（ビットと混同しないように）

ll N; string S;

void init(ll  a){
  n = 1LL;  while( n < a){ n *= 2;}
  for(ll k = 0; k < 30; k++){ 
  for(ll i = 0; i < 2*n - 1 ; i++){
    dat[i][k] = 0;} // infで初期化,範囲外参照でREしやすいので注意
  }
}





void update(ll k, ll c, ll which){
  // which == 1 つまり更新クエリの時のみ重複の影響を考慮する
  
  char check = (char)(c+'a');
  
  if( S[k] == check && which ){ return;} 
  
  int res = k;
  
  if( which ){ 
    
    int old = (int)(S[res]-'a');
   // which == 1 の時は、減らすクエリもやらなければならない
  
   res += n-1;
  
   dat[res][old]--;
   
    while( res > 0 ){ 
     res = (res-1)/2;
     dat[res][old] = dat[2*res+1][old]+dat[2*res+2][old];
   }
  }
  
  
  res = k;
  
  res += n-1;
  
  dat[res][c]++;//今度はこっちを増やす
  while( res > 0){
    res = ( res - 1)/ 2;
    dat[res][c] = dat[ 2*res + 1][c] + dat[2*res + 2][c];
  } //区間の和を保持
  
}




//[a,b)での和を求める
// l , r　は　k番目のノードが[l,r)に対応していることを意味
ll query(ll a, ll b, ll k, ll l, ll r, ll c){
  if( r <= a || b <= l){ return 0;}
  else if( a <= l && r <= b){ return dat[k][c];}
  else{
    ll vl = query(a,b,2*k + 1, l, ( l + r) / 2,c);
    ll vr = query(a, b, 2* k + 2, ( l + r) / 2, r,c);
  
  return vl+vr;}
}
//initで初期化忘れないこと　0-indexedか1-indexed問題によって注意(0-に合わせる）
// 考える範囲が[a,b]の時のqueryはquery(a,b+1,0,0,n) ←initで更新したn(not N)を使う


signed main(void){
  
  cin >> N >> S;
  
  init(N);
  
  for(int i = 0; i < N; i++){
    
    ll c = (ll)(S[i]-'a');
    
    update(i,c,0);
    
  }
  
  int Q; cin >> Q;
  
  for(int i = 0; i < Q; i++){ 
    int a; cin >> a;
    if( a == 1 ){ //変更クエリ
      int pos; char c; cin >> pos >> c; pos--;
      //変更する
      update(pos,(int)(c-'a'),1);
      
      S[pos] = c;
      
    }
    else{ //計算クエリ
      int l,r; cin >> l >> r; l--; r--;
      //計算する
      
      int cnt = 0;
      
      for(int j = 0; j < 26; j++){
        
        int res = query(l,r+1,0,0,n,j);
        
        if( res > 0 ){ cnt++;}
      }
      
      cout << cnt << endl;
      
    }
  }
  
  return 0;
}

Measured memory_bytes: 248708
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define All(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()   //reverse
#define strall(v) (v).cbegin(),(v).cend() //const_itterator
#define IN(a, b, x) (a<=x&&x<b)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<ll>>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename t, typename u, typename Comp=less<>>
bool chmax(t& xmax, const u& x, Comp comp={}) { if(comp(xmax, x)) { xmax = x; return true; } return false;}
template<typename t, typename u, typename Comp=less<>>
bool chmin(t& xmin, const u& x, Comp comp={}) { if(comp(x, xmin)) { xmin = x; return true;} return false;}
const int INF = 1e9;
const ll infl = ll(1e18)+5;

/*
*ios::sync_with_stdio(false);
*cin.tie(0);
*/
ll N,M;


int main(){
  map<ll,ll> mp_a,mp_b;
  bool suc = true;
  cin >> N;
  vector<ll> D(N,0);
  rep(i,N) cin >> D[i];
  cin >> M;
  vector<ll> T(M,0);
  rep(i,M) cin >> T[i];
 
  rep(i,N) mp_a[D[i]]++;
  rep(i,M) mp_b[T[i]]++;
  
  for(int i=0;i<M;i++){
    int x = T[i];
    if(mp_a[x] < mp_b[x]){
      cout << "NO" << endl;
      return 0;
    }
    
  }
  cout << "YES" << endl;
}

Measured memory_bytes: 28416
#! /usr/bin/env python3

import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, K, *A = map(int, read().split())

for _ in range(min(K, 42)):
    acc = [0] * (N + 1)
    for i, a in enumerate(A):
        l = max(0, i - a)
        r = min(N, i + a + 1)
        acc[l] += 1
        acc[r] -= 1
    acc[0] = min(N, acc[0])
    for i in range(N):
        acc[i + 1] = min(N, acc[i] + acc[i + 1])
    A = acc[:-1]
    if all(a == N for a in A):
        break
print(*A)


Measured memory_bytes: 170664
#include <cstdio>
int n, a[200005];
int main() {
	int i;
	scanf("%d", &n);
	for(i=0; i<n; i++) scanf("%d", &a[i]);
	for(i=n-1; i>=0; i-=2) printf("%d ", a[i]);
	for(i=n%2; i<n; i+=2) printf("%d ", a[i]);
	return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
typedef long long Int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const Int  MX=1e18;

int main() {
    int n;cin >> n;
    bool is_zero = false;
    vector<Int> a(n);
    rep(i, n) {
        cin >> a[i];
        if (a[i] == 0) {
            is_zero = true;
        }
    }
    if (is_zero) {
        cout << "0" << endl;
        return 0;
    }

    Int ans = 1;
    bool is_ng = false;
    rep(i, n) {
        if (a[i] > (MX+1) / ans || ans * a[i] > MX) {
            is_ng = true;
            break;
        }
        ans *= a[i];
    }
    if (is_ng) cout << "-1" << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 4040
#include <iostream>
#include <map>
#include <string>

using namespace std;

main(){
  map<char,string> data1;
  map<string,char> data2;
  map<string,bool> data3;
  data1['A']="00000";
  data1['B']="00001";
  data1['C']="00010";
  data1['D']="00011";
  data1['E']="00100";
  data1['F']="00101";
  data1['G']="00110";
  data1['H']="00111";
  data1['I']="01000";
  data1['J']="01001";
  data1['K']="01010";
  data1['L']="01011";
  data1['M']="01100";
  data1['N']="01101";
  data1['O']="01110";
  data1['P']="01111";
  data1['Q']="10000";
  data1['R']="10001";
  data1['S']="10010";
  data1['T']="10011";
  data1['U']="10100";
  data1['V']="10101";
  data1['W']="10110";
  data1['X']="10111";
  data1['Y']="11000";
  data1['Z']="11001";
  data1[' ']="11010";
  data1['.']="11011";
  data1[',']="11100";
  data1['-']="11101";
  data1['\'']="11110";
  data1['?']="11111";

  data2["101"]=' ';
  data2["000000"]='\'';
  data2["000011"]=',';
  data2["10010001"]='-';
  data2["010001"]='.';
  data2["000001"]='?';
  data2["100101"]='A';
  data2["10011010"]='B';
  data2["0101"]='C';
  data2["0001"]='D';
  data2["110"]='E';
  data2["01001"]='F';
  data2["10011011"]='G';
  data2["010000"]='H';
  data2["0111"]='I';
  data2["10011000"]='J';
  data2["0110"]='K';
  data2["00100"]='L';
  data2["10011001"]='M';
  data2["10011110"]='N';
  data2["00101"]='O';
  data2["111"]='P';
  data2["10011111"]='Q';
  data2["1000"]='R';
  data2["00110"]='S';
  data2["00111"]='T';
  data2["10011100"]='U';
  data2["10011101"]='V';
  data2["000010"]='W';
  data2["10010010"]='X';
  data2["10010011"]='Y';
  data2["10010000"]='Z';

  data3["101"]=true;
  data3["000000"]=true;
  data3["000011"]=true;
  data3["10010001"]=true;
  data3["010001"]=true;
  data3["000001"]=true;
  data3["100101"]=true;
  data3["10011010"]=true;
  data3["0101"]=true;
  data3["0001"]=true;
  data3["110"]=true;
  data3["01001"]=true;
  data3["10011011"]=true;
  data3["010000"]=true;
  data3["0111"]=true;
  data3["10011000"]=true;
  data3["0110"]=true;
  data3["00100"]=true;
  data3["10011001"]=true;
  data3["10011110"]=true;
  data3["00101"]=true;
  data3["111"]=true;
  data3["10011111"]=true;
  data3["1000"]=true;
  data3["00110"]=true;
  data3["00111"]=true;
  data3["10011100"]=true;
  data3["10011101"]=true;
  data3["000010"]=true;
  data3["10010010"]=true;
  data3["10010011"]=true;
  data3["10010000"]=true;

  char c;
  while(1){
    if(scanf("%c", &c)==EOF) break;
    string in="";
    while(1){
      if(c=='\n') break;
      in+=c;
      scanf("%c", &c);
    }
    string tmp1="";
    for(int i=0;i<in.size();i++){
      tmp1+=data1[in[i]];
    }
    string tmp2="";
    string ans="";
    for(int i=0;i<tmp1.size();i++){
      tmp2+=tmp1[i];
      if(data3[tmp2]){
	ans+=data2[tmp2];
	tmp2="";
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <sstream>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <queue>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ul;
typedef pair<int,int> P;
#define X first
#define Y second

const int mod = 998244353;

void go() {
	ll x,y;
	cin >> x >> y;
	ll r = x;
	int res = 0;
	for(;r<=y;r*=2) {
		res++;
	}
	cout << res << endl;
}

int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	// int t; cin >> t; for(;t--;)
	go();
	return 0;
}




Measured memory_bytes: 256
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <utility>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;++a) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define int_maxvalue numeric_limits<int>::max()
#define print_double(val,a) cout << fixed << setprecision(a) << val << endl;
ll mod = 1e9 + 7;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<int>a(3);
	cin >> a[0] >> a[1] >> a[2];
	Sort(a);
	int n;
	cin >> n;
	int maxval = a[2];
	rep(i, n) {
		maxval *= 2;
	}
	cout << maxval + a[0] + a[1] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int a,b;
	scanf("%d%d", &a,&b);
	if (a == b){
		printf("a == b\n");
	}else if (a > b){
		printf("a > b\n");
	}else if (a < b){
		printf("a < b\n");
	}
}



Measured memory_bytes: 2104
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF=20000000000;
//setprecision(2) <<

const int MOD = 1000000007;

long long max(long long a,long long b){
	if(a<b)return b;
	else return a;	
}
long long min(long long a,long long b){
	if(a>b)return b;
	else return a;	
}
long long gcd(long long a,long long b){
	if(a<b)swap(a,b);
	if(a%b==0)return b;
	else return gcd(a%b,b);
}

long long lcm(long long a,long long b){
	return a*b/gcd(a,b);
}

long long com(long long n,long long k){
	
}
long long getDigit(long long n){
	if(n==1)return 1;
	else return log10(n)+1;
}
class G{
	long long node;
	long long w;
	
};
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	long long N;
	cin>>N;
	string Gs[N+1];
	int G[N][N];
	for(int i=0;i<N;i++){
		cin>>Gs[i];
		for(int j=0;j<N;j++){
			G[i][j]=(int)(Gs[i][j]-'0');
		}
	}
	//cout<<G[0][1];
	//2graph or not
	stack<long long>que;
	vector<int>color(N+2,-1);
	vector<bool>ex(N+2,false);
	//0 not 1 black 2 white
	color[0]=1;
	que.push(0);
	while(!que.empty()){
		int u=que.top();
		que.pop();
		ex[u]=true;
		//cout<<u<<endl;
		for(int i=0;i<N;i++){
			if(G[i][u]==1){
				if(ex[i]==false)que.push(i);
				if(color[i]==-1){
					color[i]=!color[u];
					continue;
				}
				if(color[i]==color[u]){
					cout<<-1<<endl;
					return 0;
				}
			}
		}
	}
	
	
	//
	long long d[N][N];
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			d[i][j]=G[i][j];
			if(G[i][j]!=1){
				d[i][j]=INF;
			}
			if(i==j)d[i][j]=0;
		}
	}
	
	for (int k = 0; k < N; k++){       
    	for (int i = 0; i < N; i++) {    
      		for (int j = 0; j < N; j++) {  
        		d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      		}
  		}	
  	}
  	long long ans=0;
  	for(int i=0;i<N;i++){
  		for(int j=0;j<N;j++){
  			//cout<<d[i][j];
ans=max(ans,d[i][j]);
  		}
  	}
  	cout<<ans+1<<endl;
}


Measured memory_bytes: 896
from collections import Counter
import math
import statistics
import itertools
# a,b=map(int,input().split())
b=int(input())
# c=[]
# for i in a:
#     c.append(int(i))
# A,B,C= map(int,input().split())
# f = list(map(int,input().split()))
#g = [list(map(lambda x: '{}'.format(x), list(input()))) for _ in range(a)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen
# lis=[input() for i in range(a)]

print("ACL"*b)

Measured memory_bytes: 10856
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#include <math.h>
#include <iomanip>
#include <fstream>
#include <random>
#include <set>
#include <queue>
#include <complex>
#include <stack>
#include <numeric>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
using namespace std;
std::vector<bool> IsPrime;



void sieve(size_t max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    }
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない
    
    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
}
inline void InitRand()
{
    srand((unsigned int)time(NULL));
}

int main() {
    //InitRand();
    cin.tie(0);
    ios::sync_with_stdio(false);
    //std::ifstream in("input.txt");std::cin.rdbuf(in.rdbuf());
    int n,k;
    cin>>n>>k;
    long long ans=0;
    long long t=0;
    int r=0;
    if(k==0){
        
            for(int b=k+1;b<=n;++b){
                r=n%b;
                if(r<k){t=(n-k)/b+1;ans+=t*(b-k);}else{
                    t=(n-k)/b+1;ans+=t*(r-k+1);ans+=(t-1)*(b-r-1);
                }
            
           
        }
        ans=ans-n;
        cout<<ans<<endl;
            }else{
            for(int b=k+1;b<=n;++b){
                r=n%b;
                if(r<k){t=(n-k)/b+1;ans+=t*(b-k);}else{
                    t=(n-k)/b+1;ans+=t*(r-k+1);ans+=(t-1)*(b-r-1);
        }
            }
        cout<<ans<<endl;
    }
    
    
    
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
	new Main().run();
    }
    Scanner sc = new Scanner(System.in);

    int n;
    int[] a;
    int ans;
    boolean flag;

    void run(){
	while(sc.hasNext()){
	    n = sc.nextInt();
	    a = new int[n];
	    for(int i=0; i<n; i++)
		a[i] = sc.nextInt();
	    Arrays.sort(a);

	    flag = false;
	    ans = a[n-1];
	    check(ans);
	    while(!flag){
		ans += a[n-1];
		check(ans);
	    }
	    System.out.println(ans);
	}
    }

    void check(int lcm){
	for(int i=0; i<n; i++)
	    if(lcm % a[i] != 0) return;
	flag = true;
    }
}

Measured memory_bytes: 19160
/**
*
* Author: Mouhanad
* Lang: GNU C++14
*
**/
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define ii pair < int , int >
#define LS pair < ll , string >
typedef long long ll;
const int inf = 1<<30;
const int N =100100;
int n , a[N] , q ;

int main ( ){
  string s ; cin >> s;
  n = s.length();
  for ( int i = 0; i < n ; i++ ) {
    cout<<"x";
  }

return 0 ;
}


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

/* using */
using namespace std;

/* main constructor */
struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(0);
        //cout << fixed << setprecision(12);
    }
} fast;

/* template */
template <class T>
bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T>
bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }

/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
    sort(all(x));  \
    (x).erase(unique(all(x)), (x).end())
#define int long long
#define mp make_pair
#define r0 return 0

/* function */
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }

/* const */
const int inf = 1e9 + 7;
const int dxl[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dyl[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dxs[4] = {1, 0, -1, 0};
const int dys[4] = {0, 1, 0, -1};

/* main */
signed main(void)
{
    int m;
    cin >> m;
    cout << 24 + (24 - m) << endl;
    return 0;
}


Measured memory_bytes: 256
import numpy as np
import math
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))


a = [int(input()) for i in range(5)]
a = np.array(a)
b = np.ceil(a/10)*10
c = b-a
i = c.argmax()
print(int(np.sum(b)-b[i]+a[i]))


Measured memory_bytes: 12428
N, M = map(int, input().split())
ans = 0
if N == M:
    ans = 1
    for i in range(1, N+1):
        ans *= i**2
        ans %= 1000000007
    ans *= 2
    ans %= 1000000007

elif N+1 == M or N == M+1:
    ans = 1
    N = min(N, M)
    ans *= N+1
    for i in range(1, N+1):
        ans *= i**2
        ans %= 1000000007

print(ans)


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
using namespace std;

int main()
{
    int n, t;
    int i, j = 0, k = 0, first, ans = 0;
    
    cin >> n >> t;
    
    int start[n], stop[n];
    
    for(i = 0; i < n; i++) {
        cin >> start[i];
        stop[i] = start[i] + t;
    }
    
    while(k < n) {
        first = start[j];
        j++;
        
        while((start[j] <= stop[k]) and (j < n)) {
            j++;
            k++;
        }
        ans = ans + (stop[k] - first);
        k++;
    }
    
    cout << ans << endl;
    
    return 0;
}

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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

signed main()
{
    ll h, w;
    char a[1000][1000];
    cin >> h >> w;
    for (int i = 0; i < h; i++)
        for (int j = 0; j < w; j++)
            cin >> a[i][j];

    queue<pair<ll, ll>> q;
    for (int i = 0; i < h; i++)
        for (int j = 0; j < w; j++)
            if (a[i][j] == '#')
            {
                q.push(make_pair(i, j));
            }

    int cnt = 0;
    int qsize = q.size();
    int tcount = 0;
    while (!q.empty())
    {
        if (qsize == tcount)
        {
            qsize = q.size();
            tcount = 0;
            cnt++;
        }
        int x = q.front().second;
        int y = q.front().first;
        q.pop();
        for (int k = -1; k <= 1; k++)
        {
            for (int l = -1; l <= 1; l++)
            {
                if (abs(k) != abs(l) && x + k >= 0 && x + k < w && y + l >= 0 && y + l < h && a[y + l][x + k] == '.')
                {
                    q.push(make_pair(y + l, x + k));

                    a[y + l][x + k] = '#';
                }
            }
        }
        tcount++;
    }
    cout << cnt << endl;
}


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

stairs = [0] * (n+1)
broken_stairs = [0] * (n+1)

stairs[0] = 1

for i in range(m):
    broken_stairs[int(input())] = 1

for i in range(n):
    if broken_stairs[i+1] == 0:
        stairs[i+1] += stairs[i]
    if i >= n-1:
        break
    if broken_stairs[i+2] == 0:
        stairs[i+2] += stairs[i]

print(stairs[n] % (10**9+7))

Measured memory_bytes: 463476
#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a) for(int i=0;i<a;i++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline ll kaizyo(ll);
ll gcd(ll, ll);
ll combination(ll, ll);
int main() {
	int a, b, k;
	cin >> a >> b >> k;
	FOR(k) {
		if (i % 2 == 0) {
			if (a % 2 == 1) {
				a--;
			}
			a /= 2;
			b += a;
		}
		else {
			if (b % 2 == 1) {
				b--;
			}
			b /= 2;
			a += b;
		}
	}
	cout << a << ' ';
	cout << b;
	return 0;
}


inline ll kaizyo(ll x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll K; cin >> K;
    cout << (K / 2) * ((K + 1) / 2)<< endl;
}

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


Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
using namespace std;

int main()
{
	string s;
	cin >> s;
	int maxN = 0;
	int cnt = 0;
	for (int i = 0; i < 3; i++)
	{
		if (s[i] == 'S')break;
		cnt++;
	}
	maxN = max(maxN, cnt);
	cnt = 0;
	for (int i = 1; i < 3; i++)
	{
		if (s[i] == 'S')break;
		cnt++;
	}
	maxN = max(maxN, cnt);
	cnt = 0;
	for (int i = 2; i < 3; i++)
	{
		if (s[i] == 'S')break;
		cnt++;
	}
	maxN = max(maxN, cnt); \
		cout << maxN;
}

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

use proconio::{input, fastout};
use proconio::marker::*;


#[fastout]
fn main() {
    input! {
    n: usize,
    d: usize,
    x: [[i64; d]; n]
    }
    let mut ans = 0;
    for i in 0..n {
        for j in i + 1..n {
            let tmp = (0..d).map(|k| (x[j][k] - x[i][k]).pow(2)).sum::<i64>();
            if is_sqrt(tmp) {ans += 1}
        }
    }
    println!("{}", ans);
}

fn is_sqrt(n: i64) -> bool {
    for i in 0.. {
        if i * i == n {
            return true;
        }
        if i * i > n {
            break;
        }
    }
    false
}



Measured memory_bytes: 2180
#include <iostream>


using namespace std;

int main()
{
	long long n, a, b;
	cin >> n >> a >> b;
	int xi;
	cin >> xi;
	long long count = 0;
	for (int i = 1; i < n; i++)
	{
		int x;
		cin >> x;
		long long raz = x - xi;
		long long as = raz * a;
		xi = x;
		if (as < b)count += as; else count += b;
	}
	cout << count;












	/*int n;
	cin >> n;
	int fact = 1;
	int mod = 1000000000;
	mod += 7;
	for (int i = 2; i <= n; i++) {
		fact *= i;
		fact = fact % mod;
	}

	int coun = 0;
	int ind = (fact / 2) + 2;
	for (int i = 1; i <= ind; i++)
	{
		if (fact % i == 0)coun++;
	}
	coun++;
	cout << coun;*/
	
}

Measured memory_bytes: 888
# -*- coding: utf-8 -*-

S = input()

S = S.replace("A", "-")
S = S.replace("C", "-")
S = S.replace("G", "-")
S = S.replace("T", "-")

for i in range(11):
    if not "".join(["-"] * i) in S:
        print(i - 1)
        exit()

print(10)


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

int main() {
	int R, m, L = 1;
	cin >> R >> m;
	for (int i = 0; i < m; i++) {
		int l, r;
		scanf("%d%d", &l, &r);
		L = max(L, l);
		R = min(R, r);
	}
	cout << max(0, R - L + 1) << endl;
	return 0;
}


Measured memory_bytes: 256
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;


public class Main{

    static double PI = Math.acos(-1);

    static void print(Object a){System.out.print(a);}
    static void println(Object a){System.out.println(a);}

    static int gcd(int a,int b) {
        if (a % b == 0) return b;
        return gcd(b,a % b);
    }

    static int lcm(int a,int b)
    {
        return a * b / gcd(a,b);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BigDecimal a = scanner.nextBigDecimal(),b = scanner.nextBigDecimal();
        BigDecimal c = a.multiply(b);
        println(c.toBigInteger());

    }
}

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

Measured memory_bytes: 128
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;


public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			final int n = sc.nextInt();
			
			if(n == 0){
				break;
			}
			
			boolean[][] map = new boolean[n][n];
			
			for(int i = 0; i < n; i++){
				char[] ch = sc.next().toCharArray();
				
				for(int j = 0; j < n; j++){
					map[i][j] = ch[j] == '1';
				}
			}
			
			int max = 0;
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = 0; j < n; j++){
					if(map[i][j] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				
				max = Math.max(max, count);
			}
			
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = 0; j < n; j++){
					if(map[j][i] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				
				max = Math.max(max, count);
			}
			
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = 0; j <= i; j++){
					//System.out.print("( " + (i - j) +" " + j + ") ");
					if(map[i - j][j] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				//System.out.println();
				max = Math.max(max, count);
			}
			
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = n - 1; j >= i; j--){
					//System.out.print("( " + j +" " + (i + (n - 1 - j)) + ") ");
					if(map[j][i + (n - 1 - j)] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				//System.out.println();
				max = Math.max(max, count);
			}
			
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = 0; j < (n - i) ; j++){
					//System.out.print("( " + (j) +" " + (i+j) + ") ");
					if(map[j][i+j] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				//System.out.println();
				max = Math.max(max, count);
			}
			
			for(int i = 0; i < n; i++){
				int count = 0;
				boolean find = false;
				for(int j = 0; j < (n - i); j++){
					//System.out.print("( " + (i + j) +" " + (j) + ") ");
					if(map[i+j][j] == true){
						count++;
						find = true;
					}else if(find == true){
						max = Math.max(max, count);
						find = false;
						count = 0;
					}
				}
				//System.out.println();
				max = Math.max(max, count);
			}
			
			System.out.println(max);
		}

	}

}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int L[100];
    L[0]=2;
    L[1]=1;
    for(int i=2;i<100;i++){
        L[i]=L[i-1]+L[i-2];
    }
    
    int N; cin>>N;
    cout<<L[N]<<endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

ll dp[20001][256];
int c[16];
ll x[20000];
int main()
{
	while(1)
	{
		fill(dp[0],dp[20001],1e15-1);
		int n,m;
		cin>>n>>m;
		if(n==0)
			break;
		for(int i=0;i<m;i++)
			cin>>c[i];
		for(int i=0;i<n;i++)
			cin>>x[i];
		dp[0][128]=0;
		for(int i=1;i<n+1;i++)
		{
			for(int j=0;j<256;j++)
			{
				if(dp[i-1][j]!=1e8-1)
				{
					for(int k=0;k<m;k++)
					{
						ll tmp=j+c[k];
						tmp=max(0LL,tmp);
						tmp=min(255LL,tmp);
						dp[i][tmp]=min(dp[i][tmp],dp[i-1][j]+(x[i-1]-tmp)*(x[i-1]-tmp));
					}
				}
			}
		}
		ll ans=dp[n][0];
		for(int i=0;i<256;i++)
			ans=min(ans,dp[n][i]);
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 43224
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    mod = 10**9+7
    dp = [0]*k
    dp[0] = 1
    for i in range(n):
        aa = a[i]
        if aa >= k:
            continue
        for j in range(k-aa-1, -1, -1):
            dp[aa+j] = (dp[aa+j]+dp[j]) % mod
    b = [1]*n
    for i in range(n):
        if a[i] >= k:
            b[i] = 0
            continue
        aa = a[i]
        dp2 = [0]*k
        for j in range(aa):
            dp2[j] = dp[j]
        for j in range(aa, k):
            dp2[j] = (dp[j]-dp2[j-aa]) % mod
        for j in range(k-aa, k):
            if dp2[j] != 0:
                b[i] = 0
                break
    print(sum(b))


main()

Measured memory_bytes: 44780
a=input().split()
a=[int(i) for i in a]

W=a[0]
H=a[1]
x=a[2]
y=a[3]

max=round(W*H*0.5,9)
print(max)

if x==W/2 and y==H/2:
    print("1")
else:
    print("0")

Measured memory_bytes: 3064
import io
import os

from collections import Counter, defaultdict, deque


def solve(X,):
    if X < 600:
        return 8
    if X < 800:
        return 7
    if X < 1000:
        return 6
    if X < 1200:
        return 5
    if X < 1400:
        return 4
    if X < 1600:
        return 3
    if X < 1800:
        return 2

    if X < 2000:
        return 1
    assert False


if __name__ == "__main__":
    input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
    (X,) = [int(x) for x in input().split()]
    ans = solve(X,)
    print(ans)


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

typedef unsigned long long ll;
#define mod 1000000007
#define all(x) (x).begin(),(x).end()

void solve(){
	int n;
	cin>>n;
	vector<int> v(n);
	for(int &i:v){
		cin>>i;
	}
	long long sum=0;
	int mx= v[0];
	for(int i=1;i<n;i++){
		if(v[i]<mx){
			sum += mx-v[i];
		}
		if(v[i]>mx){
			//sum += v[i]-mx;
			mx = v[i];
		}
		
	}
	cout<<sum<<endl;	
}


int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}

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



int main(){
  int64_t A,V,B,W,T;
  cin>>A>>V>>B>>W>>T;
  
  int64_t d=abs(A-B);
  if((V-W)*T>=d) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}
    

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
float PHI = 1.6180339;
const float  PI_F=3.14159265358979f;
#define MAX 1000 m
#define endl "\n"    
#define manhunt 32 
//typedef long long float;
#define int long long
typedef pair<int, int> pii;
//#define float unsigned long long
typedef pair<int, int> pii;
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define CHAR_SIZE 26 
#define pi pair<int,int> 

int modpow(int x, int n, int m) { if (n == 0) return 1%m; long long u = modpow(x,n/2,m); u = (u*u)%m; if (n%2 == 1) u = (u*x)%m; return u; } 


int add(int x, int y) 
{
	x += y;
	if (x >= MOD) return x - MOD;
	return x;
}
int sub(int x, int y) 
{
	x -= y;
	if (x < 0) return x + MOD2;
	return x;
}
int inv(int a, int m = MOD2)
{
	return modpow(a, m - 2, m);
}
int mul(int a, int b) 
{
	return (long long) a * b % MOD2;
}


int nCrModp(int n, int r, int p) 
{ 
    int C[r+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (int i = 1; i <= n; i++) 
    { 
        for (int j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
} 


int32_t main()
{
    FAST
    cout << fixed << setprecision(2);
 
    
    string s;
    cin>>s;
    if(s[2]==s[3] && s[4]==s[5])
    cout<<"Yes"<<endl;
    else
    cout<<"No"<<endl;


    return 0;
}


//    1 2 1 2 1 2 1 2 1

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

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

    if (a == b)
    {
        if (b == c)
        {
            cout << 1 << endl;
        }
        else
        {
            cout << 2 << endl;
        }
    }
    else
    {
        if (b == c || a == c)
        {
            cout << 2 << endl;
        }
        else
        {
            cout << 3 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
n,t=map(int,input().split())
List=[list(map(int,input().split())) for i in range(n)]
l=[]
for i in range(n):
    if List[i][1]<=t:
        l.append(List[i][0])
if l==[]:
    print("TLE")
else:
    print(min(l))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;
int n,ans,jc[1000001]={1};
int qpow(int i,int j){return j?j&1?qpow(i*i%mod,j>>1)*i%mod:qpow(i*i%mod,j>>1):1;}
int c(int i,int j)
{
	return jc[i]*qpow(jc[j]*jc[i-j]%mod,mod-2)%mod;
}
signed main()
{
	for(int i=1;i<=1000000;i++)jc[i]=jc[i-1]*i%mod;
	scanf("%lld",&n);
	for(int i=2;i<=n;i++)ans=(ans+(mod+qpow(2,i)-2)*qpow(8,n-i)%mod*c(n,i))%mod;
	printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 11568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const ll INF = 1e16;

void solver(int N, vector<ll> &A, ull &ans){

    map<ll, int> dict;
    for(int i = 0; i < N; ++i){
        ++dict[A.at(i)];
    }

    ll rec_1st{}, rec_2nd{}, sqr{};
    for(auto p: dict){
        auto length = p.first;
        auto num = p.second;
        ll buf{};
        
        if(num >= 2){
            if(num >= 4){
                sqr = max(sqr, length);
            }
            buf = rec_1st;
            rec_1st = max(rec_1st, length);

            if(length == rec_1st){
                rec_2nd = buf;
            }
        }
    }

    ans = max(rec_1st*rec_2nd, sqr*sqr);
    return;
}

int main(){

    int N;
    cin >> N;
    vector<ll> A(N);
    for(int i = 0; i < N; ++i){
        cin >> A.at(i);
    }

    ull ans{};
    solver(N, A, ans);

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 10300
#include <bits/stdc++.h>
// #include <atcoder/all>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define vc(T) vector<T>
#define vv(T) vc(vc(T))
using namespace std;
// using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

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

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
  vector<pair<ll,int>> factor(ll x) {
    vector<pair<ll,int>> res;
    for (int p : primes) {
      int y = 0;
      while (x%p == 0) x /= p, ++y;
      if (y != 0) res.emplace_back(p,y);
    }
    if (x != 1) res.emplace_back(x,1);
    return res;
  }
};

int main() {
  ll n;
  cin >> n;
  Sieve sieve(1000005);
  ll ans = 0;
  FOR(i, 1, n) {
    vp fc = sieve.factor(i);
    ll tmp = 1;
    for(auto u : fc) {
      tmp *= u.second+1;
    }
    ans += tmp;
  }

  cout << ans << endl;


  return 0;
}

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

ll solve() {
    ll N;
    cin >> N;
    vector<ll> A(3);
    for ( int i = 0; i < 3; i++ ) {
        cin >> A[i];
    }
    map<char,int> m = {{'A',0},{'B',1},{'C',2}};
    vector<string> S(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> S[i];
    }
    vector<char> ans;
    function<bool(int)> dfs = [&](int i) {
        bool ok = false;
        for ( int j = 0; j < 2; j++ ) {
            int s1 = m[S[i][j]];
            if ( A[s1] == 0 ) continue;
            int s2 = m[S[i][1-j]];
            A[s1]--;
            A[s2]++;
            ans.push_back(S[i][1-j]);
            if ( i < N-1 && !dfs(i+1) ) {
                A[s1]++;
                A[s2]--;
                ans.pop_back();
                continue;
            }
            ok = true;
            break;
        }
        return ok;
    };
    bool r = dfs(0);
    if ( !r ) {
        cout << "No" << "\n";
    } else {
        cout << "Yes" << "\n";
        for ( int i = 0; i < N; i++ ) {
            cout << ans[i] << "\n";
        }
    }
    return 0;
}

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

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

int count(string s, bool init_flag){
    int sum = 0;
    for(int i=0;i<s.size();i++){
        if(init_flag){
            if(s.at(i)=='0'){
                sum++;
            }
            init_flag = false;
        }else{
            if(s.at(i)=='1'){
                sum++;
            }
            init_flag = true;
        }
    }
    return sum;
}

int main(){
    string s;
    cin >> s;
    // s = "10010010";
    // 0の時true
    int sum0 = count(s, true);
    int sum1 = count(s, false);
    int result = min(sum0, sum1);
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 512
// Problem : B - Papers, Please
// Contest : AtCoder - AtCoder Beginner Contest 155
// URL : https://atcoder.jp/contests/abc155/tasks/abc155_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

//Macros

#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define inf 1e10
#define PI acos(-1.0)
#define int long long
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 100005

//Solution

void solve(){
    int n;
    cin>>n;
    int a;
    for(int i=0;i<n;i++){
        cin>>a;
        if(a%2) continue;
        if(a%3 && a%5){
            cout<<"DENIED\n";
            return;
        }
    }
    cout<<"APPROVED\n";
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    int tests;
    //cin>>tests;
    tests = 1;
    while(tests--){
        solve();
    }
    return 0;
}

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

using namespace std;

 int n;

multiset<int>s;

 set<int>::iterator it;

  int main()

   { scanf("%d",&n); for(int i=1;i<=n;i++) { int x; scanf("%d",&x); if(s.empty()) s.insert(x); else { it=s.lower_bound(x); if(it==s.begin()) s.insert(x); else { it--; s.erase(it); s.insert(x); } } } printf("%d\n",s.size()); } 



Measured memory_bytes: 4992
#include<iostream>
using namespace std;
int main(){
	int n,r;
	char a[1000],b[1000],x,y;
	while(cin>>n,n){
		for(int i=0;i<n;i++){
			cin>>x>>y;
			a[i]=x;
			b[i]=y;
		}
		cin>>r;
		for(int i=0;i<r;i++){
			cin>>x;
			int j;
			for(j=0;j<n;j++)
			if(a[j]==x){
				cout<<b[j];
				break;
			}
			if(j==n)
			cout<<x;
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 856