akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 0; i <= (int)(n); i++)
using P = pair<int,int>;
using pq = priority_queue<int>;
typedef long long ll;

int  main()
{
	string s; cin >> s;

	rep(i, s.size())
	{
		if (i%2 == 0)
			cout << s[i];
	}
	cout << endl;
	return 0;
}

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

#define ll                     long long
#define loop( i,a)             for(i=0;i<a;i++)
#define loop1(i,a)             for(i=1;i<=a;i++)
#define ppp(a)                 cout<<a<<endl;
#define sscd(a)                scanf("%lf",&a)
#define sss(a)                 cin>>a
#define scc(a)                 scanf("%c",&a)
#define FOR(i,a,b)             for(i=a;i<b;i++)
#define FORE(i,a,b)            for(i=a;i<=b;i++)
#define reverses(s)            reverse(s.begin(),s.end())
#define inf                    9000000000000000
#define pii                    3.1415926536
#define pb(a)                  push_back(a)
#define pppp(a,b)              cout<<a<<"  "<<b;
#define newline                printf("\n");
#define sorted(a)               sort(a.begin(),a.end())


int main()
{
    ll n,y,m,r10k=0,r5k=0,r1k=0,nn,r;
    cin>>n>>y;
    m=y;
    r10k=m/10000;
    m=m%10000;
    r5k=m/5000;
    m=m%5000;
    r1k=m/1000;
    m=m%1000;
    if(m>0)
    {
        ppp("-1 -1 -1")
        return 0;
    }
    if(n<(r10k+r5k+r1k))
    {
        ppp("-1 -1 -1")
        return 0;
    }
    if(n==(r10k+r5k+r1k))
    {
        printf("%lld %lld %lld\n",r10k,r5k,r1k);
        return 0;
    }
    nn=y/1000;
    for(ll i=0;i<=20000;i++)
    {
        for(ll j=0;j<=10000;j++ )
        {
            if(i+j*5>nn)
                continue;
            if((nn-(i+5*j))%10==0)
            {
                if((i+j+(nn-(i+5*j))/10)==n)
                {
                    printf("%lld %lld %lld\n",(nn-(i+5*j))/10,j,i);
                    return 0;
                }
            }
        }
    }

        ppp("-1 -1 -1")

    return 0;
}


Measured memory_bytes: 256
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
import java.util.Map.Entry;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.NoSuchElementException;

public class Main {
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		ArrayList<StringBuilder> list = new ArrayList<StringBuilder>();
		for(int i = 0; i < 3; i++) list.add(new StringBuilder(sc.next()));
		int num = 0;
		String name = "ABC";
		while(true){
			StringBuilder p = list.get(num);
			if(p.length() == 0) break;
			char c = p.charAt(0);
			if(c == 'a') num = 0;
			if(c == 'b') num = 1;
			if(c == 'c') num = 2;
			p.delete(0, 1);
			
		}
		System.out.println(name.charAt(num));
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    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());
    }
}

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

#define maxn 802
#define FOR(i, l, r) for (int i=l; i<=r; ++i)
#define FORD(i, r, l) for (int i=r; i>=l; --i)
#define REP(i, r) for (int i=0; i<(int)r; ++i)
#define REPD(i, r) for (int i=(int)r-1; i>=0; --i)
#define fi first
#define se second
#define mk make_pair
#define nil NULL
#define y0 __y0
#define y1 __y1
#define x0 __x0
#define x1 __x1
#define next __next
#define sz size
#define Debug(X) {cerr << #X << " = " << X << '\n';}
#define PR(A, n) {cerr << #A << " = "; FOR(i, 1, n) cerr << A[i] << ' '; cerr << '\n';}
#define PR0(A, n) {cerr << #A << " = "; REP(i, n) cerr << A[i] << ' '; cerr << '\n';}
typedef long long ll;
typedef double db;
typedef pair<db, db> dd;
typedef pair<int, int> ii;
typedef vector<int> vi;
const int inf = 1e9;
template<class T> int getbit(T x, int pos) {return (x>>(pos-1)) & 1;}
template<class T> void turn_on(T &x, int pos) {x = x | ((T)1<<(pos-1));}
template<class T> void turn_off(T &x, int pos) {x = x & ~((T)1<<(pos-1));}
template<class T> T sqr(T a) {return a*a;}

int m, n, k, d1[maxn][maxn], d2[maxn][maxn];
queue<ii> qu_1, qu_2;
ii st, mv[] = {ii(-1, 0), ii(1, 0), ii(0, -1), ii(0, 1)};
char a[maxn][maxn];

