akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
int main()
{
    int N;
    string S,T;
    cin >> N >> S >> T;
    string W = "";
    REP(i,N){
        W = W + S[i] + T[i];
    }
    cout << W << endl;
}

Measured memory_bytes: 3512
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) ((y)<0||(x)<0||(y)>=(h)||(x)>=(w))
#define dump(...)
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct{template<class T> operator T(){T x;cin>>x;return x;}} IN;
struct before_main_function {
    before_main_function() {
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int N;
    cin >> N;
    vi a(N);
    cin >> a;
    int ans = 0;
    REP(i, N) {
        int c = 0;
        while (a[i] % 2 == 0) {
            c++;
            a[i] /= 2;
        }
        ans += c;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 384
// 2020-08-30 19:17:40
// clang-format off
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

// clang-format on
vector<P> cb[40], b;
void answer() {
  int n, cz;
  cin >> n >> cz;
  rep(i, n) {
    int x, y, c;
    cin >> x >> y >> c;
    c--;
    cb[c].emplace_back(x, y);
  }
  rep(c, cz) {
    if (cb[c].size() == 0) continue;
    sort(ALL(cb[c]));
    rep(i, cb[c].size() - 1) {
      P& cur = cb[c][i];
      P& nxt = cb[c][i + 1];
      if (cur.second == nxt.first) {
        nxt.first = cur.first;
      } else {
        b.emplace_back(cur.first - 1, cur.second);
      }
    }
    P& last = cb[c].back();
    b.emplace_back(last.first - 1, last.second);
  }
  sort(ALL(b));
  int ans = 0;
  multiset<int> t;
  for (auto p : b) {
    if (t.size() > 0) {
      for (auto it = t.begin(); it != t.end() && p.first >= *it;) {
        t.erase(prev(++it));
      }
    }
    t.insert(p.second);
    chmax(ans, int(t.size()));
  }
  cout << ans << '\n';
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 5568
import math
import copy
import sys


inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

if b == 100:
    ans = pow(100, a) * (b + 1)
else:
    ans = pow(100, a) * b
print(int(ans))




Measured memory_bytes: 3444
import sys 
nN = int(input())

Tmp = []
Tmp = input().rstrip().split(' ')
nTmp = [ 0 for i in range(nN)]

nFlag=1

if nN == 1:
  print('Yes')
  sys.exit()

for i in range(nN):
  nTmp[i] = int(Tmp[i])
  if i == 0:
    nTmp[0] -= 1
    continue
  nChk = nTmp[i]-nTmp[i-1]
  if nChk > 0:
    nTmp[i] -=1
  elif nChk == 0:
    continue
  else:
    nFlag = 0
    break

if nFlag == 1:
  print('Yes')
else:
  print('No')


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

int main() {
	int N;
	cin >> N;
	vector<int> ans(N);
	rep(i, N - 1) {
		int A;
		cin >> A;
		ans.at(A - 1)++;
	}
	rep(i, N) {
		cout << ans.at(i) << endl;
	}
	return 0;
}


Measured memory_bytes: 4048
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

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

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

// vars
int k, a, b;
void input(){
    cin >> k >> a >> b;
}

void solve(){
    for (int i=a; i<=b; ++i){
        if(i % k == 0){
            cout << "OK" << endl;
            return;
        }
    }
    cout << "NG" << endl;
}

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

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

#define ff first
#define ss second
#define endl '\n'

const int MOD = 1e9 + 7;

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

	int n, k;
	cin >> n >> k;

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

	if (accumulate(a, a+n, 0) < k) {
		cout << 0 << endl;
		return 0;
	}

	int dp[k+1][n];
	memset(dp, 0, sizeof(dp));
	for (int i = 0; i <= a[0]; ++i) {
		dp[i][0] = 1;
	}

	int p = 0;
	for (int c = 1; c < n; ++c) {
		p = 0;

		for (int r = 0; r <= a[c]; ++r) {
			p = (p + dp[r][c-1]) % MOD;
			dp[r][c] = p;
		}

		for (int r = a[c]+1; r <= k; ++r) {
			p = (p - dp[r-a[c]-1][c-1] + MOD) % MOD;
			p = (p + dp[r][c-1]) % MOD;
			dp[r][c] = p;
		}
	}

	cout << dp[k][n-1] << endl;
	return 0;
}

Measured memory_bytes: 39296
#include <bits/stdc++.h>
#define hell 1000000007
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define ll long long 
#define pi 3.1415926536
using namespace std;
const ll N=1e5+5;
void solve()
{ll n,k,l,h,r,x,y,z,w,mini,maxi=INT_MAX,prev;
  cin>>x>>y>>z;
  cout<<z<<" "<<x<<" "<<y;
}
  
int main()
{
  fast
  //fact();
  //chk();
ll t=1;
//cin>>t;
//SieveOfEratosthenes();
//cout<<"ok";
while(t--)
{ //cout<<"ok";

solve();
 //cout<<ma<<endl;
}
return 0;}

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

ll gcd(ll a, ll b){
	if(b != 0){
		gcd(b, a%b);
	}else{
		return a;
	}
}

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

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

	ll ans = lcm(a, b);

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
import numpy as np

d = int(input())
C = np.array(list(map(int, input().strip().split())))
S = np.array([list(map(int, input().strip().split())) for i in range(d)])

D = np.zeros(26)
s_d = np.zeros(d)
W = np.ones(26) + C / 100
out = np.zeros(d)
t = 0
for i in range(d):
    day = i + 1
    temp_score = 0
    con = 0
    d_l = [day]*26
    for j in range(26):
        score = S[i][j]
        score -= sum((d_l - D) * C)
        score += (day - D[j]) * C[j] * W[j]
        if score > temp_score:
            con = j
            temp_score = score
    out[i] = con + 1
    D[con] = i + 1
    t += temp_score
    s_d[i] = t
    W = W * 1.1
    W[j] = W[j] * 0.9
for i in out:
    print(int(i))


Measured memory_bytes: 26808
n = int(input())
a = 0
if 400 <= n <= 599:
    a = 8
elif 600 <= n <= 799:
    a = 7
elif 800 <= n <= 999:
    a = 6
elif 1000 <= n <= 1199:
    a = 5
elif 1200 <= n <= 1399:
    a = 4
elif 1400 <= n <= 1599:
    a = 3
elif 1600 <= n <= 1799:
    a = 2
else:
    a = 1
print(a)

Measured memory_bytes: 9176
///
// File:  1154.cpp
// Author: ymiyamoto
//
// Created on Sat Nov 18 22:38:43 2017
//

#include <array>
#include <cstdint>
#include <iostream>

using namespace std;

static array<int32_t, 300000> primes;

int32_t is_prime(uint32_t n)
{
  if (primes[n] != 0) return primes[n];

  for (uint32_t i = 0; i + 6 < n; i += 7) {
    if (i != 0 && (n % (i + 1) == 0)) {
      return primes[n] = 2;
    }
    if (n % (i + 6) == 0) {
      return primes[n] = 2;
    }
  }
  return primes[n] = 1;
}

int32_t main()
{
  for (uint32_t i = 0; i < primes.size(); i++) {
    primes[i] = 0;
  }

  while (true) {
    uint32_t n;
    cin >> n;
    if (n == 1) break;

    cout << n << ":";
    for (uint32_t i = 0; i < n; i += 7) {
      if (i + 1 != 1) {
        if (n % (i + 1) == 0) {
          if (is_prime(i + 1) == 1) {
            cout << " " << i + 1;
          }
        }
      }
      if (n % (i + 6) == 0) {
        if (is_prime(i + 6) == 1) {
          cout << " " << i + 6;
        }
      }
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 4260
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let A: i64 = read();
    let B: i64 = read();
    println!("{}", std::cmp::max(std::cmp::max(A+B, A-B), A*B));
}



Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int d, n;
    cin >> d >> n;
    int ans = pow(100, d) * (n==100?101:n);
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <iomanip>
 
using namespace std;
 
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;
 
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define endl "\n"
 
const LD EPS=1e-10;
const long long INFLL=(LL)(1e9)*(LL)(1e9);
const int INF=1e9+7;

template<class T>
void chmin(T& a, const T b)
{
	if(a>b)
		a=b;
}
template<class T>
void chmax(T& a, const T b)
{
	if(a<b)
		a=b;
}
 
const LL powLL(const LL p, const LL q)
{
	LL t=1;
	for(int i=0;i<q;i++)
		t*=p;
	return t;
}

template <typename T>
struct has_iter
{
	private:
		template <typename U>
		static constexpr true_type check(typename U::iterator*);
		template <typename U>
		static constexpr false_type check(...);

	public:
		static constexpr bool value = decltype(check<T>(nullptr))::value;
};


template<typename T, typename U = typename T::iterator>
void print(const T& container)
{
		auto&& first=begin(container), last=end(container);
		auto&& back=prev(last);
		for(auto e=first; e!=last; e=next(e))
			cout<<*e<<" \n"[e==back];
}


extern void* enabler;
template<typename Head, typename enable_if<!has_iter<Head>::value>::type*& = enabler>
void print(const Head& head)
{
	cout<<head<<endl;
}

template<> void print<string>(const string& container)
{
	cout<<container<<endl;
}

template<typename Head, typename... Tail>
void print(const Head& head, const Tail&... tail)
{
	cout<<head<<" ";
	print(tail...);
}

void io_speedup()
{
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec)
{
	for(T& x: vec) is >> x;
	return is;
}


template<typename T, typename U>
ostream& operator << (ostream& os, const pair<T, U>& p)
{
	os<<'('<<p.first<<", "<<p.second<<')';
	return os;
}

template<typename T>
vector<T> read(int n)
{
	vector<T> t(n);
	cin>>t;
	return t;
}

template<typename T>
T read()
{
	T t;
	cin>>t;
	return t;
}

template<typename Head, typename... Tail>
struct vector_demensions
{
	using type=vector<typename vector_demensions<Tail...>::type>;
};

template<typename Head>
struct vector_demensions<Head> { using type=Head; };

template<typename T>
vector<T> make_vectors(int size, T val)
{
	return vector<T>(size, val);
}

template<typename T=int, typename... Args>
auto make_vectors(int size, Args... tail)
	-> typename vector_demensions<Args..., T>::type
{
	auto val=make_vectors<T>(forward<Args>(tail)...);
	return vector<decltype(val)>(size, val);
}


int main()
{
	LL n,x;
	cin>>n>>x;
	auto a(read<LL>(n));
	sort(ALL(a));
	LL ans=0,sum=0;
	REP(i,n)
	{
		sum+=a[i];
		if(sum<=x) ans++;
	}
	if(sum<x)ans--;
	print(ans);
}

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

int main(){
    int n,k;
    cin>>n;
    for(int i=1;i<=9;i++){
        k=n;
        if(n%i==0){
            k/=i;
            if(k<=9){printf("Yes\n");return 0;}
        }
    }
    printf("No\n");return 0;
}

Measured memory_bytes: 3580
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)
int main(){
	int p[110000];
	p[0] = 0;
	p[1] = 0;
	p[2] = 1;
	p[3] = 1;
	p[4] = 0;
	for(int i = 5; i < 110000; i+=2){
		bool f = 1;
		for(int j = 3; j*j <= i; j+=2){
			if(i % j == 0)f = 0;
		}
		p[i] = f;
	}
	int N,P;
	int ps[100];
	cin >> N >> P;
	int ans[1000];
	int c;
	while(N!= -1){
		c = 0;
		for(int i = N+1; c < 100; i++){
			if(p[i]){
				ps[c] = i;
				c++;
			}
		}
		for(int i = 0; i < 1000; i++)ans[i]=1e9;
		c = 0;
		
		for(int i = 0; i < 100; i++){
			for(int j = i; j < 100; j++){
				if(c < 1000)ans[c] = ps[i]+ps[j];
				c++;
			}
		}
		sort(ans, ans+1000);
		cout << ans[P-1] << endl;
		cin >> N >> P;
	}
	return 0;
}


Measured memory_bytes: 3568
#include<stdio.h>
int main(void)
{
  int a, i, j, ender, num, answer=0, b;
  scanf("%d", &num);
  char str[num], down[num];
  for(a=0; a<num; a++)
  {
    scanf("%d", &str[a]);
  }
  
  for(j=0; j<num; j++)
  {
    down[j]=str[0];
    ender=0;
    for(i=0; i<num; i++)
    {
      if(down[j]<str[i])
      {
        down[j]=str[i];
        ender=i;
      }
    }
    str[ender]=0;
  }
  
  for(b=0; b<num; b++)
  {
    if(b%2==0) answer=answer+down[b];
    else answer=answer-down[b];
  }
  printf("%d\n", answer);
  return 0;
}

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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	int H, W, K;
	cin >> H >> W >> K;
	vector<string> smap(H);
	rep(i, 0, H)
	{
		cin >> smap[i];
	}

	int ans = INF;

	rep(i, 0, 1LL << (H - 1))
	{
		vector<int> RES(H, 0);
		int sum = 0;
		rep(j, 0, H - 1)
		{
			if ((i >> j) & 1)sum++;
		}
		rep(j, 0, W)
		{
			int idx = 0;
			vector<int> tres(H, 0);
			bool ok = true;
			bool cf = false;
			rep(k, 0, H)
			{
				if (smap[k][j] == '1')
				{
					tres[idx]++;
					if (tres[idx] > K)ok = false;
					if (tres[idx] + RES[idx] > K)cf = true;
				}
				if (k < H - 1 && ((i >> k) & 1))
				{
					idx++;
				}
			}
			if (!ok)
			{
				sum = INF;
				break;
			}
			if (cf)
			{
				sum++;
				rep(k, 0, H)
				{
					RES[k] = tres[k];
				}
			}
			else 
			{
				rep(k, 0, H)
				{
					RES[k] += tres[k];
				}
			}
		}
		if (sum != INF)
		{
			chmin(ans, sum);
		}
	}

	cout << ans << endl;

	return 0;
}

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

#入力
# s = input()[0:-1]
x = int(input())
# a = list(map(int,input().split()))
# a = [int(input()) for i in range()]


# ab=[]
# for i in range():
#     a,b = map(int, input().split())
#     ab.append([a,b])


     
def main():
   if x >2000:
       print(1)
   else:
        flag = False
        for i in range(21):
            for j in range(20):
                for k in range(20):
                    for l in range(20):
                        for m in range(20):
                            for n in range(20):
                                if 100*i + 101*j+ 102*k + 103*l + 104*m + 105*n == x:
                                    flag = True
        if flag :
            print(1)
        else:
            print(0)

    

if __name__ == '__main__':
    main()

Measured memory_bytes: 41580
#include <math.h>
#include <iostream>
#include <vector>
#include <sstream>
using namespace std;

int main() {
    int n;
    cin >> n;
    char a[n];
    int r = 0;
    string s = "";
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
        if (a[i] == 'R') {
            r++;
            s += "R";
        }
    }
    int ans = 0;
    for (int i = 0; i < r; i++) {
        if (a[i] != s[i])
            ans++;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 3508
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;++i)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;
const int MOD = 1e9 + 7;


ll fl(ll a,ll b) {
	if (a < b) {
		return 1;
	}
	if (a % b == 0) {
		return a / b;
	}
	else {
		return a / b + 1;
	}
}






int main() {
	ll n;
	cin >> n;
	vector< vector<ll> > v(n,vector<ll>(2,0));
	rep(i, 0, n) {
		cin >> v[i][0] >> v[i][1];
	}


	rep(i, 1, n) {
		ll s = max(fl(v[i-1][0],v[i][0]),fl(v[i-1][1],v[i][1]));
		v[i][0] *= s;
		v[i][1] *= s;
	}

	cout << v[n - 1][0] + v[n - 1][1] << endl;



	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define name "lqdoj"
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define ini freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout)
using namespace std;

const int MOD = 1e9 + 7;
const int NMAX = 3000 + 5;
const int TMAX = 5e4;
int n, a[NMAX];
long long dp[NMAX][NMAX];
int main(){
    fastio;
    //ini;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];

    for (int i = n; i >= 1; i--){
        for (int j = 1; j <= n; j++){
            dp[i][j] = (i == j) ? a[i] : max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1]);
        }
    }

    cout << dp[1][n] << " ";
    return 0;
}





Measured memory_bytes: 74060
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
constexpr int kMod = 1000000007;
typedef long long LL;

int main() {
  int N; std::cin >> N;
  std::vector<int> m;
  for (int i = 0; i < N; ++i) {
    int a; std::cin >> a;

    if (!m.empty() && m.back() < a) {
      for (int& v : m) {
        if (v < a) {
          v = a;
          break;
        }
      }
    } else {
      m.push_back(a);
    }
  }

  std::cout << m.size() << std::endl;
}


Measured memory_bytes: 892
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		long sum = A.Sum();
		var l = new List<long>();
		for(long i=1;i*i<=sum;i++){
			if(sum % i != 0) continue;
			l.Add(i);
			if(sum / i != i) l.Add(sum / i);
		}
		l.Sort();
		
