akhauriyash/Code-Regression huggingface dataset:
#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);
}

struct UnionFind {
	vector<int>d;

	UnionFind(int N) :d(N, -1) {}

	int find(int x) {
		if (d[x] < 0)return x;
		return d[x] = find(d[x]);
	}
	bool unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return false;
		if (d[x] > d[y])swap(x, y);
		d[x] += d[y];
		d[y] = x;
		return true;
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		return -d[find(x)];
	}
    int operator[](int k){
		return d[k];
    }
};


int main() {
    init();

	int N, M; cin >> N >> M;
	UnionFind uf(N);
	rep(i, 0, M) {
		int x, y, z; cin >> x >> y >> z;
		--x; --y;
		uf.unite(x, y);
	}
	int ans = 0;
	rep(i, 0, N) {
		if (uf[i] < 0)++ans;
	}
	cout << ans << "\n";
	
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

const int V = 7;
typedef vector<int> node;

bool judge(vector<node>& G){
  bool exist[V] = {};
  REP(i, V) exist[i] = (G[i].size() > 0);
  int s = -1;
  REP(i, V) if(exist[i]) s = i; 
  assert(s != -1);
  queue<int> que;
  bool used[V] = {};
  que.push(s);
  used[s] = true;
  while(!que.empty()){
    int u = que.front(); que.pop();
    REP(i, G[u].size()){
      int v = G[u][i];
      if(used[v]) continue;
      used[v] = true;
      que.push(v);
    }
  }
  REP(i, V) if(exist[i] && !used[i]) return false;
  int odd = 0;
  REP(i, V) if(G[i].size() % 2 == 1) odd++;
  return (odd == 2 || odd == 0);
}


int main(){
  int N;
  while(cin>>N && N){
    vector<node> G(7);
    REP(i, N){
      string s; cin>>s;
      int u = s[0] - '0';
      int v = s[1] - '0';
      G[u].push_back(v);
      G[v].push_back(u);
    }
    if(judge(G)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

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

int n, ntop[9]{}, move[9][9]{};
// 距離abs(a-b)/3+abs(a-b)%3

bool jisho(int[9], int[9]);

int main()
{
	scanf("%d", &n);
	char pre{};
	scanf(" %c", &pre);
	for (int i{1}; i < n; i++)
	{
		char s;
		scanf(" %c", &s);
		move[pre - '1'][s - '1']++;
		pre = s;
	}
	// for (int i{}; i < 9; i++)
	// {
	// 	for (int j{}; j < 9; j++)
	// 		printf("%d ", move[i][j]);
	// 	putchar('\n');
	// }
	for (int i{}; i < 9; i++) ntop[i] = i;
	long long min{1LL << 60};
	int ans[9]{};
	for (int i{}; i < 9; i++) ans[i] = 9;
	do
	{
		long long cost{};
		for (int i{}; i < 9; i++)
			for (int j{}; j < 9; j++)
				cost += move[i][j] * (std::abs(ntop[i] / 3 - ntop[j] / 3) + std::abs(ntop[i] % 3 - ntop[j] % 3));
		if (cost > min) continue;
		int tmp_ans[9]{};
		for (int i{}; i < 9; i++) tmp_ans[ntop[i]] = i;
		if (cost == min && !jisho(tmp_ans, ans)) continue;
		min = cost;
		for (int i{}; i < 9; i++) ans[i] = tmp_ans[i];
	} while (std::next_permutation(ntop, ntop + 9));
	for (int i{}; i < 3; i++)
	{
		for (int j{}; j < 3; j++)
		{
			putchar('1' + ans[3 * i + j]);
		}
		putchar('\n');
	}
	
	return 0;
}

bool jisho(int ntop[9], int min_arr[9])
{
	for (int i{}; i < 9; i++)
		if (ntop[i] > min_arr[i])
			return false;
		else if (ntop[i] < min_arr[i])
			return true;
	assert(true);
	return false;
}


Measured memory_bytes: 3140
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
using namespace std;
typedef long long ll;
// cd test ; rm -R ./*; cd .. 

const int MOD = 1000000007;

bool is_prime(long long _Num){
    if(_Num < 2)return false;
    if(_Num % 2 == 0){
        if(_Num == 2)return true;
        else return false;
    }
    bool prime = true;
    for(long long i = 3; i <= sqrt(_Num); i += 2){
        if(_Num % i == 0){
            prime = false;
            break;
        }
    }
    return prime;
}

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

  vector<int> soinsu(1000, 0);
  for (int i = 1; i <= n; i++) {
    int num = i;
    for (int j = 2; j <= i; j++) {
      while (num % j == 0) {
        soinsu[j]++;
        num /= j;
      }
    }
  }
  ll ans = 1;
  for (int i = 2; i <= n; i++) {
    if (soinsu[i]) {
      ans = (ll) ans * (soinsu[i] + 1);
      ans %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

void selectSort(int A[],int N){
  int i,j,minj,temp,num=0;
  for(i = 0; i < N-1; i++){
    minj=i;
    for(j = i+1; j < N; j++){
      if(A[j] < A[minj]){
	minj = j;
      }
    }
    if(A[i] > A[minj]){
	temp = A[i];
	A[i] = A[minj];
	A[minj] = temp;
	num++;
    }
  }
   for(i = 0; i < N; i++){
    printf("%d", A[i]);
    if(i== N-1)  break;
      printf(" ");
   }
   printf("\n%d\n", num);
}
int main(){
   int i,j,N;
  scanf("%d", &N);
  int A[N];
  for(i = 0; i < N; i++){
    scanf("%d", &A[i]);
  }
  selectSort(A,N);
  return 0;
}

Measured memory_bytes: 604
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial,sqrt
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    n=str(I())
    ans=0
    for i in range(len(n)):
        ans=(ans+int(n[i]))%9
    if ans%9==0:
        print("Yes")
    else:
        print("No")
        
    
if __name__=="__main__":
    main()



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

void solve() {
	int n, m;
	cin >> n >> m;
	map<ll, ll> mp;
	rep(i,n) {
		int a;
		cin >> a;
		mp[a]++;
	}
	rep(i,m) {
		int a, b;
		cin >> b >> a;
		mp[a] += b;
	}
	vector<pair<ll, ll>> v;
	for (auto p: mp) v.push_back(p);
	sort(ALL(v), greater<>());
	int num = 0;
	ll ans = 0;
	for (auto p: v) {
		if (num == n) break;
		if (num + p.second <= n) {
			ans += p.first * p.second;
			num += p.second;
		} else {
			ans += p.first * (n - num);
			num = n;
		}
	}
	cout << ans << endl;
}

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

Measured memory_bytes: 19944
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x) cout << #x << " = " << (x) << endl;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define P pair<int, int>
#define V vector<int>
#define M map<int, int>
#define S set<int>
int comb(int n, int k)
{
    const int mod = MOD;
    int comb_f[3000];
    comb_f[0] = 1;
    for (int i = 1; i < 2900; i++)
        comb_f[i] = (comb_f[i - 1] * i) % mod;
    int comb_res = 1;
    int comb_res_k = mod - 2;
    int comb_y = (comb_f[n - k] * comb_f[k]) % mod;
    while (comb_res_k) {
        if (comb_res_k & 1)
            comb_res = (comb_res * comb_y) % mod;
        comb_y = (comb_y * comb_y) % mod;
        comb_res_k /= 2;
    }
    return (comb_f[n] * comb_res) % mod;
}
int N, K;
void solve()
{
}

signed main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    int ans = 0;
    for (int i = 1; i <= K; i++) {
        if (i - 1 > N - K) {
            ans = 0;
        } else {
            ans = comb(K - 1, i - 1) * comb(N - K + 1, i);
            //     cout << comb(K - 1, i - 1) << " " << comb(N - K + 1, i) << endl;
            ans = ans % MOD;
        }
        cout << ans % MOD << endl;
    }
    solve();
    return 0;
}


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

int main(void){

  int d, r, a, b;
  double f;

  while(1){
    cin >> a;
    cin >> b;
    
    if(a == 0 && b == 0)
      break;
    
    if(a >= b)
      cout << b << " " << a << endl;
    
    else
      cout << a << " " << b << endl;
  }
  return 0;
} 

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

long long dp[100][4];
long long const MOD = 1000000007;

long long mod_p(long long x, long long y) {
	return (x + y) % MOD;
}
long long mod_m(long long x, long long y) {
	return (x*y) % MOD;
}

int main() {
	long long x;
	cin >> x;
	int t = 0;
	while ((x >> t) > 0) {
		t++;
	}
	dp[1][0] = dp[1][1] = 1;
	dp[1][2] = 0;
	for (int i = 1; i < t; i++) {
		if (((x >> (t - i - 1)) & 1) == 0) {
			dp[i + 1][0] = mod_p(dp[i][0],dp[i][1]);
			dp[i + 1][1] = dp[i][1];
			dp[i + 1][2] = mod_p(dp[i][1], 3*dp[i][2]);
		}
		else {
			dp[i + 1][0] = dp[i][0];
			dp[i + 1][1] = mod_p(dp[i][0], dp[i][1]);
			dp[i + 1][2] = mod_p(2 * dp[i][1], 3*dp[i][2]);
		}
	}
	cout << (dp[t][0] + dp[t][1] + dp[t][2]) % MOD << endl;

}

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

typedef long long ll;

int EuclidAlgo(int a,int b);

int main()
{
        ll a,b,ans1,ans2;

        while(cin >> a >> b){

                if(a < b) swap(a,b);

                ans1 = EuclidAlgo(a,b);
                ans2 = (a*b)/ans1;

                cout << ans1 << ' ' << ans2 << "\n";



        }

        return 0;

}

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

Measured memory_bytes: 1156
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    private const int INF = 1000000000;
    public static void Main()
    {
        string S = Console.ReadLine();
        if (S.Length == 1) { Console.WriteLine(S); return; }
        int Mbit = (int)Math.Pow(2, S.Length - 1) - 1;
        long ans = 0;
        for (int bit = 0; bit <= Mbit; bit++)
        {
            string stok = Convert.ToString(bit, 2).PadLeft(S.Length - 1, '0');
            string A = S[0].ToString();
            int count = 1;
            foreach (var s in stok)
            {
                if (s == '1')
                {
                    ans += long.Parse(A);
                    A = S[count].ToString();
                }
                else A += S[count];
                count++;
            }
            ans += long.Parse(A);
        }
        Console.WriteLine(ans);
    }
}

public class Atcoder
{
    static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static int LCM(int a, int b)
    {
        int c = a * b;
        if (a < b) Swap(ref a, ref b);
        int d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static long[] LSRead()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
}


Measured memory_bytes: 11220
void main() {
	(rs.count('o')*100+700).writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <algorithm>
#include <ctype.h>

using namespace std;

int main() {
	string W;
	string tlow;
	string endtext("END_OF_TEXT");
	getline(cin, W);
	transform(W.begin(), W.end(), W.begin(), ::tolower);

	string t;
	int count = 0;
	while(cin >> t) {
		tlow = t;
		transform(t.begin(), t.end(), tlow.begin(), ::tolower);
		if(tlow == W) count++;
		if(t == endtext) break;
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3184
#include<stdio.h>
int main (){
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if(a == 5 && b == 5 && c == 7) 
	{
		printf("YES\n");
		}
	else { 
		if(a == 5 && b == 7 && c == 5) 
	{
		printf("YES\n");
		}
	else {
		if(a == 7 && b == 5 && c == 5) 
		{
		printf("YES\n");
		}
	else {
		printf("NO\n");
		}
	}
}
	return 0;
}

Measured memory_bytes: 128
use std::io;

fn solve(){
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s = s.trim().to_owned();
    let n = s.len();
    let mut f = true;
    let s = s.as_bytes();
    for i in 0..n{
        if s[i] != s[n-1-i]{
            f = false;
            break;
        }
    }
    for i in 0..(n/2){
        if s[i] != s[n/2-1-i]{
            f = false;
            break;
        }
        if s[n-1-i] != s[n/2+1+i]{
            f = false;
            break;
        }
    }
    if f{println!("Yes")}
    else{println!("No")}
}


fn main(){
    let mut t_cases = 1;
    // let mut buf = String::new();
    // io::stdin().read_line(&mut buf);
    // t_cases = buf.trim().parse::<i32>();
    for _ in 0..t_cases{
        solve();
    }
}

Measured memory_bytes: 4352
#include<stdio.h>
#define MAX 50

int main(){
  int i, n, fib[MAX];
  scanf("%d",&n);
  fib[0] = 1;
  fib[1] = 1;
  for(i=2; i<=n; i++){
    fib[i] = fib[i-2] + fib[i-1];
  }
  printf("%d\n",fib[n]);
  return 0;
}



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

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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define what_is(x) cerr << #x << " is " << x << endl;
#define MT make_tuple
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define FOR(i,n) for (int i=0;i < n ; i++)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
int INF=1e5+21;
int main(){
	int n;
	cin >> n;
	int grade[n];
	int mint=INF;
	int sum=0;
	FOR(i,n){
		cin >> grade[i];
		sum+=grade[i];
		if(grade[i]%10 !=0) mint=min(grade[i],mint);
	}
	if(sum%10 !=0) cout << sum;
	else if(mint!=INF) cout << sum-mint;
	else cout <<0;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <stack>
#pragma GCC optimize(3 , "Ofast" , "inline")
using namespace std ;
typedef long long ll ;
const double esp = 1e-6 , pi = acos(-1) ;
typedef pair<int , int> PII ;
const int N = 1e6 + 10 , INF = 0x3f3f3f3f , mod = 998244353 ;
int in()
{
  int x = 0 , f = 1 ;
  char ch = getchar() ;
  while(!isdigit(ch)) {if(ch == '-') f = -1 ; ch = getchar() ;}
  while(isdigit(ch)) x = x * 10 + ch - 48 , ch = getchar() ;
  return x * f ;
}
ll f[N] ;
ll qmi(ll a , ll b)
{
  ll res = 1 ;
  while(b)
   {
     if(b & 1) res = res * a % mod ;
     a = a * a % mod ;
     b >>= 1;
   }
   return res ;
}
ll a[N] ;
int main()
{
  ll n = in() , m = in() , k = in() ;
  f[0] = qmi(m - 1 , n - 1) * m % mod ;
  a[0] = 1 ;
  for(int i = 1; i < N ;i ++ ) a[i] = a[i - 1] * i % mod ;
  for(int i = 0; i <= k ;i ++ )
      f[i] = m * (a[n - 1] * qmi(a[i] , mod - 2 ) % mod * qmi(a[n - 1 - i] , mod - 2 ) % mod) % mod * qmi(m - 1 , n - 1 - i) % mod ;
  ll ans = 0 ;
  for(int i = 0 ;i <= k ;i ++ )
   ans += f[i] , ans %= mod;
  cout << ans << endl ;
  return 0 ;
}
/*
*/


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

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    char c;
    cin >> c;
    c += 1;
    cout << c << "\n";
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  multimap<string,Int> m;
  Int q;
  cin>>q;
  for(Int i=0;i<q;i++){
    Int t,x;
    string s;
    cin>>t;
    if(t!=3) cin>>s;
    if(t==0) cin>>x;
    if(t==0) m.emplace(s,x);
    if(t==1){
      auto p=m.equal_range(s);
      for(auto it=p.first;it!=p.second;++it)
	cout<<it->second<<endl;
    }
    if(t==2) m.erase(s);
    if(t==3){
      string l,r;
      cin>>l>>r;
      auto latte=m.lower_bound(l);
      while(latte!=m.end()&&latte->first<=r){
	cout<<latte->first<<" "<<latte->second<<endl;
	++latte;
      }
    }
  }
  return 0;
}



Measured memory_bytes: 24696
#include<bits/stdc++.h>
#define MOD 1000000007
#define allof(a) (a).begin(),(a).end()
using namespace std;

const double EPS = 1e-9;
const int INF = 1L << 30;
vector<int> dx = {0,1,0,-1};
const int dy[4] = {-1,0,1,0};

bool in_range(int x, int lb, int ub) {return lb <= x and x < ub;}
bool in_range(int x, int y, int W, int H) {return in_range(x,0,W) and in_range(y,0,H);}
void modAdd(int &a, int b, int mod) {a = (a + b) % MOD;}
template <typename T> void maxUpdate(T& a, T b){a = max(a,b);}


int main() {
	
	int N,W,H; cin >> N >> W >> H;

	vector<int> X(W+1);
	vector<int> Y(H+1);
	for (int i = 0; i < N; i++) {
		int x,y,w; cin >> x >> y >> w;
		X[max(0,x-w)]++, X[min(W,x+w)]--;
		Y[max(0,y-w)]++,Y[min(H,y+w)]--;
	}

	int x_sum = 0;
	bool x_flg = false;
	for (int i = 0; i < W; i++) {
		x_sum += X[i];
		if (x_sum <= 0) {
			x_flg = true;
		}
	}
	int y_sum = 0;
	bool y_flg = false;
	for (int i = 0; i < H; i++) {
		y_sum += Y[i];
		if (y_sum <= 0) {
			y_flg = true;
		}
	}
	if (x_flg and y_flg) {
		cout << "No" << endl;		
	}else {
		cout << "Yes" << endl;
	}

	return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;

int main(){
    ll n,m;
    cin>>n>>m;
    for(ll i=m/n;;i--){
        if(m%i==0){
            cout<<i<<endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    E = [[] for _ in range(N)]
    for i in range(N-1):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        E[a].append((b,i))
        E[b].append((a,i))
    
    def dfs(s, g):
        par = [(-1,-1)] * N
        par[s] = (s,-1)
        stack = [s]
        while stack:
            v = stack.pop()
            for to, i in E[v]:
                if par[to][0] >= 0: continue
                par[to] = (v, i)
                if to == g: break
                stack.append(to)
        r = set()
        v = g
        while v != s:
            v, i = par[v]
            r.add(i)
        return r
    
    M = int(input())
    path = [None] * M
    for i in range(M):
        u, v = map(int, input().split())
        u, v = u-1, v-1
        path[i] = dfs(u, v)

    def calc(s): return 1<<(N-1-len(s))

    i_ans = 0
    for p in range(1, 1<<M):
        is_odd = 0
        s = set()
        for i in range(M):
            if p&1:
                s |= path[i]
                is_odd ^= 1
            p >>= 1
        if is_odd: i_ans += calc(s)
        else: i_ans -= calc(s)

    print((1<<(N-1)) - i_ans)

if __name__ == '__main__':
    main()

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

int main() {
  int n;
  cin >> n;
  
  vector<int> a(n);
  for(int i=0 ; i<n ; i++){
    cin >> a[i];
  }
  
  int g=100,A=0,B=0;
  string frag="A";
  while(g>0){
    for(int i=0 ; i<n ; i++){
      if(a[i]==g && frag=="A"){
        A += g;
        a[i] = 0;
        frag = "B";
      }else if(a[i]==g && frag == "B"){
        B += g;
        a[i] = 0;
        frag = "A";
      }
    }
    g--;
  }
  
  cout << A - B << endl;
  
  //a[1] = 8;
  /*
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << endl;
  }
  */
  
}


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

int main(){
    string s,t,u;
    int a,b;
    cin>>s>>t>>a>>b>>u;
    if(u==s){
    	a--;
    	cout<<a<<' '<<b;
    	return 0;
	}
	if(u==t){
		b--;
		cout<<a<<' '<<b;
		return 0;
	}
	return 0;
}

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

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

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] in1 = br.readLine().split(" ");
        int N = Integer.parseInt(in1[0]);
        int L = Integer.parseInt(in1[1]);
        
        in1 = br.readLine().split(" ");
        int[] a = Stream.of(in1).mapToInt(Integer::parseInt).toArray();
        br.close();

        int last_cut_rope_idx = 0;
        for(int i = 0; i < N-1; i++){
            if(a[i] + a[i+1] >= L) {
                last_cut_rope_idx = i + 1;
            }
        }

        System.out.println(last_cut_rope_idx != 0 ? "Possible" : "Impossible");
        
        if(last_cut_rope_idx != 0){
            int cut_rope = 1;
            while(cut_rope != last_cut_rope_idx){
                System.out.println(cut_rope);
                cut_rope++;
            }

            cut_rope = N - 1;
            while(cut_rope != last_cut_rope_idx){
                System.out.println(cut_rope);
                cut_rope--;
            }
        
            System.out.println(last_cut_rope_idx);
        }
    }
}

Measured memory_bytes: 51692
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define tc int t; cin>>t; while(t--)
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define mod 1000000007
#define pb push_back
#define vi vector<int>
#define vc vector<char>
#define eb emplace_back
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define fo(i,x,n) for(int i=x;i<n;i++)
#define csb(x) __builtin_popcount(x)
#define tz(x) __builtin_ctz(x)
#define lsbp(x) __builtin_ffs(x)
#define msbp(x) __lg(x)
#define btoi(str,i) stoi(str,0,i)
#define ff first
#define ss second
const int inf=0x3f3f3f3f3f3f3f3f;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



int32_t main(){

int n,k;cin>>n>>k;
 vi v(n);
 for(int i=0;i<n;i++)cin>>v[i];
 vi dp(k+1,0);
 for(int i=1;i<=k;i++){
    for(int j=0;j<n;j++){
       if(i-v[j]>=0){
          if(dp[i-v[j]]==0)dp[i]=1;
       }
    }
 }
 if(dp[k])cout<<"First"<<endl;
 else cout<<"Second"<<endl;

}

Measured memory_bytes: 1024
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
 
//#include <x86intrin.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <bitset> 
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <iomanip>
#include <stack>
#include <map>
#include <set>
//#include <ordered_set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 
//using namespace __gnu_pbds;
using namespace std;
 
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair                                     
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
//#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;
 
const double pi = acos (-1.0);
const double eps = 1e-9;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int n, p, cnt[N], ten[N], u[N];
char a[N];
ll ans;

inline int add (int a, int b) {
   a += b;
   a %= p;
   return a;
}

inline int mult (int a, int b) {
   return 1ll * a * b % p;
}

inline void boost () {
   ios_base :: sync_with_stdio (0);
   cin.tie (0), cout.tie (0);
}
 
inline void Solve () {
   cin >> n >> p;
   ten[0] = 1;
   for (int i = 1; i <= n; i ++) cin >> a[i], a[i] -= '0', ten[i] = mult (ten[i - 1], 10);
   if (p != 2 && p != 5) {
      cnt[0] = 1;
      int sum = 0;
      for (int i = n; i >= 1; i --) {
         sum = add (sum, mult (ten[n - i], a[i]));
         ans += cnt[sum];
         cnt[sum] ++;
      }
   }
   else {
      int cur = 0;
      for (int i = n; i >= 1; i --) {
         if (p == 2) cur += (a[i] % 2 == 0);
         if (p == 5) cur += (a[i] == 5 || a[i] == 0);
         ans += cur;
      }
   }
   cout << ans;
}               
 
signed main () {                                       
   //#ifdef QWERTY
   //   freopen("input", "r", stdin);
   //#endif
// freopen (".in", "r", stdin);    
// freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}                   

Measured memory_bytes: 1280
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
#define foR for

// FHCまでにスタックオーバーフローの罠を解決する

template<typename T>
struct BIT{
    vector<T> bit;
    BIT(int n) : bit(n+1) {}
    void add(int a,T w){
        for(int x=++a; x < bit.size(); x+=(x&(-x)) ){
            bit[x] += w;
        }
    }
    // return v[0]+v[1]+...+v[a-1];
    T sum(int a){
        T ret=0;
        for(int x=a;x>0;x-=(x&(-x)) ){
            ret+=bit[x];
        }
        return ret;
    }
};

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int n,q;
    cin>>n>>q;
    BIT<int> b(n+1);
    int c[n];
    for(int i=0;i<n;i++){
        cin>>c[i];
        c[i]--;
    }
    array<int,3> a[q];
    int ans[q]={};
    for(int i=0;i<q;i++){
        int l,r;
        cin>>l>>r;
        a[i] = {r,l,i};
    }
    int pre[n]={};
    sort(a,a+q);
    int now = 0;
    for(int i=0;i<n;i++){
        if(pre[c[i]]){
            b.add(pre[c[i]],-1);
        }
        b.add(i+1,1);
        pre[c[i]] = i+1;
        while(now<q && a[now][0]==i+1){
            ans[a[now][2]] = b.sum(a[now][0]+1) - b.sum(a[now][1]);
            now++;
        }
    }
    for(int i=0;i<q;i++)cout << ans[i] << "\n";
}


Measured memory_bytes: 17460
n,k=map(int,input().split())
 
b=[]
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for i in range(len(a)):
        if a[i] not in b:
            b.append(a[i])
#print(b)
print(n-len(b))

Measured memory_bytes: 9200
// D - Swap and Flip
#include <bits/stdc++.h>

using namespace std;

#define	INF	1000000000

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

	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = 0; i < n; i++) cin >> b[i];

	vector<vector<int> > dp(1 << n, vector<int>(n, INF));
	dp[0][0] = 0;
	for (int k = 0; k < (1 << n); k++)
		for (int l = 0; l < n; l++) {
			if ((k & (1 << l)) == 0) continue;
			int p = k ^ (1 << l);
			int c = __builtin_popcount(p);
			int x = abs(l - c) % 2 == 0 ? a[l] : b[l];
			int d = __builtin_popcount((~k) & ((1 << l) - 1));
			if (p == 0) {
				dp[k][l] = d;
			} else {
				for (int i = 0; i < n; i++) {
					if ((p & (1 << i)) == 0) continue;
					int y = abs(i - c + 1) % 2 == 0 ? a[i] : b[i];
					if (y <= x) dp[k][l] = min(dp[k][l], dp[p][i] + d);
				}
			}
		}
	int ans = INF;
	for (int i = 0; i < n; i++) ans = min(ans, dp[(1 << n) - 1][i]);

	cout << (ans < INF ? ans : -1) << endl;

	return 0;
}


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

import sys
import math
import random

def calc_sat_change(d, q): # d日目をコンテストqにチェンジしたときの満足度の差
  dif_sat = s[d-1][q-1] - s[d-1][ans[d-1]-1]

  lastday = 0
  nextday = D+1
  for i in reversed(range(d-1)):
    if ans[i] == q:
      lastday = i+1
  for i in range(d, D):
    if ans[i] == q:
      nextday = i+1
  dif_sat += c[q-1]*(d+1-lastday)*(nextday-d+1)

  lastday = 0
  nextday = D+1
  for i in reversed(range(d-1)):
    if ans[i] == ans[d-1]:
      lastday = i+1
  for i in range(d, D):
    if ans[i] == ans[d-1]:
      nextday = i+1
  dif_sat -= c[ans[d-1]-1]*(d+1-lastday)*(nextday-d+1)

  return dif_sat


D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]

lastdays = [0] * 26
sat = 0
ans = [0] * D

for i in range(D):
  maxtmpsat = -1000000
  for j in range(26):
    tmpsat = s[i][j] + c[j] * (i+1 - lastdays[j]) # その日に何も開催しなかった場合との満足度の差
    if tmpsat > maxtmpsat:
      maxtmpsat = tmpsat
      ans[i] = j+1
  lastdays[ans[i]-1] = i+1

for _ in range(10000):
  d = random.randint(1, 365)
  q = random.randint(1, 26)
  if calc_sat_change(d, q) > 0:
    ans[d-1] = q

for i in range(D):
  print(ans[i])




Measured memory_bytes: 9636
import math
a, b, h, m = map(int,input().split())

at = (m + h*60) * 0.5
bt = m * 6

theta = abs(at - bt)
if theta > 180:
    theta = 360 - theta

c2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(theta))

print(c2**(1/2))

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

int main(){
  cin.tie(0);
 	ios::sync_with_stdio(false);
  int n;
  cin >> n;
  bitset<18> a[n];
  for(int i = 0; i < n; i++){
    a[i][i] = 1;
  }
  vector<vector<int>> v((1 << n));
  for(int x = 1; x < (1 << n); x++){
    bitset<18> b(x);
    bitset<18> e(0);
    for(int i = 0; i < 18; i++){
      if(b[i] == 0) continue;
      if(e == 0){
        e = a[i];
      }else{
        e |= a[i];
      }
    }
    int idx = e.to_ulong();
    for(int i = 0; i < 18; i++){
      if(b[i] == 1){
        v[idx].push_back(i);
      }
    }
  }
  for(int i = 0; i < v.size(); i++){
    cout << i << ":";
    for(int j = 0; j < v[i].size(); j++){
      cout << " " << v[i][j];
    }
    cout << "\n";
  }
  return 0;
}



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


int main() {
	int n,m,l;
	int **elm1;
	int **elm2;
	long res;
	
	cin>>n>>m>>l;
	
	elm1 = new int*[m];
	for(int i=0;i<m;++i){
		elm1[i] = new int[n];
	}
	
	elm2 = new int*[l];
	for(int i=0;i<l;++i){
		elm2[i] = new int[m];
	}
	
	
	
	for(int i=0;i<n;++i){
		for(int j=0;j<m;++j){
			cin>>elm1[j][i];
		}
	}
	
	for(int i=0;i<m;++i){
		for(int j=0;j<l;++j){
			cin>>elm2[j][i];
		}
	}
	
	for(int i=0;i<n;++i){
		for(int j=0;j<l;++j){
			
			res=0;
			for(int k=0;k<m;++k){
				res += elm1[k][i]*elm2[j][k];
			}
			cout<<(j?" ":"")<<res;
		}
		cout<<endl;
	}
}

Measured memory_bytes: 1268
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <map> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;


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

    for(int i = 0; i < h; ++i)
    {
        for(int j = 0; j < w; ++j)
        {
            int tmp;
            if(i < b)
            {
                if(j < a)tmp = 0;
                else tmp = 1;
            }
            else
            {
                if(j < a)tmp = 1;
                else tmp = 0;
            }
            cout << tmp;
        }
        cout << endl;
    }

    cout << endl;
    return 0;    
}



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

n, k = map(int, input().split())

h = []
for i in range(n):
    hight= int(input())
    h.append(hight)

h.sort()

d_min = 1000000000 
for i in range(n-k+1):
    d = h[i+k-1] - h[i]
    if d_min > d:
        d_min = d

print(d_min)


Measured memory_bytes: 7384
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define ALL(x) x.begin(), x.end()
#define INF (1001000000)
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i:c)
#define EXIST(cs,v) (find(ALL(cs),(v))!=cs.end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define UNIQ(c) (c).erase(unique((c).begin(),(c).end()), (c).end());
#define P(p) cout<<(p)<<endl;

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

    int d;
    cin >> d;

    if (d == 25) {
        P("Christmas");
    }
    else if (d == 24) {
        P("Christmas Eve");
    }
    else if (d == 23) {
        P("Christmas Eve Eve");
    }
    else if (d == 22) {
        P("Christmas Eve Eve Eve");
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
#include <unordered_set>
using namespace std;
constexpr int64_t MOD = 1e9 + 1;

int main(){
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  int64_t N,X,M;
  cin >> N >> X >> M;
  unordered_set<int64_t> us;
  int64_t pre = 1;
  int64_t a = X;
  int64_t sum = a;
  us.insert(a);
  int64_t head = -1;
  for (pre = 2; pre <= N; pre++) {
    a *= a;
    a %= M;
    //cout << pre << "," << a  <<"," << sum << endl;
    if (us.count(a) == 0) {
      us.insert(a);
      sum += a;
    } else {
      head = a;
      break;
    }
  }

  if (pre == N + 1) {
    cout << sum << endl;
    return 0;
  }

  int64_t looplen = 1;
  int64_t loopsum = head;
  for (pre = pre + 1; pre <= N; pre++) {
    a *= a;
    a %= M;
    if (a != head) {
      loopsum += a;
      //loopsum %= M;
      looplen++;
    } else {
      break;
    }
  }

  sum += loopsum;
  //sum %= M;
  int64_t num_loop = (N - pre) / looplen;
  int64_t res = (N - pre) % looplen;
  sum += num_loop * loopsum;
  //sum %= M;
  a = head;
  for (pre = N - res; pre <= N; pre++) {
    sum += a;
    //sum %= M;
    a *= a;
    a %= M;
  }

  cout << sum << endl;


  return 0;
}

Measured memory_bytes: 5316
import java.util.Arrays;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    final int n = scanner.nextInt();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) a[i] = scanner.nextInt();
    Arrays.sort(a);
    int r = upperBound(a, a[n - 1] / 2);
    if (r + 1 < n - 1 && Math.abs(a[r + 1] * 2 - a[n - 1]) < Math.abs(a[r] * 2 - a[n - 1])) r = a[r + 1];
    else r = a[r];
    System.out.printf("%d %d\n", a[n - 1], r);
  }

  public static int upperBound(int[] a, int k) {
    int left = -1;
    int right = a.length;
    while (right - left > 1) {
      int mid = (left + right) / 2;
      if (a[mid] <= k) {
        left = mid;
      } else {
        right = mid;
      }
    }
    return left;
  }
}


