akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = stdIn.nextInt();
		}
		int count = 0;
		while(true) {
			for(int i = 0; i < N; i++) {
				if(A[i] % 2 == 0) {
					A[i] = A[i]/2;
				}
				else {
					System.out.println(count);
					System.exit(0);
				}
			}
			count++;
		}

	}

}

Measured memory_bytes: 21716
# B - Power Socket

a, b = list(map(int, input().split()))
tgt = b - a

if tgt == 0:
    print(1)
else:
    div = tgt // (a - 1)
    mod = tgt % (a - 1)
    print(div + 2 if mod > 0 else div + 1)

Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	while(s.hasNext()) {
	    int a, b;
	    a = s.nextInt();
	    b = s.nextInt();
	    if(a == 0 && b == 0) break;
	    if(a < b) {
		int t = a;
		a = b;
		b = t;
	    }
	    int cnt = 0;
	    for(; b != 0; ++cnt) {
		int na, nb;
		na = a; nb = b;
		a = nb;
		b = na%nb;
	    }
	    System.out.println(a+" "+cnt);
	}
    }
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

#define INF (1 << 30)

struct Node {
    int id;
    vector<int> next_node;
    vector<int> next_cost;
    bool done;
    int cost;

    bool operator<(const Node& right) const {
        return cost > right.cost;
    }
} node[100000];

int main() {
    int v, e, r, s, t, d;

    cin >> v >> e >> r;
    for (int i = 0; i < v; i++) {
        node[i].id = i;
        node[i].done = false;
        node[i].cost = INF;
    }
    for (int i = 0; i < e; i++) {
        cin >> s >> t >> d;
        node[s].next_node.push_back(t);
        node[s].next_cost.push_back(d);
    }

    Node temp;
    int size, to, cost;
    priority_queue<Node> que;
    node[r].cost = 0;
    que.push(node[r]);
    while (!que.empty()) {
        temp = que.top();
        que.pop();

        if (temp.done == true) {
            continue;
        }
        node[temp.id].done = true;

        size = temp.next_node.size();
        for (int i = 0; i < size; i++) {
            to = temp.next_node[i];
            cost = temp.cost + temp.next_cost[i];
            if (cost < node[to].cost) {
                node[to].cost = cost;
                que.push(node[to]);
            }
        }
    }

    for (int i = 0; i < v; i++) {
        if (node[i].done == false) {
            cout << "INF\n";
        }
        else {
            cout << node[i].cost << endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 35364
N, M =map(int, input().split())
H_tree = [0] + [int(n) for n in input().split()]
GOOD_tree = [0] + [1 for n in range(N)]
 
for i in range(M):
  A, B = map(int, input().split())
  if H_tree[A]<=H_tree[B]:GOOD_tree[A] = 0
  if H_tree[A]>=H_tree[B]:GOOD_tree[B] = 0
print(sum(GOOD_tree))

Measured memory_bytes: 20120
N = int(input())
A = list(map(int, input().split()))
s = []
s.append(A[0])
for i in range(1, N):
  s.append(s[i - 1] + A[i])
sum = s[-1]
d = float('inf')
for i in range(N - 1):
  d = min(d, abs((sum - s[i]) - s[i]))
print(d)

Measured memory_bytes: 26764
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int D = sc.nextInt();
        int X = sc.nextInt();

        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }
        // consume array O(N * D)
        int[] C = new int[D + 1];
        for (int i = 1; i <= D; i++) {
            for (int j = 0; j < N; j++) {
                if ((i - 1) % A[j] == 0) {
                    C[i]++;
                }
            }
        }

        // start time-based simulation.
        long sum = X;
        for (int i = 1; i <= D; i++) {
            sum += C[i];
        }

        System.out.println(sum);

        return;
    }

}

Measured memory_bytes: 23124
struct Fibonacci {
    memo: Vec<i32>,
}

impl Fibonacci {
    fn fib_entry(&mut self, n: u32) -> u32 {
        self.memo = vec![-1; (n + 1) as usize];
        self.fib(n)
    }

    fn fib(&mut self, n: u32) -> u32 {
        let m = self.memo[n as usize];
        if m != -1 {
            return m as u32;
        }

        let result = if n == 0 || n == 1 {
            1
        } else {
            self.fib(n - 1) + self.fib(n - 2)
        };
        self.memo[n as usize] = result as i32;
        result
    }
}

fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).ok();
    let n = line.trim().parse::<u32>().unwrap();

    let mut f = Fibonacci { memo: vec![-1] };

    println!("{}", f.fib_entry(n));
}



Measured memory_bytes: 5024
#include<stdio.h>
int main()
{
	int n,i,a,b,c,d;
	char s[4];
	scanf("%d",&n);
	a=0;
	b=0;
	c=0;
	d=0;
	for(i=0;i<n;i++){
		scanf("%s",s);
		if(s[0]=='A'){
			a++;
		}
		if(s[0]=='W'){
			b++;
		}
		if(s[0]=='T'){
			c++;
		}
		if(s[0]=='R'){
			d++;
		}
	}
	printf("AC x %d\n",a);
	printf("WA x %d\n",b);
	printf("TLE x %d\n",c);
	printf("RE x %d\n",d);
	return 0;
}	

