akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
struct LazySegTree{ //seg sum
    int n;
    vector <int> node, lazy;
   
    LazySegTree(vector <int> v){
        int sz = v.size();
        n = 1;
        while(n<sz) n*=2;
        
        node.resize(2*n-1, INF);
        lazy.resize(2*n-1, INF);
        
        for(int i=0; i<sz; i++) node[i+n-1] = v[i]; 
        for(int i=n-2;i>=0;i--) chmin(node[i], min(node[2*i+1],node[2*i+2]));
        
    }

    void eval(int k,int l, int r){
        if(lazy[k] != INF){
            chmin(node[k],lazy[k]);
            if(r - l >1){
                chmin(lazy[2*k+1] , lazy[k]);
                chmin(lazy[2*k+2] , lazy[k]);
            }
            lazy[k] = INF;
        }
    }

    void minimize(int a, int b, int x, int k=0, int l=0, int r=-1) {
        
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] = x;
            eval(k, l, r);
        }
        else {
            minimize(a, b, x, 2*k+1, l, (l+r)/2);
            minimize(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = min(node[2*k+1] , node[2*k+2]);    
        }
    }
    int getmin(int a, int b, int k=0, int l=0, int r=-1) {
        
        if(r < 0) r = n;
        if(b <= l || r <= a) return INF;
        eval(k, l, r);
        
        if(a <= l && r <= b) {
            //cout<<node[k]<<"+"<<endl;
            return node[k];
        }
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        
        //cout<<vl<<' '<< l<<' '<<r<<endl<<vr<<'+'<<(l+r)/2<<'+'<<r<<endl;
        return min(vl, vr);
    }
};

signed main(void){
    int n, m; cin>>n>>m;
    
    vector <int> a(n, INF);
    a[0] = 0;
    struct LazySegTree Lseg = LazySegTree(a);
    vector <tuple <int,int,int>> data(m);
    rep(i,m){
        int a,b,c; cin>>a>>b>>c;
        a--; b--;
        data[i] = make_tuple(a, b, c);
    }
    sort(data.begin(),data.end());
    
    for(int i=0;i<m;i++){
        int l = get <0>(data[i]), r = get <1>(data[i]), c = get <2>(data[i]);
        int mi = Lseg.getmin(l, r+1);
        Lseg.minimize(l, r+1, mi + c);
    }
    int ans = Lseg.getmin(n-1,n);
    if(ans == INF) ans = -1;
    cout<<ans<<endl;
}


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

