akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define VIN(x) for(auto&youso_: (x) )cin>>youso_
#define VOUT(x, delim) for(auto&youso_: (x) )cout<<youso_<<delim;cout<<endl

#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) i64 __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


int main() {
    CIN(N, K);
    vector<i64> A(N);
    VIN(A);

    vector<i64> C(N + 1, 0);
    REP(i, N) C[i + 1] = C[i] + A[i];

    vector<i64> candid;
    REP(l, N) {
        FOR(r, l, N) {
            candid.pb(C[r + 1] - C[l]);
        }
    }

    i64 M = (N * (N + 1)) / 2;
    vector<bool> chosen(M, true);

    i64 ans = 0;
    i64 p = 1L << 50;
    while (p > 0) {
        p >>= 1;
        i64 ok = 0;
        REP(i, M) {
            if (!chosen[i]) continue;
            if (candid[i] & p) ok++;
        }
        if (ok < K) continue;
        ans += p;
        REP(i, M) {
            if (!chosen[i]) continue;
            if (candid[i] & p) continue;
            chosen[i] = false;
        }
    }
    COUT(ans);

    return 0;
}


Measured memory_bytes: 7424
#include <stdio.h>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>

#define INF 1 << 29
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)

using namespace std;

typedef pair<int,int> s;
typedef long long int ll;

int abs(int x){
  return x > 0 ? x : -x;
}

int length(char c[]){
  int cnt=0;
  for(cnt=0;c[cnt]!='\0';cnt++){
  }
  return cnt;
}


int main(){
  char s[1000000];
  int mi = INF;
  int n;
  scanf("%s",s);
  n=length(s);
  REP(i,n-1){
    if(s[i]-s[i+1]!=0){
      mi = min(mi,max(i+1,n-i-1));
    }
  }
  if(mi==INF){
    mi=n;
  }
  printf("%d\n",mi);
  return 0;
}


Measured memory_bytes: 256
#include <array>
#include <vector>
#include <deque>
#include <set>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <limits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdint>
#include <cassert>

using namespace std;

#define FOR(i, start, end) for(int i = (start); i < (end); ++i)
#define REP(i, n) FOR(i, 0, n)

void read_problem(int& m, int& n)
{
    scanf("%d %d\n", &m, &n);
}

constexpr int MODULO = 1000000007;

int pow_modulo(int m, int n, int mod)
{
    if(n == 0) return 1;

    long result = pow_modulo(m, n/2, mod);
    result = result * result % mod;
    if(n % 2)
        result = m * result % mod;

    return result;
}

int main()
{
    int m, n;
    read_problem(m, n);

    int result = pow_modulo(m, n, MODULO);
    printf("%d\n", result);

    return 0;
}

Measured memory_bytes: 2720
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

int n, q;
int A[100100];
bool dp[5000];

bool solve(int i, int m) {
	if (i == n) {
		if(m == 0)return dp[m] = true;
		else return false;
	}
	dp[m] |= solve(i + 1, m);
	if (m - A[i] < 0)return dp[m];
	dp[m - A[i]] |= solve(i + 1, m - A[i]);
	return dp[m] || dp[m - A[i]];
}