		long ma = 0;
		foreach(var d in l){
			if(Check(d)) ma = Math.Max(d, ma);
		}
		Console.WriteLine(ma);
		
	}
	
	bool Check(long d){
		var l = new List<long>();
		for(int i=0;i<N;i++){
			l.Add(A[i] % d);
		}
		l.Sort();
		
		long step = 0;
		int M = l.Count;
		int r = M - 1;
		for(int i=0;i<M;i++){
			if(l[i] == 0) continue;
			long inc = l[i];
			l[i] = 0;
			step += inc;
			while(inc > 0){
				if(l[r] + inc < d){
					l[r] += inc;
					break;
				}
				long rest = l[r] + inc - d;
				l[r] = 0;
				inc = rest;
				r--;
			}
		}
		return step <= K;
	}
	
	
	
	int N;
	long K;
	long[] A;
	public Sol(){
		var d = ria();
		N = d[0]; K = d[1];
		A = rla();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main(){
int s;
  cin>>s;
  
  int count=1;
  while(s>4 || s==3){
   if(s%2==0){s/=2;}
   else{s=3*s+1;}  // s<=2になったら、以降4→2→1とループするため、
   count++;        // 4→2→1とループするまでの計算回数をcount
  }
  
  cout<<count+3;  // 初項sのcount=1と、
}     // 4→2→1とループ後に新たに4が現れるまでのカウント＋3を足す。


Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a = INT()
    print(a + a ** 2 + a **3)


if __name__ == '__main__':
    main()


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

int main() {
    
    // 1. input.
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    
    // 2. sort.
    sort(a, a + 3);
    
    // 3. output answer.
    cout << a[0] << " " << a[1] << " " << a[2] << endl;
    
    return 0;
    
}


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

#整数値入力 1文字の入力
def input_one_number():
    return int(input())

#整数値龍力　複数の入力
def input_multiple_number():
    return map(int, input().split())

#整数値龍力　複数の入力(配列)
def input_multiple_number_as_list():
    return list(map(int, input().split()))

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)