void bfs() {
    memset(d1, -1, sizeof(d1));
    memset(d2, -1, sizeof(d2));
    d1[st.fi][st.se] = d2[st.fi][st.se] = 0;
    qu_1.push(st);
    qu_2.push(st);
    int res = inf;
    while (qu_1.sz()) {
        ii u = qu_1.front(); qu_1.pop();
        REP(i, 4) {
            int x = u.fi + mv[i].fi, y = u.se + mv[i].se;
            if (x<1 || x>m || y<1 || y>n || a[x][y]!='.') continue;
            if (d1[u.fi][u.se]<k && d1[x][y]==-1) {
                d1[x][y] = d1[u.fi][u.se] + 1;
                qu_1.push(ii(x, y));
                qu_2.push(ii(x, y));
                d2[x][y] = 0;
                if (x==1 || x==m || y==1 || y==n) res = 1;
            }
        }
    }
    while (qu_2.sz()) {
        ii u = qu_2.front(); qu_2.pop();
        REP(i, 4) {
            int x = u.fi + mv[i].fi, y = u.se + mv[i].se;
            if (x<1 || x>m || y<1 || y>n) continue;
            if (d2[x][y]==-1) {
                d2[x][y] = d2[u.fi][u.se] + 1;
                qu_2.push(ii(x, y));
                if (x==1 || x==m || y==1 || y==n) res = min(res, 1+d2[x][y]/k+(d2[x][y]%k!=0));
            }
        }
    }
    cout << res;
}

int main() {
    //freopen("closedroom.inp", "r", stdin);
    //freopen(".out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> m >> n >> k;
    FOR(i, 1, m) FOR(j, 1, n) {
        cin >> a[i][j];
        if (a[i][j]=='S') st = ii(i, j);
    }
    bfs();
}


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

using ll = long long;
using db = double;
using pll = pair < ll, ll >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std :: endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define pb push_back
#define mp make_pair
#define fastIo() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)

const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;

int main(){
	ll a, b, n, x;
	cin >> a >> b >> n;
	x = n;
	x = min(n, b-1);
	cout << (a*x)/b - a * (x/b) << endl;
}

Measured memory_bytes: 3564
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD 1000000007
using namespace std;

int main(void){
    int n,h,w;
    cin >> n >> h >> w;
    int a,b,ans=0;
    for(int i=0; i<n; i++){
        cin >> a >> b;
        if(a>=h && b>=w)ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// 12/07/2020  @ 19:54:17
// *****************************************************************
// *****************************************************************
#include <bits/stdc++.h>
// *****************************************************************
// *****************************************************************
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#define fr(i,n) for(llu i=0;i<n;i++)
#define fl(j,a,b) for(llu j=a;j<=b;j++)
#define Pi 3.1415926535897932384626
#define mod 1e9+7
#define MID(a,b) ((a + b) >> 1)
#define MAX(a,b) ((a) > (b) ? (a): (b))
#define MIN(a,b) ((a) < (b) ? (a) :(b))
#define pb push_back
#define mp make_pair
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define printer(a, n) fr(i,n) cout << a[i] << " ";
// *****************************************************************
// *****************************************************************
typedef long long unsigned int llu;
typedef long long int ll;
// *****************************************************************
// *****************************************************************
using namespace std;
// *****************************************************************
// *****************************************************************

                   // Dream it. Wish it. Do it.

                         // tannatsri //

              // Without tact you can learn nothing.

// *****************************************************************
// *****************************************************************
bool rev(ll a, ll b) {
    return a > b;
}
// *****************************************************************
void solution() {
	int  n;
	cin >> n;
	int  x = n  % 10;
	if(x == 1 or x == 0 or x == 6 or x == 8) cout << "pon";
	else if(x == 3) cout <<"bon";
	else cout <<"hon";

}
// *****************************************************************
int main() {
    IOS;
    // #ifndef ONLINE_JUDGE
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/input.txt", "r", stdin);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/output.txt", "w", stdout);
        // freopen("C:/Users/Mr.Tanishq/Desktop/noc/error.txt", "w", stderr);
    // #endif
    // *****************************************************************
    // *****************************************************************
    int t = 1;
    // cin >> t;
    while(t--) {

       solution();
       cout << "\n";
    }
    return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define ll long long
using namespace std;

ll n, ans;

inline ll read(){
	ll s = 0, w = 1;
	char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) w *= ch == '-' ? -1 : 1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) s = s * 10 + ch - '0';
	return s * w;
}