int main() {
	cin >> n;
	rep(i, n)cin >> A[i];
	solve(0, 0);
	cin >> q;
	rep(i, q) {
		fill(dp, dp + 5000, false);
		int m;
		cin >> m;
		if (solve(0, m))cout << "yes" << endl;
		else cout << "no" << endl;
	}
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;

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

    ll ans = 0;
    if (k <= a + b) ans = min(a, k);
    else ans = a - (k - a - b);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3620
#include<stdio.h>
#include<math.h>
int main() {
	int n, i;
	double m, a, s[1000], sum;
	while (1) {
		a = 0;
		sum = 0;
		scanf("%d", &n);
		if (n == 0) {
			break;
		}
		for (i = 0;i < n;i++) {
			scanf("%lf", &s[i]);
			sum += s[i];
		}
		m = sum / n;
		for (i = 0;i < n;i++) {
			a += (s[i] - m)*(s[i] - m) / n;
		}
		printf("%.8lf\n", sqrt(a));
	}
	return 0;
}

Measured memory_bytes: 668
#include<iostream>
#include<algorithm>
#include<cmath>
typedef long long ll;
using namespace std;

ll power(int a, int b){
    ll powerd = 1;
    for(int i=0; i<b; i++) powerd *= a;
    return powerd; 
}

int main(){
    int N; cin >> N;
    ll A[N], ans = 0;
    int one[60] = {}, count = 0, amari;
    for(int i=0; i<N; i++) cin >> A[i];

    // A[i] = 2進数で2^i桁目が1になる数字の数
    for(int i=0; i<60; i++){
        for(int j=0; j<N; j++){
            one[i] += A[j]%2;
            A[j] = A[j]/2;
        }
    }
    ll x, y, x_1, x_2;
    for(int i=0; i<60; i++){
        if(one[i] == 0) continue;
        x_1 = one[i]%1000000007;
        x_2 = (N-one[i])%1000000007;
        x = x_1*x_2%1000000007;
        y = power(2, i)%1000000007;
        ans += x*y;
        ans = ans%1000000007;
    }
    cout << ans << endl;
}

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

int main() {
  
 string s,t;
  cin >> s >> t;
  
  t.erase(t.end()-1,t.end());
  if ( s == t ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  
}


Measured memory_bytes: 3640
#N個のボールを持ち，K個以下の整数にする
#順当に考えるならば，種類が少ないやつから変更していけばいい
#番号の列をリストで表現
#押し付けきれるとは限らない

counter = 0

condition = list(map(int, input().split()))
A_list = list(map(int, input().split()))

zero_line = [0 for _ in range(200001)]

for i in A_list:
    if zero_line[i] == 0:
        counter += 1
    zero_line[i] += 1

zero_line.sort()
zero_line.reverse()

if counter <= condition[1]:
    print(0)
else:
    print(sum(zero_line[condition[1] :counter]))

Measured memory_bytes: 25876
#include "bits/stdc++.h"
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define repi_(i,a,b) for(int i=(a), i##_len=(b); i<=i##_len; ++i)
#define rep_(i,n) repi_(i,0,n)
#define all(x) (x).begin(),(x).end()
#define vsort(v) sort((v).begin(), (v).end())
#define gsort(v) tsort(v); reverse((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define cnt(v, n) count(all(v), n)
#define vmin(v) *min_element(v.begin(), v.end())
#define vmax(v) *max_element(v.begin(), v.end())
#define el "\n"
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define cosp(x) cout<<(x)<<' '
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#define POSSIBLE(c) coc(c, "POSSIBLE", "IMPOSSIBLE")
#define Possible(c) coc(c, "Possible", "Impossible")
#define possible(c) coc(c, "possible", "impossible")
#define inf INT_MAX
#ifdef tqktmp_2
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))


typedef long long lint;

lint dx[8] = { 0,1,1,1,0,-1,-1,-1 },
dy[8] = { 1,1,0,-1,-1,-1,0,1 };

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



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

	lint a, b, c; cin >> a >> b >> c;
	co(max3(a, b, c) - min3(a, b, c));
	gc();
}


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

  rep(i, n){
    cin >> a[i];
    if(a[i] == 0){ ans = 0; break;}
  }
  
  rep(i, n){
    if(ans == 0) break;
    if(1000000000000000000/a[i] >= ans) ans *= a[i];
    else {ans = -1; break;}
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4048
#include<stdio.h>
#include<ctype.h>
#include <cstring>
char s[201] = {};
char p[101] = {};
char t[101] = {};

int main(void){
    scanf("%s", &s);
    scanf("%s", &p);
    strcpy(t, s);
    strcat(s, t);
    if (strstr(s, p)) printf("Yes\n");
    else printf("No\n");
  
    return 0;
}

Measured memory_bytes: 2640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }

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

  int n;
  cin >> n;
  vi w(n);
  rep(i, n) cin >> w[i];

  int ans = 100000000;
  int sum = 0;
  int cnt = 0;
  rep(i, n) {
    sum += w[i];
  }

  rep(i, n-1) {
    cnt += w[i];
    cmin(ans, abs(cnt-(sum-cnt)));
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a = sc.nextInt();

		boolean isOk = (n % 500) <= a;
		System.out.println(isOk ? "Yes" : "No");

		sc.close();
	}
}


Measured memory_bytes: 22484
import sys

def solve(n, lst_a):
    i=max(lst_a)
    ii=min(lst_a)
    answer = i-ii
    return answer

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <utility>
using namespace std;