Measured memory_bytes: 1712
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (ll)((v).size())
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define tihs if(fopen("inp.txt","r"))freopen("inp.txt", "r", stdin),freopen("out.txt", "w", stdout);
using namespace std;
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 


#define M 100010


int main(){
    IOS;
    tihs;
    
    ll k,a,b;cin>>k>>a>>b;
    bool ok=0;
    rep(i,a,b+1)if(i%k==0)ok=1;
    if(ok)cout<<"OK";
    else cout<<"NG";
   
    return 0;
}

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

class Player{
private:
    bool played_;
    queue<int> games_;
    int id_;
public:
    Player();
    void SetId(int i);
    int GetId();
    void NewDay();
    bool CanPlay();
    int NextGame();
    void Play();
    void Input(int i);
};

Player::Player() {
  played_ = false;
  id_ = 0;
}

void Player::SetId(int i) {
  id_ = i;
}

int Player::GetId() {
  return id_;
}

void Player::NewDay(){
  played_ = false;
}

bool Player::CanPlay(){
  return !(played_ or games_.empty());
}

int Player::NextGame() {
  return games_.front();
}

void Player::Play() {
  games_.pop();
  played_ = true;
}

void Player::Input(int i) {
  games_.push(i);
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<Player> players(n);
  vector<Player*> active_players(n);
  for (int i = 0; i < n; ++i) {
    players[i].SetId(i);
    active_players[i] = &players[i];
    for (int j = 0; j < n - 1; ++j) {
      int a;
      cin >> a;
      players[i].Input(a - 1);
    }
  }

  int game = 0;
  int day = 0;
  int total_games = n * (n - 1) / 2;

  while (game < total_games) {
    bool updated = false;
    vector<Player*> next_active_players;
    for (Player* player : active_players) {
      if (not player->CanPlay()) continue;
      Player* opponent = &players[player->NextGame()];
      if (not opponent->CanPlay()) continue;
      if (player->GetId() == opponent->NextGame()) {
        player->Play();
        opponent->Play();
        next_active_players.push_back(player);
        next_active_players.push_back(opponent);
        ++game;
        updated = true;
      }
    }
    if (not updated) {
      cout << -1 << endl;
      return 0;
    }
    ++day;
    for (Player* player : next_active_players) {
      player->NewDay();
    }
    active_players = next_active_players;
  }

  cout << day << endl;
  return 0;
}


Measured memory_bytes: 4736
#define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647 -> 10桁
// MAX ll 9,223,372,036,854,775,807 -> 19桁
// MAX O(n) 10^18 -> 18回

int main() {
    ll a;
    double b;
    cin >> a >> b;

    ll tmp = b * 100 + 0.5;

    ll ans = (a * tmp) / 100;

    cout << ans << endl;

    return 0;
}

// 100000000000001 0.01

Measured memory_bytes: 3708
def calc_blank_minute(H1, M1, H2, M2, K):
  return (H2 * 60) + M2 - (H1 * 60) - M1 - K

H1, M1, H2, M2, K = map(int, input().split())
ans = calc_blank_minute(H1, M1, H2, M2, K)
print(ans)

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

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

typedef long long ll;
typedef long double ld;

const int INF = 2e9;
const ld EPS = 1e-8;

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

int main(){
  int N, X;
  cin >> N >> X;
  vector<int> x(N + 1);
  REP(i,N) cin >> x[i];
  x[N] = X;

  sort(ALL(x));
  vector<int> y(N);
  REP(i,N) y[i] = x[i + 1] - x[i];

  int ret = y[0];
  REP(i,N) ret = gcd(ret, y[i]);

  cout << ret << endl;
  return 0;
}



Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            long K = in.nextLong();
            long A = in.nextLong();
            long B = in.nextLong();
            long maxBiscuits = K + 1;
            if( K - 1 < A || A >= B){
                System.out.println(maxBiscuits);
            }else{
                long N = (K + 1 - A) / 2;
                long biscuits = A + (B - A) * N + ((K + 1 - A) % 2);
                maxBiscuits = Math.max(maxBiscuits, biscuits);
                System.out.println(maxBiscuits);
            }
        }
    }
}

Measured memory_bytes: 23508
#include<iostream>
#include<stdio.h>
#include<queue>
#include<map>
#include<iterator>

using namespace std;

int main()
{
    long long n;
    cin>>n;
    vector<long long> a;
    map<long long,long long> m;
    for(long long i=0;i<n;i++)
    {
        long long j;
        cin>>j;
        a.push_back(j);
        if(m.count(j)==0)
            m.insert(make_pair(j,1));
        else
            m.at(j)++;
    }
    long long sum=0;
    map<long long, long long>::iterator iter;
    for( iter=m.begin();iter!=m.end();iter++)
        sum+=iter->second*(iter->second-1)/2;

    for(long long i=0;i<n;i++)
        cout<<sum+1-m[a[i]]<<' ';
    return 0;
}