def calc_gcd_list(l):
    gcd = l[0]
    for i in range(1, N):
        gcd = gcd(gcd, l[i])
    return gcd

def calc_lcm_list(l):
    lcm = 1
    for i in l:
        lcm = lcm * i // gcd(lcm, i)
    return lcm


N = input_one_number()
lstA = input_multiple_number_as_list()
lcm = calc_lcm_list(lstA)
pow = 10**9 +7
print(sum(lcm//a for a in lstA)%pow)


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

vector<string>v;
int main(){
	string s;
	int k;
	cin>>s>>k;
	for(int i=0;i<s.size();i++)
	{
		string cur;
		for(int j=i;j<s.size()&&j<i+k;j++)
			cur+=s[j],
			v.push_back(cur);
	}
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	cout<<v[k-1];
}


Measured memory_bytes: 1660
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
typedef pair<LL, LL> P;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)      (x).begin(),(x).end()
# define UNIQ(c)     (c).erase(unique(ALL((c))),(c).end())
# define mp          make_pair
# define eb          emplace_back
# define FOR(i,a,b)  for(int i=(a);i<(b);i++)
# define RFOR(i,a,b) for(int i=(a);i>=(b);i--)
# define REP(i,n)    FOR(i,0,n)
# define INIT        std::ios::sync_with_stdio(false);std::cin.tie(0)

LL x;

int main() {
	cin >> x;
	LL ans = (x / 11)*2;
	if (x % 11 > 6)ans += 2;
	else if (x % 11)ans++;
	cout << ans << endl;
}

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

int main(void){
    int A, B, C;
    cin >> A >> B >> C;
    long i = 1;
    long tmp;
    bool isYes = false;
    while(i <= A * B){
        tmp = A * i;
        i++;
        if(tmp % B == C){
            cout << "YES" << endl;
            isYes = true;
            break;
        }
    }
    
    if(isYes == false){
    cout << "NO" <<endl;
    }
    
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int a,b;
  char op;
  cin >> a >> op >> b;
  while(op!='?'){
    int c;
    if(op=='+') c=a+b;
    if(op=='-') c=a-b;
    if(op=='*') c=a*b;
    if(op=='/') c=a/b;
    cout << c << endl;
    cin >> a >> op >> b;
  }
  return 0;
}

Measured memory_bytes: 1164
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define ll long long
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB emplace_back
#define PF emplace_front
#define FILL(a,b) memset(a,b,sizeof(a))
#define lwb lower_bound
#define upb upper_bound
using namespace std;
int a[1005];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,k;
	cin>>n>>k;
	FOR(i,1,n)cin>>a[i];
	sort(a+1,a+n+1);
	int ans=0;
	FOR(i,1,k)ans+=a[i];
	cout<<ans;
	RE 0;
}




Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
int a[500005],pos[500005];
long long m[500005];
bool ok[500005];
int main()
{
	int n,q;
	scanf("%d%d",&n,&pos[0]);
	for (int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		pos[i]=min(pos[i-1],abs(pos[i-1]-a[i]));
	}
	m[n+1]=1;
	for (int i=n;i>0;i--)
	{
		m[i]=m[i+1];
		if (a[i]/2<m[i])
		m[i]+=a[i];
		if (pos[i-1]>=m[i+1])
		ok[i]=1;
	}
	scanf("%d",&q);
	while (q--)
	{
		int a;
		scanf("%d",&a);
		puts(ok[a]? "YES":"NO");
	}
}