int main(){
  int a, b;
  cin >> a >> b;
  int c = b - a;
  int res = (c * (c + 1)) / 2;
  cout << res - b << endl;
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
c=0
all=sum(A)
buf=all
A1=[]
A2=[]
s1=0
s2=0
c=float("inf")
for i in range(N-1):
    buf=buf-A[i]
    if c>abs((all-buf)-buf):
        c=abs((all-buf)-buf)
    else:
        break
print(c)


Measured memory_bytes: 88016
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
mix = lambda x:list(li() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(n,v):
    v = sorted(v)
    res = (v[0]+v[1])/2
    for i in range(2, n):
        res = (res + v[i]) / 2
    print(res)

n = ii()
v = mi()
main(n,v)

Measured memory_bytes: 3064
/// 7:00 PM 13/05/20
/// Author: t_bone_289 (An Immature Programmer.... I'm still developing !!)
#include<bits/stdc++.h>

using namespace std;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define endl '\n'
#define VARIABLE_ERROR(x) cout << #x << " = " << x << endl;
#define CONTAINER_ERROR(v) cout << "{";for (auto &x:v) { cout << x << ','; }cout << "}" << endl;
#define PI 3.14159265358979323846
#define M 1000000007
#define INF 1e15
typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n, c;
    cin >> n >> c;
    vector<pll > forward(n);
    for (auto &x:forward) {
        cin >> x.fi >> x.se;
    }
    vector<pll > backward(forward);
    for (auto &x:backward) {
        x.fi = c - x.fi;
    }
    ll ans = INF;
    vector<ll> energyForward(n, 0);
    for (ll i = 0; i < n; i++) {
        energyForward[i] = 0;
        if (i > 0) {
            energyForward[i] += energyForward[i - 1];
        }
        energyForward[i] += forward[i].se;
    }
    vector<ll> energyBackward(n, 0);
    for (ll i = n - 1; i >= 0; i--) {
        energyBackward[i] = 0;
        if (i < n - 1) {
            energyBackward[i] += energyBackward[i + 1];
        }
        energyBackward[i] += backward[i].se;
    }
    for (ll i = 0; i < n; i++) {
        energyForward[i] -= forward[i].fi;
    }
    for (ll i = 0; i < n; i++) {
        energyBackward[i] -= backward[i].fi;
    }
    ll mv = -INF;
    vector<ll> maxLeft(n);
    vector<ll> maxRight(n);
    maxLeft[0] = energyForward[0];
    for (ll i = 1; i < n; i++) {
        maxLeft[i] = max(maxLeft[i - 1], energyForward[i]);
    }
    maxRight[n - 1] = energyBackward[n - 1];
    for (ll i = n - 2; i >= 0; i--) {
        maxRight[i] = max(maxRight[i + 1], energyBackward[i]);
    }
    for (ll i = 0; i < n; i++) {
        ll curr = energyForward[i];
        mv = max(curr, mv);
        if (i < n - 1) {
            ll back = maxRight[i + 1];
            back -= forward[i].fi;
            back += curr;
            mv = max(mv, back);
        }
    }
    for (ll i = n - 1; i >= 0; i--) {
        ll curr = energyBackward[i];
        mv = max(curr, mv);
        if (i > 0) {
            ll front = maxLeft[i - 1];
            front -= backward[i].fi;
            front += curr;
            mv = max(mv, front);
        }
    }
    mv = max(mv, 0ll);
    cout << mv;
    return 0;
}

Measured memory_bytes: 9524
import java.util.Scanner;

public class Main {
	static int cnt=0;
	static long s;
	public static void dfs(long x,long y,long z,long w)
	{
		if(y>0&&z>0&&w>0&&x<=s) cnt++;
		if(x*10<s)
		{
			dfs(x*10+3,y+1,z,w);
			dfs(x*10+5,y,z+1,w);
			dfs(x*10+7,y,z,w+1);
		}
		
	}
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		s=in.nextLong();
		dfs(0,0,0,0);
		System.out.println(cnt);
		in.close();
	}
}

Measured memory_bytes: 23764
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

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



int main(){
    int n, q; cin >> n >> q;
    vector<stack<int>> A(n);
    REP(i, q){
        int op; cin >> op;
        int d, x;
        switch(op){
            case 0:
                cin >> d >> x;
                A[d].push(x);
                break;
            case 1:
                cin >> d;
                if(!A[d].empty())
                    cout << A[d].top() << "\n";
                break;
            case 2:
                cin >> d;
                if(!A[d].empty())
                    A[d].pop();
        }
    }
    return 0;
}



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

using namespace std;

int main(){
    int h,w,a,b;
    cin>>h>>w>>a>>b;
    /*
    if(min(a,b)==0){
        if(a==0){
            if(w==1){
                for (int i = 0; i < b; ++i) {
                    cout<<0<<endl;
                }
                for (int j = b; j < h; ++j) {
                    cout<<1<<endl;
                }
            }
            else{
                for (int i = 0; i < h; ++i) {
                    for (int j = 0; j < w; ++j) {
                        if(i<b)cout<<1;
                        else cout<<0;
                    }
                    cout<<endl;
                }
            }
        }
        else{
            if(h==1){
                for (int i = 0; i < a; ++i) {
                    cout<<0;
                }
                for (int j = a; j < w; ++j) {
                    cout<<1;
                }
            }
            else{
                for (int i = 0; i < h; ++i) {
                    for (int j = 0; j < w; ++j) {
                        if(j<a)cout<<1;
                        else cout<<0;
                    }
                    cout<<endl;
                }
            }

        }
        return 0;
    }
     */
    vector<vector<int>> ans(h,vector<int>(w,0));
    for (int i = 0; i < b; ++i) {
        for (int j = 0; j < a; ++j) {
            ans[i][j]=1;
        }
    }
    for (int i = b; i < h; ++i) {
        for (int j = a; j < w; ++j) {
            ans[i][j]=1;
        }
    }
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            cout<<ans[i][j];
        }
        cout<<endl;
    }
    return 0;
}

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

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

long long MOD = 1000000000 + 7;