inline void work(){
	n = read();
	ans = (1 + n) * n >> 1;
	REP(i, 3, n)
		if (i % 3 == 0 || i % 5 == 0) ans -= i;
	printf("%lld\n", ans);
}

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

Measured memory_bytes: 3752
#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;

int main(){
    string s;
    cin >> s;
    string t = s;
    reverse(t.begin(), t.end());
    ll ans = 0;
    ll si = 0, ti = 0;
    while(1){
        if(si == s.size() && ti == t.size()){
            break;
        }else if(si == s.size() && t[ti] == 'x'){
            ti++;
        }else if(ti == t.size() && s[si] == 'x'){
            si++;
            ans++;
        }else if(si == s.size() || ti == t.size()){
            break;
        }else if(s[si] == t[ti]){
            si++;
            ti++;
            continue;
        }else if(s[si] == 'x'){
            si++;
            ans++;
        }else if(t[ti] == 'x'){
            ti++;
        }else{
            break;
        }
    }
    cout << (si == s.size() && ti == t.size() ? ans : -1) << endl;
    return 0;
}


Measured memory_bytes: 512
loop do
    n = gets.to_i
    break if n == 0
    a = gets.split.map(&:to_i)
    table = (0..n-1).map { [0] * n }
    (0..n-2).each do |i|
        table[i][i+1] = 2 if (a[i] - a[i+1]).abs <= 1
    end
    (2..n-1).each do |d|
        (0..n-1-d).each do |l|
            r = l + d
            x = table[l+1][r-1]
            table[l][r] = x + 2 if (a[l] - a[r]).abs <= 1 && x == r - l - 1
            (l..r-1).each do |i|
                m = table[l][i] + table[i+1][r]
                table[l][r] = m if m > table[l][r]
            end
        end
    end
    p table[0][n-1]
end

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

int main() {
  int x;
  cin >> x;
  int ans = 0;
  if(400 <= x && x <= 599) ans = 8;
  else if(600 <= x && x <= 799) ans = 7;
  else if(800 <= x && x <= 999) ans = 6;
  else if(1000 <= x && x <= 1199) ans = 5;
  else if(1200 <= x && x <= 1399) ans = 4;
  else if(1400 <= x && x <= 1599) ans = 3;
  else if(1600 <= x && x <= 1799) ans = 2;
  else if(1800 <= x && x <= 1999) ans = 1;

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

Measured memory_bytes: 3620
import java.util.Scanner;

public class Main {

//
//高橋君は 
//3
// 桁のパスワードを設定しようとしています。
//
//使える文字が 
//1
// 以上 
//N
// 以下の数字のみであるとき、設定できるパスワードが全部で何種類であるかを答えてください。
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int maxNum = sc.nextInt();
		
		System.out.println(maxNum*maxNum*maxNum);
	}
}


Measured memory_bytes: 23892
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//solve

//FUNCTION
//solve

void solve(void)
{
  int H,N;
  cin>>H>>N;
  vector<pair<int,int> > vp;
  for (int i = 0; i < N; i++)
  {
    int A,B;cin>>A>>B;
    vp.emplace_back(A,B);
  }

  vector<int> DP (H+1,INF);
  DP[0] = 0;
  for (int i = 1; i <= H; i++)
  {
    for (int j = 0; j < N; j++)
    {
      DP[i] = min(DP[i],DP[max(0LL,i - vp[j].first)] + vp[j].second);
    }
    
  }
  // DEBUG(DP);
  cout<<DP[H]<<endl;
  
  return;
}

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

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

