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

using namespace std;

vector<int> BusTime;
string TimeInfo;


void getInputInfo() {
	int h, m;
	stringstream ss;

	ss << TimeInfo;
	//cout << TimeInfo << endl;
	while (ss >> h >> m) {
		//cout << h << "," << m << ",";
		BusTime.push_back(h * 60 + m);
	}
	//cout << endl;
}

int main() {
	int num, size;

	for (int i = 0; i < 2; ++i) {
		cin >> num;
		getline(cin, TimeInfo);
		getInputInfo();
	}
	sort(BusTime.begin(), BusTime.end());
	BusTime.erase(unique(BusTime.begin(), BusTime.end()), BusTime.end());

	size = BusTime.size();
	for (int i = 0; i < size; ++i) {
		if (i != 0) {
			cout << " ";
		}
		cout << BusTime[i] / 60 << ":" << setw(2) << setfill('0') << BusTime[i] % 60;
	}
	cout << endl;

	return 0;
}



Measured memory_bytes: 3212
import java.util.*;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(in);
        int n=sc.nextInt();
        int ans=0;
        HashMap<Integer,Integer> m=new HashMap<>();
        for (int i = 0; i < n; i++) {
            int c=sc.nextInt();
            m.put(c, 1+m.getOrDefault(c, 0));
        }
        for(int k:m.keySet()){
            if(m.get(k)%2==1)ans++;
        }
        out.println(ans);
    }
}

Measured memory_bytes: 62564
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
using ll = long long;
using namespace std;

