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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}


int main(){
  int K; cin >> K;

  ll now = 0;
  for (int i = 1; i <= int(1e7); i++){
    now *= 10; now += 7; now %= K;
    if (now == 0){
      cout << i << endl;
      return 0;
    }
  }
  cout <<-1 << endl;

  return 0;
}


Measured memory_bytes: 3632
"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const x = BigInt(spi[0]);

    let val = 100n, ans = 0;
    while (val < x) {
        val = (val*101n)/100n;
        ans++;
    }

    console.log(ans);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29692
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
#include<tuple>
#include<stdio.h>
 
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
 
#define shosu setprecision(10)
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Q;
ll longinf=1ll<<60;
int inf=1<<29;
int dh[]={1,-1,0,0};
int dw[]={0,0,1,-1};
//mleしなければぜんぶllでかく。

int main(){
      cin.tie(0);
      ios::sync_with_stdio(false);
      int n,k;
      cin>>n>>k;
      if(n>=2*k-1){
            cout<<"YES"<<endl;
      }
      else cout<<"NO"<<endl;
      
      return 0;
}

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

using namespace std;

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

int main(){
    string s,t;
    cin >> s >> t;
    sort(s.begin(),s.end());
    sort(t.rbegin(),t.rend());

    if(s<t){
        cout << "Yes";
    }else{
        cout << "No";
    }

}

Measured memory_bytes: 256
let readString() = stdin.ReadLine()
let readStringArray() = stdin.ReadLine().Split(' ');
let readInt() = readString() |> int
let readIntArray() = readStringArray() |> Array.map(fun x -> int x)
let char2String(value) = List.ofSeq value |> List.toArray |> System.String


let s = readString();
let rec f str current num =
    if num >= 3 then 
        num
    else 
        match str with 
        | h::t -> if h = current then f t h (num + 1) else f t h 1
        | _ -> 0

f (List.ofSeq s) (Seq.head s) 0
|> fun x -> if x >= 3 then "Yes" else "No"
|> printfn "%s"

Measured memory_bytes: 14812
#define LOCAL

#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <cmath>

using namespace std;

// From Errichto's Youtube stream
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using int64 = long long;

/////////////////////
// Code starts here//
/////////////////////
const double INF = 1e12;

struct Circle {
    int x, y, r;
};

vector<Circle> circles;

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

    int xa, ya, xb, yb, xc, yc, r;
    int N;
    cin >> xa >> ya >> xb >> yb;
    
    cin >> N;

    circles.push_back(Circle{xa, ya, 0});
    for (int i = 0; i < N; i++) {
        cin >> xc >> yc >> r;
        circles.push_back(Circle{xc, yc, r});
    }
    circles.push_back(Circle{xb, yb, 0});

    N += 2;

    vector<double> dist(N, INF);
    vector<char> seen(N);

    dist[0] = 0;

    for (int steps = 0; steps < N; steps++) {
        auto el = min_element(dist.begin(), dist.end()) - dist.begin();
        auto d = dist[el];

        seen[el] = true;
        dist[el] = INF;
        //debug() << el << " " << d;

        if (el == N - 1) {
            cout << setprecision(10) << d << "\n";
            return 0;
        }

        for (int i = 0; i < N; i++) {
            if (!seen[i]) {
                auto cost = hypot(1.0 * circles[i].x - circles[el].x, 1.0 * circles[i].y - circles[el].y);
                double common = circles[i].r + circles[el].r;
                if (cost >= common) {
                    cost = abs(cost - common);
                } else {
                    cost = 0;
                }

                if (dist[i] > d + cost) {
                    dist[i] = d + cost;
                }
            }
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (true) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      return 0;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 3640
#include "bits/stdc++.h"
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
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 T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, INF = 1e18;


lint D, M, d, q;
lint decrease[26];
lint satis[365][26];
lint last[26];
lint t[365];

lint downscore(lint passed) {
	lint sum = 0;
	REP(i, 26) {
		sum += decrease[i] * (passed - last[i]);
	}
	return -sum;
}

int main() {
	cin >> D;
	REP(i, 26) {
		cin >> decrease[i];
	}
	REP(i, D) {
		REP(j, 26) {
			cin >> satis[i][j];
		}
	}

	lint score = 0;
	REP(i, D) {
		cin >> t[i]; t[i]--;
	}
	cin >> M;
	REP(i, M) {
		lint score = 0;
		REP(i, 26) last[i] = 0;
		cin >> d >> q; d--; q--;
		t[d] = q;
		REP(i, D) {
			last[t[i]] = i + 1;
			score += satis[i][t[i]];
			score += downscore(i + 1);
		}
		cout << score << endl;
	}
}


Measured memory_bytes: 3580
import java.lang.Math.abs
import java.lang.Math.min
import java.util.*

fun main(args: Array<String>) {
    try {
        val sc = Scanner(System.`in`)
        val n = sc.nextInt()
        if (n < 2 || n > 100000) {
            throw Exception("Unexpected input.")
        }
        val hs = IntArray(n)
        for (i in 0 until n) {
            hs[i] = sc.nextInt()
        }
        val c = calcMinCost3(hs)
        println(c)
    } catch (e: Exception) {
        println(e)
    }
}

fun calcMinCost3(hs: IntArray): Int {
    val cs = IntArray(hs.size)
    cs[0] = 0
    cs[1] = abs(hs[0] - hs[1])
    for (i in 2 until hs.size) {
        cs[i] = min(
                cs[i - 2] + abs(hs[i - 2] - hs[i]),
                cs[i - 1] + abs(hs[i - 1] - hs[i])
        )
    }
    return cs[hs.size - 1]
}


Measured memory_bytes: 49844
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    long k;
    if(a>=b){
      k = b;
    }else{
      k = a;
    }
    for(long x =k ; x>=1 ; x--){
      if(a%x==0 && b%x==0){
        Long l;
        l = (a*b)/x;
        System.out.println(l);
        break;
      }
    }

  }
}