int main(){

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

	if(a==b){
	cout << "a == b" << endl;
	}else if(a>b){
	cout << "a > b" << endl;
	}else{
	cout << "a < b" << endl;
	}
	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  char c;
  cin >> c;
  if('a' <= c && c <= 'z') cout << 'a' << endl;
  else cout << 'A' << endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD=1e9+7;

int main() {
    long long x;
    cin>>x;
    //6,5,6,5,6と得点するのが最良
    long long ans=0;
    ans+=(x/11)*2;
    if(x%11>0){
        if(x%11>6) ans+=2;
        else ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main() {
	int n, m, l;
	cin >> n >> m >> l;
	long long a[100][100];
	long long b[100][100];
	 long long c[100][100];
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < m; ++i) {
		for (int j = 0; j < l; ++j) {
			cin >> b[i][j];
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < l; ++j) {
			c[i][j] = 0;
			for (int k = 0; k < m; ++k) {
				c[i][j] += a[i][k] * b[k][j];
			}
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < l; ++j) {
			if(j){cout<<" ";}
			cout << c[i][j];
		}
		cout << endl;
	}
	return 0;
}

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

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

int INF=1e9;
using namespace std;

int main()
{
	int d,e;
	while(cin>>d>>e,d)
	{
		int a,b;
		double ans=INF;
		FOR(i,0,d+1)
		{
			a=i;
			b=d-i;
			ans=min(ans, abs(sqrt(a*a+b*b)-e));
		}
		cout<<setprecision(5)<<fixed<<ans<<endl;
	}
}

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

uint_fast32_t N, M, a[101010], A;

constexpr uint_fast32_t z = static_cast<uint_fast32_t>('0'), n = static_cast<uint_fast32_t>('9');
template<class T>
void uread(T& x){
    do{
        x = static_cast<T>(fgetc(stdin));
    }while(z > x || x > n);
    x -= z;
    T c = static_cast<T>(fgetc(stdin));
    while(z <= c && c <= n){
        x = x * 10 + c - z;
        c = static_cast<T>(fgetc(stdin));
    }
}

int main(){
    scanf("%u%u", &N, &M);
    for(int i = 1; i <= N; ++i){
        uread(a[i]);
        a[i] += a[i - 1];
        a[i] %= M;
    }
    sort(a, a + N + 1);
    for(int i = 0, j = 0; i <= N; ++i){
        if(i && a[i] != a[i - 1])j = 0;
        A += j++;
    }
    cout << A << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned long long int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int BE(int x, int n, int m) //function to calculate x raise to power n modulo m
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x % m;
		x = x * x % m;
		n = n / 2;
	}
	return result;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________

	string s;
	cin >> s;
	int n = s.size();
	map<char, int>mt;
	zip(i, 0, n)
	{
		mt[s[i]] = i + 1;
	}
	int a, b, c;
	if (n == 26)
	{
		int flag = 0;
		//cout << s << en;
		zip(i, 1, n)
		{
			if (s[i] < s[i - 1])
			{
				if (i == n - 1 && flag == 0)
				{
					cout << -1 << en;
					return 0;
				}
			}
			else
			{
				// flag = 1;
				// a = i;
				// b = i - 1;
				break;
			}
		}
		flag = 25;
		for (int i = n - 1; i >= 0; i--)
		{
			if (s[i] < s[i - 1])
			{
				flag = i - 1;
			}
			else
			{
				//cout << s[i] << en;
				break;
			}
		}
		//cout << s << en;
		char ch = 'z';
		//cout << flag << en;
		if (flag == 1)
		{
			ch = s[0] + 1;
			cout << ch << en;
			return 0;
		}
		zip(i, 0, flag - 1)
		{
			cout << s[i];
		}
		int j = flag - 1;
		ch = 'z';
		zip(i, flag, n)
		{
			if (s[i] > s[j])
			{
				ch = min(ch, s[i]);
			}
		}
		cout << ch << en;


		// c = b - 1;
		// char ch = s[c];
		// char ans;
		// for (char x = ch + 1; x <= 'z'; x++)
		// {
		// 	if (mt[x] > b + 1)
		// 	{
		// 		ans = x;
		// 		break;
		// 	}
		// }
		// zip(i, 0, c + 1)
		// {
		// 	cout << s[i];
		// }
		// cout << ans;
		// cout << en;
		// //swap(s[a], s[b]);

		return 0;
	}
	char a1;
	for (char x = 'a'; x <= 'z'; x++)
	{
		if (mt[x] == 0)
		{
			a1 = x;
			break;
		}
	}
	cout << s << a1 << en;

	return 0;
}



Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Control.Monad.ST
-- import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe
 
-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
-- templete

ct (as, bs, cs, n) i = (next as, next bs, next cs, nn)
  where
    nn = if member cs && (not (member as) || member bs) then n + 1 else n
    member s = head s == i
    next s
      | member s = tail s
      | otherwise = s

main = do
    n <- getInt
    as <- (++[0]) . sort . tail <$> getInts
    bs <- (++[0]) . sort . tail <$> getInts
    cs <- (++[0]) . sort . tail <$> getInts
    print $ (\(_,_,_,r) -> r) $ foldl ct (as,bs,cs,0) [1..n]



Measured memory_bytes: 4168
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a, b = [0], [0]
for i in range(N):
	a.append(a[i]+A[i])
for i in range(M):
	b.append(b[i]+B[i])
	
ans, j = 0, M
for i in range(N+1):
	if a[i] > K:
		break
	while b[j] > K - a[i]:
		j -= 1
	ans = max(ans, i+j)
	
print(ans)

Measured memory_bytes: 47268
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
#define Pll pair<ll,ll>

template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const int INF =2e+9;
const ll INFL =9e+18;
const long MOD =1e+9+7;
#define PI 3.14159265258979

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

int main(void){
	int N,A,B;
	cin>>N>>A>>B;		
	if(abs(A-B)%2) print("Borys");
	else print("Alice");

	return 0;
}




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

ll n,l,r,q,a[100000],ans=0;
int main(){
    cin>>n>>q;
    rep(i,n)cin>>a[i];
    sort(a,a+n);
    rep(i,q){
        cin>>l>>r;
        cout<<upper_bound(a,a+n,r)-lower_bound(a,a+n,l)<<endl;
    }
}


Measured memory_bytes: 3932
input()
A = list(filter(lambda x: x % 2 == 0, map(int, input().split())))
count = 0
for i in A:
    tmp = i
    while True:
        if tmp % 2 == 0:
            count += 1
            tmp = int(tmp/2)
        else:
            break
print(count)


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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> P;

const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;

int h, w;
string a[102];

int main() {
	cin >> h >> w;
	
	REP(i, h) cin >> a[i + 1];
	
	string ans[102];
	REP(i, w + 2) {
		ans[0] += '#';
		ans[h + 1] += '#';
	}
	
	REP(i, h) {
		ans[i + 1] += '#';
		ans[i + 1] += a[i + 1];
		ans[i + 1] += '#';
	}
	
	REP(i, h + 2) cout << ans[i] << endl;
	
	return 0;
}


Measured memory_bytes: 256
import glob


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\135\\A'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class A(Common):

    def resolve(self):

        tmp = [int(i) for i in self.input_data().split()]
        A = tmp[0]
        B = tmp[1]

        if A % 2 != B % 2:
            print("IMPOSSIBLE")
        else:
            result = int((A + B) / 2)
            print(str(result))


solver = A(REL_PATH)
solver.exec_resolve()

Measured memory_bytes: 4084
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a);i>int(b);--i)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define show(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl;
#define MOD 1000000007
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define SZ(x) ((int)(x).size())
#define sum(v,i) accumulate(all(v),i)
//#define int long long
using ll = long long;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
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; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }//最大公約数
int lcm(int a, int b) { return a * b / gcd(a, b); }	//最小公倍数
//template <typename... Args>void IN(Args& ... args) {cin >>args;IN(args...);return;} //まとめて入力　IN(a,b,c,d...)