Measured memory_bytes: 10240
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}

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

    int ans = 0;
    if(a-b<c){
        ans = c -(a-b);
    }

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


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

int main()
{
    std::string w;
    std::cin >> w;

    std::unordered_map<char, int> map;

    for (auto c : w) {
        map[c]++;
    }

    for (auto i = map.begin(); i != map.end(); i++) {
        if (i->second % 2) {
            std::cout << "No" << std::endl;
            return 0;
        }
    }
    std::cout << "Yes" << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
#define pb push_back
int main(void){
    ll n;
    cin>>n;
    vector<ll>a(n);
    rep(0,i,n)cin>>a[i];
    sort(a.rbegin(),a.rend());
    ll ans=a[0];
    ll c[(ll)3e5]={0},M=a[1],count=1;
    rep(1,i,a.size()-1){
        ans+=M;
        ++c[count];
        if(c[count]==2){
            ++count;
            M=a[count];
        }
        //cout<<M<<endl;
    }
    cout<<ans;
}


Measured memory_bytes: 7208
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF  = 0x3f3f3f3f;
const ll  mod  = 2019;
const ll  maxn = 1e6 + 5;
const int N = 2e5 + 5;

char s[N];
int a[N],pre[N],suf[N],n;

ll qpow(ll a,ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}

map<ll,ll>M;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>s+1;
	int n=strlen(s+1);
	for(int i=1;i<=n;i++){
		a[i]=s[i]-'0';
	}
	int cnt=0;
	// for(int i=1;i<=n;i++){
	// 	pre[i]=(pre[i-1]*10+a[i])%mod;
	// 	if(pre[i]==0) cnt++;
	// }
	for(int i=n;i>=1;i--){
		suf[i]=(suf[i+1]+a[i]*qpow(10,n-i+1))%mod;
		M[suf[i]]++;
	}
	// for(int i=1;i<=n;i++){
	// 	cout<<pre[i]<<"\n";
	// }
	M[0]++;
	for(int i=0;i<2019;i++){
		if(M[i]>=2) cnt+=M[i]*(M[i]-1)/2;
	}
	// cout<<"\n\n\n";
	// for(int i=1;i<=n;i++){
		// cout<<suf[i]<<'\n';
	// }
	// for(int i=1;i)
	// for(int i=1;i<=n;i++){
	// 	if(pre[i]==0) 
	// }
	// cout<<(1+cnt)*cnt/2<<'\n';
	cout<<cnt<<'\n';
	return 0;
}