int main(void){
    int N, M;
    cin >> N >> M;
    
    vector<int> A(N);
    int sum = 0;
    for(int i = 0; i < N; i++){
        cin >> A[i];
        sum += A[i];
    }
    
    int cnt = 0;
    for(int i = 0; i < N; i++){
        if(A[i]*4*M >= sum) cnt++;
    }
    
    if(cnt >= M) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>

int solve(int A, int B)
{
    if (A >= 13)
        return B;
    else if (A >= 6)
        return B / 2;
    else
        return 0;
}

int main()
{
    int A, B;

    std::cin >> A >> B;
    std::cout << solve(A, B) << std::endl;
    return 0;
}


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

int main()
{
	string s;
	cin >> s;
	int a = -1, z;
	for (int i = 0; i < s.size(); i++) {
		if (a == -1 && s[i] == 'A') {
			a = i;
		}
		if (s[i] == 'Z') {
			z = i;
		}
	}
	cout << (z - a + 1) << endl;
	return 0;
}


Measured memory_bytes: 640
var
	s:String;
	t:String;
	l,i:Longint;
begin
	readln(s);
	l:=length(s);
	for i:=0 to 7 do begin
		t:=copy(s,1,i)+copy(s,l-(6-i),7-i);
		if t='keyence'then begin
			writeln('YES');
			exit;
		end;
	end;
	writeln('NO');
end.


Measured memory_bytes: 128
main=do
 x<-map(subtract 48.fromEnum)<$>getLine
 putStrLn$((show$head x)++)$f(head x)(tail x)
f q[]=if q==7 then "=7 " else ""
f q(c:s)=if null pl then if null mi then "" else "-"++(show c)++mi else "+"++(show c)++pl
 where pl=f(q+c)s
       mi=f(q-c)s

Measured memory_bytes: 380
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a)      (a).begin(),(a).end()
#define debug_array(a,n) for (ll bccc=(0); bccc<(n); bccc++) cout<<a[bccc]<<" "<<"\n"
#define debug_vector(a) for(ll bccc=(0); bccc<(a.size());bccc++) cout<<a[bccc]<<" "<<"\n"
#define F           first
#define S           second
#define debug_set(s) for(auto p:s) cout<<p<<" "
#define debug_map(m) for(auto p:m) cout<<p.F<<" "<<p.S<<"\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll> >,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
/* ll t = 0;
ordered_multiset me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

///////////   t is insertion time
*/
//#pragma GCC optimize("Ofast")  // works very well
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long double lld;
lld pi=3.14159265358;
ll powr(ll a,ll b)
{
    ll c=1;
    ll kjk;
    for(kjk=0;kjk<b;kjk++)
        c*=a;
    return c;
}
ll hell=1000000007;
//ll hell=998244353   ;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// to generate random number , use rng() ... eg cout<<rng();
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    ll n,i;
    cin>>n;
    vector<ll> a(n);
    vector<string> s(n);
    for(i=0;i<n;i++)
    {
        cin>>s[i]>>a[i];
    }
    string ss;
    cin>>ss;
    for(i=0;i<n;i++)
    {
        if(s[i]==ss)
            break;
    }
    ll sum=0;
    for(ll j=i+1;j<n;j++)
    {
        sum+=a[j];
    }
    cout<<sum;
    return 0;
}


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

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

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

  int ans = h / a;
  if (h % a != 0) ++ans;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

fn solve() {
    input! {
        n: usize
    };
    let c = (n + 1) / 2;
    let res = c as f64 / n as f64;
    println!("{}", res);
}

fn main() {
    std::thread::Builder::new()
        .name("big stack size".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(|| {
            solve();
        })
        .unwrap()
        .join()
        .unwrap();
}


Measured memory_bytes: 2264
#include<algorithm>
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
long long  N=0;
long long a[100010]={0},b[100010]={0},c[100010]={0};
long long dp[100010][4]={0};
int main(void){
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>a[i]>>b[i]>>c[i];
	}
	dp[0][0]=a[0];
	dp[0][1]=b[0];
	dp[0][2]=c[0];
	for(int j=0;j<N-1;j++){
		for(int i=0;i<3;i++){
			if(i==0){
				dp[j+1][0]=max(dp[j][1],dp[j][2])+a[j+1];
			}
			else if(i==1){
				dp[j+1][1]=max(dp[j][0],dp[j][2])+b[j+1];
			}
			else{
				dp[j+1][2]=max(dp[j][0],dp[j][1])+c[j+1];
			}
		}
	}
	cout<<max(dp[N-1][0],max(dp[N-1][1],dp[N-1][2]))<<endl;
	return 0;
}

Measured memory_bytes: 5760
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
C_sum=0
for i in range(1,N):
    if A[i]-A[i-1]==1:
        C_sum+=C[A[i-1]-1]
print(sum(B)+C_sum)

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
import sys
import math

#tmp = input().split()
#n,m = list(map(lambda a: int(a), tmp))

#k = int(input())
#s = input()
tmp = input().split()
a,b,h,m = list(map(lambda a: int(a), tmp))

rad=abs(h*30+m/2-m*6)

if(rad>=180):
	rad=360-rad

csq=a**2+b**2-2*a*b*math.cos(math.radians(rad))

print(math.sqrt(csq))