void Main() {
	int n,nn=1; cin >> n;
	vector<int>x(n), y(n);
	double d;
	vector<double>dis;
	rep(i, n)cin >> x[i]>>y[i];
	//rep(i, n)cin >> y[i];
	rep(i, n) {
		nn *= (i + 1);
		rep(j, n) {
			if (i == j)continue;
			d = sqrt(pow(x[i] - x[j], 2) + pow(y[i] - y[j], 2));
			dis.push_back(d);
			//cout << d << endl;
		}
	}
	d=accumulate(dis.begin(), dis.end(), 0.0)/n;
	printf("%.10lf",d);
	//cout << nn;
}

signed main() {
	Main();

	return 0;
}


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

using namespace std;

int main(void)
{
	long long count = 0;
	long long M,D, D1, D10;
	
	cin >> M >> D;

	for (int i = 1; i <= M; i++)
	{
		for (int j = 22; j <= D; j++)
		{
			if (j % 10 < 2)continue;
			else if (j / 10 < 2)continue;
			D1 = j % 10;
			D10 = j / 10;
			if (D1 * D10 == i)
			{
				count++;
			}
		}
	}

	cout << count << endl;

	return 0;
}

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

#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  int x, a;
  cin >> x >> a;
  if (x < a) cout << 0 << '\n'; else cout << 10 << '\n';
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
#include<cmath>

using namespace std;
using ll = long long;

int main() {
    int n, m, a;
    cin >> n >> m;
    vector<bool> input(n);
    for (int i=0; i<m; ++i) {
        cin >> a;
        input[a] = true;
    }
    vector<int> dp(n+1);
    dp[0] = 1;
    for (int i=0; i<dp.size()-1; ++i) {
        if (input[i]) continue;
        dp[i+1] += dp[i];
        dp[i+1] %= 1000000007;
        if (i+2 >= dp.size()) continue;
        dp[i+2] += dp[i];
        dp[i+1] %= 1000000007;
    }
    cout << dp.back() << endl;
}


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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll d;
  cin >> d;

  if (d == 25) {
    cout << "Christmas"
         << "\n";
  } else if (d == 24) {
    cout << "Christmas Eve"
         << "\n";
  } else if (d == 23) {
    cout << "Christmas Eve Eve"
         << "\n";
  } else if (d == 22) {
    cout << "Christmas Eve Eve Eve"
         << "\n";
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<math.h>
#include<unordered_set>
using namespace std;
const int INF = 2147483647;
const int MAX = 100000;

int main()
{
	int N;
	vector<pair<int, int>> scor;

	cin >> N;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		scor.push_back(make_pair(a, b));
	}

	sort(scor.begin(), scor.end());

	int cnt = 0;
	int num = 0;
	for (int i = 0; i < scor.size(); i++) {
		cnt += scor[i].first - num;
		num = scor[i].first;
	}

	cnt += scor[scor.size() - 1].second;

	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 1400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoderPractice
{
    class Calc
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine(a + a * a + a * a * a);
        }
    }
}