int main(){
	int D, N, ans;
	cin >> D >> N;
	if( N == 100 ){
		N = 101;
	}
	if( D == 0 ){
		ans = N;
	} else if ( D == 1 ){
		ans = N * 100;
	} else {
		ans = N * 10000;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

ll a[110];
ll b[110];
ll ans;
int main(){
	ll n;
	scanf("%lld",&n);
	rep(i,0,n)scanf("%lld",a+i);
	rep(i,0,n)scanf("%lld",b+i);
	rep(k,0,n){
		ll s=0;
		rep(i,0,k+1)s+=a[i];
		rep(i,k,n)s+=b[i];
		ans=max(ans,s);
	}
	printf("%lld",ans);
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n, a;
    cin >> n >> a;

    if(n%500 <= a) {
        out("Yes");
    }
    else {
        out("No");
    }
    
    re0;
}

Measured memory_bytes: 256
from sys import stdin, setrecursionlimit


def main():
    n, k = map(int, stdin.readline().split())
    h = list(map(int, stdin.readline().split()))
    h.sort()

    ans = 0
    for i in range(n - k):
        ans += h[i]
    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Measured memory_bytes: 78796
import sys

n = int(input())
ab = []
for i in range(n):
    a,b = map(int,input().split())
    ab.append([a,b])
    
ab.sort(key=lambda x:x[1])

limit = 0
for i in range(n):
    limit += ab[i][0]
    if limit > ab[i][1]:
        print("No")
        sys.exit()

print("Yes")

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

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

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
	if(y<=0) return 1;
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

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

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

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

	ll n;
	cin>>n;
	string ans="";
	ll po=26;
	while(n>0){
		n--;
		ans+='a'+n%po;
		n/=26;
	}
	reverse(all(ans));
	cout<<ans;


    return 0;
}


Measured memory_bytes: 3656
from collections import deque

S = input()
N = int(input())
Q = [list(input().split()) for _ in range(N)]

d = deque(S)

cnt = 0 
for q in Q:
    if q[0] == "1":
        cnt+=1
        #d.reverse()
    elif q[0] == "2":
        if (cnt%2==0 and q[1] == "1") or (cnt%2!=0 and q[1] == "2"):
            d.appendleft(q[2])
        else:
            d.append(q[2])
            
if cnt%2 != 0:
    d.reverse()
print("".join(d))

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

//input
int R, G, B, N;

int main() {
    cin >> R >> G >> B >> N;

    long long count = 0;
    for (int i = 0; i < 3001; ++i) {
        for (int j = 0; j < 3001; ++j) {
            int ret = N - R * i - G * j;
            if (0 <= ret && ret % B == 0) count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
use std::io::stdin;
use std::vec::Vec;

mod utils {
    use std::io::BufRead;
    use std::str::{self, FromStr};

    pub struct StdinReader<R: BufRead> {
        reader: R,
        buf: Vec<u8>,
    }

    impl<R: BufRead> StdinReader<R> {
        pub fn new(reader: R) -> StdinReader<R> {
            StdinReader {
                reader: reader,
                buf: Vec::new(),
            }
        }

        #[allow(unused)]
        #[inline]
        pub fn reads<T: FromStr>(&mut self) -> T {
            self.read_until(b' ')
        }

        #[allow(unused)]
        #[inline]
        pub fn readl<T: FromStr>(&mut self) -> T {
            self.read_until(b'\n')
        }

        #[allow(unused)]
        #[inline]
        pub fn read_vec<T: FromStr>(&mut self) -> Vec<T> {
            return self.read_until::<String>(b'\n').trim().split_whitespace().map(|c| c.parse().ok().unwrap()).collect();
        }

        #[inline]
        pub fn read_until<T: FromStr>(&mut self, delim: u8) -> T {
            loop {
                self.buf.clear();
                let len = self.reader
                    .read_until(delim, &mut self.buf)
                    .expect("failed reading bytes");
                match len {
                    0 => panic!("early eof"),
                    1 if self.buf[0] == delim => (),
                    _ => {
                        if self.buf[len - 1] == delim {
                            self.buf.truncate(len - 1);
                        }
                        break;
                    }
                }
            }

            let elem = unsafe { str::from_utf8_unchecked(&self.buf) };
            elem.parse().unwrap_or_else(|_| panic!(format!("failed parsing: {}", elem)))
         }
    }
}


fn main(){
    let stdin = stdin();
    let mut r = utils::StdinReader::new(stdin.lock());
    let k:usize = r.readl();
    
    let mut res:usize = 0;

    for x in 1..(k + 1) {
        for y in 1..(k + 1) {
            for z in 1..(k+1) {
                res += getGCD(x, y, z)
            }
        }
    } 

    println!("{}", res);
}

pub fn getGCD(aa:usize, bb:usize, cc:usize) -> usize {
    let mut abGcd = 0;
    if(aa > bb) {
        abGcd = gcd(aa, bb)
    }else{
        abGcd = gcd(bb, aa)
    }
    if(abGcd > cc) {
        return gcd(abGcd, cc);
    }else{
        return gcd(cc, abGcd);
    }
}

pub fn gcd(left: usize, right:usize) -> usize {
    if(left % right == 0) {
        return right
    }else{
        return gcd(right, left%right)
    }
}


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

#define BLANK 0

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

bool dfs(int color, int x, int y, int gx, int gy, vector<vector<int> >& blocks){
  if(x == gx && y == gy){ return true; }
  blocks[x][y] = BLANK;
  for(int i = 0; i < 4; i++)
    if(blocks[x + dx[i]][y + dy[i]] == color)
      if(dfs(color, x + dx[i], y + dy[i], gx, gy, blocks))
        return true;
  return false;
}


int main(void){
  while(true){
    int w, h;
    cin >> w >> h;
    if(w == 0 && h == 0){ break; }

    int sx, sy, gx, gy;
    cin >> sx >> sy;
    cin >> gx >> gy;

    int n;
    cin >> n;

    vector<vector<int> > blocks(w + 2, vector<int>(h + 2, BLANK));
    for(int i = 0; i < n; i++){
      int c, d, x, y;
      cin >> c >> d >> x >> y;
      int now_w = (d == 0) ? 4 : 2;
      int now_h = (d == 0) ? 2 : 4;
      for(int j = 0; j < now_w; j++)
        for(int k = 0; k < now_h; k++)
          blocks[x + j][y + k] = c;
    }

    // ????????????
    if(blocks[sx][sy] == BLANK){
      cout << "NG" << endl;
      continue;
    }

    // ??????
    if(dfs(blocks[sx][sy], sx, sy, gx, gy, blocks)){ cout << "OK" << endl; }
    else{ cout << "NG" << endl; }
  }

  return 0;
}

Measured memory_bytes: 3084
#include <stdio.h>

void print_na(int a, int b);
void leap_year(int a, int b);

int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    if (a != 0 || b != 0) {
        print_na(a, b);
        leap_year(a, b);
        scanf("%d %d", &a, &b);
    }
    while (a != 0 || b != 0) {
        printf("\n");
        print_na(a, b);
        leap_year(a, b);
        scanf("%d %d", &a, &b);
    }
    return 0;
}

void print_na(int a, int b)
{
    for (int i = a; i <= b; i++) {
        if ((i % 4 == 0 && !(i % 100 == 0)) || i % 400 == 0) {
            return;
        }
    }
    printf("NA\n");
}

void leap_year(int a, int b)
{
    for (int i = a; i <= b; i++) {
        if ((i % 4 == 0 && !(i % 100 == 0)) || i % 400 == 0) {
            printf("%d\n", i);
        }
    }
}

Measured memory_bytes: 1044
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
inline int read(){
	int x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x;
}
const int mod=1e9+7;
ll pw(ll a,ll t){
	ll x=1;
	while(t>0){
		if(t&1)x=x*a%mod;
		a=a*a%mod,t>>=1;
	}
	return x;
}
ll C(ll n,ll r){
	if(r>n or r<0)return 0;
	ll res=1;
	for(ll i=0;i<r;i++){
		res=res*(n-i)%mod;
		res=res*pw(r-i,mod-2)%mod;
	}
	return res;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	ll t;
	cin>>t;
	while(t--){
		ll ans,n;
		n=ans=0;
		cin>>n;
		n-=5;
		for(ll i=0;i<12;i++){
			if((n-i)&1)continue;
			ans=(ans+C((n-i)/2+15,15)*C(11,i))%mod;
		}
		cout<<ans<<'\n';
	}
	return 0;
}



Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int A,B;
  cin >> A >> B;
  if(A*B % 2 == 0){
	cout << "Even" << endl;
  }
  else{
    cout << "Odd" << endl;
  }
  
  
}

Measured memory_bytes: 256
open Printf
open Scanf

let inputs x y z =
	let nums = Array.make 3 0 in
	nums.(0) <- x;
	nums.(1) <- y;
	nums.(2) <- z;
	Array.sort(compare) nums;
	printf "%d %d %d\n" nums.(0) nums.(1) nums.(2);;

Scanf.scanf "%d %d %d" inputs;;

Measured memory_bytes: 2376
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <utility>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_map>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
    int n, m;
    cin >> n >> m;
    priority_queue<int> Q[n];
    rep(i, m){
        int q, t, x;
        cin >> q;
        switch (q)
        {
        case 0:
            cin >> t >> x;
            Q[t].push(x);
            break;
        case 1:
            cin >> t;
            if(!Q[t].empty()) cout << Q[t].top() << endl;
            break;
        default:
            cin >> t;
            if(!Q[t].empty()) Q[t].pop();
            break;
        }
    }


    return 0;
}


Measured memory_bytes: 4060
import sys
input = sys.stdin.readline
 
def main():
    N, K, Q = map(int, input().split())
    A = [0]*N
    for _ in range(Q):
        q = int(input())
        A[q-1] += 1

    for a in A:
        if K-Q+a>0:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 4680
#include <bits/stdc++.h>
#define For(i, l, r) for(register long long i = (l), i##end = (long long)(r); i <= i##end; ++i)
#define Fordown(i, r, l) for(register long long i = (r), i##end = (long long)(l); i >= i##end; --i)
#define Set(a, v) memset(a, v, sizeof(a))
using namespace std;

inline bool chkmin(long long &a, long long b) {return b < a ? a = b, 1 : 0;}
inline bool chkmax(long long &a, long long b) {return b > a ? a = b, 1 : 0;}

inline long long read() {
    long long x = 0, fh = 1; char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') fh = -1;
    for (; isdigit(ch); ch = getchar()) x = (x * 10) + (ch ^ 48);
    return x * fh;
}

const long long N = 300100;

long long pos[N];

int main () {
	long long n = read(), a = read(), b = read();
	if (a + b - 1 > n || a * b < n) return puts("-1"), 0;
	
	int val = n - a, cnt = 0;
	For (i, 1, a)
		pos[++cnt] = (++ val);
	if (cnt >= n) {
		For (k, 1, n) printf ("%lld ", pos[k]); printf ("\n");
		return 0;
	}

	val -= a;
	For (i, 1, b - 1) {
		int Block = min(val / (b - i), a);
		val -= Block;
		For (j, 1, Block){
			pos[++cnt] = (++val);
			if (cnt >= n) {
				For (k, 1, n) printf ("%lld ", pos[k]); printf ("\n");
				return 0;
			}
		}
		val -= Block;
	}
    return 0;
}


Measured memory_bytes: 4480
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size();
  t = t.substr(0, n);
  cout << (s == t ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String[] line = br.readLine().split(" ");
      int buf = 0;
      Stack stack = new Stack(line.length);

      for (String s : line) {
        switch(s) {
          case "+" :
            buf += stack.pop();
            buf += stack.pop();
            stack.push(buf);
            buf = 0;
            break;

          case "-" :
            buf -= stack.pop();
            buf += stack.pop();
            stack.push(buf);
            buf = 0;
            break;

          case "*" :
            buf  = stack.pop();
            buf *= stack.pop();
            stack.push(buf);
            buf = 0;
            break;

          default :
            stack.push(Integer.parseInt(s));
            break;
        }
      }

      System.out.println(stack.pop());
    }
  }
}

