akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 200
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d ", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 1000000009
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(int N, int pos){return (bool)(N & (1<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    int a, b, c;
    cin>>a>>b>>c;
    if((a==b && b!=c) || (a==c && c!=b) || (b==c && a!=b))
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    //End();
    return 0;
}
/*

*/


Measured memory_bytes: 256
#include <iostream>
#include "string.h"
using namespace std;
int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int N;
	string S;
	cin >> N;
	cin >> S;
	int count = 0;
	int max = 0;
	for(int i = 0;i < S.length();i++){
		if(S[i] == 'D') count -= 1;
		if(S[i] == 'I') count += 1;
		if(max < count) max = count;
	}
	cout << max << endl;
	return 0;
}

Measured memory_bytes: 508
#include <atcoder/dsu>
#include <cstdio>

using namespace std;
using namespace atcoder;

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                printf("1\n");
            } else {
                printf("0\n");
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3516
#include "bits/stdc++.h"
using namespace std;
#define fst first
#define scd second
int main()
{
	int n, k;
	scanf("%d%d", &n, &k);
	int ans = 0;
	for(; n; ++ans)
	{
		n /= k;
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 256
<?php
  list($n) = explode(" ", trim(fgets(STDIN)));

  $p = explode(" ", trim(fgets(STDIN)));

  $ans = 0;
  for($i=1; $i<$n-1; $i++){
    if($p[$i-1] > $p[$i] && $p[$i] > $p[$i+1]){
      $ans++;
    }else if($p[$i-1] < $p[$i] && $p[$i] < $p[$i+1]){
      $ans++;
    }
  }

  echo $ans;

Measured memory_bytes: 4604
fn solve(a: u16, b: u16, c: u16, x: u16) -> usize {
    let mut result = 0;

    for ai in 0..=a {
        for bi in 0..=b {
            for ci in 0..=c {
                if ai * 500 + bi * 100 + ci * 50 == x {
                    result += 1;
                }
            }
        }
    }
    result
}

fn main() {
    let a = read_1();
    let b = read_1();
    let c = read_1();
    let x = read_1();

    println!("{}", solve(a, b, c, x));
}

fn read_1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}


Measured memory_bytes: 2068
n = int(input())
A = list(map(int,input().split()))
 
A.sort(reverse=True)
 
ans = 0
mod = 10**9+7
 
for i in range(n):
    ans = (ans+(i+2)*A[i])%mod
    # print(i,ans)
 
for i in range(n*2-2):
    ans = (ans*2) % mod
 
print(ans)


Measured memory_bytes: 26800
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
 
int main() {
	cin.tie(0);
    ios::sync_with_stdio(false);
    
    double R;
    cin >> R;

    cout << fixed << setprecision(15) << 3.1415926535 * R * 2 << endl;
}

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

int main()
{
    int N, M;
    cin >> N >> M;
    int *A = new int[M];
    int *B = new int[M];
    for (int i = 0; i < M; ++i)
    {
        cin >> A[i] >> B[i];
    }
    int *ans = new int[N]{0};
    for (int i = 0; i < M; ++i)
    {
        ++ans[A[i] - 1];
        ++ans[B[i] - 1];
    }
    for (int i = 0; i < N; ++i)
    {
        cout << ans[i] << endl;
    }
}

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

using ll = long long;
using pii = pair<int, int>;

#define     endl               "\n"
#define     fast_io            ios::sync_with_stdio(false); cin.tie(0);
#define     file_io            freopen("input.txt", "r", stdin);   \
                               freopen("output.txt", "w", stdout);
#define     all(x)             begin(x), end(x)
#define     debug(x)           cerr <<"Line "<< __LINE__ <<" : "<< #x " = "<< x <<endl;
 
template<typename T, typename TT>
ostream& operator<<(ostream &os, const pair<T, TT> &t) { return os<<"("<<t.first<<", "<<t.second<<")"; }
template<typename T>
ostream& operator<<(ostream& os, const vector<T> &t) { for(auto& i: t) os<<i<<" "; return os; }
 




int main(int argc, char** argv) {
    fast_io
   
	int a, b, c, cnt(0);
	cin >> a >> b >> c;
	
    for(; a <= b; ++a) if(!(c%a)) ++cnt;
    cout << cnt<<endl;
	
	

    return 0;
}























Measured memory_bytes: 3184
div = 10 ** 9 + 7

define_method(:count_of){|whole, choice|
    (1 + (whole - choice) * choice) % div
}

n, k = gets.split.map(&:to_i)

sum = 0
(k..(n + 1)).each{|choice| 
    sum += count_of(n + 1, choice)
    sum %= div
}
puts sum


Measured memory_bytes: 14372
use proconio::input;
use proconio::fastout;
use std::collections::BinaryHeap;
use std::cmp::Reverse;


#[fastout]
fn main() {
    input! {
        n: usize,
    }

    let mut ans = 0;
    for j in 1 .. n + 1 {
        for i in (j .. n + 1).step_by(j) {
            ans += i;
        }
    }

    println!("{}", ans);

}


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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    string o,e;
    cin >> o >> e;
    rep(i,e.size()){
        cout << o[i];
        cout << e[i];
    }
    if(o.size() > e.size()) cout << o[o.size()-1];
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import Counter

N = int(input())
As = list(map(int, input().split()))

P = 10**9 + 7

rlt = 1
dic = Counter(As)

if N % 2 == 0:
  for k in dic:
    if k % 2 == 1 and dic[k] == 2:
      rlt *= 2
      rlt %= P
    else:
      print(0)
      exit()
else:
  for k in dic:
    if k == 0 and dic[k] == 1:
      continue
    elif k % 2 == 0 and dic[k] == 2:
      rlt *= 2
      rlt %= P
    else:
      print(0)
      exit()
      
print(rlt)

Measured memory_bytes: 93464
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int iinf = 1 << 29;
const int imax = ~(1 << 31);
const long long linf = 1ll << 61;
const long long lmax = ~(1ll << 63);

#define dump(x) cerr << #x << " : " << x << '\n'
#define MOD(x, y) (((y) + (x) % (y)) % (y))

int H, W;
char S[12][20];

bool check(char T[12][20], int h, int w)
{
	int P = 0;
	int count = 0;
	for (int i = 0; i < w; i++) {
		for (int j = i + 1; j < w; j++) {
			if (P >> i & 1 || P >> j & 1) continue;
			bool f = true;
			for (int k = 0; k < h; k++) {
				if (T[k][i] != T[h - k - 1][j]) {
					f = false;
					break;
				}
			}
			if (f) {
				P |= 1 << i;
				P |= 1 << j;
				count += 2;
			}
		}
	}
	if (count == w) return true;
	if (count <= w - 2) return false;
	for (int i = 0; i < w; i++) {
		if (P >> i & 1) continue;
		for (int k = 0; k < h; k++) {
			if (T[k][i] != T[h - k - 1][i]) {
				return false;
			}
		}
		return true;
	}
	return false;
}

bool next_group(int* A, int n)
{
	int used = -1;
	for (int i = n / 2 - 1; i >= 0; i--) {
		int first = A[i * 2];
		int second = A[i * 2 + 1];
		used &= ~(1 << second);
		if (~used >= (1 << (second + 1))) {
			for (int j = second + 1; j < n; j++) {
				if (!(used >> j & 1)) {
					second = j;
					break;
				}
			}
			A[i * 2 + 1] = second;
			used |= 1 << second;
			int k = (i + 1) * 2;
			for (int j = 0; j < n; j++) {
				if (used >> j & 1) continue;
				A[k] = j;
				used |= 1 << j;
				k++;
			}
			return true;
		}
		used &= ~(1 << first);
	}
	return false;
}

int main(int argc, char* argv[])
{
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; i++) {
		scanf("%s", S[i]);
	}
	int P[12];
	int K = H + (H & 1);
	for (int i = 0; i < K; i++) {
		P[i] = i;
	}
	char T[12][20];
	do {
		int y = 0;
		for (int i = 0; i < K; i += 2) {
			if (P[i] == H) {
				for (int j = 0; j < W; j++) {
					T[H / 2][j] = S[P[i + 1]][j];
				}
			} else if (P[i + 1] == H) {
				for (int j = 0; j < W; j++) {
					T[H / 2][j] = S[P[i]][j];
				}
			} else {
				for (int j = 0; j < W; j++) {
					T[y][j] = S[P[i]][j];
					T[H - y - 1][j] = S[P[i + 1]][j];
				}
				y++;
			}
		}
		if (check(T, H, W)) {
			printf("YES\n");
			return 0;
		}
	} while (next_group(P, K));
	printf("NO\n");

	return 0;
}


Measured memory_bytes: 256
from heapq import*
import sys
r=sys.stdin.readline
def g(n,E,S,G):
 F=[1e7]*-~n;F[S]=0;H=[(0,S)]
 while H:
  c,u=heappop(H)
  if u==G:return c
  for f,v in E[u]:
   t=c+f
   if t<F[v]:F[v]=t;heappush(H,(t,v))
 return-1
def s(n,k):
 E=[[]for _ in[0]*-~n]
 for _ in[0]*k:
  f=r()
  if'0'==f[0]:print(g(n,E,*map(int,f[2:].split())))
  else:c,d,e=map(int,f[2:].split());E[c].append([e,d]);E[d].append([e,c])
for e in iter(r,'0 0\n'):s(*map(int,e.split()))


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

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(b*c>=a)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define db(x) cout<<#x<<" ---> "<<x<<"\n";
void print(vector<int> v);
void fastio();

void solve()
{
	int n,d;
	cin>>n>>d;
	d*=d;
	std::vector<int> v(n);
	int count=0;
	for (int i = 0; i < n; ++i)
	{
		int a,b;
		cin>>a>>b;
		int temp=(a*a)+(b*b);
		if(temp<=d)
			count++;
	}
	cout<<count;
}

int32_t main()
{
	fastio();
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
}
void print(vector<int>v)
{
	for (auto x : v)
	{
		cout << x << " ";
	}
	cout << "\n";
}
void fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout .tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

Measured memory_bytes: 4780
#include<iostream>
#include<fstream>
#include<math.h>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<sstream>

using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define esta(x,v) (find((v).begin(),(v).end(),(x)) !=  (v).end())
#define index(x,v) (find((v).begin(),(v).end(),(x)) - (v).begin())
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair

typedef long long tint;
typedef unsigned long long utint;
typedef long double ldouble;

typedef vector<int> vint;

int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}