Measured memory_bytes: 27384
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();

		int r = 0;
		char t = s.charAt(0);
		for (char c : s.toCharArray()) {
			if (t != c) {
				r += 1;
				t = c;
			}
		}
		System.out.println(n - 1 - Math.max(0, r - k * 2));
	}
}

Measured memory_bytes: 25684
n, m = map(int, input().split())
lst = []
for i in range(m):
    lsti = list(map(int, input().split()))
    lst.append(lsti)

lst.sort(key= lambda x: x[2], reverse=True)
lst.sort(key= lambda x: x[0])

d = [10**18 for i in range(n+1)]
d[1] = 0
for lsti in lst:
    l = lsti[0]
    r = lsti[1]
    c = lsti[2]
    if l == 1:
        for i in range(l+1, r+1):
            d[i] = c
    else:
        for i in range(l+1, r+1):
            j = l+1+r-i
            if d[l]+c < d[j]:
                d[j] = d[l] + c
            else:
                break

if d[n] == 10**18:
    print(-1)
else:
    print(d[n])

Measured memory_bytes: 73944
#include<iostream>
#include<time.h>
#include<stdlib.h>
#include<string>
 
using namespace std;
 
int main(){
    string a; cin >> a;
    string b; cin >> b;
    if(a == "1"){
        if(b == "2")
        cout << 3;
        else cout << 2;
    }
    if(a == "2"){
        if(b == "1")
        cout << 3;
        else cout << 1;
    }
  if(a == "3"){
        if(b == "1")
        cout << 2;
        else cout << 1;
    }
    return 0;
}

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

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

    int X, Y;
    cin >> X >> Y;

    cout << ((Y % 2 != 0 || Y < 2 * X || 4 * X < Y) ? "No" : "Yes") << endl;

    return 0;
}

Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

namespace ConsoleAppAtCoderIHC
{
    class Program
    {
        static void Main(string[] args)
        {
            // 入力
            var D = int.Parse(ReadLine());
            var c = new List<int>() { 0 };
            c.AddRange(ReadLine().Split(' ').Select(s => int.Parse(s)));
            var s = new List<int>[D + 1];
            for (int d = 1; d <= D; d++)
            {
                s[d] = new List<int>() { 0 };
                s[d].AddRange(ReadLine().Split(' ').Select(s => int.Parse(s)));
            }

            // 処理
            var t = new int[D + 1];
            for (int d = 1; d <= D; d++)
            {
                var _t = 0;
                var maxScore = int.MinValue;
                for (int i = 1; i <= 26; i++)
                {
                    t[d] = i;
                    var score = Scoring(d, c, s, t);

                    if(maxScore < score)
                    {
                        _t = i;
                        maxScore = score;
                    }
                }
                t[d] = _t;
            }

            // 出力
            for (int d = 1; d <= D; d++)
            {
                WriteLine(t[d]);
            }
        }

        private static int Scoring(int D, List<int> c, List<int>[] s, int[] t)
        {
            // 満足度計算
            var last = new int[27];
            var v = 0;
            for (int d = 1; d <= D; d++)
            {
                // 加算
                v += s[d][t[d]];

                // 最終開催日を更新
                last[t[d]] = d;

                // 減算
                var minus = 0;
                for (int i = 1; i <= 26; i++)
                {
                    minus += c[i] * (d - last[i]);
                }

                v -= minus;
            }

            return v;
        }
    }
}


Measured memory_bytes: 30228
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
using namespace std;

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

    vector<long long> A(N);
    int cnt = 0;
    for (int i = 0; i < N; i++) {
        cin >> A[i];

        if (A[i] < 0)
            cnt++;

        A[i] = max(A[i], -A[i]);
    }

    long long sum = 0;
    for (int i = 0; i < N; i++)
        sum += A[i];

    if (cnt % 2 == 0) {
        cout << sum << endl;
    }
    else {
        long long n = *min_element(A.begin(), A.end());
        cout << sum - 2 * n << endl;
    }

    return 0;
}


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

using namespace std;