Measured memory_bytes: 50944
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
ll d[100000];
int main()
{
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	if ((b - a) % 2 == 0)printf("Alice\n");
	else printf("Borys\n");
}

Measured memory_bytes: 128
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [True] * (10**6 + 1)
cnt = 0
for i in range(n):
  d = a[i]
  if l[d]:
    if i < n-1 and a[i] != a[i+1]:
      cnt += 1
    elif i == n-1:
      cnt += 1
    for j in range(d, 10**6 + 1, d):
      l[j] = False
print(cnt)


Measured memory_bytes: 32372
#include<stdio.h>
#include<stdlib.h>
#define N 100

main(){
  int A[N],a,i,j,n,minj,count=0;

  scanf("%d",&n);
  if( n > N )
    exit(1);

  for( i=0 ; i < n ; i++)
    scanf("%d",&A[i]);

  for( i = 0 ; i < n ; i++ ){
    minj = i;
    for( j = i ; j < n ; j++ ){
      if( A[j] < A[minj] )
	minj = j;
    }
    if( minj > i){
      a = A[i];
      A[i] = A[minj];
      A[minj] = a;
      count++;
    }
  }
     
    
  for( i = 0 ; i < n ; i++){
    printf("%d",A[i]);
    if ( i != n - 1)
      printf(" ");
  }
  printf("\n%d\n",count);
   
  return 0;
  
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int d = max({a, b, c});
    if (a == d) cout << "A" << endl;
    if (b == d) cout << "B" << endl;
    if (c == d) cout << "C" << endl;
    return 0;
}