string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

int main (){
	int n;
	cin>>n;
	int ar[n];
	forn(i, n){
		cin>>ar[i];
	}
	int cant=0;
	forn(i, n){
		if(ar[ar[i]-1]==i+1){
			cant++;
		}
	}
	cout<<cant/2<<endl;
}


Measured memory_bytes: 640
#!/usr/bin/perl
my ($n) = map { $_ - 0 } split(/\s+/,<STDIN>);
my @aa = sort { $a <=> $b } map { $_ - 0 } split(/\s+/,<STDIN>);
my $sum = 0;
$sum += $_ for @aa;
my $msum = $sum;
for(my $i=0;$i<=$#aa-1;$i+=2){
  $sum -= 2*( $aa[$i] + $aa[1+$i]);
  $msum = $sum if $sum > $msum;
}
print "$msum\n";
exit(0);


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

int main(void){
    int n = 0;
    int y = 0;
    char s[2];

    scanf("%d", &n);

    for(int i = 0; i < n; i++){
        scanf("%s", s);
        if(s[0] == 'Y'){
            y++;
        }
    }

    if(y == 0){
        printf("Three\n");
    }else{
        printf("Four\n");
    }

    return 0;

} 


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<functional>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef queue<P> Q;

#define _CRT_SECURE_NO_WARNINGS