Measured memory_bytes: 9448
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int x,maxn=1;
int main()
{
	scanf("%d",&x);
	int c=sqrt(x);
	for(int b=2;b<=c;b++)
		for(int t=b*b;t<=x;t*=b)
			maxn=max(maxn,t);
	printf("%d",maxn);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 100005;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
class UnionFind{
    private:
        vector<ll> par;
        vector<ll> siz;
    public:
        UnionFind(ll sz){
            par.resize(sz);
            siz.assign(sz,1LL);
            rep(i,sz) par[i] = i;
        }

        ll find(ll x){
            if (par[x] == x) return x;
            else return par[x] = find(par[x]);
        }

        void unite(ll x,ll y){
            x = find(x);
            y = find(y);
            if (x == y) return;
            if (siz[x] < siz[y]) swap(x,y);
            siz[x] += siz[y];
            par[y] = x;
        }

        bool same(ll x,ll y){
            return find(x) == find(y);
        }

        ll size(ll x){
            return siz[find(x)];
        }
};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m,x,y;
    cin >> n >> m;
    vector<ll> p(n);
    rep(i,n){
        cin >> x;
        p[--x] = i;
    }
    UnionFind g(n);
    rep(i,m){
        cin >> x >> y;
        --x;
        --y;
        g.unite(x,y);
    }
    ll cnt = 0;
    rep(i,n){
        if (g.same(i,p[i])) cnt++;
    }
    PRINT(cnt);
}





Measured memory_bytes: 2560
#include <iostream>
#include <string>
#include <vector>
// #include <unordered_map>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <climits>

using namespace std;

#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define FOR(i, j, k) for(int i=j ; i<k ; i++)
#define RFOR(i, j, k) for(int i=j ; i>=k ; i--)
#define REP(i, j) FOR(i, 0, j)
#define RREP(i, j) RFOR(i, j, 0)
#define PI 3.1415926535897932384626433832795
typedef long long int ll;
typedef unsigned long long int  ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef vector<vi> vvi;

#define INF 1000000000

int N, A, B;

bool check(ll mid, vll& h){

	ll c = 0;

    REP(i, N) {
        ll b_attack = mid * B;
        if (h[i] - b_attack > 0) {
            c += (h[i] - b_attack) / (A - B);
            if ( (h[i] - b_attack) % (A - B) > 0) c++;
        }
    }

	return c <= mid;
}