Measured memory_bytes: 5484
#include <bits/stdc++.h>
#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 REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define dump(x) cout << #x << " = " << (x) << endl;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

#define int long long

int gcd(int a, int b) {
    return b != 0 ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
const int MOD = 1e9 + 7;
signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    string S, T;
    cin >> S >> T;
    int p = lcm(N, M) / N;
    int q = lcm(N, M) / M;
    bool ok = true;
    for (int i = 0; i < N; ++i) {
        if(i * p % q == 0){
            int j = i * p / q;
            if(S[i] != T[j]){
                ok = false;
            }
        }
    }
    if(ok){
        cout << lcm(N, M) << endl;
    }else{
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <functional>
#include <ctime>
#include <random>

using namespace std;

#if _DEBUG
#include <fstream>
ifstream cin("input.txt");
ofstream cout("output.txt");
#else
#include <iostream>
#endif

const int MAXN = 1010;
int n, m, in, k, x, y;
char a[10][10];
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			cin >> a[i][j];
			if (a[i][j] == '#')
				k++;
		}
	}
	if (a[x][y] != '#')
	{
		cout << "Impossible";
		return 0;
	}
	k--;
	while (true)
	{
		if (a[x][y + 1] == '#')
		{
			y++;
			k--;
			continue;
		}
		if (a[x + 1][y] == '#')
		{
			x++;
			k--;
			continue;
		}
		break;
	}
	if (x != n - 1 || y != m - 1 || k != 0)
	{
		cout << "Impossible";
	}
	else
	{
		cout << "Possible";
	}
	return 0;
}

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