int N=0,K = 0;
int a[105]={};
int dp[5][5][105]={};

int Saiki(int last,int beforeLast,int day){
    if(dp[last][beforeLast][day]!=0){
        return dp[last][beforeLast][day];
    }
    if(day==N){
        return 1;
    }
    if(a[day]!=0){
        return dp[last][beforeLast][day]=(Saiki(a[day],last,day+1)%10000);
    }
    set<int> cantUse;
    if(a[day+1]==a[day+2] && a[day+1]!=0){
        cantUse.insert(a[day+1]);
    }
    if(last==a[day+1]){
        cantUse.insert(last);
    }
    if( last==beforeLast ){
        cantUse.insert(last);
    }
    int temp=0;
    for(int i=1;i<=3;i++){
        if( cantUse.find(i)==cantUse.end() ){
            temp+=(Saiki(i,last,day+1)%10000);
        }
    }
    return dp[last][beforeLast][day]=(temp%10000);
}

int main() {
	cin >> N >> K;
    for(int i=0;i<K;i++){
        int b,c;
        cin >> b>>c;
        a[b-1]=c;
    }
	int i = Saiki(0, 0, 0) % 10000;
    cout << i <<endl;
	return 0;
}


Measured memory_bytes: 3112
#include <bits/stdc++.h>
#define x real()
#define y imag()
using namespace std;
typedef complex<double> point;
int n,ans;
vector <point> xy;
bool used[5001][5001];
 
void check(point a,point b){
  point d=b-a;
  point e=point(0,abs(d)),f=point(abs(d),abs(d));
  e=e*d/abs(d)+a;
  f=f*d/abs(d)+a;
  complex <int> E=e,F=f;
  e-=E,f-=F;
  if(E.x<0||E.y<0||F.x<0||F.y<0||5000<E.x||5000<F.x||5000<E.y||5000<F.y)return;
  if(e==point(0,0)&&f==point(0,0)&&used[E.x][E.y]&&used[F.x][F.y])ans=max(ans,(int)(d.x*d.x+d.y*d.y));
}
 
int main(){
  while(cin>>n,n){
    xy.clear();
    memset(used,0,sizeof(used));
    for(int i=0,a,b;i<n;i++){
      cin>>a>>b;
      used[a][b]=1;
      xy.push_back(point(a,b));
    }
    ans=0;
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)if(i!=j)check(xy[i],xy[j]);
    cout <<ans<<endl;
  }
  return 0;
}

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

const int MAX_N = 1e5+10;
int N, A, B;
ll h[MAX_N];
ll mx, cnt, tot;

bool ok(int x)
{
	ll needed = 0;
	for(int i=0;i<N;++i){
		if(h[i]>1LL*B*x) needed+=(h[i]-1LL*B*x+A-B-1)/(A-B);
	}
	return needed <= x;
}

void solve()
{
    mx = *max_element(h,h+N);
    cnt = count(h,h+N,mx);
    tot = accumulate(h,h+N,0LL);
    int lo=0, hi=(mx+B-1)/B;
    while(lo+1<hi){
        int mid = 1LL*(lo+hi)/2;
        if(ok(mid)) hi = mid;
        else lo=mid;
    }
    cout << hi << '\n';
}


int main()
{
	cin >> N >> A >> B;
	for(int i=0;i<N;++i) cin >> h[i];
	solve();
	return 0;
}