Measured memory_bytes: 11120
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		while(true) {
		int x = scan.nextInt();
		int y = scan.nextInt();

			if (x == 0 && y == 0) {
				break;
			}else if(x > y) {
				System.out.println(y + " " + x);
			}else{
				System.out.println(x + " " + y);
			}
		}
	}
}



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

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

void solve() {
    ll A, B, Q;
    cin >> A >> B >> Q;
    vector<ll> S(A);
    vector<ll> T(B);
    for(int i = 0; i < A; i++) cin >> S[i];
    for(int i = 0; i < B; i++) cin >> T[i];
    for(int i = 0; i < Q; i++) {
        ll x;
        cin >> x;
        int s = lower_bound(all(S), x) - S.begin();
        int t = lower_bound(all(T), x) - T.begin();
        vector<int> ss;
        vector<int> tt;
        for(int k = -1; k <= 1; k++) {
            if (s + k >= 0 && s + k < A) ss.push_back(s + k);
            if (t + k >= 0 && t + k < B) tt.push_back(t + k);
        }
        ll mi = 1LL << 61;
        for(int si = 0; si < ss.size(); si++) {
            for(int ti = 0; ti < tt.size(); ti++) {
                mi = min(mi, abs(x - S[ss[si]]) + abs(S[ss[si]] - T[tt[ti]]));
                mi = min(mi, abs(x - T[tt[ti]]) + abs(T[tt[ti]] - S[ss[si]]));
            }
        }
        cout << mi << endl;
    }
}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp>
typedef long long int64;
#define REP(i,n) for(int64 i=0;i<(int64)(n);i++)
#define REPD(i,n) for(int64 i=(int64)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int64 i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((int64)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define GSORT(x) sort(ALL(x), greater<int64>());
#define SUM(x) accumulate(ALL(A), 0);
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; }

using namespace std;

void Main()
{
	int64 N;
	cin>>N;
	int64 result=0;
	for (int i = 1; i <= N; ++i) {
		for (int j = 1; j <= N; ++j) {
			for (int k = 1; k <= N; ++k) {
				vector<int> v{i,j,k};
				int64 val=boost::integer::gcd_range(v.begin(), v.end()).first;
				result+=val;
			}
		}
	}
	cout<<result<<endl;
	return;
}

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


Measured memory_bytes: 3640
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 123456;
vector<pii> G[MAXN];
int cnt[MAXN];
int ans[MAXN];

void dfs(int cur, int par_idx) {
     int color = 1;
     for (auto i : G[cur]) {
         int to_idx = i.first, to = i.second;
         if (color == ans[par_idx]) color++;
         if (ans[to_idx]) continue;
         ans[to_idx] = color++;
         dfs(to, to_idx);
     }
}

int main() {
    int N;
    scanf("%d", &N);
    for (int i = 0; i < N - 1; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        G[a].push_back(make_pair(i, b));
        G[b].push_back(make_pair(i, a));
        cnt[a]++;
        cnt[b]++;
    }
    int mx = 0, mx_idx = 0;
    for (int i = 1; i <= N; i++) {
        if (cnt[i] >= mx) {
           mx = cnt[i];
           mx_idx = i;
        }
    }
    printf("%d\n", mx);
    dfs(mx_idx, 0);
    for (int i = 0; i < N - 1; i++) printf("%d\n", ans[i]);
    return 0;
}


Measured memory_bytes: 8320
package main

import "fmt"

func main() {
	var a, b, c, d, e, f int
	fmt.Scan(&a, &b, &c, &d, &e, &f)
	a *= 100
	b *= 100

	max, ansM, ansS := 0.0, a, 0
	for i := 0; a*i <= f; i++ {
		for j := 0; a*i+b*j <= f; j++ {
			w := a*i + b*j
			for k := 0; w+c*k <= f; k++ {
				for l := 0; w+c*k+d*l <= f; l++ {
					s := c*k + d*l
					if s > w*e/100 {
						break
					}
					t := float64(s) / float64(w+s)
					if t > max {
						max = t
						ansM, ansS = w+s, s
					}
				}
			}
		}
	}

	fmt.Println(ansM, ansS)
}


Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main() {

	int x, y;

	while (true) {

		cin >> x >> y;

		if (!(x | y))
			return 0;

		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				cout << '#';
			}
			cout << endl;
		}
		cout << endl;

	}

	return 0;

}

Measured memory_bytes: 3080
n = int(input())
data = list(map(int, input().split()))
mx = max(data)
marked = [0]*(mx + 1)
for a in data:
    for x in range(a, mx+1, a):
        marked[x] += 1