Measured memory_bytes: 23252
#include <cstdio>
#include <sstream>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <iostream>
#include <fstream>
#include <numeric>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <iterator>
#include <iomanip>
#include <unordered_map>

using namespace std;

#define ll long long int



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a,b,c;
    cin>>a>>b>>c;
    cout<<c<<" "<<a<<" "<<b;    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long a[100000];
int main()
{
    int b,c;
    long long d=1000000000;
    cin>>b>>c;
    for(int i=0;i<b;i++){
        cin>>a[i];
    }
    sort(a,a+b);
    for(int j=0;j<b-c+1;j++){
        if(d>a[j+c-1]-a[j]){
            d=a[j+c-1]-a[j];
        }
    }
    cout<<d;
    return 0;
}

Measured memory_bytes: 1024
import java.awt.Point;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	static boolean[] visited;

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

		int n = sc.nextInt();
		ArrayList<ArrayList<Integer>> arr = new ArrayList<>(n+10);
		for (int i = 0; i < n; i++) {
			arr.add(new ArrayList<Integer>());
		}

		for (int i = 0; i < n - 1; i++) {
			int from = sc.nextInt() - 1;
			int to = sc.nextInt() - 1;
			arr.get(from).add(to);
			arr.get(to).add(from);
		}

		visited = new boolean[n];
		int[] FDiff = new int[n];
		int[] SDiff = new int[n];

		ArrayDeque<Point> deq = new ArrayDeque<>();
		deq.add(new Point(0, 0));

		while (!deq.isEmpty()) {
			Point p = deq.poll();
			if (visited[p.x])
				continue;
			FDiff[p.x] = p.y;
			visited[p.x] = true;
			ArrayList<Integer> Edges = arr.get(p.x);
			for (int i = 0; i < Edges.size(); i++) {
				int to = Edges.get(i);
				if (!visited[to]) {
					deq.add(new Point(to, p.y + 1));
				}
			}
		}

		deq = new ArrayDeque<>();
		visited = new boolean[n];
		deq.add(new Point(n - 1, 0));
		while (!deq.isEmpty()) {
			Point p = deq.poll();
			if (visited[p.x]) {
				continue;
			}
			SDiff[p.x] = p.y;
			visited[p.x] = true;
			ArrayList<Integer> Edges = arr.get(p.x);
			for (int i = 0; i < Edges.size(); i++) {
				int to = Edges.get(i);
				if (!visited[to]) {
					deq.add(new Point(to, p.y + 1));
				}
			}
		}
		int fp = 0, sp = 0;
		for (int i = 0; i < n; i++) {
			if (FDiff[i] <= SDiff[i]) {
				fp++;
			} else {
				sp++;
			}
		}
		System.out.println(fp > sp ? "Fennec" : "Snuke");
		//		System.out.println(Arrays.toString(FDiff));
		//		System.out.println(Arrays.toString(SDiff));
		//		System.out.println(fp+" "+sp);
	}
}

Measured memory_bytes: 102852
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇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 n;
vector<string> s;