Measured memory_bytes: 4360
// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }




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

	ll ans = S.size();
	rep(i, S.size() - 1) {
		if (S[i] != S[i + 1]) ans = min(ans, max(i + 1, (ll)S.size() - 1 - i));
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define chmax(a,b) if(a<b)a=b;
#define chmin(a,b) if(b<a)a=b;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
constexpr int mod = 1000000007;
ll power(ll x, ll n, ll M) {
	ll res = 1;
	if(n > 0) {
		res = power(x, n / 2, M);
		if(n % 2 == 0) res = (res * res) % M;
		else res = (((res * res) % M) * x) % M;
	}
	return res;
}
int main() {
	int m, n; cin >> m >> n;
	P(power(m, n, mod));
	return 0;
}

Measured memory_bytes: 3164
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>

typedef long long ll;
using namespace std;

string a,b,c;
ll x,y;

int pot (ll q, ll w){
	ll qw = q;
	q = 1;
	for (int i = 0; i<w; i++)
		q*= qw;
	return q;
}

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

cin >> a >> b >> x >> y >> c;

if (c==a)
	cout << x-1 << " " << y;
else
	cout << x << " "<< y-1;




return 0;
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

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


Measured memory_bytes: 3100
#include "bits/stdc++.h"
using namespace std;

#define rep(i, n)  for (int i = 0; i < (int) (n); i++)
#define Rrep(i, n) for (int i = ((int) n - 1); i >= 0; i--)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
#define INF 2e15
#define MOD 10e9 + 7

typedef vector <int> vint;
typedef long long    ll;



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

    int n, x, t;
    cin >> n >> x >> t;

    if (n % x == 0) {
        int num = n / x;

        cout << t * num << endl;

        return 0;
    }
    else {
        int num = n / x + 1;
        cout << t * num << endl;

        return 0;
    }


    return 0;
}


Measured memory_bytes: 3648
#include <cstdio>
#include <vector>
using namespace std;
vector<int> e[150010];
vector<int> ri[150010];
vector<double> dp[150010];
int done[150010];
double s[150010];
int n;
double dfs(int v, int pi) {
	if (done[v] == n) {
		return s[v] - dp[v][pi];
	}
	if (done[v] != -1) {
		if (pi == done[v]) {
			return s[v];
		}
		if (e[v].size() == 1) {
			return 0;
		}
		int i = done[v];
		s[v] += dp[v][i] = (1.0 + dfs(e[v][i], ri[v][i])) / (e[v].size() - 1.0);
		done[v] = n;
		return s[v] - dp[v][pi];
	}
	done[v] = pi;
	for (int i = 0; i < e[v].size(); i++) {
		if (i == pi) {
			continue;
		}
		s[v] += dp[v][i] = (1.0 + dfs(e[v][i], ri[v][i])) / (e[v].size() - 1.0);
	}
	return s[v];
}
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		done[i] = -1;
		s[i] = 0.0;
	}
	for (int i = 0; i < n - 1; i++) {
		int u, v;
		scanf("%d%d", &u, &v);
		--u; --v;
		ri[u].push_back((int)e[v].size());
		ri[v].push_back((int)e[u].size());
		e[u].push_back(v);
		e[v].push_back(u);
	}
	for (int i = 0; i < n; i++) {
		dp[i] = vector<double>(e[i].size(), 0);
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < e[i].size(); j++) {
			dfs(i, j);
		}
	}
	for (int i = 0; i < n; i++) {
		double k = 0;
		for (int j = 0; j < e[i].size(); j++) {
			k += (1.0 + dfs(e[i][j], ri[i][j])) / e[i].size();
		}
		printf("%.12f\n", k);
	}
	return 0;
}

Measured memory_bytes: 33536
N = int(input())
A1 = [int(v) for v in input().split()]
A2 = [int(v) for v in input().split()]
a1,a2 = A1[0],sum(A2)
ans = a1+a2
for i in range(1,N):
  a1 += A1[i]
  a2 -= A2[i-1]
  ans = max(ans, a1+a2)
print(ans)


Measured memory_bytes: 3064
#include <iostream>

int main() {
    std::string a,b ;
    std::cin >> a >> b;
    int i=0, j=a.size(),c=0;
    while(i<j){
        if(a[i]!=b[i])c++;
        i++;
    }
    std::cout<<c<<std::endl;
    return 0;
}


Measured memory_bytes: 3464
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;

namespace AOJ
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static void Main(string[] args)
        {
            var NT = Sarray();
            var N = NT[0];
            var T = (int)NT[1];
            var q = new Queue<KeyValuePair<string, int>>();
            var e = new KeyValuePair<string, int>[N];
            for(var i =0;i<N;++i)
            {
                var nt = ReadLine().Split();
                q.Enqueue(new KeyValuePair<string, int>(nt[0], int.Parse(nt[1])));
            }
            var time = 0;
            while(q.Any())
            {
                var kv = q.Dequeue();
                if (kv.Value <= T)
                {
                    time += kv.Value;
                    WriteLine($"{kv.Key} {time}");
                }
                else
                {
                    time += T;
                    q.Enqueue(new KeyValuePair<string, int>(kv.Key, kv.Value - T));
                }
            }
        }
    }
}