class Stack {
  int[] stack;
  int ite;

  public Stack(int capacity) {
    stack = new int[capacity];
    ite = 0;
  }

  public void initialize() {
    ite = 0;
  }

  public int getIte() {
    return ite;
  }

  public boolean isEmpty() {
    return ite == 0;
  }

  public boolean isFull() {
    return ite >= stack.length-1;
  }

  public  boolean push(int x) {
    if(isFull()) return false;

    stack[++ite] = x;
    return true;
  }

  public int pop() {
    if(isEmpty()) return 0;

    return stack[ite--];

  }
}


Measured memory_bytes: 24324
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;
typedef long long int lli;

int main(void){
  int n;
  cin>>n;
  cout<<n/3<<endl;
  
  return 0;
}


Measured memory_bytes: 256
function Main(input) {
    var data = input.split(" ")
    var nokori = parseInt(data[0]) - parseInt(data[1])*2;
    if(nokori <= 0){
    	console.log(0)
	}else{
		console.log(nokori)
	}
}
 
// Don't edit this line!
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

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

   cout << (r/d-l/d+((l%d==0)?1:0)) << endl;
   return 0;
}


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

int main(){
 long long a,c,d,e,f,r;
  cin>>a;
  vector<long long>b(a);
    for(int i=0;i<a;i++){
      cin>>b[i];
    }
  c=b[0];
  for(int i=1;i<a;i++){
    d=b[i];
    e=c;
    if(d>c){
      swap(c,d);
    }
 
    r=c%d;
    while(r!=0){
      c=d;
      d=r;
      r=c%d;
    }
    e=e/d;
    f=b[i]/d;
    c=e*f*d;
  }
    cout<<c<<endl;
     
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
/*        string[] input = ReadLine().Split(' ');
        long a = long.Parse(input[0]);
        long b = long.Parse(input[1]);
        long c = long.Parse(input[2]);
        long d = long.Parse(input[3]);*/
//        string temp = ReadLine();
//        int a = int.Parse(ReadLine());
//        int b = int.Parse(ReadLine());
//        int c = int.Parse(ReadLine());
//        int d = int.Parse(ReadLine());
//        string a = ReadLine();
//        string b = ReadLine();
//        string c = ReadLine();
//        string[] input = ReadLine().Split(' ');
//        string ko = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        string a = ReadLine();
        string b = ReadLine();
        int count = 0;
        for(int i=0;i<a.Length;i++){
            if(a == b){
                count++;
            }else{
                string t1 = a.Substring(1);
                string t2 = a.Substring(0,1);
                a = t1 + t2;
            }
        }
        if(count >0){
            WriteLine("Yes");
        }else{
            WriteLine("No");
        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define now edge[i].v
#define go(x) for(int i=head[x];i;i=edge[i].nxt)
using namespace std;
const int sz=3e3+7;
int n;
int cnt;
int u,v;
int a[sz];
bool w[sz];
int head[sz];
struct Edge{
	int v,nxt;
}edge[sz<<1]; 
void make_edge(int u,int v){
	edge[++cnt]=(Edge){v,head[u]};head[u]=cnt;
	edge[++cnt]=(Edge){u,head[v]};head[v]=cnt;
}
void dfs(int x){
	w[x]=0;
	go(x) if(a[x]>a[now]){
		dfs(now);
		if(!w[now]) w[x]=1;
	}
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<n;i++){
		scanf("%d%d",&u,&v);
		make_edge(u,v);
	}
	for(int i=1;i<=n;i++){
		dfs(i);
		if(w[i]) printf("%d ",i);
	}
}

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

int main(){
  string t;
  string s[4]={"dream","dreamer","erase","eraser"};
  cin>>t;
  reverse(t.begin(),t.end());
  for(int i=0;i<4;i++){
    reverse(s[i].begin(),s[i].end());
  }
  for(int i=0;i<t.size();){
    bool flag=false;
    for(int j=0;j<4;j++){
      string x=s[j];
      if(t.substr(i,x.size())==x) {
        flag=true;
        i+=x.size();
      }
    }
    if(!flag){cout<<"NO"; return 0;}
  }
  cout<<"YES";
}


Measured memory_bytes: 3740
#include <stdio.h>
int main()
{
    int a,b,c,d,x;
    x=0;

    scanf("%d %d %d",&a,&b,&c);
    for(d=a;d<=b;d++)
    {
        if(c%d==0)
        {
            x=x+1;
        }
    }
    printf("%d\n",x);
    return 0;
}



Measured memory_bytes: 2044
#include <iostream>
#include <cassert>
#include <string>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
string s;
long long k;
int pos;
void next();
void next2();
int main() {
  cin >> s;
  cin >> k;
  pos = 0;
  next();
  cout << s << endl;
  return 0;
}

void next(){
  while(k > 0){
    if(pos < s.size()){
      if(s[pos]!='a'){
        if(k>=25){
          k -= 26 - ((int)s[pos] - (int)'a');
          s[pos] = 'a';
          pos++;
        }else{
          int cnt = 26 - ((int)s[pos] - (int)'a');
          if(cnt <= k){
            k -= cnt;
            s[pos] = 'a';
            pos++;
          }else{
            pos++;
          }
        }
      }else{
        pos++;
      }
    }else{
      pos = s.size()-1;
      next2();
    }
  }
}
void next2(){
  k %= 26;
  int cnt = 26 - ((int)s[pos] - (int)'a');
  if(cnt > k){
    s[pos] = (char)((int)s[pos] + k);
  }else{
    k -= cnt;
    s[pos] = (char)((int)'a' + k);
  }
  k = 0;
}

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

const int N = 1100;

struct Point {
	int x, y;
	Point(int x = 0, int y = 0) : x(x), y(y) {}
} P[N], Q[N];

int n;
int b[N], vis[N];

bool Find(int u) {
	for (int i = 1; i <= n; i++) if (P[u].x < Q[i].x && P[u].y < Q[i].y && !vis[i]) {
		vis[i] = 1;
		if (b[i] == -1 || Find(b[i])) {
			b[i] = u;
			return true;
		}
	}
	return false;
}

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> P[i].x >> P[i].y;
	for (int i = 1; i <= n; i++) cin >> Q[i].x >> Q[i].y;
	
	memset(b, 0xff, sizeof b);
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) vis[j] = 0;
		if (Find(i)) ans++;
	}
	cout << ans << "\n";
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