ans = 0
for a in data:
    if marked[a] == 1:
        ans += 1
print(ans)


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

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;

using f32 = double;
using f64 = long double;

template <typename T> using Vec = vector<T>;

template <typename K, typename V> using HashMap = unordered_map<K, V>;

auto solve(long long N) -> void {
  i32 m = N % 10;
  if (m == 3) {
    puts("bon");
    return;
  }
  if (m == 0 || m == 1 || m == 6 || m == 8) {
    puts("pon");
    return;
  }
  puts("hon");
}

auto main() -> int {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Measured memory_bytes: 3640
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>

using namespace std;

struct pp
{
	int l,r;
}q[200001];

int f[600001],n,Q,b[200001],sum=0;

bool cmp(pp o,pp p) {return (o.l<p.l)||((o.l==p.l)&&(o.r>p.r));}

int get(int o,int p,int q,int r,int s)
{
	if((o==q)&&(p==r)) return f[s];
	int mid=(o+p)/2;
	if(r<=mid) return get(o,mid,q,r,s*2);else
	if(q>mid) return get(mid+1,p,q,r,s*2+1);else
	return min(get(o,mid,q,mid,s*2),get(mid+1,p,mid+1,r,s*2+1));
}

void put(int o,int p,int q,int r,int s)
{
	f[r]=min(f[r],s);
	if((o==q)&&(p==q)) return;
	int mid=(o+p)/2;
	if(q<=mid) put(o,mid,q,r*2,s);else put(mid+1,p,q,r*2+1,s);
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&b[i]);
		sum+=b[i]==0;
	}
	memset(f,0,sizeof(f));
	scanf("%d",&Q);
	for(int i=1;i<=Q;i++) scanf("%d%d",&q[i].l,&q[i].r);
	memset(f,13,sizeof(f));
	put(0,n,0,1,0);
	sort(q+1,q+Q+1,cmp);
	int j=1;
	for(int i=1;i<=n;i++)
	{
		while(q[j].l==i) 
		{
			int yu=get(0,n,i-1,q[j].r,1);
			put(0,n,q[j].r,1,yu);
			j++;
		}
		int yt=get(0,n,i-1,i-1,1)+((b[i]==1)?1:(-1));
		put(0,n,i,1,yt);
	}
	cout<<(get(0,n,n,n,1)+sum)<<endl;
	return 0;
}

Measured memory_bytes: 4992
import java.util.*;

public class Main {
    public static void main(String[] args) {	
	Main main = new Main();
    	main.solveB();
    }
    
    private void solveA() {
    	Scanner sc = new Scanner(System.in);
    	String s = sc.next();
	int top = 0;

	for(int i=0; i < 3; i++){
	    if (s.charAt(i) == 'o') top += 100;
	}
	
    	System.out.println(700 + top);
    }

    private void solveB() {
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    	int x = sc.nextInt();
	int cnt = 0;

	int[] m = new int[n];

	for(int i=0; i < n; i++){
	    m[i] = sc.nextInt();	    
	}

	Arrays.sort(m);

	for(int i=0; i < n; i++){
	    x -= m[i];
	    cnt++;
	}

	System.out.println(cnt + x/m[0]);
    }
}

Measured memory_bytes: 22228
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

int main() {
	ll n;
	cin >> n;
	set<ll> s;
	for (ll i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			s.insert(i);
			s.insert(n/i);
		}
	}

	ll ans = 0;
	for (ll x: s) {
		ll m = x - 1;
		if (m == 0) continue;
		ll a = n / m;
		ll b = n % m;
		if (a == b) ans += m;
	}
	cout << ans << endl;
}

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n;
  cin >> n;
  vll a(n);
  REP(i, n)
    cin >> a[i];

  sort(a.begin(), a.end());
  auto result = unique(a.begin(), a.end());
  a.erase(result, a.end());

  cout << a.size() - (1-a.size()%2) << endl;

}


Measured memory_bytes: 1024
N = int(input())
A = list(map(int,input().split()))
Flag = True
for x in A:
  if x%2 != 1:
    Flag = False
    break
if Flag:
  print(0)
  exit()
ans = 0
for x in A:
  while x%2 == 0:
    ans += 1
    x = x//2
print(ans)

Measured memory_bytes: 70744
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <iomanip>
#include <queue>
#include <deque>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <utility>
using namespace std;

#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector< vector<int> >
#define PI 3.1415926535897932384626433832795

string s;
int n;
vector<int> from(8000,-1);