int main(){
  cout << setprecision(10);
  int N,K; cin >> N >> K;
  int ans = 0;
  for(int i = 0; i< N ; i++){
    int tmp; cin >> tmp;
    if(tmp >= K) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3636
#pragma GCC optimize("Ofast") 
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> PII;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
typedef vector<vector<ll>> VII;
ll gcd(ll A,ll B) {if(!B)return A;return gcd(B,A%B);}
ll dp[3001][3001];
int main()
{
	int n;
	cin>>n;
	dp[1][1] = 1;
	string s;
	cin>>s;
	for(int len=2;len<=n;len++){
			vector<ll>pref(len+1,0);
			for(int i=1;i<len;i++){
				pref[i] =dp[len-1][i]+pref[i-1];
			}		
		for(int b=1;b<=len;b++){
			if(s[len-2] == '<'){
				dp[len][b] = pref[b-1];
			}else{
			    dp[len][b] = pref[len-1]-pref[b-1];
			}
			dp[len][b]%=MOD;
		}
	}
	ll ans=0;
	for(int i=1;i<=n;i++)ans+=dp[n][i];
	ans%=MOD;
	cout<<ans;
}


Measured memory_bytes: 49772
N = int(input())
d_list = []
Height = 0
for i in range(N):
    d_list.append(int(input()))
while d_list != []:
    MAX_Value = max(d_list)
    while MAX_Value == max(d_list):
        d_list.remove(MAX_Value)
        if d_list == [] :
            break
    Height +=1
print(Height)

Measured memory_bytes: 9120
#include <cstdio>
#include <map>
#include <vector>
#include <algorithm>

typedef std::pair<int,int> Entrant;

bool descending_Entrant(const Entrant& e1, const Entrant& e2){
	return e1.second > e2.second;
}

int main(){
	int num, points;
	std::vector<Entrant> v;
	std::map<int,int> m;
	while(scanf("%d,%d", &num, &points), num){
		v.push_back(Entrant(num, points));
	}

	std::sort(v.begin(), v.end(), descending_Entrant);

	int rank = 1;
	for(int i=0;i<v.size();i++){
		m[v[i].first] = rank;
		if(i+1 < v.size() && v[i].second != v[i+1].second)rank++;
	}

	int n;
	while(~scanf("%d", &n)){
		printf("%d\n", m[n]);
	}
}

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

int main() {
  int N,i;
  cin >> N;
  vector<int> A(N), B(N);

  for(i=0; i<N; i++) {
    cin >> A.at(i);
    B.at(A.at(i)-1) = i+1;
  }

  for(i=0; i<N; i++)
    cout << B.at(i) << " ";
  cout << endl;
}

Measured memory_bytes: 1664
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            sample[] SP = new sample[N];
            for (int i = 0; i < N; i++)
            {
                string[] inpval = Console.ReadLine().Split(' ');
                SP[i] = new sample { index = i + 1, city = inpval[0], score = int.Parse(inpval[1]) };
            }

            SP = SP.OrderBy(z => z.city).ThenByDescending(x => x.score).ToArray();

            for (int p = 0; p < N; p++)
            {
                Console.WriteLine(SP[p].index);
            }
        }
        class sample
        {
            public int index { get; set; }
            public string city { get; set; }
            public int score { get; set; }
        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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

char alpha[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'};

int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(){
    ll a, b, c; cin >> a >> b >> c;
    if(a != 1 && a == b && b == c){
        cout << -1 << endl;
        return 0;
    }
    int count = 0;
    while(1){
        if(a % 2 == 0 && b % 2 == 0 && c % 2 == 0){
            count++;
            ll ha = a/2, hb = b/2, hc = c/2;
            a = hb+hc; b = ha+hc; c = ha+hb;
        }else{
            break;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
A,B = map(int,input().split())
if A <= 0 <= B:
    print('Zero')
    exit()

if 0 < A:
    print('Positive')
elif B < 0:
    c = B-A+1
    print('Negative' if c%2 else 'Positive')
else:
    c = -A
    print('Negative' if c%2 else 'Positive')

Measured memory_bytes: 3060
n = int(input())
s = input()
s_min = s[1:].count("E")
s_now = s[1:].count("E")

for i in range(1,n):
    if s[i-1] == "E" and s[i] == "E":
        s_now -= 1
    if s[i-1] == "W" and s[i] == "W":
        s_now += 1
    s_min = min(s_min, s_now)
print(s_min)

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

int main(){
    int n;
    cin >> n;
    vector<int> h(n+10,0);
    for(int i = 1; i <= n; i++){
        cin >> h[i];
    }
    int ans = 0;
    int ma = 0;
    for(int i = 1; i <= n; i++){
        if(ma <= h[i]){
            ans++;
        }
        ma = max(ma,h[i]);
    }
    cout << ans << endl;
}

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

using namespace std;

int n;
int a[105];

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  int ac=0,wa=0,tle=0,re=0;
  int n;cin>>n;
  rep(i,n){
    str s;
    cin>>s;
    if(s=="AC")ac++;
    if(s=="WA")wa++;
    if(s=="TLE")tle++;
    if(s=="RE")re++;
  }
  cout<<"AC x "<<ac<<endl;
  cout<<"WA x "<<wa<<endl;
  cout<<"TLE x "<<tle<<endl;
  cout<<"RE x "<<re<<endl;
  return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#include<vector>

using namespace std;

bool LinearSearch(vector<int> S,int key)
{
	int i = 0;
	while(i != S.size()){
		if(S[i] == key){
			return true;
		}
		i++;
	}
	return false;
}

int main()
{
	int n;
	int q;
	int count = 0;
	int i = 0;
	vector<int> S;
	
	cin >> n;
	while(S.size() != n){
		int i;
		cin >> i;
		S.push_back(i);
	}
	
	cin >> q;
	while(i != q){
		i++;
		int key;
		cin >> key;
		if(LinearSearch(S,key) == true)count++;
	}
	cout << count << endl;
}

Measured memory_bytes: 1320
using System;
using System.Collections.Generic;
//using System.Collections;
using System.Linq;

namespace solution
{
  class Class1
  {
    static void Main()
    {
      List<int> dice1 = new List<int>() { 0 };
      List<int> dice2 = new List<int>() { 0 };

      int[] num1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
      int[] num2 = Console.ReadLine().Split().Select(int.Parse).ToArray();

      dice1 = dice1.Concat(num1).ToList();
      dice2 = dice2.Concat(num2).ToList();

      Dice d1 = new Dice(dice1);
      Dice d2 = new Dice(dice2);

      string[] dir = new string[] { "", "E", "NE", "SE", "W", "EE" };
      string flag = "No";
      foreach (var x in dir)
      {
        dice2 = new List<int>() { 0 }.Concat(num2).ToList();
        d2 = new Dice(dice2);
        d2.Roll(x);
        flag = new Class1().Check(d1, d2);
        if (flag == "Yes") break;
      }
      Console.WriteLine(flag);
    }

    public string Check(Dice d1, Dice d2)
    {
      string ss = "No";
      for (int k = 0; k < 4; k++)
      {
        int count = 0;
        for (int i = 1; i <= 6; i++)
        {
          if (d1.face[i] == d2.face[i]) count++;
        }
        if (count == 6) { ss = "Yes"; break; }
        d2.Roll("N");
      }
      return ss;
    }
  }

  public class Dice
  {
    public List<int> face = new List<int>();
    public Dice(List<int> face)
    {
      this.face = face;
    }
    public void Roll(string r)
    {
      int temp;
      char[] c = r.ToArray();
      foreach (var x in c)
      {
        switch (x)
        {
          case 'N':
            temp = face[1]; face[1] = face[2]; face[2] = face[6]; face[6] = face[5]; face[5] = temp;
            break;
          case 'E':
            temp = face[1]; face[1] = face[4]; face[4] = face[6]; face[6] = face[3]; face[3] = temp;
            break;
          case 'W':
            temp = face[1]; face[1] = face[3]; face[3] = face[6]; face[6] = face[4]; face[4] = temp;
            break;
          case 'S':
            temp = face[1]; face[1] = face[5]; face[5] = face[6]; face[6] = face[2]; face[2] = temp;
            break;
        }
      }
    }
  }
}








Measured memory_bytes: 9404
# -*- coding:utf-8 -*-
"""解説

(例)
T0 = 2
T1 = 3

直感的に、最小公倍数が答え。
よって6。
"""
from fractions import gcd
from functools import reduce


def lcm(a, b):
    """ aとbの最小公倍数を返す """
    return a*b // gcd(a, b)

def solve():
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    ans = reduce(lcm, T)
    print(ans)


if __name__ == "__main__":
    solve()


Measured memory_bytes: 5116
#include<bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007
#define Vi vector<int>
#define Vl vector<long long>
#define pb(a) push_back(a)

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=100000000001;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct edge{int to,cost;};
struct pos{
	int x,y,cost;
};
ll gcd(ll a2,ll b2){
	int t;
	while(b2!=0){
		t=a2%b2;
		a2=b2;
		b2=t;
	}
	return a2;
}
ll lcm(ll a1,ll b1){
	if(a1*b1==0){return 0;}
	return (a1*b1/gcd(a1,b1));
}


int main() {

	string s;
	cin>>s;
	rrep(i,s.size()){
		cout<<s[i];
	}
	cout<<endl;

	return 0;
}



Measured memory_bytes: 3148
/* ****TCIITB**** */

#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

#define N  100005

int main()
{
	
	io
	
	ll n;
	cin>>n;
	ll vis[n+1]={0};
	std::map<ll,ll> edge[n+1];
	if((n%2))
	{
		rep(i,1,n+1)
		{
			if(vis[i])
				continue;
			ll z1=i;
			ll z2=(n-i);
			edge[z1][z2]++;
			edge[z2][z1]++;
			vis[z1]=1;
			vis[z2]=1;
		}
	}
	else
	{
		rep(i,1,n+1)
		{
			if(vis[i])
				continue;
			ll z1=i;
			ll z2=(n-i+1);
			edge[z1][z2]++;
			edge[z2][z1]++;
			vis[z1]=1;
			vis[z2]=1;
		}
	}
	std::map<pair<ll,ll>,ll> zz;
	std::vector<pair<ll,ll>> res;
	rep(i,1,n+1)
	{
		rep(j,1,n+1)
		{
			if(j==i)
				continue;
			if(!edge[i][j])
			{
				if(zz[{i,j}] || zz[{j,i}])
					continue;
				res.pb({i,j});
				zz[{i,j}]++;
				zz[{j,i}]++;
			}
		}
	}
	cout<<res.size()<<endl;
	for(auto i:res)
	{
		cout<<i.F<<" "<<i.S<<endl;
	}
}

Measured memory_bytes: 1584
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

constexpr const int N_MAX = 100010;
constexpr const int sqrtN = 200;

int N, K;
int a[N_MAX];
int b[N_MAX / sqrtN + 1];

void build()
{
  for (int i = 1; i <= N; ++i) {
    b[i / sqrtN] = __gcd(b[i / sqrtN], a[i]);
  }
}

int query(int l, int r)
{
  int ret = 0;
  while(l < r && l % sqrtN != 0) ret = __gcd(ret, a[l++]);
  while(l < r && r % sqrtN != 0) ret = __gcd(a[--r], ret);

  for (int i = l/sqrtN; i < r/sqrtN; ++i) {
    ret = __gcd(ret, b[i]);
  }

  return ret;
}

signed main()
{
  iostreamBooster();

  cin >> N;
  K = (N + sqrtN - 1) / sqrtN;

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

  build();

  int maxv = 0;
  for (int i = 1; i <= N; ++i) {
    chmax(
        maxv,
        __gcd(query(1, i), query(i+1, N+1))
    );
  }

  cout << maxv << endl;


  return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#define FOR(i,b,e) for (common_type_t<decltype(b),decltype(e)> i = (b), i ## __end = (e); i < i ## __end; ++ i)
#define rep(i,n)   FOR (i, size_t{}, n)
#define ALL(x)     begin (x), end (x)
using namespace std;
using ll = int64_t;
constexpr ll inf = 2e18;

auto main () -> int
{
  cin.tie (nullptr);
  ios::sync_with_stdio (false);

  size_t n;
  cin >> n;
  vector <size_t> ans (n + 1);
  rep (i, n)
  {
    size_t a;
    cin >> a;
    ans [a] = i + 1;
  }
  copy (next (begin (ans)), end (ans), ostream_iterator <iterator_traits <decltype (begin (ans))>::value_type> (cout, " "));
  cout << endl;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 100000000

//aのb乗
int beki(int a,int b,int M = modulo){
	int x = 1;
	while(b!=0){
		if(b&1){
			x=((long long)x*a)%M;
		}
		a=((long long)a*a)%M;
		b>>=1;
	}
	return x;
}


//aの逆元
int gyakugen(int a){
	return beki(a,modulo-2);
}

struct combi{
	deque<int> kaijou;
	deque<int> kaijou_;
	
	combi(int n){
		kaijou.push_back(1);
		for(int i=1;i<=n;i++){
			kaijou.push_back(mod(kaijou[i-1]*i));
		}
		
		int b=gyakugen(kaijou[n]);
		
		kaijou_.push_front(b);
		for(int i=1;i<=n;i++){
			int k=n+1-i;
			kaijou_.push_front(mod(kaijou_[0]*k));
		}
	}
	
	int combination(int n,int r){
		if(r>n)return 0;
		int a = mod(kaijou[n]*kaijou_[r]);
		a=mod(a*kaijou_[n-r]);
		return a;
	}
	
	int junretsu(int a,int b){
		int x = mod(kaijou_[a]*kaijou_[b]);
		x=mod(x*kaijou[a+b]);
		return x;
	}
	
	int catalan(int n){
		return mod(combination(2*n,n)*gyakugen(n+1));
	}
	
};

int main() {
	
	int N,A,B,C,D;
	cin>>N>>A>>B>>C>>D;
	combi c(10000);
	
	vector<vector<int>> dp(N+2,vector<int>(N+1,0));
	dp[0][0] = 1;
	
	for(int i=0;i<=N;i++){
		for(int j=0;j<=N;j++){
			dp[i+1][j] = mod(dp[i][j]+dp[i+1][j]);
			if(i>=A&&i<=B){
				int temp = N-j;
				int t = 1;
				for(int k=1;k<=D;k++){
					if(temp<i)break;
					t = mod(t * c.combination(temp,i));
					int x = mod(t * c.kaijou_[k]);
					if(k>=C)dp[i+1][j+k*i] = mod(dp[i+1][j+k*i] + mod(x*dp[i][j]));
					temp-=i;
				}
			}
		}
	}
	
	cout<<dp.back().back()<<endl;
	
    return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
typedef map<lint,lint> M;
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 

  int main(){
     lint n;
     cin >>n; vector<lint> a(n);
     rep(i,n)cin >> a[i];
     lint ans=0;
     lint mx=0;
     rep(i,n){
         if(mx>a[i])ans+=(mx-a[i]);
         mx=max(mx,a[i]);
     }
     cout<<ans<<endl;
  }
      
    
  

Measured memory_bytes: 4748
#include<stdio.h>

void insertionSort(int A[], int n){
	int i,j,k;
	int v;
	for(i=1;i<n;i++){
		v=A[i];
		j=i-1;
		while(j>=0 && A[j]>v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		for(k=0;k<n-1;k++) printf("%d ",A[k]);
		printf("%d",A[k]);
		printf("\n");
	}
}

int main(void)
{
	int N;
	scanf("%d",&N);
	int Num[N];
	int i;
	for(i=0;i<N;i++) scanf("%d",&Num[i]);
	for(i=0;i<N-1;i++) printf("%d ",Num[i]);
    printf("%d",Num[i]);
	printf("\n");
	insertionSort(Num,N);
	return 0;
}

Measured memory_bytes: 1796
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons;

void main()
{
    auto hw = readln.split.to!(int[]);
    auto H = hw[0];
    auto W = hw[1];

    wchar[][] PIC;
    PIC.length = H;
    foreach (ref line; PIC) {
        line = readln.chomp.to!(wchar[]);
    }

    foreach (i, line; PIC) {
        foreach (j, p; line) {
            if (p == '#') {
                wchar[] cs = "....".to!(wchar[]);
                if (i > 0) cs[0] = PIC[i-1][j];
                if (i < H-1) cs[1] = PIC[i+1][j];
                if (j > 0) cs[2] = PIC[i][j-1];
                if (j < W-1) cs[3] = PIC[i][j+1];
                if (cs == "....") {
                    writeln("No");
                    return;
                }
            }
        }
    }
    writeln("Yes");
}

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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    for (int i = 0; i < n; i++) {
        cout << 'x';
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
//#pragma warning disable
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System;
using System.Numerics;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
class Z { static void Main() => new K(); }
class K
{
	int F() => int.Parse(ReadLine());
	long FL() => long.Parse(ReadLine());
	int[] G() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	long[] GL() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
	public const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Console.WriteLine(Solve());
		Out.Flush();
	}
	long Solve()
	{
		var S = Console.ReadLine();
		var s = S.Select(c => c - 'a').ToArray();
		var N = S.Length;
		var cnt = new int[26];
		foreach (var c in s) cnt[c]++;
		var odd = 0;
		foreach (var c in cnt) if (c % 2 == 1) odd++;
		if (odd > 1) return -1;
		var center = -1;
		if (odd > 0) for (var c = 0; c < 26; c++) if (cnt[c] % 2 == 1) cnt[center = c]--;
		for (var c = 0; c < 26; c++) cnt[c] /= 2;
		var half = N / 2;
		var left = new List<int>();
		foreach (var c in s) if (cnt[c] > 0) { cnt[c]--; left.Add(c); }
		var t = new int[N];
		for (var i = 0; i < left.Count; i++) t[N - 1 - i] = t[i] = left[i];
		if (center >= 0) t[N / 2] = center;
		var ind = new int[26];
		var p = new int[N];
		for (var i = 0; i < N; i++)
		{
			var c = s[i];
			while (t[ind[c]] != c) ind[c]++;
			p[i] = ind[c]++;
		}
		//return Distance(s, t);
		return Inversion(p);
	}
	long Distance(int[] s, int[] t)
	{
		var N = s.Length;
		var ans = 0L;
		for (var c = 0; c < 26; c++)
		{
			int a = 0, b = 0;
			while (true)
			{
				while (a < N && s[a] != c) a++;
				if (a >= N) break;
				while (b < N && t[b] != c) b++;
				ans += Abs(a++ - b++);
			}
		}
		return ans / 2;
	}
	long Inversion(int[] s)
	{
		var ans = 0L;
		var bit = new BITSet(s.Length);
		for (var j = 0; j < s.Length; j++)
		{
			ans += j - bit.GetRank(s[j]);
			bit.Add(s[j]);
		}
		return ans;
	}
}
class BinaryIndexedTree
{
	public readonly int Size;
	readonly int[] bit;
	public BinaryIndexedTree(int size) { Size = size; bit = new int[size + 1]; }
	public void Add(int index, int value) { for (var i = index + 1; i <= Size; i += i & (-i)) bit[i] += value; }
	public int Sum(int from, int to) => Sum(to) - Sum(from);
	int Sum(int to) { var sum = 0; for (var i = to; i > 0; i -= i & (-i)) sum += bit[i]; return sum; }
}
class BITSet : BinaryIndexedTree
{
	public BITSet(int size) : base(size) { }
	public void Add(int item) => Add(item, 1);
	public bool Contains(int item) => Sum(item, item + 1) > 0;
	public int Count(int item) => Sum(item, item + 1);
	// 順位 = item が小さい方から何番目か(0-indexed)
	public int GetRank(int item) => Sum(0, item);
	public void Remove(int item) => Add(item, -1);
	public void RemoveAll(int item) => Add(item, -Count(item));
	/*// 0-indexed で順位が rank のものを求める
	// ない場合は Size が返る
	public int GetValue(int rank) => Func.FirstBinary(0, Size, t => Sum(0, t + 1) >= rank + 1);*/
}


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

pub fn read<T: FromStr>() -> T {
  let stdin = 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")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let a = read::<i64>();
  let b = read::<i64>();

  let mut memo = vec![0; 1000];
  let mut total = 0;

  for i in 1..1000 {
    total += i;
    memo[i - 1] = total;
  }
  println!("{}", memo[(b - a) as usize - 1] - b as usize);
}



Measured memory_bytes: 4352
n,m=map(int,input().split())
g=[[] for i in range(n)]
for _ in range(m):
    a, b = [int(x) for x in input().split()]
    g[a-1].append(b)
    g[b-1].append(a)
from collections import deque
x=[0]*n
s=1
for i in range(1,n+1):
    if x[i-1]==0:
        x[i-1]=s
        q=deque([i])
        while q:
            v = q.popleft()
            for j in g[v-1]:
                if x[j-1]==0:
                    q.append(j)
                    x[j-1]=s
        s+=1
print(s-2)

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

int main() {
  int A, B;
  cin >> A >> B;
  
  int total = 0;
  
  for (int i = A; i <= B; i++) {
    if (i % 10 == i % 100000 / 10000 && i % 100 / 10 == i % 10000 / 1000) total++;
  }
  
  cout << total << endl;
}

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

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

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& vec){
    if(!vec.empty()){
        ostr << vec.front();
        for(auto itr = ++vec.begin(); itr != vec.end(); itr++)
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& mat){
    if(!mat.empty()){
        ostr << mat.front();
        for(auto itr = ++mat.begin(); itr != mat.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

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

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& mat){
    if(!mat.empty()){
        ostr << mat.front();
        for(auto itr = ++mat.begin(); itr != mat.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
// vll x(n); x[i]=a;
typedef vector<pair<ll,ll>> vpll;
// vpll x(n); x[i]={a,b}; x[i].first/second;
typedef vector<vector<ll>> vvll;
// vvll x(m,vi(n)); x[i][j]=a;

#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORR(i,a,b) for(ll i=(b)-1; i>=(a); i--)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()
// sort(all(x));

int main(){
    ll a, b;
    cin >> a >> b;
    if(b >= 0){
        if(a+b > a*b) cout << a+b << endl;
        else cout << a*b << endl;
    }
    else{
        if(a-b > a*b) cout << a-b << endl;
        else cout << a*b << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define st first
#define nd second
#define mp make_pair
#define pii pair<int,int>

using namespace std;



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

    int x; cin>>x;
    if(x==0) cout<<1;
    else cout<<0;

    return 0;

}



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



int main(){
  
  int N,M;
  cin>>N>>M;
  vector<int> vec(N+1);
  vector<int> cal(N+1);
  for(int i=1;i<=N;i++){
    cin>>vec.at(i);
  }
  for(int i=0;i<M;i++){
    int A,B;
    cin>>A>>B;
    if(vec.at(A)>vec.at(B)) cal.at(B)+=1;
    else if(vec.at(A)<vec.at(B)) cal.at(A)+=1;
    else{
      cal.at(A)+=1;
      cal.at(B)+=1;
    }
  }
  int sum=0;
  for(int i=1;i<=N;i++){
    if(cal.at(i)==0) sum+=1;
  }
  cout<<sum<<endl;
  
 
  
}
  

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a = 0;
	for(int i=1;i<10 && i<=n;++i) ++a;
	for(int i=100;i<1000 && i<=n;++i) ++a;
	for(int i=10000;i<100000 && i<=n;++i) ++a;
	cout << a <<endl;
	return 0;
}

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

int main() {
  int n;
  cin>>n;
  vector<int>vec(n);
  for(int i=0;i<n;i++){
    cin>>vec[i];
  }
  int cnt=0;
   for(int i=0;i<n;i++){
      if(i==n-2)break;
     if(vec[i]<vec[i+1]&&vec[i+1]<vec[i+2])cnt++;
     if(vec[i]>vec[i+1]&&vec[i+1]>vec[i+2])cnt++;
   }
  cout<<cnt<<endl;
}

Measured memory_bytes: 256