void input(){
    cin >> n;
    s.resize(n);
    REP(i, n){
        cin >> s[i];
    }
}

void solve(){
    set<string> gets;
    REP(i, n){
        gets.insert(s[i]);
    }
    cout << gets.size() << endl;
}

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

Measured memory_bytes: 19996
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

struct P {
  int x, y, d;
  P(int x, int y, int d): x(x), y(y), d(d){}
};

signed main() {
  int N; 
  cin >> N;

  int p = 1;
  while(pow(2, p+1) <= N) p++;

  vector<P> ans;
  REP(i, p){
    ans.emplace_back(i+1, i+2, 0);
    ans.emplace_back(i+1, i+2, pow(2, i));
  }
  RREP(i, N){
    if(N-pow(2, i) >= pow(2, p)){
      ans.emplace_back(i+1, p+1, N-pow(2, i));
      N -= pow(2, i);
    }
  }

  cout << p+1 << " " << ans.size() << "\n";
  REP(i, ans.size()){
    cout << ans[i].x << " " << ans[i].y << " " << ans[i].d << "\n";
  }

  return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cctype>
#include <algorithm>
#define MAXIN 300000
#define gc() (SS==TT&&(TT=(SS=IN)+fread(IN,1,MAXIN,stdin),SS==TT)?EOF:*SS++)
typedef long long LL;
const int N=1e6+5;

int a[N];
char IN[MAXIN],*SS=IN,*TT=IN;

inline int read()
{
	int now=0;register char c=gc();
	for(;!isdigit(c);c=gc());
	for(;isdigit(c);now=now*10+c-'0',c=gc());
	return now;
}
bool Check1(const int n)
{
	int A=0,B=0;
	for(int i=2,a1=a[1]; i<=n; ++i)
		if(a[i]==a1) ++A;
		else if(a[i]==a1-1) ++B;
		else return 0;
	return B<n-1&&(A+1>>1)+B>=a[1]&&B<a[1];//上界限制啊啊啊 
}
bool Check2(const int n)
{
	int A=0,B=0;
	for(int i=2,a1=a[1]; i<=n; ++i)
		if(a[i]==a1) ++A;
		else if(a[i]==a1+1) ++B;
		else return 0;
	return B!=1&&A+(B>>1)>=a[1]&&A+(B!=0)<=a[1];
}

int main()
{
	int n=read();
	for(int i=1; i<=n; ++i) a[i]=read();
	puts(Check1(n)||Check2(n)?"Yes":"No");
	return 0;
}

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

using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 30;
const ll MOD = 1000000007;

ll dp[101010];

bool hasElement(const vector<int>& vec, int target){
    return binary_search(vec.begin(), vec.end(), target);
}

int main() {
#ifdef MYLOCAL
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
#endif

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

    dp[0] = 1;
    if(hasElement(a, 1)){
        dp[1] = 0;
    }
    else{
        dp[1] = 1;
    }

    for(int i = 2; i <= n; ++i){
        if(!hasElement(a, i)){
            dp[i] = (dp[i] + dp[i - 1]) % MOD;
            dp[i] = (dp[i] + dp[i - 2]) % MOD;
        }
    }

    cout << dp[n] << endl;
    return 0;
}



Measured memory_bytes: 1280
s = list(input())

N = len(s)

RL = []
LR = [-1]
for i in range(N-1):
    if s[i] == 'R' and s[i+1] == 'L':
        RL.append(i)
    if s[i] == 'L' and s[i+1] == 'R':
        LR.append(i)

LR.append(N-1)

_num = []
for i in range(len(LR)-1):
    _num.append(LR[i+1] - LR[i])
# _num[0] = _num[0] + 1

ans = [0]*N

for i in range(len(_num)):
    if int(_num[i]/2) == _num[i]/2:
        ans[RL[i]] = int(_num[i]/2)
        ans[RL[i]+1] = int(_num[i]/2)
    else:
        if int((RL[i] - LR[i])/2) == ((RL[i] - LR[i])/2):
            ans[RL[i]] = int(_num[i]/2)
            ans[RL[i]+1] = int(_num[i]/2) + 1
        else:
            ans[RL[i]] = int(_num[i]/2) + 1
            ans[RL[i]+1] = int(_num[i]/2)

print(' '.join(map(str, ans)))

Measured memory_bytes: 15520
a,b=map(int,input().split())
s=input()
number=["1","2","3","4","5","6","7","8","9","0"]
sum=0
for i in range(a):
    if s[i] in number:
        sum+=1
if s[a]=="-":
    sum+=1
for i in range(a+1,a+b+1):
    if s[i] in number:
        sum+=1
if sum==len(s):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3316
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <set>   

using namespace std;


int main() {

	int a, b, x;
	cin >> a >> b >> x;

	if (a > x) {
		cout << "NO" << endl;
	}
	else if (a + b >= x || a == x) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;

	}

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool ans=false;
  if(s[0]==s[1]) ans=true;
  if(s[1]==s[2]) ans=true;
  if(s[2]==s[3]) ans=true;
  puts(ans?"Bad":"Good");
  return 0;
}
  
     