Measured memory_bytes: 3076
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define mod 1000000007
#define first f
#define second s
#define N 1000000
vector<ll>v(N);
ll l,m,n,sum,ans,maximum,minimum,mahakal,a,b,c,t,i,j,k;
ll cnt,cnt1,cnt2,cnt3;
string str,str1;
ll arr[N];
int main(){
    cin>>n;
    if(n%2==0){
        cout<<n/2-1<<endl;
    }
    else{
        cout<<n/2<<endl;
    }
    return 0;
}

Measured memory_bytes: 8064
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,k;
  cin>>n>>k;
  vector<double> a(n);
  rep(i,n) cin>>a[i];
  double l=0;
  double r=1e9;
  rep(b,300){
    double mid=(l+r)/2;
    ll cu=0;
    rep(i,n){
      cu+=(ll)(a[i]/mid);
    }
    if(cu<=k) r=mid;
    else l=mid;
  }
  if((ll)(l)==l) COUT((ll)(l));
  else COUT((ll)(l)+1);
}

Measured memory_bytes: 4832
#include <algorithm>
#include <map>
#include <iostream>
#include <string>
#include <set>
#include <queue>
#include <cmath>
#include <iterator>
#include <array>
typedef long long int ll;
using namespace std;
#define maxN 200005
#define mod 1000000007