void solve(int fr, int to, int ind) {
	vector<bool> was (500,false);
	for(int i = to; i >= fr; i--) {
		was[s.at(i)] = true;
	}
	char ch = 'a';
	for(int i = 'a'; i <= 'z'; i++) {
		if(!was[i]) {
			ch = i;
			cout << ch;
			break;
		}
	}
	if(ind > 0) {
		int start = 0;
		for(int i = to+1; i<= n-1; i++) {
			if(s.at(i) == ch) {
				start = i;
				break;
			}
		}
		solve(start+1,from[ind-1],ind-1);
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> s;
	n = s.length();
	vector<bool> isgoodforcurr(500,false);
	vector<int> lastoccurences (500,-1);
	from[0] = n-1;
	int isallgoodtill = 0;
	for(int i = n-1; i >= 0; i--) {
		isgoodforcurr[s.at(i)] = true;
		lastoccurences[s.at(i)] = i;
		bool allgood = true;
		for(int j = 'a'; j <= 'z'; j++) {
			if(!isgoodforcurr[j]) {
				allgood = false;
				break;
			}
		}
		if(allgood) {
			isallgoodtill++;
			from[isallgoodtill] = i-1;
			for(int j = 'a'; j <= 'z'; j++) {
				isgoodforcurr[j] = false;
			}
		}
	}
	solve(0,from[isallgoodtill],isallgoodtill);
	return 0;
}


Measured memory_bytes: 2068
numPlayers = $stdin.gets.to_i
score = Array.new(numPlayers).fill(0)
number = []

#プレイヤーごとの数字を受け取り
#各回ごとの数字に変換
numPlayers.times do
  number << $stdin.gets.chomp.split(" ").map(&:to_i)
end
number = number.transpose

#各回ごとに重複スコアがなければ、スコアを獲得する
3.times do |i|
  numPlayers.times do |j|
    if number[i].count(number[i][j]) == 1
      score[j] += number[i][j]
    end
  end
end

score.each do |v|
  puts v
end

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

int main(void)
{
    long long n = 0, u;
    cin >> n;
    int sum = 0;
    u = n;
    for (int i = 0; i < 10; i++) {
	sum += u % 10;
	u/= 10;
    }
    if(n%sum==0){
    cout<<"Yes"<<endl;
    }else{
    cout<<"No"<<endl;
    }
   
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,w[1010],v[1010],dp[1010][100010],mx,wm,jumw;

int main()
{
	scanf("%lld %lld",&n,&wm);
	
	for(int i=1;i<=n;i++)
	{
		scanf("%lld %lld",&w[i],&v[i]);
		mx+=v[i];
		jumw+=w[i];
	}
	
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=100000;j++)
		{
			dp[i][j]=jumw+1;
		}
	}
	dp[0][0] = 0;
	for(int i=1;i<=n;i++)
	{
		for(int j=mx;j>=0;j--)
		{
			if(j==mx)
			{
				dp[i][j] = dp[i-1][j-v[i]]+w[i];
				dp[i][j] = min(dp[i][j],dp[i-1][j]);
				continue;
			}
			if(j-v[i]>=0) dp[i][j] = min(dp[i][j+1],dp[i-1][j-v[i]]+w[i]);
			dp[i][j] = min(dp[i][j],dp[i-1][j]);
			//printf("%-7lld ",dp[i][j]);
		}
		//printf("\n");
	}
	for(int i=mx;i>=0;i--)
	{
		if(dp[n][i]<=wm)
		{
			printf("%d\n",i);
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 80128
{-# LANGUAGE BangPatterns #-}
import           Control.Exception           (assert)
import           Control.Monad
import           Control.Monad.Primitive
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import qualified Data.Map.Strict             as Map
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector                 as VB
import qualified Data.Vector.Mutable         as VBM
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

inf :: Int
inf = 10^18

main = do
  [x, n] <- getIntList
  ps <- getIntList

  v <- VM.new 102
  VM.set v False
  forM_ ps $ \i -> VM.write v i True

  let solve :: Int -> IO Int
      solve i = do let x1 = x - i
                       x2 = x + i
                   c1 <- VM.read v x1
                   c2 <- VM.read v x2
                   if c1 == False
                     then return x1
                     else if c2 == False
                          then return x2
                          else solve (i+1)

  ans <- solve 0

  print ans



Measured memory_bytes: 3824
#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using Uint = uint32_t;
constexpr int INF = 1e9;
constexpr LL INFLL = 1e18;
constexpr int MAX_N = 200;
int n;
bool g[MAX_N][MAX_N];
int color[MAX_N], d[MAX_N];
void checkBiPartition() {
    memset(color, -1, n * sizeof(int));
    color[0] = 0;
    queue<int> que;
    que.push(0);
    while (!que.empty()) {
        int u = que.front();
        que.pop();
        for (int v = 0; v < n; ++v)
            if (g[u][v]) {
                if (color[v] == -1) {
                    color[v] = color[u] ^ 1;
                    que.push(v);
                } else if (color[v] == color[u]) {
                    cout << "-1\n";
                    exit(0);
                }
            }
    }
}
void bfs(int s) {
    memset(d, -1, n * sizeof(int));
    d[s] = 0;
    queue<int> que;
    que.push(s);
    while (!que.empty()) {
        int u = que.front();
        que.pop();
        for (int v = 0; v < n; ++v)
            if (g[u][v] && d[v] == -1) {
                d[v] = d[u] + 1;
                que.push(v);
            }
    }
}
void solve() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < n; ++j)
            g[i][j] = s[j] - '0';
    }
    checkBiPartition();
    int ans = 0;
    for (int s = 0; s < n; ++s) {
        bfs(s);
        for (int i = 0; i < n; ++i)
            ans = max(ans, d[i] + 1);
    }
    cout << ans << "\n";
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
    // cin >> T;
    for (int i = 1; i <= T; ++i)
        solve();
    return 0;
}

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


int main()
{

  string number;
  int num = 0;
  
  // for( int n = 0; n < 1001; n++ )
  //{
  //  num[n] = 0;
  //}
  
  while(1)
    { 
      
      cin >> number;
      num = 0;
      for( int i = 0; i < number.size(); i++ )
	{
	  
	  num += number[i] - '0';
	}
    
      
      if( number == "0" ) break;
 
      cout << num << "\n";
    }
  

  return 0;
} 

Measured memory_bytes: 1188
#include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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 N;

int main() {
    cin >> N;
    vector<ll> A(N);
    map<ll, int> m;
    REP(i, N) {
        cin >> A.at(i);
        m[A[i]]++;
    }

    vector<ll> use;
    for (auto i : m) {
        if (i.second >= 2) use.push_back(i.first);
        if (i.second >= 4) use.push_back(i.first);
    }
    sort(ALL(use), greater<ll>());
    if (use.size() >= 2) {
        cout << use[0] * use[1] << endl;
    } else {
        cout << 0 << endl;
    }

    return 0;
}


Measured memory_bytes: 7296
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace A_ABC135
{
    class MainClass
    {

        static long[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), long.Parse);
            long u = Max(s[0],s[1]);
            long v = Min(s[0],s[1]);
            if((u-v)%2==1){
                WriteLine("IMPOSSIBLE");
            }else{
                WriteLine((u-v)/2+v);
            }

        }
    }
}