Measured memory_bytes: 256
using System;
namespace ConsoleApplication1{
    class Program{
        static void Main(string[] args){
            while (true) {
                String str = Console.ReadLine();
                if (str == null) {
                    break;
                }
                int n = int.Parse(str);
                int count = 0;
                for (int a = 0; a < 10; a++) {
                    for (int b = 0; b < 10; b++) {
                        for (int c = 0; c < 10; c++) {
                            for (int d = 0; d < 10; d++) {
                                if (a + b + c + d == n) {
                                    count++;
                                }
                            }
                        }
                    }
                }
                Console.WriteLine(count);
            }
        }
    }
}

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

s = input()
k = int(input())

digits = 0

res = ""
for c in s:
    if int(c) == 1:
        digits += 1
        if digits == k:
            res = 1
            break
    else:
        res = int(c)
        break
    
print(res)


Measured memory_bytes: 2940
#include<stdio.h>

int main(void) {
  int n, d, x, i, j;
  scanf("%d %d %d", &n, &d, &x);

  int a[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (j = 0; j < n; j++) {
    for (i = 1; i <= d; i += a[j]) {
      x++;
    }
  }
  printf("%d\n", x);
  
  return 0;
}


Measured memory_bytes: 128
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5+5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    
n=int(input())
A=list(map(int,input().split()))
a=sum(A)-n*(n+1)//2
B=[]
for i in range(n+1):
  if A[i]==a:
    B.append(i)
for k in range(1,n+2):
  print((cmb(n-1,k,mod)+2*cmb(n-1,k-1,mod)-cmb(n-B[1]+B[0],k-1,mod)+cmb(n-1,k-2,mod))%mod)

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

int main() {
  int n;
  cin >> n;
  int cnt =0;
  vector<int> t(n);
  for(int i=0;i<n;i++){
    cin >> t.at(i);
    cnt += t.at(i);
  }
  int m;
  cin >> m;
  vector<int> p(m),x(m),T(m);
  for(int i=0;i<m;i++){
    cin >> p.at(i) >> x.at(i);
    T.at(i) = t.at(p.at(i)-1) - x.at(i);
  }
  for(int i=0;i<m;i++){
    cout << cnt - T.at(i) << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
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; }
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;}

ll N, K;
vector<ll> A;

bool isok(ll x){
  // code here
  ll cnt = 0;
  rep(i,N){
    cnt += (A[i]-1)/x;
  }
  if(cnt<=K) return true;
  else return false;
}
ll binsch(){
  // set value
  ll ng = 0; ll ok = 1e9;
  while(abs(ok-ng)>1){
    ll mid = (ok+ng)/2;
    if(isok(mid)) ok = mid;
    else ng = mid;
  }
  return ok;
}

int main(){
  cin >> N >> K;
  A.resize(N); rep(i,N) cin >> A[i];
  ll ans = binsch();
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4752
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    a, b = LI()

    d = b - a

    ans = (1 + d) * d // 2 - b
    print(ans)

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9976
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++)
                ar[i] = in.nextLong();
            Arrays.sort(ar);
            long ans = 0L;
            if (k < n) {
                int rest = n - k;
                for (int i = 0; i < rest; i++)
                    ans += ar[i];
            }
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 60968
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,x;
	cin>>n;
	x=floor(n/500);
	n=n%500;
	x=x*1000;
	x=x+(floor(n/5)*5);
	cout<<x<<endl;
	return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i < (n); ++i)  //0スタート
#define rep1(i,n) for (int i = 1; i < (n); ++i)  //1スタート
#define REP(i,a,b) for (int i = a; i < (b); ++i)  //aからbまで
#define P(x) cout<<x<<endl  //xを改行付きで出力
#define INF 1000000007  //最大値兼MOD
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
/*
./a.exe
*/
int a,b,c;
cin>>a>>b>>c;
P(c / a * b);
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 repi(i, a, b) for (int i = a; i <= (int)(b); i++)