long long func(long long x, long long y){
    if(y == 0) return 1; //0乗は１
    else if(y % 2 == 0){//偶数乗ならば
        return func((x * x) % M, y / 2); //底がx*xになったから、指数は半分にする
    }
    else{//奇数乗ならば
        return (x * func(x, y - 1) % M); //底を1/x倍したため、指数を１引く
    }
}

int main(void){
    int m, n;
    cin >> m >> n;
    cout << func(m, n) << endl;
}


Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

string S, T, U;
int a,b,c;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);
	
	cin >> S;
    bool flag = true;
    string hi = "hi";
    string now = "";
    
    rep(i,10){
        now += "hi";
        if(S == now) Yes
    }
    No

}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <functional>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

// #define rep(i,n) for(int i=0;i<(n);++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _fromto2(i,n) for(int i=0;i<=(n);++i)
#define _fromto3(i,a,b) for(int i=(a);i<=(b);++i)
#define fromto(...) _overload3(__VA_ARGS__,_fromto3,_fromto2,)(__VA_ARGS__)

#define rrep(i,n) for(int i=(n);i>=0;--i)
const int MOD = 1e9+7;
const int INF = 1e9;
const int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
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;}

// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
#else
#define debug(...) 42
#endif


int main() {
  int A[3][3];
  bool card[3][3];
  rep(i, 3) rep(j, 3) {
    cin >> A[i][j];
    card[i][j] = false;
  }
  int N; cin >> N;

  rep(i, N) {
    int b; cin >> b;
    rep(i, 3) rep(j, 3) {
      if (A[i][j] == b)
        card[i][j] = true;
    }
  }
  rep(i, 3) {
    bool ok = true;
    rep(j, 3) {
      if (card[i][j] == false)
        ok = false;
    }
    if (ok) {
      cout << "Yes\n";
      return 0;
    }
  }
  rep(i, 3) {
    bool ok = true;
    rep(j, 3) {
      if (card[j][i] == false)
        ok = false;
    }
    if (ok) {
      cout << "Yes\n";
      return 0;
    }
  }
  if (card[0][0] && card[1][1] && card[2][2] ||
      card[2][0] && card[1][1] && card[0][2]) {
    cout << "Yes\n";
  } else
    cout << "No\n";

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int x = 0;
			int max = 0;
			int N = sc.nextInt();
			sc.nextLine();
			String S = sc.nextLine();
			for (int i = 0; i < N; i++) {
				if (S.charAt(i) == 'I') {
					x++;
				} else {
					x--;
				}
				if (max < x) {
					max = x;
				}
			}
			System.out.println(max);
		}
	}
}


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