Measured memory_bytes: 13268
//-----------------------
// author : xyqkoala
// time : 2020-08-29
//-----------------------

#include<iostream>
#include<vector>
#include<string>
#include<deque>
#include<unordered_map>
#include<unordered_set>
#include<queue>
#include<algorithm>
#include<cmath>
#include<numeric>
using namespace std;

typedef long long LL;
const int MOD = 1e9+7;

void solve();


int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int T = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


void solve(){
	string s,t;
	cin>>s;
	cin>>t;
	int n = s.size();
	int m = t.size();
	int res = n;
	for(int i=0;i<(n-m+1);i++){
		int cnt = 0;
		for(int j=0;j<m;j++){
			if(s[i+j]!=t[j]) cnt++;
		}
		res = min(res,cnt);
	}
	cout<<res<<endl;
}


Measured memory_bytes: 3660
fun main(args: Array<String>) {
    val N = nextInt()
    val A = listOfLong().toLongArray()
    fun solve(init: Int): Long =
        A.foldIndexed(Pair(0L, 0L)) { index, acc, value ->
            val sum = acc.second + value
            if(index % 2 == init) {
                if(sum > 0) Pair(acc.first, sum)
                else Pair(acc.first - sum + 1L, 1L)
            }
            else {
                if(sum < 0) Pair(acc.first, sum)
                else Pair(acc.first + sum + 1L, -1L)
            }
        }.first
    val ans = Math.min(solve(0), solve(1))
    println(ans)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfLong() = listOfString().map(String::toLong)


Measured memory_bytes: 57488
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	string s, t; cin >> s >> t;
	int cnt = 0, l = s.size() - 1, r = 0;
	int ans = s.size() + t.size();
	rep(i, 1, t.size() + 1) {
		if (s.substr(N - i, i) == t.substr(0, i)) {
			chmin(ans, 2 * N - i);
		}
	}
	cout << ans << "\n";

	return 0;
}

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

L = []
for i in range(N):
    k = a[i]
    while k > 0:
        k -= 1
        L.append(i + 1)


c = 0
count = 0
for i in range(H):
    if (count % 2 == 0):
        A = []
        while c < W * (i + 1):
            A.append(str(L[c]))
            c += 1
        print(' '.join(A))
    else:
        B = []
        while c < W * (i + 1):
            B.append(str(L[c]))
            c += 1
        print(' '.join(B[:: -1]))

    count += 1


Measured memory_bytes: 9400
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():

    n=int(input())
    k=int(input())
    val=1
    for i in range(n):
        val=min(val*2,k+val)
    print(val)

resolve()

Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pi  pair<int,int>
#define  pb  push_back
string s,p;
int main()
{
    ft
    ll t,i,j,n,m,k,l,r=0;
    cin>>n>>m>>l>>k;
    r+=min(n,k);
    k-=min(n,k);
    k-=min(m,k);
    r-=min(l,k);
    cout<<r<<"\n";
    return 0;
}



Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)