Measured memory_bytes: 29092
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <tuple>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rep1(i, n) for(int i=1; i<=n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
#define countof(array) (sizeof(array) / sizeof(array[0]))
typedef long long ll;

#define MAX_N 200000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

string ab = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string as = {"abcdefghijklmnopqrstuvwxyz"};

ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

ll lcm(ll x, ll y) {
  return (x*y)/gcd(x, y);
}

void yes() {
  cout << "Yes" << endl;
}

void no() {
  cout << "No" << endl;
}

void print_array(int array[], int len) {

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

}

ll absolute(ll x) {
  return (x<0)? (-1)*x : x;
}

//g++ AtCoder.cpp -o AtCoder
//AtCoder

//--------------------------
int main() {

  int n;
  string s;
  cin >> n >> s;

  int cnt = 0;
  for(int i=0; i<n-2; ++i) {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C') ++cnt;
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
// #include "prettyprint.hpp"

long mod = 1000000007;
int main() {
  int N, K;
  cin >> N >> K;

  vector<int> adj[N + 5];
  int depth[N + 5];
  bool color[N + 5];
  // long long value[N + 5];
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }

  for (int i = 1; i <= N; i++) {
    color[i] = true;
  }

  depth[1] = 1;
  color[1] = false;
  long long result = K; // TODO
  // value[1] = K;
  queue<int> bfsQueue;
  bfsQueue.push(1);

  while (!bfsQueue.empty()) {
    int current = bfsQueue.front();
    bfsQueue.pop();

    // cout << "current: " << current << endl;
    int siblingCount = 0;
    for (auto next = adj[current].begin(); next != adj[current].end(); next++) {
      if (color[*next]) {
        color[*next] = false;
        depth[*next] = depth[current] + 1;
        long long temp = K - (depth[*next] < 3 ? 1 : 2) - siblingCount;
        if (temp <= 0) {
          result = 0;
        } else {
          // cout << (*next) << ": " << temp << endl;
          result *= temp;
          result %= mod;
        }
        siblingCount += 1;
        bfsQueue.push(*next);
      }
    }
  }

  cout << (result % mod + mod) % mod << endl;
  return 0;
}

Measured memory_bytes: 7032
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

ll sum(ll a) {
    if (a == -1) return 0;
    if (a == 0) return 0;
    if (a == 1) return 1;

    ll amk = a % 2 == 0 ? a - 1 : a;

    ll x = (amk - 2 + 1) / 2 % 2;

    if (a % 2 == 0) {
        return 1ll ^ x ^ a;
    } else {
        return 1ll ^ x;
    }

}

int main() {

    ll a, b;
    cin >> a >> b;
    cout << (sum(a - 1) ^ sum(b)) << endl;
}


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

int main() {
  // 入力
  int N;
  cin >> N;
  vector<int> h(N);
  for (int i = 0; i < N; i++) {
    cin >> h.at(i);
  }
  
  // 判定
  bool judge = true;
  int count = 0;
  for (int i = 0; i < N; i++) {
    judge = true;
  	for (int j = 0; j < i; j++) {
   	  if (h.at(i) < h.at(j)) {
        judge = false;
        break;
      }
    }
    if (judge) {
      count++;
    }
  }
  
  // 出力
  cout << count << endl;
  
  return 0;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
res = 0
MOD = 10 ** 9 + 7
small = ((K - 2) * (K - 1)) // 2
large = ((N * 2 - K + 2) * (K - 1)) // 2
for i in range(K, N + 2):
    small += i - 1
    large += N - (i - 1)
    res += large - small + 1
    res %= MOD
else:
    print(res)


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

remained_monsters = [int(s) for s in input().split()]
remained_capacities = [int(s) for s in input().split()]
n_killed = 0

for i in range(n):
    if remained_monsters[i] <= remained_capacities[i]:
        n_killed += remained_monsters[i]
        remained_capacities[i] -= remained_monsters[i]
        remained_monsters[i] = 0
    else:
        n_killed += remained_capacities[i]
        remained_monsters[i] -= remained_capacities[i]
        remained_capacities[i] = 0
    if remained_monsters[i + 1] <= remained_capacities[i]:
        n_killed += remained_monsters[i + 1]
        remained_capacities[i] -= remained_monsters[i + 1]
        remained_monsters[i + 1] = 0
    else:
        n_killed += remained_capacities[i]
        remained_monsters[i + 1] -= remained_capacities[i]
        remained_capacities[i] = 0

print(n_killed)


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

int main(){
  int A,B;
  cin >> A >> B;
  if(( A+B>=A*2-1 )&& (A+B>=B*2-1)){
    cout << A+B << endl;
    return 0;
  }
  if(( B*2-1>=A*2-1 )&& (B*2-1>=A+B)){
    cout << B*2-1 << endl;
    return 0;
  }
  if(( A*2-1>=A+B )&& (A*2-1>=B*2-1)){
    cout << A*2-1 << endl;
    return 0;
  }
}
  
    
    

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

#define FAST std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M 1000000007
#define mp make_pair
#define pb push_back
#define PB pop_back
#define sl(a) (int)a.length()
#define sz(a) (int)a.size()
#define lcase(a) (char)tolower(a)
#define ucase(a) (char)toupper(a)
#define precise(a) fixed<<setprecision(a)<<
#define F first
#define S second
#define I insert
#define pii pair<int,int>
#define trav(a, x) for(auto& a : x)
#define rep(n) for(int i = 0;i<n;i++)
#define rrep(n) for(int i = n-1;i>=0;i--)
#define time cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
#define invect(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.pb(tmp);commands}
#define inset(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.I(tmp);commands}
#define display(x) trav(a,x) cout<<a<<" "; cout<<endl;
#define ingrid(data,n,commands) for(int i = 0; i<n; i++){cin>>data[i];commands}
#define section(a,b,w) set_intersection(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
#define union(a,b,w) set_union(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
#define copy(a,w) copy(a.begin(), a.end(),back_inserter(w));
#define all(data) data.begin(), data.end()
#define PI 3.14159265358979323844
#define endl '\n'
#define last(a) a[sz(a)-1]
 
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
 
// Graph DFS
const int fx[]={+1,-1,+0,+0};
const int fy[]={+0,+0,+1,-1};
 
//primes for hashing 937,991,1013,1409,1741
 
//Returns index of first element not less than key and more than key respectively
#define lb(data,key) lower_bound(all(data),key) - data.begin();
#define up(data,key) upper_bound(all(data),key) - data.begin();
#define fnd(data,key) find(all(data),key) - data.begin();
/* Long Long Int */
#define int long long int
const int N = (int)1e5+5;

int n, k;
vector<int> h(N+100), dp(N+100);

int soln(int current){
    // trace(current);/
    if(current >= n)return M;
    if(current == n-1)return 0;
    int &ans = dp[current];
    if(ans != -1)return ans;

    ans = M;
    for (int i = 1; i <= k; ++i)
    {
        ans = min(ans, soln(current+i) + abs(h[current]-h[current+i]));
    }

    return ans;

}
 
void solve(){
    // int n, k;
    cin>>n>>k;

    // memset(dp, -1, sizeof(dp)); Memset not on vectors
    fill(all(dp), -1);
    for (int i = 0; i < n; ++i)
    {
        cin>>h[i];
    }
    cout<<soln(0);

    return;

}

signed main()
{
    FAST
    int t = 1;
    // cin>>t;
    while(t--) solve();
    return 0;

return 0;
}

Measured memory_bytes: 6528
A, B, M = map(int, input().split(' '))
aa = list(map(int, input().split(' ')))
bb = list(map(int, input().split(' ')))
cc = []
for _ in range(M):
    x, y, c = map(int, input().split(' '))
    cc.append([x, y, c])

ans = min(aa) + min(bb)
for x, y, c in cc:
    price = aa[x - 1] + bb[y - 1] - c
    if price < ans:
        ans = price

print(ans)


Measured memory_bytes: 30864
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const long long INF = 1LL << 60;
ll MOD = 1e9+7;

int main() {

    int A,B; cin>>A>>B;

    cout<<A*B<<endl;

}

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

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

using namespace std;

int main(){
  int n;cin>>n;
  char t;
  int rc=0;
  rep(i,n){
    cin>>t;
    if(t=='R')rc++;
    else rc--;
  }

  if(rc>0)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <map>
#include <array>
#include <cmath>

using namespace std;

int PRIME = 1000000007;

struct info{
    info(){
        x = 0;
        y = 0;
        h = 0;
    }

    info(int _x, int _y, int _h){
        x = _x;
        y = _y;
        h = _h;
    }

    int x;
    int y;
    int h;
};

vector<info> info_vec;


int main(int argc, char* argv[]){
    int N;
    cin >> N;

    info_vec.resize(N);

    int b_x, b_y, b_h;

    for(int i = 0; i < N; ++i){
        int x, y, h;
        if(h != 0){
            b_x = x;
            b_y = y;
            b_h = h;
        }
        cin >> x >> y >> h;
        info_vec[i] = info(x, y, h);
    }


    for(int c_x = 0; c_x <= 100; ++c_x){
        for(int c_y = 0; c_y <= 100; ++c_y){
            int H = b_h + abs(b_x - c_x) + abs(b_y - c_y);
            int i;

            for(i = 0; i < N; ++i){
                int H2 = max(H - abs(info_vec[i].x - c_x) - abs(info_vec[i].y - c_y), 0);
                if(info_vec[i].h != H2)break;
            }

            if(i == N){
                cout << c_x << " " << c_y << " " << H;
                return 0;
            }
        }
    }
}


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

using db = double;
using ll = long long;
using vi = vector <int>;
#define op operator
#define pb push_back

int main() {
	ios :: sync_with_stdio(0);

	for(int a, b, n; cin >> a >> b >> n; ) {
		int ans = 0;
		a %= b;
		while(n --) {
			ans += a * 10 / b;
			a = a * 10 % b;
		}
		cout << ans << '\n';
	}

	return 0;
}

Measured memory_bytes: 3172
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;

#define Endl endl


/*--------------------template--------------------*/




int main() {
    cin >> n;
    while (1) {
        ans = pow(k, 2);
        if (ans > n) {
            break;
        }
        k++;
    }
    cout << (ll)pow(k - 1, 2) << endl;
}

Measured memory_bytes: 256
import numpy as np
n, m = map(int, input().split())

switches = []
for i in range(m):
  a = list(map(int,input().split()))
  switches.append(a[1:])

p = list(map(int,input().split()))

ans = 0
# bit全探索
for t in range(2 ** n):
  # N個のスイッチのうち,onになっているスイッチの数を調べる
  on_switch_list = np.array([t >> s & 1 for s in range(n)])
  
  # 各電球に対しonになっているスイッチの合計%2のリストを作り,pと等しければカウント
  # iは 1 ~ Mの値を取るので-1してインデックスに使えるように
  if p == [np.sum(on_switch_list[np.array(i) - 1]) % 2 for i in switches]:
    ans += 1
print(ans)

Measured memory_bytes: 22300
n,k= map(int, input().split())
x= list(map(int, input().split()))
s=0
cnt=0
while x[s]<0:
    s+=1
    if n==s+1:
        break
a=[]
if x[s]>=0:
    for i in range(s,min(s+k,n)):
        cnt+=1
        if i-k-1>=0:
            a.append(2*x[i]-x[i-k+1])
        if cnt==k:
            a.append(x[i])
    s-=1
cnt=0
for i in range(s,max(s-k,-1),-1):
    cnt+=1
    if i+k-1<n:
        a.append(-2*x[i]+x[i+k-1])
    if cnt==k:
        a.append(-x[i])
print(min(a))

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

using namespace std;

int main()
{
   int a[10000] = {};
   int n, x, y;
   cin >> n >> x >> y;
   for(int i = 1; i <= n; i++)
   {
      for(int j = i+1; j <= n; j++)
      {
         int tmp = min((j-i), min( abs(x - i) + 1 + abs(j-y), abs(y-i) + 1 + abs(j-x) ) );
         a[tmp]++;
      }
   }
   for(int i = 1; i < n; i++)
      cout << a[i] << endl;



}



Measured memory_bytes: 256
#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()

int main(){
    long a, b, c, d;
    cin >> a >> b >> c >> d;
    vector<long> yaku;
    long mincd = min(c,d);
    for(int i=1; i<=pow(mincd,0.5); i++){
        if(mincd % i == 0){
            yaku.push_back(i);
            yaku.push_back(mincd/i);
        }
    }

    long gcd = 1;
    for(int x:yaku){
        if(max(c,d) % x == 0){
            if(x > gcd){
                gcd = x;
            }
        }
    }

    long lcm = gcd * (c/gcd) * (d/gcd);
    
    long ac = (a-1)/c;
    long ad = (a-1)/d;
    long acd = (a-1)/lcm;
    long bc = b/c;
    long bd = b/d;
    long bcd = b/lcm;

    cout << ( b - (bc + bd - bcd) ) - ((a-1) - (ac + ad - acd)) << endl;

}   


Measured memory_bytes: 384
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
a = Counter(v[::2]).most_common()
b = Counter(v[1::2]).most_common()
a.append([0,0])
b.append([0,0])

if a[0][0]!=b[0][0]:
    print(n-a[0][1]-b[0][1])
else:
    print(min(n-a[1][1]-b[0][1],n-a[0][1]-b[1][1]))


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

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/4;
    public static final int inf = Integer.MAX_VALUE/4;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni();
        int[][] dp = new int[13][n+1];
        int[] item = new int[]{1, 6, 36, 216, 1296, 7776, 46656, 9, 81, 729, 6561, 59049};
        for (int i = 0; i < 13; i++) {
            Arrays.fill(dp[i], inf);
            dp[i][0] = 0;
        }
        for (int i = 1; i < 13; i++) {
            for (int j = 0; j < n+1; j++) {
                if(j>=item[i-1]){
                    dp[i][j] = Math.min(dp[i-1][j], dp[i][j-item[i-1]]+1);
                }else dp[i][j] = dp[i-1][j];
            }
        }
        out.println(dp[12][n]);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public Double nd(){
            return Double.parseDouble(ns());
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 25812
#include <bits/stdc++.h>
#define MAX 100000
#define N 505

using namespace std;
typedef long long ll;

template <class T> inline void read(T &x) {
	char ch; bool flag = false;
	while (!isdigit(ch = getchar())) flag |= ch == '-';
	for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48));
	if (flag) x = -x;
}

inline int input() {
	int x; char ch; bool flag = false;
	while (!isdigit(ch = getchar())) flag |= ch == '-';
	for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48));
	return flag ? -x : x;
}

const int mod = 1e9 + 7;
inline int add(int x, int y) { x += y; return x >= mod ? x - mod : x; }
inline void inc(int &x, int y) { x += y; x -= x >= mod ? mod : 0; }

inline int Power(int x, int y) {
	int res = 1;
	while (y) {
		if (y & 1) res = (ll) res * x % mod;
		x = (ll) x * x % mod, y >>= 1;
	} return res;
}

template <class T> void chkmax(T &x, T y) { x = x > y ? x : y; }
template <class T> void chkmin(T &x, T y) { x = x < y ? x : y; }
template <class T> T gcd(T x, T y) { return !y ? x : gcd(y, x % y); }
template <class T> T lcm(T x, T y) { return x / gcd(x, y) * y; }

int n;
ll a[N][N];
ll p[20005], totp;
bool nop[MAX];

void prework() {
	for (int i = 2; i < MAX; ++i) {
		if (!nop[i]) p[++totp] = i;
		for (int j = 1; j <= totp && p[j] * i < MAX; ++j) {
			nop[i * p[j]] = true;
			if (i % p[j] == 0) break;
		}
	}
}

int main() {
	cin >> n;
	if (n == 2) {
		puts("4 7");
		puts("23 10");
		return 0;
	}
	prework();
	for (int i = 0; i <= n + 1; ++i)
		for (int j = 0; j <= n + 1; ++j)
			a[i][j] = 1;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			if ((i + j) & 1) {
				a[i][j] = p[(i + j) >> 1] * p[(n + 1 + i - j) / 2 + n];
				a[i + 1][j] = lcm(a[i][j], a[i + 1][j]);
				a[i - 1][j] = lcm(a[i][j], a[i - 1][j]);
				a[i][j + 1] = lcm(a[i][j], a[i][j + 1]);
				a[i][j - 1] = lcm(a[i][j], a[i][j - 1]);
			}

	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			if (!((i + j) & 1)) ++a[i][j];
			printf("%lld ", a[i][j]);
		}
		puts("");
	}
	return 0;
}