int main(){
	long long a,b = 0;
	cin>>a;
	if(a % 2 != 0) cout<<"0"<<endl;
	else{
		a /= 2;
		for(long long i = 5 ; i <= a ; i *= 5) b += a / i;
		cout<<b<<endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define in ({int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';n?-x:x;})
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l,int r){return l+rng()%(r-l+1);}
#define fasty ios_base::sync_with_stdio(false),cin.tie(nullptr);
#define task "uigioioidevailonditmemaythangoatconnayditmemaytuoilon"
#define forinc(a,b,c) for(int a=b,_c=c;a<=_c;++a)
#define fordec(a,b,c) for(int a=b,_c=c;a>=_c;--a)
#define forv(a,b) for(auto&a:b)
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define mt make_tuple
#define all(a) a.begin(),a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define bit(x,i) ((x>>(i-1))&1)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1<<(i-1)))
main(){
    //freopen(task".inp","r",stdin);
    //freopen(task".out","w",stdout);
    int n=in,m=in;
    vector<ii> a;
    int mi=INT_MIN,ma=INT_MAX;
    forinc(i,1,m){
        int l=in,r=in;
        mi=max(mi,l);
        ma=min(ma,r);
    }
    cout<<max(0ll,ma-mi+1);
}


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

#define int long long

#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second

using vint = vector<int>;
using pint = pair<int, int>;
using vpint = vector<pint>;

template <typename A, typename B>
inline void chmin(A& a, B b) {
    if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A& a, B b) {
    if (a < b) a = b;
}

template <class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>& p) {
    ost << "{" << p.first << "," << p.second << "}";
    return ost;
}

template <class T>
ostream& operator<<(ostream& ost, const vector<T>& v) {
    ost << "{";
    for (int i = 0; i < v.size(); i++) {
        if (i) ost << ",";
        ost << v[i];
    }
    ost << "}";
    return ost;
}

inline int topbit(unsigned long long x) {
    return x ? 63 - __builtin_clzll(x) : -1;
}

inline int popcount(unsigned long long x) {
    return __builtin_popcountll(x);
}

inline int parity(unsigned long long x) {
    return __builtin_parity(x);
}

signed main() {
    int N, X, T;
    cin >> N >> X >> T;

    cout << (N + X - 1) / X * T << endl;
    return 0;
}

Measured memory_bytes: 3620
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())), dtype = np.int64)

xor = np.bitwise_xor.reduce(A)

# 1の個数が奇数個の桁は定数
odd_digit = [1<<i for i in range(60) if xor&(1<<i)]

# 1の個数が奇数個の桁は無視する
for i in odd_digit:
    A = A & (~i)

for i in range(60, - 1 , - 1):
    one_digit = (A & (1<<i) != 0)
    pivot_flag = np.where(one_digit &  (A < (1<<(i + 1))))[0]
    if len(pivot_flag) == 0:
        continue
    p = pivot_flag[0]
    pivot = A[p]
    A[one_digit] ^= pivot
    A[p] = pivot
    
res = sum(odd_digit) + 2*(np.bitwise_xor.reduce(A))
print(res)

Measured memory_bytes: 24288
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fi first
#define sc second
#define ALL(x) x.begin(), x.end()
#define RALL(X) x.begin(), x.end()
#define FOR(i, n, k) for(i=0; i<n; i+=k)
#define FO(i, n, k) for(i=1; i<=n; i+=k)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define N 100005
#define mid ((l+r)/2)
#define dbg(x) (cerr << #x << " : " << x << endl)
#define endl "\n"
#define MOD 100000009

using namespace std;

typedef long long lli;
#define int long long

signed main(){
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	vector <int> ar(n);
	int odd = 0, even = 0;
	for(int i=0 ;i<n; i++){
		cin >> ar[i];
		if(i%2) odd += ar[i];
		else even += ar[i];
	}

	int first = even - odd;
	cout << first << " ";
	for(int i=0; i<n-1; i++){
		int cur = (ar[i] - first/2) * 2;
		cout << cur << " ";
		first = cur;
	}

	return 0;
}

Measured memory_bytes: 2176
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

#define MOD 1000000007;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0; i<n; i++)
		cin >> a[i];
	int p=0, num=0;
	for(int i=1; i<=n; i++){
		p=a[p]-1;
		num++;
		if(p==1)
			break;
	}
	if(num == n)
		cout << -1 << endl;
	else
		cout << num << endl;
	return 0;
}

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

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std; 

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";} 
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}
template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }
template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

int main(void)
{
    string s;
    cin >> s;
    
    int ans = 0;
    irep(i, 3) {
        if(s[i] == 'R') { ans = 1; }
    }
    if(s[0] == 'R' && s[1] == 'R') { ans++; }
    if(s[1] == 'R' && s[2] == 'R') { ans++; }
    
    cout << ans << endl;
    
    return 0;
} /*atcoder*/



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