ll n;

void f(int bit, ll num, ll& ans) {
    if (num > n) return;
    if (bit == 7) ans++;
    f(bit | (1 << 0), num * 10 + 3, ans);
    f(bit | (1 << 1), num * 10 + 5, ans);
    f(bit | (1 << 2), num * 10 + 7, ans);
    return;
}

int main() {
    cin >> n;
    ll ans = 0;
    f(0, 0, ans);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;


//入力文字列
char str_input[8][9];


//入力数
int n = 0;
//爆弾座標
int bom_y = 0 , bom_x = 0;


//最初のボム
void f_bom(int);


//再起関数
void f_saiki(int , int , int , int);




int main(void)
{
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		//入力
		for (int j = 0; j < 8; j++)
		{
			cin >> str_input[j];
		}
		cin >> bom_x >> bom_y;

		//関数で処理
		f_bom(i);
	}

	return 0;
}




//最初のボム
void f_bom(int index)
{
	//座標が1ずつ配列とずれている
	bom_y-- , bom_x--;

	//文字列の現在地を'0'にして再起関数へ
	str_input[bom_y][bom_x] = '0';

	f_saiki(bom_y - 3 , bom_y + 3 , bom_x - 3 , bom_x + 3);

	cout << "Data " << index + 1 << ":" << endl;

	for (int i = 0; i < 8; i++)
	{
		cout << str_input[i] << endl;
	}
}