Measured memory_bytes: 5248
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define inf LLONG_MAX>>2
#define MAX 1000000
#define mod 1000000007
#define pb push_back
#define f(i,a,n,x) for ((i)=(a);(i)<(n);(i)+=(x))
#define fd(i,a,n,x) for ((i)=(a);(i)>=(n);(i)-=(x))
#define fi first
#define se second
#define mk make_pair
#define pi pair
#define vt vector
using namespace std;
void read(vt<ll> &a,ll n){ll i,temp;f(i,0,n,1){cin>>temp;a.pb(temp);}}
void dfs(ll k,vt<vt<pi<ll,ll>>> &adj,vt<bool> &visited,vt<ll> &dist){
    ll i;
    visited[k]=true;
    f(i,0,adj[k].size(),1)
        if (!visited[adj[k][i].fi]){
            dist[adj[k][i].fi]=dist[k]+adj[k][i].se;
            dfs(adj[k][i].fi,adj,visited,dist);
        }
}
void solve(){
    ll n,i,a,b,c,q,k;
    cin>>n;
    vt<vt<pi<ll,ll>>> adj(n+1);
    vt<ll> dist(n+1);
    vt<bool> visited(n+1,false);
    f(i,1,n,1){
        cin>>a>>b>>c;
        adj[a].pb(mk(b,c));
        adj[b].pb(mk(a,c));
    }
    cin>>q>>k;
    dist[k]=0;
    dfs(k,adj,visited,dist);
    f(i,0,q,1){
        cin>>a>>b;
        cout<<dist[a]+dist[b]<<endl;
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll t=1;
    //cin>>t;
    while(t--)
        solve();
    return 0;
}

Measured memory_bytes: 18756
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N, M;
  cin >> N >> M;
  vector<pair<int,int>> v;
  rep(i,N){
    int a, b;
    cin >> a >> b;
    v.emplace_back(a,b);
  }
  sort(ALLOF(v));

  ll ret = 0;
  priority_queue<int> que;
  int k = -1;
  for(int i=M; i>0; i--){
    int j = M+1-i;
    while(k+1<v.size() && v[k+1].first<=j){
      que.push(v[k+1].second);
      k++;
    }

    if(!que.empty()){
      ret += que.top();
      que.pop();
    }
  }

  cout << ret << endl;
  
  return 0;
}


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