int main(){
  int l, r;
  cin >> l >> r;

  if(r-l > 2019){
    cout << 0 << endl;
    return 0;
  }

  int ans = 1001001001;
  repi(i, l, r-1) repi(j, i+1, r){
    int mi, mj, m;
    mi = i % 2019;
    mj = j % 2019;
    m = (mi*mj) % 2019;
    ans = min(ans, m);
  }

  cout << ans << endl;

  return 0;

}


Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val pw = PrintWriter(System.out)
fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    // 回答をここに書く
    val (a,b,c,d) = listOfInt()
    val ac = Math.abs(a - c)
    val ab = Math.abs(a - b)
    val bc = Math.abs(b - c)
    val s = if (ac <= d || (ab <= d) && (bc <= d)) {
        "Yes"
    } else "No"
    println(s)
}

// 入力取得
fun next() = br.readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() =listOfString().map { it.toInt() }
fun listOfLong() =listOfString().map { it.toLong() }
fun listOfDouble() =listOfString().map { it.toDouble() }

// 約数のList
fun divisor(value : Long) : List<Long> {
    val max = Math.sqrt(value.toDouble()).toLong()
    return (1..max)
            .filter { value % it == 0L }
            .map { listOf(it, value / it) }
            .flatten()
            .sorted()
}

// 範囲内の素数を取得
// fromだけ指定すると戻り値の個数で素数判定ができる
fun prime(from : Long, to : Long = from) : List<Long> {
    return (from..to).filter { i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all { j ->  i % j != 0L }
    }
}

// 素因数分解
fun decom(value : Long) : List<Long>{
    if (value == 1L) return listOf(1)
    val max = Math.sqrt(value.toDouble()).toLong()
    return prime(2, max).filter { value % it == 0L }
}

// 最大公約数
fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

// 文字列を入れ替え
fun swap(base : String, a : String, b : String) : String {
    return base.map {
        when (it) {
            a.toCharArray()[0] -> b
            b.toCharArray()[0] -> a
            else -> it.toString()
        }
    }.joinToString()
}

fun println(value : Any) {
    pw.println(value)
}

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

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

    long long minT = 1, minA = 1;
    for (int i = 0; i < n; i++) {
        long long t, a;
        cin >> t >> a;

        long long mul = max(minT / t, minA / a);
        if (t * mul < minT || a * mul < minA) mul++;
        minT = t * mul;
        minA = a * mul;
    }

    cout << minT + minA << endl;
}   

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
N,M=map(int, sys.stdin.readline().split())
H=[None]+map(int, sys.stdin.readline().split())

al=[ [] for _ in range(N+1) ]	#隣接リスト
for i in range(M):
	a,b=map(int, sys.stdin.readline().split())
	al[a].append(b)
	al[b].append(a)

ans=0
for i in range(1,N+1):
    cur=H[i]
    for j in al[i]:
        nextto=H[j]
        if cur<=nextto:
            break
    else:
        ans+=1
print ans

Measured memory_bytes: 95512
N, K, Q = gets.split.map(&:to_i)
A = Q.times.map{gets.to_i}
P = Array.new(N, K)

A.each do |a|
    P[a-1] +=1
end

P.each do |p|
    puts p - Q > 0 ? "Yes" : "No"
end

Measured memory_bytes: 3892
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>