int main(void){
    string s;
    cin >> s;
    
    vector<int> v;
    v.push_back(1);
    
    for(int i = 1; i < s.size(); i++) {
        if(s[i-1] == s[i]) v[v.size()-1] += 1;
        else v.push_back(1);
    }
    
    bool flg = true;
    for(int i = 0; i < s.size(); i++) {
        if(s[0] != s[i]) {
            flg = false;
        }
    }
    
    long k;
    cin >> k;
    
    if(flg) {
        cout << (s.size()*k)/2 << endl;
        return 0;
    }
    
    long result = 0;
    for(int i = 1; i < v.size()-1; i++) {
        result += v[i]/2;
    }
    result *= k;
    
    if(s[0] == s[s.size()-1]) result += ((v[0]+v[v.size()-1])/2) * (k-1);
    else result += (v[0]/2 + v[v.size()-1]/2) * (k-1);
    
    result += v[0]/2 + v[v.size()-1]/2;
    
    cout << result << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,k;
    vec h(200001);
    cin>>n>>k;
    rep(i,n) cin>>h[i];
    if(n==k){
        cout<<0;return 0;
    }
    ll dp[301][301]={0},inf=1e18,ans=inf;
    rep(i,n)rep(j,n+1) dp[i][j]=inf;
    rep(i,n) dp[i][1]=h[i];
    rep(i,n)rep(j,n)rep(k,i) dp[i][j+1]=min(dp[i][j+1],dp[k][j]+max((ll)0,h[i]-h[k]));
    rep(i,n) ans=min(ans,dp[i][n-k]);
    cout<<ans<<"\n";
}


Measured memory_bytes: 2560
#include <cstdio>
int main(void){
    // Here your code !
    int n;
    int a;
    int smallest;
    int biggest;
    long long sum;
    
    scanf("%d", &n);
    scanf("%d", &a);
    biggest = a;
    smallest = a;
    sum = a;
    for (int i = 1; i < n; i++){
        scanf("%d", &a);
        if (a > biggest) biggest = a;
        if (a < smallest) smallest = a; 
        sum += a;
    }
    printf("%d %d %ld\n", smallest, biggest, sum);
    return 0;
}

Measured memory_bytes: 2744
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
a = list(map(int, input().split()))

b = sorted(a)

mx = b[-1]
cnt = 0
for i in range(len(b) - 1):
    cnt += b[i]
print("Yes" if cnt > mx else "No")



Measured memory_bytes: 7880
#include<bits/stdc++.h>
using namespace std;
int a[105],sum;
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
	     cin>>a[i],sum+=a[i];
    if(sum%10!=0) cout<<sum<<endl;
    else
    {
    	int cnt=sum;
    	for(int i=1;i<=n;++i)
    	  if(a[i]%10!=0) cnt=min(cnt,a[i]);
    	sum-=cnt;
    	if(sum%10!=0) cout<<sum<<endl;
    	else cout<<0<<endl;
	}
	return 0;
 } 

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

typedef long long ll;
using namespace std;

int main(){
	
	int n;
	cin >> n;
	vector< vector<int> > happ(n, vector<int>(3));
	int INF = 1<<30;
	
	for(int i=0;i<n;++i)
		for(int j=0;j<3;++j)
			cin >> happ[i][j];
	//dp[i][j] es la mayor felicidad del dia i con la actividad anterior j
	vector< vector<int> > dp(n, vector<int>(3,0));
	dp[0][0]=max(happ[0][1],happ[0][2]);
	dp[0][1]=max(happ[0][0],happ[0][2]);
	dp[0][2]=max(happ[0][1],happ[0][0]);
	for(int day=1;day<n;++day){
		for(int i=0;i<3;++i){
			for(int j=0;j<3;++j){
				if(i!=j){
					dp[day][j]=max(dp[day][j],dp[day-1][i]+happ[day][i] );
					//cout << "day " << day << " i " << i << " j " << j << " dp "  << dp[day][j] << endl;
				}
			}
		}
	}
	
	int maxi = -INF;
	for(int i=0;i<3;++i){
		maxi = max(maxi,dp[n-1][i]);
	}
	cout << maxi << endl;
	/*
	for(int i=0;i<n;++i){
		for(int j=0;j<3;j++){
			cout << dp[i][j] << " ";
		}
		cout << endl;
	}
	*/
	
			
	
	
	return 0;
}