int main() {
  int N;
  cin >> N;
  
  string color;
  for(int i=0; i<N; i++){
    cin >> color;
    if(color == "Y"){
      cout << "Four" << endl;
      return 0;
    }
    else
      continue;
  }
  cout << "Three" << endl;
}


Measured memory_bytes: 256
#
 
#include<stdio.h>
 
int main(void) {
    int a, b;
    scanf("%d %d", &a, &b);
 
    int s = a*b;
    int mawari = a * 2 + b * 2;
     
    printf("%d %d\n", s, mawari);
 return 0;
}

Measured memory_bytes: 1024
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,x:usize,
        l:[usize;n],
    }
    let mut ans = 1; // d[0]
    let mut d = 0;
    for i in 0..n {
        d += l[i];
        if d <= x {
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2196
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define x first
#define y second

using namespace std;

typedef long long ll;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n, even = 0, odd = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        if (x % 2 == 0) even++;
        else odd++;
    }
    if (odd > 0) cout << "first\n";
    else cout << "second\n";
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int s1,s2,ans1=0,ans2=0;
    cin>>s1>>s2;
    if(s1<=1 && s2<=1)
    {
        cout<<0<<endl;
    }
    else
    {
        if(s1>1)
        {
            int x=s1-1;
             ans1=x*(x+1)/2;
        }
        if(s2>1)
        {
            int y=s2-1;
             ans2=y*(y+1)/2;

        }
        cout<<ans1+ans2<<endl;
    }

    return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	bool is_visited = false;
} node;
typedef struct {
	int to;
	int cost;
	P <int, int> change;
} edge;