//再起関数
void f_saiki(int y_min , int y_max , int x_min , int x_max)
{
	//+ 3は-3でもらった引数を無理やり戻す)
	int yy = y_min + 3;
	int xx = x_min + 3;

	//indexを超えないように調整
	for (int i = y_min; i <= y_max; i++)
	{
		if (i >= 0 && i < 8)
		{
			//'1'(x_min 
			if (str_input[i][xx] == '1')
			{
				//まずこの位置の’1’を消す
				str_input[i][xx] = '0';

				//再帰
				f_saiki(i - 3 , i + 3 , xx - 3 , xx + 3);
			}
		}
	}

	//同様にｘ
	for (int i = x_min; i <= x_max; i++)
	{
		if (i >= 0 && i < 8)
		{
			//'1'
			if (str_input[yy][i] == '1')
			{
				//消してから(無限ループ防止)
				str_input[yy][i] = '0';

				f_saiki(yy - 3 , yy + 3 , i - 3 , i + 3);
			}
		}
	}
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
#define maxn (int)(1e5)
#define i64 long long
#define pii pair<i64,i64>
#define all(x) x.begin(),x.end()
#define LB(x,v) lower_bound(all(x), v) - x.begin()
#define fread() freopen("in.txt", "r", stdin);
using namespace std;
int shift[26][27];
void precalc(){
    for(int i=0;i<26;i++) shift[i][0] = i;
    //for(int i=0;i<=26;i++) printf("%d %c\n", i, shift[i][0]);
    for(int i=0;i<26;i++){
        for(int j=1;j<=26; j++){
            shift[i][j] = (shift[i][j-1]+1)%26 ;
        }
    }   
}
void solve(string s, int n){
    for(int i = 0; i < s.size(); i++) printf("%c", shift[s[i]-'A'][n]+'A');
    printf("\n");
}

int main() {
    /*BEFORE SUBMIT, CHECK
    sample i/o format
    statements for debugging are removed/comment out
    global values / stl containers are initialized/cleared for each test (if needed)
    all array size are sufficient
    loop variable or output value doesn't cross min/max limit of input
    // */
    // #ifndef ONLINE_JUDGE
    //     fread();
    // #endif
    
    int n,k; 
    string s;
    precalc();
    while(scanf("%d",&n)==1){
        getchar();
        cin>>s;
        solve(s,n);     
    }
    return 0;
}

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

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

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

int main(){
  
  ll n,m;
  cin >> n >> m;
  string s,t;
  cin >> s >> t;
  ll g = gcd(n,m);
  ll cntN = 0;
  ll cntM = 0;
  while(cntN<n && cntM<m){
    if(s[cntN] != t[cntM]){
      cout << -1 << endl;
      return 0;
    }
    cntN += n/g;
    cntM += m/g;
  }
  cout << lcm(n,m) << endl;
}

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

using namespace std;
long long int n ,h[100003],f[100003],k;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>k;
    for(int i =1 ;i<= n ;i++)
    {
        cin>>h[i];
    }
    f[1] = 0;
    for(int i =2 ; i <= k ; i++)
    {
        f[i] = INT_MAX;
        for(int j = 1 ; j<i ; j++)
        {
            f[i] = min(f[i] , f[j] + abs(h[i] - h[j]));
        }
    }
    for(int i =k+1 ; i<= n ;i++)
    {
        f[i] = INT_MAX;
        for(int j = i -1; j >=i-k; j--)
        {
            f[i] = min(f[j] + abs(h[i] - h[j]) , f[i]);
        }
    }
    cout<<f[n];
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<long> a(n);
    for (int i = 0; i < n; i++) {
        cin>>a[i];
    }
    sort(a.begin(), a.end());
    int c = 0;
    for (int i = 0; i < n - 2; i++) {
        for (int j = i + 1; j < n - 1; j++) {
            for (int k = j + 1; k < n; k++) {
                if (a[i] == a[j] || a[j] == a[k]) {
                    continue;
                }
                if (a[i] + a[j] > a[k]) {
                    c++;
                }
            }
        }
    }
    cout << c << endl;
}


Measured memory_bytes: 3612
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;

vector<long long> diffs;

void get_candidate1(long long H, long long W){
  //
  long long all = H * W;
//  cout << H << " " << W << " " << (H * W) << endl;
  long long  h = H/3;

  for (long long i = 0; i <= 1; ++i) {
//    for (long long h = 1; h <= H; ++h) {
    h += i;
    long long d1 = W * h;
    long long  w = W/2;
    for (long long j = 0; j <= 1; ++j) {
      w += j;
      long long d2 = (H-h) * w;
      long long d3 = all - (d2+d1);

      long long max_d = max(d1, max(d2, d3));
      long long min_d = min(d1, min(d2, d3));
      diffs.push_back(max_d - min_d);
    }
  }
}