Measured memory_bytes: 11136
package main

import (
	"bufio"
	"math"
	"os"
	"strconv"
	"strings"
	"fmt"
)

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

//func nextUint64() uint64 {
//	sc.Scan()
//	i, e := strconv.ParseUint(sc.Text(), 10, 64)
//	if e != nil {
//		panic(e)
//	}
//	return i
//}

func Powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func main() {
	h := nextInt()
	w := nextInt()
	k := nextInt()

	c := make([][]string, h, h)

	for i := 0; i < h; i++ {
		c[i] = make([]string, w, w)
		chars := strings.Split(nextString(), "")

		for j := 0; j < w; j++ {
			c[i][j] = chars[j]
		}
	}

	count := 0

	arr1 := make([]int, h, h)
	for i := 0; i < h; i++ {
		arr1[i] = i
	}
	arr2 := make([]int, w, w)
	for i := 0; i < w; i++ {
		arr2[i] = i
	}

	nonRedRowsCombi := Powerset2(arr1)
	nonRedColumnsCombi := Powerset2(arr2)

	for _, nonRedRows := range nonRedRowsCombi {
		for _, nonRedColumns := range nonRedColumnsCombi {
			numBlacks := 0
			for _, i := range nonRedRows {
				for _, j := range nonRedColumns {
					if c[i][j] == "#" {
						numBlacks++
					}

				}
			}

			if numBlacks == k {
				count++
			}
		}
	}

	fmt.Println(count)
}


Measured memory_bytes: 1788
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

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

  string s;
  cin >> s;

  if (s[0] == '9' || s[1] == '9')
    cout << "Yes";
  else
    cout << "No";

  cout << endl;

  return 0;
}


Measured memory_bytes: 256
s = input()

answer = "No"

s1= s[:int((len(s)-1)/2)]
s2 = s[int((len(s)+3)/2)-1:]
def check(s): return True if s == s[::-1] else False
if check(s) and check(s1) and check(s2):
    answer = "Yes"
print(answer)

Measured memory_bytes: 3064
import sys
import copy
from collections import deque

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = [deque(lr()) for _ in range(N)]

match = 0
candidate = []
used = set()
for i in range(N):    
    bool = False
    if len(A[i]) == 0:
        continue
    op = A[i][0] - 1
    if op in used or i in used:
        continue
    if A[op][0]-1 == i:
        used.add(i)
        used.add(op)
        candidate.extend([i, op])
        match += 1
        bool = True
        A[i].popleft()
        A[op].popleft()
answer = 1

while True:
    used = set()
    bool = False
    c = []
    for i in candidate:
        if len(A[i]) == 0:
            continue
        op = A[i][0] - 1
        if op in used or i in used:
            continue
        if A[op][0]-1 == i:
            used.add(i)
            used.add(op)
            match += 1
            c.extend([i, op])
            bool = True
            A[i].popleft()
            A[op].popleft()
    
    answer += 1
    candidate = c
    if match == N * (N-1) // 2:
        break
    if not bool:
        print(-1)
        exit()

print(answer)