int main() {
    int N, K;
    cin >> N >> K;
    
    //vector<vector<int>> A(K, vector<int>(N));
    vector<int> snu(N);
    vector<int> d(K);
    for(int i = 0; i < K; i++) {
        cin >> d.at(i);
        for(int j = 0; j < d.at(i); j++) {
            int num;
            cin >> num;
            snu.at(num-1) = 1;
        }
    }
    
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        if(snu.at(i) == 0)
            cnt++;
    }
    
    cout << cnt << endl;
    
    return 0;
}


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

int main(){
  int H, W;
  string s[100];
  cin >> H >> W;
  for(int i=0; i<H; i++){
    cin >> s[i];
  }
  for(int i=0; i<H+2; i++){
    if(i==0 || i==H+1){
      for(int j=0; j<W+2; j++){
        cout << '#';
      }
    }else{
      cout << '#' << s[i-1] << '#';
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 256
S = input().strip()
K = int(input())
if K==1 or S[0]!=S[-1]:
    x = list(S)
    cnt = 0
    for i in range(1,len(x)):
        if x[i]==x[i-1]:
            x[i]=0
            cnt += 1
    print(cnt*K)
else:
    x = list(S+S)
    cnt = 0
    for i in range(1,len(x)):
        if x[i]==x[i-1]:
            x[i]=0
            cnt += 1
    k1 = len(x)
    x = x+list(S)
    d1 = 0
    for i in range(k1,len(x)):
        if x[i]==x[i-1]:
            x[i]=0
            d1 += 1
    k2 = len(x)
    x += list(S)
    d2 = d1
    for i in range(k2,len(x)):
        if x[i]==x[i-1]:
            x[i]=0
            d2 += 1
    if K==2:
        print(cnt)
    elif K%2==0:
        print(cnt+d2*(K//2-1))
    else:
        print(cnt+d2*(K//2-1)+d1)

Measured memory_bytes: 62208
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] ss = line.split(" ");
		int[] num = new int[ss.length];
		for (int i = 0; i < ss.length; i++) {
			num[i] = Integer.parseInt(ss[i]);
		}
		Arrays.sort(num);
		System.out.println(num[0] + " " + num[1] + " " + num[2]);
	}
}

Measured memory_bytes: 26060
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(){
    int N;
    cin >> N;
    while(N > 0){
        if(N % 10 == 9){
            cout << "Yes\n";
            return 0;
        }
        N /= 10;
    }
    cout << "No\n";
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func maxtime(x int) int {
	return (x + 9) / 10 * 10
}

func remtime(x int) int {
	return maxtime(x) - x
}

func max(nums ...int) int {
	max := nums[0]
	for _, v := range nums {
		if max < v {
			max = v
		}
	}
	return max
}

func main() {
	var a, b, c, d, e int
	fmt.Scan(&a, &b, &c, &d, &e)

	sum := maxtime(a) + maxtime(b) + maxtime(c) + maxtime(d) + maxtime(e)
	sum -= max(remtime(a), remtime(b), remtime(c), remtime(d), remtime(e))
	fmt.Println(sum)
}


Measured memory_bytes: 512