ll in1;
void solve()
{
    cin >> in1;
    ll count = 0, start = 100;
    while (start < in1)
    {
        start += start / 100;
        count++;
    }
    cout << count << endl;
}

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

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

int main() {
	int n,a,b,c,d;cin>>n>>a>>b>>c>>d;
	int Min=INT_MAX;
	for(int w=1;w<=n;w++){
		int ax=(a-1)/w,ay=(a-1)%w;
		int bx=(b-1)/w,by=(b-1)%w;
		int cx=(c-1)/w,cy=(c-1)%w;
		int dx=(d-1)/w,dy=(d-1)%w;
		Min=min(Min,abs(ax-bx)+abs(ay-by)+abs(cx-dx)+abs(cy-dy));
	}
	cout<<Min<<endl;
}

Measured memory_bytes: 3080
import java.util.*;

class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        String n = scan.next();
        boolean out = n.charAt(0) == '7' || n.charAt(1) == '7' || n.charAt(2) == '7';
        System.out.println(out ? "Yes" : "No");
        scan.close();
    }
    public static void main(String[] args){
        new Main().solve();
    }
}


Measured memory_bytes: 26904
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

const int N = 1e5+100;
typedef long long LL;
LL dp[N];
int n,m;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n>>m;
    for(int i = 1;i<=n; i++){
        int w,v;
        cin>>w>>v;
        for(int j = m; j>=w; j--){
            dp[j] = max(dp[j],dp[j-w]+v);
        }
    }
    cout<<dp[m];
    return 0;
}