Measured memory_bytes: 38220
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n;
	cin>>n;
	if(n==1){
		cout<<"Hello World"<<endl;
	}else{
		int a,b;
		cin>>a>>b;
		cout<<a+b<<endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 100000000
using namespace std;
int main(){
  int e;
  while(1){
    cin >> e;
    if(e==0) break;
    int ans = INF;
    for(int y=0; y<1000; y++){
      for(int z=0; z<1000; z++){
	int x = e-y*y-z*z*z;
	if(x<0) continue;
	ans = min(ans,x+y+z);
      }
    }
    cout << ans << endl;
  }
  return 0;
}


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

int main(){
  int n,m,inf = -1000000007;
  cin >> n >> m;
  int a[m],num[10] = {0,2,5,5,4,5,6,3,7,6};
  for(int i = 0;i < m;i++){
    cin >> a[i];
  }
  sort(a,a+m);
  reverse(a,a+m);
  int dp[n+1];
  for(int i = 0;i <= n;i++){
    dp[i] = inf;
  }
  dp[0] = 0;
  vector<int> disp;
  for(int i = 1;i <= n;i++){
    int c;
    for(int j = 0;j < m;j++){
      if(i - num[a[j]] >= 0){
        if(dp[i] < dp[i-num[a[j]]] + 1){
          dp[i] = dp[i-num[a[j]]] + 1;
        }
      }
    }
  }
  /*for(int i = 0;i <= n;i++){
    cout << dp[i] << " " << i << endl;
  }*/
  int k = dp[n],l = n;
  while(k > 0){
    for(int i = 0;i < m;i++){
      if(l-num[a[i]] >= 0 && dp[l-num[a[i]]] == k-1){
        disp.push_back(a[i]);
        k--;
        l -= num[a[i]];
        break;
      }
    }
  }
  for(int i = 0;i < disp.size();i++){
    cout << disp.at(i);
  }
  cout << " " << endl;
}

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

#ifdef LOCAL_PC
	#define debug(args...) { cout.flush(); fflush(stdout); fprintf(stderr, args); }
#else
	#define debug(args...) ; /*  */
#endif
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second
using ll = long long;
using pii = pair<int, int>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class Ty> Ty rnd(Ty a, Ty b) { return uniform_int_distribution<Ty>(a, b)(rng); }

template<class num> inline void rd(num &x) {
	char c; while(isspace(c = getchar()));
	bool neg = false;
	if(!isdigit(c)) neg = (c == '-'), x = 0;
	else x = c - '0';
	while(isdigit(c = getchar()))
		x = (x << 3) + (x << 1) + c - '0';
	if (neg) x = -x;
} template <class T, class... Args> inline void rd(T& x, Args&... args) { rd(x); rd(args...); }

const int MAXN = 2e5 + 5, INF = 0x3f3f3f3f;

inline ll f(ll x) {
	return x * x * x * x * x;
}

inline ll get(ll x) {

	ll lo = -5000, hi = 5000, mi;
	while(lo < hi) {
		mi = (lo + hi + 1) / 2;
		if (f(mi) <= x) lo = mi;
		else hi = mi - 1;
	}

	return lo;
}

int main() {
	ll n; rd(n);

	for (ll b = -5000; b <= 5000; b++) {
		ll a = get(f(b) + n);
		if (f(a) - f(b) == n) {
			printf("%lld %lld\n", a, b);
			return 0;
		}
	}
}

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


int main() {
    //freopen("input.txt", "r", stdin);
    
    string s;
    cin >> s;

    if (s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes" << "\n";
    }
    else {
        cout << "No" << "\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iomanip>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <iostream>
using namespace std;

int main() 
{
    int N;
    cin >> N;
    
    double A = round(N / 2.0);
    cout << fixed << setprecision(10);
    cout << A / N << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
    int i,n,k,ans=1000;
    cin>>n;
    int a[n+5]={0};
    for(i=1;i<=n;i++){
        cin>>a[i];
    }
   for(i=1;i<=n;i++){
      if(a[i+1]>a[i]){
          k=(ans)/a[i];
          ans=ans%a[i]+(k*a[i+1]);
      }
   }cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3644
//
#include <vector>
#include <set>
#include <map>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <numeric>
#include <bitset>
//
using ll = long long;
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
inline void yes(bool cond) { cond ? puts("Yes") : puts("No"); }
template<typename Type> inline void chmin(Type& a, Type b) { if (a > b) a = b; }
template<typename Type> inline void chmax(Type& a, Type b) { if (a < b) a = b; }
template<typename Arr, typename Type> inline void fill(Arr& arr, Type v) { std::fill(arr.begin(), arr.end(), v); }
template<typename Type> inline void sort(Type& arr) { std::sort(arr.begin(), arr.end()); }
template<typename Type> inline Type nth(vector<Type>& arr, size_t pos) { std::nth_element(arr.begin(), arr.begin() + pos, arr.end()); return arr[pos]; }
constexpr double BIGP = 1000000007L;
constexpr double INF_I = std::numeric_limits<double>::max();
constexpr double INF_F = std::numeric_limits<float>::infinity();
constexpr double PI = 3.14159265358979323846L;
//
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    vector<ll> B(N - 1);
    rep(i, N - 1)
    {
        cin >> B[i];
    }

    ll total = 0;
    total += B[0];
    rep(ii, N-2)
    {
        ll i = ii + 1;
        total += min(B[i - 1], B[i - 0]);
    }
    total += B.back();
    cout << total;

    return 0;
}

Measured memory_bytes: 3160
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val (a, b, c) = (0 until 3).map { sc.nextInt() }
    var res = a - b
    var res2 = c - res

    if (res2 < 0) {
        println(0)
    } else {
        println(res2)
    }
}

Measured memory_bytes: 29588