int main(){
   int w,h,n;
   string s;   
   cin >> w >> h >> n;
   int ans=0;
   vector<vector<int>> maze(h,vector<int> (w,0));
   rep(i,n){
      int x,y,z;
      cin >> x >> y >> z;
      if (z==1){
         rep(i,h){
            for (int j=0;j < x;j++){
               maze[i][j]=1;
            }
         }
      }
      if (z==2){
         rep(i,h){
            for (int j=x;j < w;j++){
               maze[i][j]=1;
            }
         }
      }
      if (z==3){
         rep(i,y){
            for (int j=0;j < w;j++){
               maze[i][j]=1;
            }
         }
      }
      if (z==4){
         for (int i=y;i < h;i++){
            for (int j=0;j < w;j++){
               maze[i][j]=1;
            }
         }
      }
   }
   rep(i,h){
      rep(j,w){
         if (maze[i][j]==0) ans++;
      }
   }
   //rep(i,h){
   //   rep(j,w){
   //      printf("%d",maze[i][j]);
   //   }
   //   printf("\n");
   //}
   cout << ans << endl;
 
   
   return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){

int N;
int A,B;
scanf("%d",&N);
if(N==1)        printf("Hello World\n");
else if(N==2){
        scanf("%d%d",&A,&B);
        printf("%d\n",A+B);
        }
else    printf("error\n");
return 0;
}


Measured memory_bytes: 128
using System;
using System.IO;
using System.Collections.Generic;
namespace aoj{
    class program{
     
    static void Main() {
		
		BinaryTree bt = new BinaryTree();
	    int orderNum = int.Parse(Console.ReadLine());
	    for(int i=0; i<orderNum; i++){
	    string tmp= Console.ReadLine();
	    string[] order = tmp.Split(' ');
	    if(order[0]=="print")
		    bt.show();
		else
		    bt.AddNode(int.Parse(order[1]));
	    }
    }
}
class Node{
	public int Key { get; set; }
	public int? Parent { get; set; }
	public int? Left { get; set; }
	public int? Right { get; set; }
	public Node(int k){
		Key = k;
		Parent=null;
		Left = null;
		Right = null;
	}
	public Node(int k, int? p, int? l, int? r){
		Key = k;
		Parent=p;
		Left = l;
		Right = r;
	}
	
}
class BinaryTree{
	List<Node> nodes;
	public BinaryTree(){
		nodes= new List<Node>();
	}
	
	void findParent(Node n, int k){
		if(n.Left==null && k < n.Key ){
			n.Left=nodes.Count-1;
			return;
		}else if(n.Right==null && k > n.Key){
			n.Right=nodes.Count-1;
			return;
		}
		if(n.Key>k)
			findParent(nodes[(int)n.Left],k);
		else
			findParent(nodes[(int)n.Right],k);
	}
	public void AddNode(int key){
		if(nodes.Count==0)
			nodes.Add(new Node(key));
		else{
			nodes.Add(new Node(key));
			findParent(nodes[0],key);
		}
	}

	void inorder(Node n){

		if(n.Left!=null)
			inorder(nodes[(int)n.Left]);
	 	Console.Write(" {0}",n.Key);
	//	if(++count!=nodes.Count)
	//		Console.Write(" ");
	 	if(n.Right!=null)
			inorder(nodes[(int)n.Right]);
	}
	void preorder(Node n){
		Console.Write(" {0}",n.Key);
		//if(++count!=nodes.Count)
		//	Console.Write(" ");
		if(n.Left!=null)
			preorder(nodes[(int)n.Left]);
		if(n.Right!=null)
			preorder(nodes[(int)n.Right]);
	}
	public void show(){
	//	foreach( Node n in nodes)
	//		Console.WriteLine("{0}_{1}_{2}_{3}", n.Key, n.Parent, n.Left, n.Right,);
	//	count=0;
		inorder(nodes[0]);
			Console.WriteLine("");
	//	count=0;
		preorder(nodes[0]);
			Console.WriteLine("");
	}
}

}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u; return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}

ll pow3[33];

ll calc(ll a, ll b, ll c, ll d, ll size = 30) {
	ll div = pow3[size-1];
	ll parta = a / div, partb = b / div;
	ll partc = c / div, partd = d / div;
	ll spath = abs(d-b) + abs(c-a);
	if (parta == partc && partb == partd) {
		return (calc(a - parta*div, b - partb*div, c - partc*div, d - partd*div, size-1));
	}
	
	//やばいやつら
	if (parta == partc || partb == partd) {
		if (partb == partd) { swap(a, b); swap(c, d); swap(parta, partb); swap(partc, partd); }
		if (parta == 1) {
			return (abs(d-b) + min(a-div+1+c-div+1, 2*div-a+2*div-c));
		}
		a -= parta*div, c -= partc*div;
		for (ll sz = size-2; sz >= 0; sz--) {
			ll dv = pow3[sz];
			ll pta = a/dv, ptc = c/dv;
			if (pta != ptc) return (spath);
			if (pta == ptc && pta == 1 && abs(d-b) / dv > 1) return (abs(d-b) + min(a-dv+1+c-dv+1, 2*dv-a+2*dv-c));
			a -= pta*dv, c -= ptc*dv;
		}
	}
	return (spath);
}