void get_candidate2(long long H, long long W){
  //
  long long all = H *W;
  long long  h = H/3;

  for (long long i = 0; i <= 1; ++i) {
    h += i;
    long long d1 = W * h;
    long long  h2 = (H-h)/2;
    for (long long j = 0; j <= 1; ++j) {
      h2 += j;
      long long d2 = W * (h2);
      long long d3 = all - (d2+d1);

      long long max_d = max(d1, max(d2, d3));
      long long min_d = min(d1, min(d2, d3));
      diffs.push_back(max_d - min_d);
    }
  }
}


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

  get_candidate1(H, W);
  get_candidate1(W, H);
  get_candidate2(H, W);
  get_candidate2(W, H);

  sort(diffs.begin(), diffs.end());
//  for(auto d: diffs)
//    cout << d << endl;

  cout << diffs[0] << endl;


  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> PLL;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;
//typedef boost::multiprecision::cpp_int bigint;

class Modint {
public:
	LL v;
	Modint(LL _v) {
		_v %= MOD;
		if (_v < 0)_v += MOD;
		v = _v;
	}
	Modint operator+=(Modint m);
	Modint operator-=(Modint m);
	Modint operator*=(Modint m);
	friend ostream& operator<<(ostream& st, Modint m);
	friend ostream& operator>>(ostream& st, Modint m);
	Modint() :v(0) {}
	static Modint one;
};
Modint Modint::one = Modint(1);
ostream& operator<<(ostream& st, Modint m) {
	cout << m.v;
	return st;
}
ostream& operator>>(ostream& st, Modint m) {
	LL v;
	cin >> v;
	m.v = v % MOD;
	return st;
}
Modint operator+(Modint a, Modint b) {
	Modint r;
	r.v = a.v + b.v;
	if (r.v >= MOD)r.v -= MOD;
	return r;
}
Modint operator-(Modint a, Modint b) {
	Modint r;
	r.v = a.v - b.v;
	if (r.v < 0)r.v += MOD;
	return r;
}
Modint operator*(Modint a, Modint b) {
	return Modint((a.v * b.v) % MOD);
}
Modint operator+(Modint a, LL b) {
	return Modint(a.v + b);
}
Modint operator+(LL a, Modint b) {
	return Modint(a + b.v);
}
Modint operator-(Modint a, LL b) {
	return Modint(a.v - b);
}
Modint operator-(LL a, Modint b) {
	return Modint(a - b.v);
}
Modint operator*(Modint a, LL b) {
	return Modint(a.v * (b % MOD));
}
Modint operator*(LL a, Modint b) {
	return Modint((a % MOD) * b.v);
}
Modint Modint::operator+=(Modint m) {
	*this = *this + m;
	return *this;
}
Modint Modint::operator-=(Modint m) {
	*this = *this - m;
	return *this;
}
Modint Modint::operator*=(Modint m) {
	*this = *this * m;
	return *this;
}
template<class T>
T pow(T& base, LL p) {
	if (p == 0)return T();
	else if (p == 1)return base;
	T ret = pow(base, p / 2);
	ret *= ret;
	if (p & 1)ret *= base;
	return ret;
}
template<class T>
T modpow(T base, LL p) {
	if (p == 0)return T();
	else if (p == 1)return base;
	T ret = modpow(base, p / 2);
	ret *= ret;
	if (p & 1)ret *= base;
	return ret;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	LL N, K;
	cin >> N >> K;
	Modint ans(0);
	vector<Modint> DP(K+1);
	for (LL g = K; g >= 1; g--) {
		Modint temp = modpow(Modint(K / g), N);
		for (LL t = 2; t * g <= K; t++) {
			temp -= DP[t * g];
		}
		ans += temp * Modint(g);
		DP[g] = temp;
	}
	cout << ans.v << "\n";
	return 0;
}


Measured memory_bytes: 3668
import sys
input = sys.stdin.readline


def main():
    H, W = map(int, input().split())
    A = []
    for _ in range(H):
        A.append(input().strip())

    dp = [[0]*W for _ in range(H)]
    x = 1
    for w in range(W):
        if A[0][w] == "#":
            x = 0
        dp[0][w] = x
    x = 1
    for h in range(H):
        if A[h][0] == "#":
            x = 0
        dp[h][0] = x

    for h in range(1, H):
        for w in range(1, W):
            if A[h][w] == ".":
                dp[h][w] = dp[h-1][w] + dp[h][w-1]
            else:
                dp[h][w] = 0

    print(dp[-1][-1] % (10**9+7))


if __name__ == '__main__':
    main()


Measured memory_bytes: 208220
N = int(input())
S = list((input()))
L = [str(i) for i in range(0,10)]
ALL =[]
for i in L:
    for j in L:
        for k in L:
            ALL.append(i+j+k)
cnt=0    
for a in ALL:
    try:
        
        I1 = S.index(a[0])
        I2 = S[I1+1:].index(a[1])+len(S[:I1+1])
        I3 = S[I2+1:].index(a[2])+len(S[:I2+1])

        if I1<I2 and I2<I3:
            cnt+=1
    except:
        continue