int main() {

    cin >> N >> A >> B;

    vll h(N);
    REP(i, N) cin >> h[i];

    ll bot = 0, top = INF;
    while ((top - bot) > 1) {
        ll mid = (bot + top) / 2;

        if (check(mid, h)) top = mid;
        else bot = mid;
    }

	if (check(bot, h)) cout << bot << endl;
	else cout << top << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

vector<int>v[100005];
int t[100005]={};

void BFS(int p)
{
	queue<int>Q;	
	Q.push(p);
	t[p]=p;
	while(!Q.empty())
	{
		p=Q.front();
		Q.pop();
		for(int i=0;i<v[p].size();i++)
		{
			if(!t[v[p][i]])
			{
				t[v[p][i]]=p;
				Q.push(v[p][i]);
			}
		}
	}
}

int main()
{	
	int n,m,a,b;
	cin>>n>>m;
	vector<pair<int,int>>w;
	for(int i=0;i<m;i++)
	{
		cin>>a>>b;
		if(a>b)swap(a,b);
		w.push_back(make_pair(a,b));
	}
	sort(w.begin(),w.end());
	for(int i=0;i<m;i++)
	{
		v[w[i].first].push_back(w[i].second);
		v[w[i].second].push_back(w[i].first);
	}
	BFS(1);
	for(int i=2;i<=n;i++)
	{
		if(t[i]==0)
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	for(int i=2;i<=n;i++)cout<<t[i]<<endl;
	return 0;
}

Measured memory_bytes: 12040
import java.io.*;

public class Main {
    public static void main(String [] args) {
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            int k = Integer.parseInt(in.readLine());
            String s = in.readLine();
            if (s.length() <= k) {
                System.out.print(s);
            } else {
                System.out.print(s.substring(0, k) + "...");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Measured memory_bytes: 36264
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

const int INF = INT_MAX / 2;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    for(int i=0; i<n; ++i)
        cin >> h[i];

    vector<int> dp(n, INF);
    dp[0] = 0;
    for(int i=0; i<n; ++i){
        for(int j=1; j<=k && i+j<n; ++j){
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i] - h[i+j]));
        }
    }
    cout << dp[n-1] << endl;

    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define All(V) V.begin(), V.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

int main()
{
  int k; cin >> k;
  vector<ll> va;
  for(int i = 1; i <= 9; i++) va.push_back(i);
  while(1){
    if(k < va.size()){
      cout << va[k-1] << endl;
      system("pause");
      return 0;
    }
    k -= va.size();
    vector<ll> vb;
    swap(va, vb);
    for(ll t : vb){
      for(int i = -1; i <= 1; i++){
        ll x = t%10 + i;
        if(x < 0 || x > 9)continue;
        ll nx = t*10 + x;
        va.push_back(nx);
      }
    }
  }
  system("pause");
}

Measured memory_bytes: 1712
n=int(input())

num,a,b=0,0,0

for i in range(n):
  t,x,y=map(int,input().split())
  num,a,b=abs(t-num),abs(x-a),abs(y-b)
  su=a+b
  if num>=su and num%2 == su%2:
    ans="Yes"
  else:
    ans="No"
    break
      
print(ans)


Measured memory_bytes: 9160
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main(){
	int r,g,b,n;cin>>r>>g>>b>>n;
	int cnt=0;
	for(int i=0;r*i<=n;i++){
		for(int j=0;r*i+g*j<=n;j++){
			int k=n-(r*i+g*j);
			if(k%b==0){
				cnt++;
			}
		}
	}
	cout<<cnt<<endl;
}

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

int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	int ans = 0;
	if(a<0){
		ans+= -a*c;
		a = 0;
	}
	
	if(a==0)ans += d;
	if(a>=0) {
		 ans+=(b-a)*e;
	}
	
	cout<<ans<<endl;
	return 0;
}


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

int main() {

    int n;

    cin >> n;

    map<int,int> m;

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

    ans = m.size();

    if(ans%2 == 0){
        ans--;
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;

int main(){
    int num, bil;
    scanf("%d %d", &num, &bil);

    vector<long long> arr(num), w(num);
    vector<vector<long long>> dp(num, vector<long long>(bil+1, 0));

    for(int i = 0; i < num; i++){
        scanf("%lld %lld", &arr[i], &w[i]);
    }

    for(int i = 0; i < num; i++){
        for(int j = 1; j <= bil; j++){
            if(i == 0){
                if(j - arr[i] < 0) dp[i][j] = 0;
                else dp[i][j] = w[i];
            }
            else{
                dp[i][j] = dp[i-1][j];
                if(j - arr[i] >= 0){
                    dp[i][j] = max(dp[i][j], (w[i] + dp[i-1][j-arr[i]]));
                }
            }
        }
    }

    printf("%lld\n", dp[num-1][bil]);

    return 0;
}

Measured memory_bytes: 82328
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int k;
  cin>>k;
  int sum = 1;
  if(a>=b&&a>=c){
    sum = pow(2.0,k)*a;
    sum = sum + b+ c;
  }
  else if(b>=a&&b>=c){
    sum = pow(2.0,k)*b;
    sum = sum + a+ c;

  }
  else if(c>=a&&c>=b){
    sum = pow(2.0,k)*c;
    sum = sum + a+ b;

  }
  cout<<sum<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")  
#pragma GCC optimize ("-fno-defer-pop")
typedef long long int ll; 
typedef long double ld; 

int main()
{	
    std::ios_base::sync_with_stdio(0);
	  cin.tie(0);
	  cout.tie(0);
    
    ll A,B,C,D;
    cin>>A>>B>>C>>D;

    while(1)
    {
        C-=B;
        if(C<=0)
        {
            cout<<"Yes"<<endl;
            return 0;
        }
        A-=D;
        if(A<=0)
        {
            cout<<"No"<<endl;
            return 0;
        }
    }


}

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

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;}
/*
void chmin(ll a, ll b){if (a>b){a = b; return true;}return false;}
void chmax(ll a, ll b){if (a<b){a = b; return true;}return false;}
*/

const ll MOD = 1000000007;

int main() {
  int n,m; cin >>n >>m;
  vector<int> a(m);
  vector<ll> dp(n+2, 0);
  dp[0] = 1;
  rep(i,m){
    cin >>a.at(i);
    dp[a.at(i)] = -1;
  }

  for (int i=0; i<n; i++){
    if (dp[i]==-1) continue;
    if (dp[i+1]!=-1) dp[i+1] = (dp[i+1] + dp[i]) % MOD;
    if (dp[i+2]!=-1) dp[i+2] = (dp[i+2] + dp[i]) % MOD;
  }
  cout <<dp[n] <<endl;
}

Measured memory_bytes: 1408
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        string s, t;
        cin >> s >> t;
        cout << t << s << endl;
    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 760
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val array = Array(n, {0.0})
    for(i in 0..n-1){
        array[i] = scanner.nextDouble()
    }
    array.sortDescending()
    val array2 = Array(n-1, {0.0})
    for(i in 1..n-1){
        array2[i-1] = array[i]
    }
    array2.sort()
    var result = array2[0]
    for(i in 1..array2.size-1){
        result = (result+array2[i])/2.0
    }
    println((array[0]+result)/2.0)
}

Measured memory_bytes: 35664
using System;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int x = sc.NextInt();
        int a = sc.NextInt();
        int b = sc.NextInt();

        int aa = Math.Abs(a - x);
        int bb = Math.Abs(b - x);

        if (aa < bb)
        {
            Console.WriteLine("A");
        }
        else
        {
            Console.WriteLine("B");
        }
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 13268
N = int(input())
A = list(map(int, input().split()))
max_a = max(A) + 1
counter = [0 for _ in range(max_a)]

for i in A:
    for j in range(i, max_a, i):
        counter[j] += 1

res = 0

for a in A:
    if counter[a] == 1:
        res += 1

print(res)


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

#define IOS                                                                    \
    ios::sync_with_stdio(0);                                                   \
    cin.tie(0);                                                                \
    cout.tie(0);
#define endl "\n"
typedef long long ll;
const ll MOD = 1e9 + 7;

int main(void) {
    IOS;
    int x, n;
    cin >> x >> n;

    if(n == 0) {
        cout << x;
        return 0;
    }

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

    int t = 0;
    int mi;
    int pl;
    for(int i = 0; i < 200; i++) {
        mi = x - t;
        pl = x + t;
        bool found = false;
        for(int j = 0; j < n; j++) {
            if(mi == p[j]) {
                found = true;
                break;
            }
        }
        if(!found) {
            cout << mi;
            return 0;
        }
        found = false;
        for(int j = 0; j < n; j++) {
            if(pl == p[j]) {
                found = true;
                break;
            }
        }
        if(!found) {
            cout << pl;
            return 0;
        }
        t++;
    }
}


Measured memory_bytes: 3624
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/

#include <bits/stdc++.h>
using namespace std;

const int mx=1e5+5;
typedef pair<int,int> PII;
vector<PII> edges[mx];
deque<PII> myQ;
int dist[mx];
int bfs01 ()
{
    memset(dist,63,sizeof(dist));
    dist[1]=1;
    myQ.push_front(PII(1,1));
    while (!myQ.empty()) {
        PII A=myQ.front();
        myQ.pop_front();
        if (dist[A.first]<A.second) continue;
        for (PII E: edges[A.first]) {
            if (dist[A.first]+E.second<dist[E.first]) {
                dist[E.first]=dist[A.first]+E.second;
                if (E.second) myQ.push_back(PII(E.first,dist[E.first]));
                else myQ.push_front(PII(E.first,dist[E.first]));
            }
        }
    }
    return dist[0];
}
int main ()
{
    int i,n;

    scanf ("%d",&n);
    for (i=0;i<n;i++) {
        edges[i].push_back(PII(i*10%n,0));
        edges[i].push_back(PII((i+1)%n,1));
    }
    printf ("%d\n",bfs01());

    return 0;
}


Measured memory_bytes: 6528
#include<bits/stdc++.h>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
ll h,n,ans,a;
int main(){
	cin>>h>>n;
	rep(i,n){
		cin>>a;
		ans+=a;
	}
	if(ans<h)
	cout<<"No";
	else
	cout<<"Yes";
	re 0;
}


Measured memory_bytes: 256
n = int(input())
p = map(int, input().split())
p = list(p)
n = len(p)
n = n - 1

c = 0
for i in range(1, n):
    i0 = i -1
    i1 = i + 1
    if (p[i] > p[i0]) & (p[i] < p[i1]):
        c += 1
    elif (p[i] < p[i0]) & (p[i] > p[i1]):
        c += 1
    else:
        c += 0    
print(c)

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

using namespace std;

typedef long long ll;

const int N = 2e5 + 5;

vector <int> g[N];
vector <int> has;
ll a[N];
ll ans[N];
int n;
int st[N], ed[N];
int t = 0;
int q;

void dfs(int u, int p) {
  st[u] = ++t; has.push_back(u);
  for(auto v : g[u]) {
    if(v == p) continue;
    dfs(v, u);
  }
  ed[u] = t;
}

int main() {
  cin >> n >> q; has.push_back(-1);
  for(int i = 1; i < n; i++) {
    int u, v; cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  while(q--) {
    int p; cin >> p;
    ll x; cin >> x;
    a[st[p]] += x, a[ed[p] + 1] -= x;
  }
  //for(int i = 1; i <= n; i++) {
    //a[i] += a[i - 1];
  //}
  ll sum = 0;
  for(int i = 1; i <= n; i++) {
    sum += a[i]; ans[has[i]] = sum;
  }
  for(int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  }
}

Measured memory_bytes: 28280
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<set>
#include<vector>
#include<queue>
#include<string>
using namespace std;
const int MAX_N = 10005;
const int INF = 0x3f3f3f3f;
typedef long long ll;

int main() {
	int x, y, z;
	cin >> x >> y >> z;
	if (x == y && x != z || x == z && x != y || y == z && y != x) {
		cout << "Yes\n";
	}
	else cout << "No\n";
	return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <climits>
#define int int64_t
#define endl "\n"
#define INF INT_MAX - 2
using namespace std;

void io()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
}

int n, capacity;
int knapsack(vector<int> &weight, vector<int> &price,int maxProfit)
{
    vector<vector<int>> dp(102, vector<int>(100000, 0));
    //base case initiliazation
    for (int N = 0; N <= n; N++)
    {
        for (int profit = 0; profit <= maxProfit; profit++)
        {
            if (N ==0 && profit == 0)
            {
                dp[N][profit] = 0;
            }
            else if(N ==0){
                dp[N][profit] = INF;
            }
            else if(price[N-1] <= profit){
                dp[N][profit] = min(weight[N-1] + dp[N-1][profit - price[N-1]],dp[N-1][profit]);
            }else {
                dp[N][profit] = dp[N-1][profit];
            }
            
        }
        
    }
    int ans = 0;
    for (int profit = 0; profit <= maxProfit; profit++)
    {
        if(dp[n][profit] <= capacity && dp[n][profit]!= INF){
            ans = profit;
        } 
    }
   
    return ans;
}
void Solution()
{
    cin >> n >> capacity;
    vector<int> weight(n);
    vector<int> price(n);
    int maxProfit =0;
    for (int i = 0; i < n; i++)
    {
        cin >> weight[i] >> price[i];
        maxProfit += price[i];
    }

    cout << knapsack(weight,price,maxProfit);
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //io();
    Solution();
}

Measured memory_bytes: 81024
#include<bits/stdc++.h>
#include<string.h>
#include <math.h>
#include<iostream>
using namespace std;
typedef long long           ll;
typedef unsigned long long  ull;
typedef long double         ld;

#define sf                  scanf
#define pf                  printf
#define srev                reverse(s.begin(),s.end())
#define sortstr             sort(s.begin(), s.end());
#define gtl(x)              getline(cin, (x))
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define PI                  acos(-1)
#define Precision(a) cout << fixed << setprecision(a)
#define FasterIO     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);


template <typename T> T Sqr(T x) { T n = x * x ; return n ;}
template <typename T> T Pow(T B,T P){ if(P==0) return 1; if(P&1) return B*Pow(B,P-1);  else return Sqr(Pow(B,P/2));}
template <typename T> T Abs(T a) {if(a<0)return -a;else return a;}
template <typename T> T Gcd(T a,T b){if(a<0)return Gcd(-a,b);if(b<0)return Gcd(a,-b);return (b==0)?a:Gcd(b,a%b);}
template <typename T> T Lcm(T a,T b) {if(a<0)return Lcm(-a,b);if(b<0)return Lcm(a,-b);return a*(b/Gcd(a,b));}
//scanf("%[^\n]%*c", str);
//sort(s,s+n,greater<int>());

int main()
{
    int n, a;
    int s[1000000];
    cin >> n;
    for(int i=2; i<=n; i++)
    {
        cin >> a;
        s[a]++;

    }
    for(int i=1; i<=n; i++)
    {
        cout << s[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 4396
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <set>
using namespace std;

#define rint register int
#define gc() getchar()
inline int read(rint ans = 0, rint sgn = ' ', rint ch = gc())
{
	for(; ch < '0' || ch > '9'; sgn = ch, ch = gc());
	for(; ch >='0' && ch <='9';(ans*=10)+=ch-'0', ch = gc());
	return sgn-'-'?ans:-ans;
}
int n, m; multiset<int> S;
int main()
{
	n = read();
	for(rint i = 1; i <= n; S.insert(read()), i++);
	m = read();
	for(rint i = 1, a; i <= m; i++)
	{
		a = read();
		if(S.find(a)==S.end()){puts("NO"); return 0;}
		S.erase(S.find(a));
	}	puts("YES"); return 0;
}

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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  long long k, i = 0;
  cin >> s >> k;
  while (true) {
    if (i + 1LL == k || s[i] != '1') {
      cout << s[i] << '\n';
      return 0;
    }
    i++;
  }
}


Measured memory_bytes: 256