int main( void ){
	string S; cin >> S;
	cout << S.substr(0,3) << endl;
}
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 3600
#include<cstdio>
#include<cstring>
#define N 6006
char a[N],x[N];int b[N],i,j,n,o,p,q,t,y;
int main()
{
    scanf("%d%s",&n,a+1);
    for(*b=i=j=1;j<=n<<1;j++)if(a[j]==97?o++:p++,o==p)
    if(a[i]==97)
    {
        for(o=p=q=y=0;i<=j;i++)if(a[i]==97&&x[++o,y]!=97||a[i]==98&&++p==q&&x[y]!=98)x[++y]=a[i],q=o;
        memcpy(a+b[t],x+1,y),b[t+1]=b[t]+y,t++;
    }
    else
    {
        for(y=j-i+1,memcpy(x+1,a+i,y),memset(a+b[t],0,y);y;)
        {
            if(strncmp(a+b[t],x+1,y)<0)memcpy(a+b[t],x+1,y),b[t+1]=b[t]+y;
            for(i=1;x[i]==98;i++);
            for(y--;i<=y;i++)x[i]=x[i+1];
            for(i=1;x[i]==97;i++);
            for(y--;i<=y;i++)x[i]=x[i+1];
        }
        i=j+1,t++;
    }
    for(i=t,y=0;i--;)x[y+1]=a[b[i+1]]=0,strncmp(x+1,a+b[i],b[i+1]-b[i])<=0?memcpy(a+b[i+1],x+1,y),y+=b[i+1]-b[i],memcpy(x+1,a+b[i],y):0;
    return 0&(x[y+1]=0,printf("%s\n",x+1));
}

Measured memory_bytes: 384
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n = 100
    x = inp()
    ans = 0
    while n < x:
        n *= 1.01
        n = int(n)
        ans += 1
    print(ans)
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 10844