print(cnt)

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

int a=0;
int main(){
    string s;
    cin>>s;
    ref(i,s.size()){
        if(s[i]=='?') s[i]='D';
    }
    cout<<s;
    return 0;

}




Measured memory_bytes: 3752
using System;

namespace A___Multiple_of_2_and_N
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = long.Parse(Console.ReadLine());
            if (n % 2 == 0)
            {
                Console.WriteLine(n);
            }
            else
            {
                Console.WriteLine(n * 2);
            }
        }
    }
}

Measured memory_bytes: 13140
#include <iostream>

using namespace std;

int main() {
	long long int x, y;
	long long int kari;
	while (cin >> x >> y) {
		if (x == 0 && y == 0) {
			break;
		}
		if (x < y) {
			kari = x;
			x = y; 
			y = kari;
		}
		int counter = 0;
		while (y != 0) {
			counter++;
			x = x % y;
			kari = y;
			y = x;
			x = kari;
		}
		cout << x << " " << counter << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a;i < b; i++)

int main() {

	int a, b, c;
	cin >> a >> b >> c;

	a -= b;
	c -= a;

	if (c < 0) cout << 0 << endl;
	else cout << c << endl;

	return 0;
}


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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
   int n, k;
   cin>>n>>k;
   int p[1000];
   rep(i, n) cin>>p[i];
   sort(p, p+n);
   int sum=0;
   rep(i, k) sum+=p[i];
   cout << sum << endl;
   return 0;
}


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

using namespace std;

#define INP "solve"
#define OUT "solve"

const int QQ = 3e5 + 10;
const int maxN = 1e6 + 10;
const int maxM = 3e5 + 10;
const long long oo = 1e15;
const int module = 1e9 + 7;
const long double du = 1e-9;

void doc() {
    freopen(INP ".inp","r",stdin);
    freopen(OUT ".out","w",stdout);
}

void solve() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    long long F[n][n];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) F[i][j] = 1e15;
        F[i][i] = 0;
    }
    for (int i = n - 1; i >= 0; i--) {
        for (int j = i + 1; j < n; j++) {
            long long S = 0;
            for (int k = i; k <= j; k++) S += a[k];
            long long T = 0;
            for (int k = i; k < j; k++) {
                T += a[k];
                S -= a[k];
                F[i][j] = min(F[i][j], F[i][k] + F[k + 1][j] + T + S);
            }
        }
    }
    cout << F[0][n - 1];
}
int main(int argc,char *argv[]) {
    //srand(time(nullptr));
    ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
    ///doc();
    solve();
}


Measured memory_bytes: 1536
import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if(a == b && b == c){
			System.out.print("Yes");
		}else{
			System.out.print("No");
		}
	}
}


Measured memory_bytes: 21844
N,M = (int(i) for i in input().split())
ent = 2 **N
chk = [[int(i) for i in input().split()] for i in range(M)]
p_value = [int(i) for i in input().split()]
ans = 0
for i in range(ent):
    for k in range(M):
        count = 0
        for j in range(chk[k][0]):
            sy = i
            for l in range(chk[k][j+1]):
                if l == chk[k][j+1]-1:
                    sy = sy%2
                else:
                    sy = sy//2
            if sy ==1:
                count +=1
        if count%2 != p_value[k]:
            break
        else:
            if k == M-1:
                ans += 1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
//using lint = long long;

struct P
{
    int x,y,z;

    bool operator<(const P &a)const{
              return z>a.z;
    }

};

vector<int> v[3333];

//bitset<4001000> b;
int a,i,b,n,d,c,m,k;


int o[111113];
int l[111113];
int j[1];
int e;


int dx[10]={2,2,-2,-2,1,1,-1,-1},dy[10]={1,-1,1,-1,2,-2,2,-2};

//int dx[10]={0,1,0,-1,1,1,-1,-1},dy[10]={1,0,-1,0,1,-1,1,-1},dz[10]={0,0,0,0,1,-1};
long long mod=998244353,mod2=1000000009,mod3=2017;
long long x,z,y;
double pi=3.14159265;
//P u[222221];
stack<int> s;
//set<int> s[222][22];
//priority_queue<int> q;

//2147483647
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
//map<int,int> p;
//list<int> l;

//string r1,r2;
//char r1[33],r2[33];
//deque<int> de;
//srand((int)time(NULL));
bool as(P a,P b)
{
    return a.x<b.x;
}
bool qw(int a,int b)
{
    return a>b;
}

int main()
{
    scanf("%d",&a);
    if(a==1)
    {
        printf("Yes\n2\n1 1\n1 1");
        return 0;
    }
    if(a==2)
    {
        puts("No");
        return 0;
    }
    for(int t=3;t*(t-1)/2<=a;t++)
    {
        if(t*(t-1)/2==a)
        {
            int i=1;
            for(int h=1;h<=t;h++)
            for(int p=h+1;p<=t;p++)
            {
                v[h].push_back(i);
                v[p].push_back(i);
                i++;
            }
            printf("Yes\n%d\n",t);
            for(int i=1;i<=t;i++)
            {
                printf("%d ",v[i].size());
                for(int h=0;h<v[i].size();h++)
                    printf("%d ",v[i][h]);
                puts("");
            }
            return 0;
        }
    }
    puts("No");
}