void solve() {
	ll a, b, c, d; cin >> a >> b >> c >> d; --a, --b, --c, --d;
	cout << calc(a, b, c, d) << el;
}

void Main() {
	//init
	pow3[0] = 1;
	for (int i = 1; i <= 30; i++) pow3[i] = pow3[i-1] * 3;

	int Q; cin >> Q;
	while (Q--) solve();
}

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


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
#define fi first
#define se second
#define upb upper_bound
#define lwb lower_bound
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;

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

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y){
    if(y<=0) return 1;
    ll ans = 1;
    x %= mod;
    while(y){
        if(y&1)
            ans = (x * ans) % mod;
        x = (x * x) % mod;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = (a - b); if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = (a + b); if(c >= mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

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

//const ll N = 2e5 + 1;
//vector<ll> adj[N];
//bool visited[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<<fixed<<setprecision(10);

	ll d, t, s;
	cin>>d>>t>>s;
	if(s*t>=d) cout<<"Yes";
	else cout<<"No";


    return 0;
}


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

int keta(long long n)
{
	for(int i = 0; ;){
		i += 1;
		if(n < 10) return i;
		n /= 10;
	}
}

int main()
{
	long long n;
	int min = INT_MAX;
	cin >> n;
	for(long long i = 1; n/i >= i; i++){
		if(n % i == 0){
			int k = keta(n/i);
			min = (min > k ? k : min);
			if(keta(i) == k) break;
		}
	}
	cout << min << endl;
	return 0;
}

Measured memory_bytes: 256
# きりみんちゃんの配信からきました
# 登場回数が同一ならいけそうなのでそうする
s, t = input(), input()
sd, td = {}, {}
for sv in s:
    if sv in sd:
        sd[sv] += 1
    else:
        sd[sv] = 1
for tv in t:
    if tv in td:
        td[tv] += 1
    else:
        td[tv] = 1
sort_sk, sort_tk = sorted(sd.values()), sorted(td.values())
print("Yes" if sort_sk == sort_tk else "No")

Measured memory_bytes: 41712
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	if(a<b&&b<c) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 1156
#include <iostream>
#include <limits>

using namespace std;

const int INF = numeric_limits<int>::max();
const int NEGINF = numeric_limits<int>::min();

int main() {
	int N;
  	cin >> N;
  
  	int x, y;
  	int maxPlusXY = NEGINF, minPlusXY = INF, maxMinusXY = NEGINF, minMinusXY = INF;
  	for (int i = 0; i < N; ++i) {
    	cin >> x >> y;
      	maxPlusXY = max(maxPlusXY, x+y);
      	minPlusXY = min(minPlusXY, x+y);
      	maxMinusXY = max(maxMinusXY, x-y);
      	minMinusXY = min(minMinusXY, x-y);
    }
  	cout << max(maxPlusXY-minPlusXY, maxMinusXY-minMinusXY) << endl;
}

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    int h,w,d;
    cin >> h >> w >> d;
    int n = h * w;
    vector<int> vx(n+1), vy(n+1),m(n+1);
    REP(i,h)REP(j,w){
        int a;
        cin >> a;
        vx[a-1] = i;
        vy[a-1] = j;
    }
    REP(i,d){
        for (int j = 0+i; j <= n-d;j+=d){
            m[j+d]=abs(vx[j + d] - vx[j]) + abs(vy[j + d] - vy[j])+m[j];
        }
    }
    int q;
    cin >> q;
    REP(i,q){
        int l, r;
        cin >> l>> r;
        cout << m[r-1]-m[l-1] << "\n";
    }
    return 0;
}

Measured memory_bytes: 2176
import java.util.*;
import java.math.BigInteger;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        BigInteger MOD = new BigInteger("4294967311");

        while(sc.hasNextInt()){
            int n = sc.nextInt();
            BigInteger ans = BigInteger.ZERO;

            for(int i = 0; i < n; i++){
                int o = sc.nextInt();
                BigInteger y = sc.nextBigInteger();

                if(o == 1){
                    ans = ans.add(y).mod(MOD);
                }
                else if(o == 2){
                    ans = ans.add(MOD).subtract(y).mod(MOD);
                }
                else if(o == 3){
                    ans = ans.multiply(y).mod(MOD);
                }
                else if(o == 4){
                    ans = ans.multiply(y.modInverse(MOD)).mod(MOD);
                }
            }

            BigInteger tmp = new BigInteger(Long.toString(1L<<31));

            if(ans.compareTo(tmp) >= 0){
                ans = ans.subtract(MOD);
            }

            System.out.println(ans);
        }
    }
}

Measured memory_bytes: 13000