int main() {
#ifdef WYXLOCAL
	freopen("tmp.in", "r", stdin);
	freopen("tmp.out", "w", stdout);
#endif // WYXLOCAL
	int n, m;
	scanf("%d%d", &n, &m);
	int mx = m / n;
	if (n == 1) {
		printf("%d\n", m);
		return 0;
	} 
	int ans = 1;
	for (int i = 1; i <= mx; ++i) {
		if (m % i == 0) ans = i;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, d;
    cin >> n >> d;
    ll x, y;
    int ans = 0;
    d *= d;
    for(int i=0;i<n;i++){
    	cin >> x >> y;
    	if(d >= x * x + y * y){
    		ans++;
    	}
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int n, k;
int a[505];
int factor[100000];
int need[100000];
int sum = 0;

bool good(int x){
  int cnt = 0;
  for(int i=0; i<n; i++){
    int t = a[i] % x;
    if(t)
      need[++cnt] = t;
  }

  sort(need + 1, need + 1 + cnt);
  int have = k;
  int l=1, r=cnt;
  while(l < r){
    int t = min(need[l], x-need[r]);
    if(t > have)
      return false;
    have -= t;
    need[l] -= t; if(need[l] == 0) l++;
    need[r] += t; if(need[r] == x) r--;
  }
  return true;
}

int main(){
  ios::sync_with_stdio(false);
  // freopen("in.in","r",stdin);

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

  for(int i=1; i*i < sum; i++){
    if(sum%i == 0){
      factor[++factor[0]] = i;
      factor[++factor[0]] = sum / i;
    }
  }

  sort(factor + 1, factor + 1 + factor[0]);

  int ans;
  for(int i=factor[0]; i>=1; i--){
    if(good(factor[i])){
      ans = factor[i];
      break;
    }
  }

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


Measured memory_bytes: 384
#include <iostream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <stack>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>

#define DBG

using namespace std;
typedef unsigned long long int lld;
const int mod = 1000000007;

struct pa {
    lld tc, c;
    double l;
    void init (int cc, double ll) {
        tc = 2 / ll * cc;
        c = cc;
        l = ll;
    }
}pas[4];

bool PAC (const pa &a, const pa &b) {
    return a.tc < b.tc;
}

int main (void) {
	ios::sync_with_stdio(false);
    lld q, h, s, d, n;
    lld sum;
    cin >> q >> h >> s >> d >> n;
    pas[0].init(q, 0.25);
    pas[1].init(h, 0.5);
    pas[2].init(s, 1);
    pas[3].init(d, 2);
    sort (pas, pas + 4, PAC);
    /*for (int i = 0; i < 4; i++) {
        cout << pas[i].c << " " << pas[i].l << endl;
    }*/
    sum = 0;
    for (int i = 0; i < 4; i++) {
        if (n < pas[i].l) continue;
        sum += (lld)(n / pas[i].l) * pas[i].c;
        n -= (lld)(n / pas[i].l) * pas[i].l;
    }
    cout << sum << endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>

long long int sum(long long int n){
    return n * (n + 1) / 2;
}

int main(){
    int n;
    std::cin >> n;

    std::cout << sum(n) - sum(n / 3) * 3 - sum(n / 5) * 5 + sum(n / 15) * 15 << std::endl;

    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include<cmath>
#include<algorithm>
#include <cassert>
#include <stdio.h>
using namespace std;
int main()
{
	int A = 0, B = 0;
	cin >> A >> B;
	if (A <= 8 && B <= 8) {
		cout << "Yay!";
	}
	else { cout << ":("<<endl; 
	}
	
	
}

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

int n, k;
vector<int> g[100005];

const int  mod = 1000000007;
struct mint{
    ll x;
    mint (ll x=0) : x((x%mod+mod)%mod){}//カッコの中で初期化している
    mint& operator+=(const mint a){//operatorは構造体同士の比較に用いられる
        if((x +=a.x)>=mod) x-=mod;
        return *this;//thisとは現在のオブジェクトのこと
    }
    mint& operator-=(const mint a){
        if((x +=mod-a.x)>=mod) x-=mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x*=a.x)%=mod;
        return *this;
    }
    mint operator+(const mint a){
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a){
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a){
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const{
        if(!t) return 1;
        mint a=pow(t>>1);
        a*=a;
        if(t&1) a*=*this;
        return a;
    }
    mint inv() const{
        return pow(mod-2);//逆元
    }
    mint&operator/=(const mint a) {
        return (*this)*=a.inv();
    }
    mint&operator/(const mint a) const{
    mint res(*this);
    return res/=a;
    }
};

vector<mint> factorial(100005);
mint ans;
vector<bool>visit(100005);
void dfs(int u, int p, int depth){
    if(visit[u] == false){
        if(depth>=1){
            if(k-2<g[u].size()-1){
                ans = 0;
                return;
            }
            ans *= factorial[k-2];
            ans /= factorial[k-2-(g[u].size()-1)];
        }
        else{
            if(k-1<g[u].size()){
                ans = 0;
                return;
            }
            ans *= factorial[k-1];
            ans /= factorial[k-1-g[u].size()];
        }
    }
    visit[u] = true;
    for(auto v : g[u]){
        if(v == p) continue;
        dfs(v, u, depth+1);
    }
}

int main(void){
    cin>>n>>k;
    rep(i, n-1){
        int a, b;
        cin>>a>>b;
        --a;--b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    factorial[0] = 1;
    rep(i, 100004){
        factorial[i+1] = factorial[i]*(i+1);
    }
    ans = k;
    rep(i, 100005) visit[i] = false;
    dfs(0, -1, 0);
    cout<<ans.x<<endl;
    return 0;
}

Measured memory_bytes: 12416
import java.util.*;
public class Main {
    public static void main(String args[]) {
       Scanner sc = new Scanner(System.in);
       String s = sc.nextLine();
       if(s.charAt(s.length()-1)=='s')
       System.out.print(s+"es");
       else
       System.out.print(s+"s");
    }
}

Measured memory_bytes: 38480
using System;
using System.Linq;
using System.Collections.Generic;

public class Program
{
    public void Proc() {
        Reader.IsDebug = false;
        int len = int.Parse(Reader.ReadLine());

        string s = Reader.ReadLine();
        string t = Reader.ReadLine();

        int kasanari = 0;
        for(int i=len; i>=1; i--) {
            if(s.Substring(len-i).Equals(t.Substring(0,i))) {
                kasanari = i;
                break;
            }
        }

        string ans = s + t.Substring(kasanari);
        Console.WriteLine(ans.Length);

    }


    


    public class Reader {
        public static bool IsDebug = true;
        private static System.IO.StringReader SReader;
        private static string InitText = @"


4
expr
expr



";
        public static string ReadLine() {
            if(IsDebug) {
                if(SReader == null) {
                    SReader = new System.IO.StringReader(InitText.Trim());
                }
                return SReader.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }
    }
    public static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 2776
h,w,k=map(int,input().split())
c=[]
for i in range(h):
  ct=str(input())
  ct=list(ct)
  c.append(ct)
ans=0
for i in range(2 ** h):
  tempc=[]
  for j in range(h):
    if (i >> j)%2==1:
      tempc.append(c[j])
  if len(tempc)>0:
    for f in range(2 ** w):
      tempc2=[]
      for l in range(w):
        if (f >> l)%2==1:
          for m in range(len(tempc)):
            tempc2.append(tempc[m][l])
      if tempc2.count("#")==k:
        ans=ans+1
print(ans)

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);

/* -----  2019/07/27  Problem: ABC 135 A / Link: http://abc135.contest.atcoder.jp/tasks/abc135_a  ----- */


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

	LL A, B; cin >> A >> B;
	if (A % 2 == B % 2) {
		LL ans = (A + B) / 2;
		cout << (ans) << "\n";
	}
	else {
		cout << "IMPOSSIBLE" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <cstdio>

#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <string>
#include <array>

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

using namespace std;
typedef long long int ll;

int main() {
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a.at(i);

  vector<ll> cntv(n);
  rep(i, n) ++cntv.at(a.at(i));
  ll mods = 1000000007;
  ll ans = 1;
  bool isLast0 = false;
  rep(i, cntv.size()) {
    if (cntv.at(i) == 2 and isLast0) {
      ans *= 2;
      isLast0 = false;
    } else if (cntv.at(i) == 0 and not isLast0) {
      isLast0 = true;
    } else if (cntv.at(i) == 1 and i == 0 and n % 2 == 1) {
      ans = 1;
    } else {
      ans = 0;
      break;
    }
    ans = ans % mods;

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

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
    string s,t;cin>>s>>t;
    s+=s;
    if(s.find(t)==string::npos)cout<<"No";
    else cout<<"Yes";
}

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

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



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

bool hoge(string s) {
    int a = stoi(s);
    return 1 <= a && a <= 12;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if (hoge(s.substr(0, 2)) && hoge(s.substr(2, 2))) {
        cout << "AMBIGUOUS" << endl;
    } else if (hoge(s.substr(0, 2))) {
        cout << "MMYY" << endl; 
    } else if (hoge(s.substr(2, 2))) {
        cout << "YYMM" << endl;
    } else {
        cout << "NA" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define maxn 100086

using namespace std;

typedef long long ll;

char s[maxn];
int n;
ll ans;

void dfs(int i, ll val, ll sum){
	if(i > n){
		ans += sum + val;
		return;
	}
	if(val) dfs(i + 1, s[i] - '0', sum + val);
	dfs(i + 1, val * 10 + s[i] - '0', sum);
}

int main(){
	scanf("%s", s + 1);
	n = strlen(s + 1);
	dfs(1, 0, 0);
	printf("%lld", ans);
}

Measured memory_bytes: 3828
#include<stdio.h>


int main()
{
    int k,a,b,i,j,c ;
    scanf("%d %d %d",&k,&a,&b) ;
    for(i=a ; i<=b ; i++)
    {
        if(i%k==0)
          {
               c=1 ;
               break ;
          }
          else
            c=0 ;

    }
    if(c==1)
        printf("OK") ;
    else
        printf("NG") ;

    return 0 ;
}


Measured memory_bytes: 1732
#include <iostream>
#include <string>
#include <math.h> 
using namespace std;

int main()
{
	int N, i, judg = 0, judg2 = 0;
	double A[100005], sub = 1000000000.0;
	long long Ans = 0;
	cin >> N;
	for (i = 0; i < N; i++)
		cin >> A[i];

	for (i = 0; i < N; i++) {
		if (A[i] < 0.0)
			judg += 1;
		if (A[i] == 0.0)
			judg2 = 1;
		Ans += fabs(A[i]);
		if (sub > fabs(A[i]))
			sub = fabs(A[i]);
	}

	if (judg % 2 == 1 && judg2 == 0)
		Ans -= sub * 2.0;

	cout << Ans;
	return 0;
}

Measured memory_bytes: 1152
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
//deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector
//#include<bits/stdc++.h>
#define ll long long
using namespace std;




int main()
{
	ios::sync_with_stdio(false);
	double a[100];
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	double s;
	for(int i=0;i<n-1;i++){
		s=(a[i]+a[i+1])/2;
		a[i+1]=s;
		//cout<<s<<endl;
	}
	cout<<s<<endl;
return 0;
}





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

int main() {
	int H, W, h, w; cin >> H >> W >> h >> w;
	if(H % h == 0 and W % w == 0) {
		cout << "No" << '\n';
		return 0;
	}
	bool sw = false;
	if(W % w == 0) {
		swap(H, W);
		swap(h, w);
		sw = true;
	}
	cout << "Yes" << '\n';
	int64_t s[W + 1] = {}; s[W] = 1;
	bool b[W + 1] = {};
	for(int i = 0; i + w <= W; i += w) {
		s[i + w] = s[i] - 1;
		b[i] = b[i + w] = true;
	}
	for(int i = W; i - w >= 0; i -= w) {
		s[i - w] = s[i] + 1;
		b[i] = b[i - w] = true;
	}
	for(int i = 0; i + w <= W; ++i) {
		if(b[i]) continue;
		s[i + w] = s[i] - 1;
	}
	int ans[W];
	for(int i = 0; i < W; ++i) {
		ans[i] = s[i + 1] - s[i];
	}
	if(sw) {
		for(int i = 0; i < W; ++i) {
			for(int j = 0; j < H; ++j) {
				cout << ans[i] << (j == H - 1 ? "\n" : " ");
			}
		}
	} else {
		for(int i = 0; i < H; ++i) {
			for(int j = 0; j < W; ++j) {
				cout << ans[j] << (j == W - 1 ? "\n" : " ");
			}
		}
	}
	return 0;
}


Measured memory_bytes: 3636
using System;

namespace ITP1_5_D
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 1; i <= n; i++)
            {
                int x = i;

                if (x % 3 == 0) Console.Write(" " + i);

                else
                {
                    for (; ; )
                    {
                        if (x % 10 == 3)
                        {
                            Console.Write(" " + i);
                            break;
                        }

                        else
                        {
                            x /= 10;
                            if (x == 0) break;
                        }
                    }
                }
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 9292
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 998244353;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;

vector<int> B(200010, INF);
vector<int> A(200010);
vector<int> ans(200010);
vector<bool> seen;
void dfs(const Graph &G, int v){
    seen[v] = true; // v を訪問済みにする
	auto itr = lower_bound(B.begin(), B.end(), A[v]);
	int old = *itr;
	*itr = A[v];
	ans[v] = lower_bound(B.begin(), B.end(), INF) - B.begin();
    // vから行ける各頂点 next_v について
    for(auto nv : G[v]){
        if(seen[nv]) continue; // next_v が探索済みだったらスルー
        dfs(G, nv); // 再帰的に探索
    } 
	*itr = old;
}


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

	int N;
	cin >> N;
	rep(i,N) cin >> A[i];
	Graph G(N);
	int a, b;
	rep(i,N-1){
		cin >> a >> b;
		--a; --b;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	seen.assign(N, false); // 全頂点を「未訪問」にして初期化
	dfs(G, 0);
	rep(i,N) cout << ans[i] << endl;
}

Measured memory_bytes: 30220
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
using namespace std;

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

  	long r,D,x;
  	cin >> r >> D >> x;
  	for(int i=0;i<10;i++)
    {
      	x = r*x -D;
      	cout << x << endl;
    }
  	return 0;
}


Measured memory_bytes: 256