Measured memory_bytes: 2432
<?php
fscanf(STDIN, "%s", $count);
$source = fgets(STDIN);
$takos = explode(" ",$source);
$result = 0;

for($i = 0; $i < $count; $i++)
{
    $temp = 0;
    for($j = 1; $i+$j < $count; $j++)
    {
        $temp += $takos[$i+$j];
    }
    $result += $takos[$i]*$temp;
}

echo($result);


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

int main() {
  int N;
  cin >> N;
  if(N % 10 == 3){
    cout << "bon" << endl;
  }
  else if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8){
    cout << "pon" << endl;
  }
  else{
    cout << "hon" << endl;
  }
  return 0;
}

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

#define ll long long
#define mtv(kit) cout<<#kit<<" - "<<kit<<"\n";
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map

void doit(){
	ll n;
	cin >> n;
	bool ok = 0;
	while(n){
		ll k = n % 10;
		if(k == 7)
			ok = 1;
		n /= 10;
	}
	if(ok)cout << "Yes" << nl;
	else cout << "No" << nl;
}

int main() {
#ifndef ONLINE_JUDGE
//    freopen("input1.txt","r",stdin);
//    freopen("output1.txt","w",stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ll t = 1;
//	 cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}


Measured memory_bytes: 3536
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

void solve() {
    int n, m;
    std::cin >> n >> m;

    std::vector<int> ds(n);
    for (int i = 0; i < n; ++i) {
        auto& d = ds[i];
        std::cin >> d;
    }

    Edges<int> es(m);
    std::vector<std::vector<int>> graph(n);
    for (int i = 0; i < m; ++i) {
        auto& e = es[i];
        std::cin >> e.src >> e.dst;
        --e.src, --e.dst;
        e.cost = 1e9;
        graph[e.src].push_back(i);
        graph[e.dst].push_back(i);
    }

    std::vector<bool> used(n, false);
    std::vector<std::vector<int>> forest(n);
    for (int v = 0; v < n; ++v) {
        if (used[v]) continue;

        // d_u <= d_vなる辺uvを探す
        int eid = -1;
        for (int i : graph[v]) {
            const auto& e = es[i];
            int u = e.src;
            if (u == v) u = e.dst;

            if (ds[u] <= ds[v]) {
                eid = i;
                break;
            }
        }

        if (eid < 0) {
            std::cout << -1 << std::endl;
            return;
        }

        // 辺を森に追加
        auto& e = es[eid];
        int u = e.src;
        if (u == v) u = e.dst;

        e.cost = ds[v];
        forest[v].push_back(u);
        forest[u].push_back(v);

        used[v] = true;
        if (ds[u] == ds[v]) used[u] = true;
        // uの条件も満たされる
    }

    // BFSで彩色
    std::vector<int> cs(n, -1);
    for (int r = 0; r < n; ++r) {
        if (cs[r] >= 0) continue;

        std::queue<int> que;
        que.push(r);
        cs[r] = 0;
        while (!que.empty()) {
            int v = que.front();
            que.pop();

            for (int u : forest[v]) {
                if (cs[u] >= 0) continue;
                cs[u] = 1 - cs[v];
                que.push(u);
            }
        }
    }

    for (auto c : cs) std::cout << "BW"[c];
    std::cout << std::endl;

    for (const auto& e : es) std::cout << e.cost << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}


Measured memory_bytes: 17152
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <queue>


using namespace std;
#define INF 0x3f3f3f3f3f
#define ll long long
#define pr(x) (cerr << #x << ' ' << x << ' ')
#define prln(x) (cerr << #x << ' ' << x << endl)


int main()
{
	#ifdef LOCAL
		freopen("in.txt", "r", stdin);
	#endif // LOCAL
	int n;
	scanf("%d", &n);
	int t = n;
	int cnt = 0;
	while (n) {
		cnt += (n % 10);
		n /= 10;
	}
	if (t % cnt == 0) {
		puts("Yes");
	}else {
		puts("No");
	}

	return 0;
}

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

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        System.out.println(Math.max(0,fsc.nextLong()-fsc.nextLong()));
        fsc.close();
        
    }
    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}


Measured memory_bytes: 21332
<?php
  fscanf(STDIN, "%s", $s);
  $cnt = [];
  $chars = str_split($s);
  foreach($chars as $c) $cnt[$c]++;

  foreach(range('a','z') as $c) {
    if ($cnt[$c] == 0) {
      echo $c . "\n";
      exit;
    }
  }

  if (f) echo "None\n";

Measured memory_bytes: 10744
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i = 0; i < n; i++)
#define println(v) cout << v << "\n";

int ni() {
    int i;
    cin >> i;
    return i;
}

int main()
{
    int N = ni(), M = ni();

    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<>> ab;

    REP(i, M) {
        int a = ni()-1;
        int b = ni()-1;
        ab.push(make_pair(a, b));
    }

    int minB = N;
    int ans = 0;
    REP(x, N) {
        if (x == minB) {
            ans++;
            minB = N;
        }
        while (ab.size() > 0 &&  x == ab.top().first) {
            minB = min(minB, ab.top().second);
            ab.pop();
        }
    }

    println(ans);

    return 0;
}

Measured memory_bytes: 1400