Measured memory_bytes: 3968
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n;
    cin >> n;
    int k;
    cin >> k;
    long long tmp=0;
    int cnt = 0;
    int i=0;
    while(tmp <= n){
        tmp = pow(k,i);
        i++;
    }
    cnt = i-1;
    cout << cnt << endl;
}




Measured memory_bytes: 256
import sys
input = sys.stdin.readline
N, M = [int(x) for x in input().strip().split()]
A = set([int(input()) for _ in range(M)])
s = 1
s_ = 0
for n in range(1, N+1):
  if n in A:
    s, s_ = 0, s
    continue
  s, s_ = s + s_, s
print(s % (10 ** 9 + 7))


Measured memory_bytes: 13192
#include<iostream>
#include<vector>
#include<map>
#include<tuple>
#include<string>
#include<cmath>
#include<climits>
#include<algorithm>
#include<bitset>
#include<set>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
#define DIV 1000000007
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m; x=x*x%m;n>>=1;}return r%m;}
using namespace std;
 
int main(){
  int n; cin >> n;
  int t_2 = 0, t_1 = 0;
  rep(i,n){
    int in; cin >> in;
    if(in % 2 == 0)  t_2++;
    else  t_1++;
  }
  SHOW(t_1,t_2);
  ll ans = t_1 + t_2*2;
  cout << ((ans%2)?("NO"):("YES")) << endl;
  return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;


int main(){
    int n;
    cin >> n;
    llong tmp;
    REP(i,n){
        scanf("%lld",&tmp);
        if(tmp%2==1){
            cout << "first" << endl;
            return 0;
        }
    }
    cout << "second" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

#define MOD 1000000007;

int gcd(int x, int y){
	int r=x%y;
	while(r){
		x=y;
		y=r;
		r=x%y;
	}
	return y;
}

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0; i<n; i++)
		cin >> a[i];
	vector<int> l(n);
	l[1] = a[0];
	for(int i=2; i<n; i++)
		l[i]=gcd(l[i-1], a[i-1]);
	vector<int> r(n);
	r[n-2] = a[n-1];
	for(int i=n-3; i>=0; i--)
		r[i]=gcd(r[i+1], a[i+1]);
	int ans=max(r[0],l[n-1]);
	for(int i=1; i<n-1; i++)
		ans=max(gcd(l[i],r[i]),ans);
	cout << ans << endl;
	return 0;
}

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

int main()
{
	int n;
	int b[200];
	int ans[200];
	int count=0;

	cin >> n;
	for (int i = 0;i < n-1;i++)
	{
		cin >> b[i];
	}
	ans[0] = b[0];
	ans[n-1] = b[n-2];
	for (int i = 0;i < n-2;i++)
	{
		ans[i+1] = min(b[i], b[i + 1]);
	}
	for (int i = 0;i < n;i++)
	{
		count += ans[i];
	}
	cout << count;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    long X = sc.nextLong();
    long Y = sc.nextLong();
    long ans = Integer.MAX_VALUE;
    if (Y >= X) {
      ans = Y - X;
    }
    if (-Y >= X) {
      ans = Math.min(ans, -Y - X + 1);
    }
    if (Y >= -X) {
      ans = Math.min(ans, Y + X + 1);
    }
    if (-Y >= -X) {
      ans = Math.min(ans, -Y + X + 2);
    }
    System.out.println(ans);
  }

}


Measured memory_bytes: 10320