akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define va first
#define vb second
#define lb lower_bound
#define pb push_back
#define all(v) v.begin(),v.end()
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
using ll = long long;
using lf = long double;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int n, m;
vector<int> G[100005];
vector<int> topo;
int dp[100005];
int ideg[100005];

int main(){
    fio;
    cin >> n >> m;
    for(int a, b; m--;){
        cin >> a >> b;
        G[a].push_back(b);
        ++ideg[b];
    }
    queue<int> Q;
    for(int i = 1; i <= n; i++) if(!ideg[i]) Q.push(i);
    while(!Q.empty()){
        int f = Q.front(); Q.pop();
        topo.push_back(f);
        for(int u : G[f]){
            if(!--ideg[u]) Q.push(u);
        }
    }
    reverse(all(topo));
    for(int u : topo){
        for(int v : G[u]) dp[u] = max(dp[u], dp[v] + 1);
    }
    cout << *max_element(dp,dp+n+1) << '\n';
}

Measured memory_bytes: 7032
#include <iostream>
#include <string>

using namespace std;

int main(){
  string a, b, c;
  cin >> a >> b >> c;
  if( a[a.size()-1] == b[0] && b[b.size()-1] == c[0] ){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define xx first
#define yy second

using namespace std;
const ll mod = 1e9 + 7, N = 1000000 + 5;
ll dp[N], fac[N];
ll sum, l, n, d, h, now;

inline ll add (ll m, ll n) {
	ll k = (m + n);
	return k >= mod ? k - mod : k;
}

inline ll sub(ll m, ll n) {
	ll k = m - n;
	return k < 0 ? k + mod : k;
}

inline ll mul (ll m, ll n) {
	ll k = m * n;
	k %= mod;
	return k;
}

inline ll qpow (ll m, ll n) {
	ll tot = 1, base = m;
	while (n) {
		if (n % 2 == 1) {
			tot = mul (tot, base);
		}
		base = mul (base, base);
		n /= 2;
	}
	return tot;
}

int main () {
	#ifdef wll
	freopen ("testdata.in", "r", stdin);
	#endif
	cin >> n >> h >> d;
	fac[1] = 1;
	for (int i = 2; i <= 1000000; ++i) {
		fac[i] = mul (fac[i - 1], i);
	}
	for (int i = 1; i <= n; ++i) {
		sum = add (sum, fac[i]);
	}
	dp[0] = 1;
	now = 1;
	for (int i = 1; i <= h; ++i) {
		if (l < i - d) {
			now = sub (now, dp[l]);
			++l;
		}
		dp[i] = mul (now, sum);
		now = add (now, dp[i]);
	}
	cout << mul (dp[h], mul (fac[n], qpow (sum, mod - 2))) << endl;
	return 0;
}
















Measured memory_bytes: 15872
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (LLONG_MAX - 1e5)
#define fcout cout << fixed << setprecision(10)

using namespace std;

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

    int N;
    cin >> N;
    int ct = 1;
    int ca = 1;
    REP(i, N) {
        int t, a;
        cin >> t >> a;

        int nt = ct / t;
        if (ct % t > 0) nt++;
        int na = ca / a;
        if (ca % a > 0) na++;
        int n = max(nt, na);
        ct = n * t;
        ca = n * a;
    }
    cout << ct + ca << endl;
    return 0;
}


Measured memory_bytes: 256
class AOJ
  def initialize
    n = gets.chomp.to_i
    a = gets.chomp.split(' ').map(&:to_i)

    0.upto(n-1) do |i|
      j = i
      v = a[j]

      while j > 0 && v < a[j-1]
        j -= 1
      end

      a.delete_at(i)
      a.insert(j, v)

      puts a.join(' ')
    end
  end
end

AOJ.new

Measured memory_bytes: 6108
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;

const ll INF = 9223372036854775807;
const int inf = 2147483647;

int rim(int n){
    if(n>=0){
        return n%-2;
    }else{
        return n%-2*-1;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> a={};
    while(n!=0){
        int b = rim(n);
        n = (n-b)/-2;
        a.push_back(b);
    }
    string res="";
    int l = a.size();
    if(l>0){
        REP(i,l){
            if(a[l-i-1]==0){
                res += "0";
            }else{
                res += "1";
            }
        }
        put(res);
    }else{
        put(0);
    }
    return 0;
}


Measured memory_bytes: 256
using namespace std;
#include<bits/stdc++.h>
#define int long long
#define pb push_back 
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ff first
#define ss second
#define repa(i,a,b) for (int i=a; i<=b; i++)
#define repd(i,b,a) for (int i=b; i>=a; i--)
#define endl "\n"
//debugging
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;
#define NL cout<<endl;
#define NNL cout<<endl<<endl;

int MAX = 1e+6+5;
int BIG = 1e+18+3;
int MOD = 1e+9+7;

signed main()
{
    IOS;
    int n; cin>>n;
    pair<int,int> ar[n+1];

    repa(i,1,n)
    {
        cin>>ar[i].ff;
        ar[i].ss=i;
    }

    sort(ar+1,ar+1+n);

    int minTillnow = ar[1].ss;
    int ans(0);
    repa(i,1,n)
    {
        if (ar[i].ss<=minTillnow)
            ans++;
        minTillnow=min(minTillnow,ar[i].ss);
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 3328
#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()
{
	ll A,B,C,X,Y;
	cin >> A >> B >> C >> X >> Y;
	ll ans = 1e15;
	rep(i,100005)
	{
		ll temp = 2 * C * i;
		temp += A * max(ll(0),X-ll(i));
		temp += B * max(ll(0),Y-ll(i));
		ans = min(ans,temp);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3572
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll N;
ll a[100010];
ll ans;

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

  rep( i, N )
    std::cin >> a[i], --a[i];

  ll p = 0;

  while( p != 1 )
  {
    p = a[p];
    ++ans;

    if( ans > N )
    {
      std::cout << -1 << std::endl;

      return 0;
    }
  }

  std::cout << ans << std::endl;

  return 0;
}

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

int A,B,C,D,E,F;

double calc(int a,int b)
{
	if(a==0 && b==0)return (double)0;
	if(a+b>F)return (double)0;
	return (double)(100*b)/(double)(a+b);
}

int main()
{
	vector<int> w,s;
	int tmp,ansi=0,ansj=0;
	double dtmp,ans=0;
	
	cin >> A >> B >> C >> D >> E >> F;
	
	for(int i=0;100*A*i<=F;i++)
	{
		for(int j=0;100*B*j<=F;j++)
		{
			tmp=100*A*i+100*B*j;
			if(tmp>F)break;
			w.push_back(tmp);
		}
	}
	for(int i=0;C*i<=F;i++)
	{
		for(int j=0;D*j<=F;j++)
		{
			tmp=C*i+D*j;
			if(tmp>F)break;
			s.push_back(tmp);
		}
	}
	
	for(int i:w)
	{
		for(int j:s)
		{
			dtmp=calc(i,j);
			if(dtmp<=calc(100,E) && dtmp>ans)
			{
				ans=dtmp;
				ansi=i;
				ansj=j;
			}
		}
	}
	
	if(ans==0)ansi=100*A;
	cout << ansi+ansj << " " << ansj << endl;
	return 0;
}


Measured memory_bytes: 1400
# a = input()
# b = input()

# words_a = list(a)
# words_b = list(b)
# # リストから共通のものを取り出す。
# matched_list = []
# for a in words_a:
#   for b in words_b:
#     if a!=b:
#       matched_list.append(a)

# print(len(matched_list))

a = [input() for i in range(2)]
i = 0
count = 0

while i<len(a[0]):
  if a[0][i]!=a[1][i]:
    count+=1
  i+=1

print(count)

Measured memory_bytes: 9380
package main

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

var matchNum = []int{0, 2, 5, 5, 4, 5, 6, 3, 7, 6}

func main() {
	N := nextInt()
	M := nextInt()
	var As []int
	for i := 0; M > i; i++ {
		As = append(As, nextInt())
	}

	sort.Sort(sort.Reverse(sort.IntSlice(As)))

	dp := make([]int, N+1)
	dp[0] = 0
	for i := 1; N >= i; i++ {
		maxDigit := int(math.Inf(-1))
		for _, A := range As {
			index := i - matchNum[A]
			if index < 0 || dp[index] < 0 {
				continue
			}
			num := dp[index] + 1
			maxDigit = max(maxDigit, num)
		}
		dp[i] = maxDigit
	}

	remain := dp[N]
	match := N
	for match > 0 {
		for _, A := range As {
			if match-matchNum[A] < 0 {
				continue
			}

			if dp[match-matchNum[A]] == remain-1 {
				fmt.Print(A)
				match -= matchNum[A]
				remain--
				break
			}
		}
	}

	/*
		remain := N
		for i := 0; dp[N] > i; i++ {
			for _, A := range As {
				if dp[remain-matchNum[A]] == dp[remain]-1 {
					fmt.Println(dp[remain])
					if dp[remain] == 1 && matchNum[A] != remain {
						continue
					}
					fmt.Print(A)
					remain--
					break
				}
			}
		}
		fmt.Println()
	*/
}

// Input. ----------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
}

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

	return i
}

func nextString() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}

	return sc.Text()
}

// ---------- Input.

// Util. ----------

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

// ---------- Util.


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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
const ll zero=0;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<ll>a(n);
  for(i=0;i<n;i++){
    cin>>a[i];
  }
  map<ll,ll>s;
  for(i=0;i<n;i++){
    if(s.find(a[i])==s.end()){
      s.emplace(a[i],1);
    }
    else{
      s[a[i]]++;
    }
  }
  vector<ll>bufa,bufb;
  for(auto z:s){
      bufa.push_back(z.fi);
      bufb.push_back(z.se);
  }
  //cout<<bufa[0] spa bufa[1] spa bufa[2]<<endl;
  //cout<<bufb[0] spa bufb[1] spa bufb[2]<<endl;
  //cout<<(bufa[0]^bufa[1])<<endl;
  if(s.size()>3)judge=false;
  else if(s.size()==3){
    if((bufa[0]^bufa[1])!=bufa[2])judge=false;
    if(bufb[0]!=bufb[1]||bufb[1]!=bufb[2])judge=false;
  }
  else if(s.size()==2){
    if(bufa[0]!=0||bufb[0]*2!=bufb[1])judge=false;
    //cout<<bufa[0] spa bufb[0] spa bufb[1]<<endl;
  }
  else if(s.size()==1&&bufa[0]!=0)judge=false;
  ans1(judge);
  return 0;
}

Measured memory_bytes: 7332
S = list(map(str, input().split()))

# 単語の先頭の文字をつなげ、大文字にした略語を出力してください

s1 = S[0][0].upper()
s2 = S[1][0].upper()
s3 = S[2][0].upper()

print(s1 + s2 + s3)

Measured memory_bytes: 8916
n, x = map(int, input().split())
a = list(map(int, input().split()))
c = 0
for i in range(n-1):
	if a[i] + a[i+1] > x:
		if x > a[i]:
			c += a[i]+a[i+1]-x
			a[i+1] -= a[i]+a[i+1]-x
		else:
			c += a[i+1]
			a[i+1] = 0
			c += a[i]-x
			a[i] -= a[i]-x
print (c)

Measured memory_bytes: 14052
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>
#include<numeric>
#include<complex>

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void printVector(vector<ll> A){
    cout << "[vector]" << endl;
    for(int i=0; i<A.size(); i++){
        cout << A[i] << " ";
    }
    cout << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    // input
    int N, K;
    cin >> N >> K;

    if(N % K == 0){
        p(0);
    }else{
        p(1);
    }
    
    return 0;
}

Measured memory_bytes: 256
n ,m = map(int, raw_input().split())
A = sorted(list(map(int, raw_input().split())), reverse = True)
divider = sum(A) / (4.0 * m) 

stack = 0

for a in A:
    if a >= divider:
        stack += 1

if stack >= m:
    print 'Yes'
else:
    print 'No'

Measured memory_bytes: 2568
#include <bits/stdc++.h>
#include<math.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int , int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18 


int main () {
    string s ;
    cin >> s ;
    int n = s.size() ;
    vector<int> ans (n) ;
    rep(j, 2){
        int num = 0 ;
        rep(i, n){
            if(s[i] == 'R'){
                num++ ; 
            }
            else {
                int rm = num - (num / 2) ;
                ans[i] += num/2 ;
                ans[i - 1] += rm ;
                num =  0 ;
            }
        }
        rep(i, n){
            if(s[i] == 'R'){
                s[i] = 'L' ;
            }
            else {
                s[i] = 'R' ;
            }
        }
        reverse(s.begin(),s.end()) ;
        reverse(ans.begin(), ans.end()) ;
    }

    
    rep(i, n){
        cout << ans[i] << " " ;
    }
    cout << endl ;
} 


Measured memory_bytes: 3840
#include<iostream>
using namespace std;
typedef long long li;
#define ceil(a,b) (((a)+(b)-1)/(b))
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  int a,b,c,d; cin >>a >>b >>c >>d;
  print((ceil(c,b)<=ceil(a,d))?"Yes":"No");
}


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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {

			//出力の都度更新をやめる
			var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
			Console.SetOut(sw);


			Ans();

			//更新する
			Console.Out.Flush();
			
		}
			public static void Ans() {

			var inputArray = retreiveLongArray();
			var inputCount = 2;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			var N = (int)inputArray[0];
			var K = (int)inputArray[1];


			var NGs = retreiveLongArray().Select(x =>(int)x).ToList();

			var OKs = new List<int>();

			for (int i = 0; i <= 9; i++) {
				if (!NGs.Contains(i)) {
					OKs.Add(i);
				}
			}

			var kosu = OKs.Count();

			var keta = (int)Math.Truncate(Math.Log10(N))+1;

			//keta桁の数のうち、Oksだけで使用されているものを列挙する
			var patterns = (int)Math.Pow(kosu, keta);
			var kouhos = new List<int>();
			
			for (int i = 0; i < patterns; i++) {
				var num = i;
				var kouho = 0;
				for (int j = 0; j < keta; j++) {

					kouho = kouho * 10 + OKs[num % kosu];
					num = num / kosu;
				}
				kouhos.Add(kouho);
			}


			//N =9999など桁を増さないとクリアできない場合
			if (kouhos.Max() < N) {
				var minNum = OKs[0];
				if (minNum !=0) {
					var minAns = string.Join("", Enumerable.Repeat(minNum, keta + 1));
					Console.WriteLine(minAns);
					return;
				}
				else {
					var min2 = OKs[1];
					var minAns = min2 + string.Join("", Enumerable.Repeat(minNum, keta));
					Console.WriteLine(minAns);
					return;
				}
			}

			var sorted = kouhos.OrderBy(x => x).ToList();
			//個の個数なら最小二乗法は不要だろう
			for (int i = 0; i < sorted.Count(); i++) {
				if (N <= sorted[i]) {
					Console.WriteLine(sorted[i]);
					return;
				}

			}


		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}


		/// <summary>
		/// 2組みずつの入力データ(数値)からTuppleListを作成する
		/// </summary>
		/// <param name="N"></param>
		/// <returns></returns>
		private static List<Tuple<long, long>> createLongTuppleList(long N) {
			var inpList = new List<Tuple<long, long>>();

			for (int i = 0; i < N; i++) {
				var inp = retreiveLongArray();
				var item1 = inp[0];
				var item2 = inp[1];
				inpList.Add(new Tuple<long, long>(item1, item2));
			}
			return inpList;
		}
	}
}


Measured memory_bytes: 28872
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;
const int MOD = 1000000007;
 
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a;
    string s;
    cin >> a >> s;
    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("-O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void Main();
#ifdef ConanYu
#include "local.hpp"
#else
#define debug(...) do { } while(0)
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Main();
}
#endif

void Main() {
  long long n; cin >> n;
  cout << (n * (n - 1) / 2) << "\n";
}


Measured memory_bytes: 256
import string
import bisect

S, T = input(), input()
lS, lT = len(S), len(T)

l = {s: [] for s in string.ascii_lowercase}
for i in range(lS):
    l[S[i]].append(i)

id, ans = -1, 0
for i in range(lT):
    if len(l[T[i]]) == 0:
        print(-1)
        exit()

    tmp = l[T[i]][(bisect.bisect(l[T[i]], id)) % len(l[T[i]])]
    if id >= tmp:
        ans += lS
    id = tmp

print(ans + id + 1)


Measured memory_bytes: 8180
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <deque>
using namespace std;
int main ()
{
    int k , n ;
    cin >> k ;cin>>n;
    int arr[k+1];

    for (int i = 0; i < k ; ++i)
    {
        cin >>arr[i];

    }

    sort(arr,arr+k);


    int sum = 0;

    for (int j = 0; j < n ; ++j)
    {
        sum+=arr[j];
    }
    cout <<sum<<endl;
}

Measured memory_bytes: 3632
package main

import "fmt"

func main() {
	var A, B, C, t string
	fmt.Scan(&A, &B, &C)
	t = "a"
	for {
		switch t {
		case "a":
			if len(A) == 0 {
				fmt.Println("A")
				return
			}
			t = A[0:1]
			if len(A) == 1 {
				A = ""
			} else {
				A = A[1:]
			}
		case "b":
			if len(B) == 0 {
				fmt.Println("B")
				return
			}
			t = B[0:1]
			if len(B) == 1 {
				B = ""
			} else {
				B = B[1:]
			}
		case "c":
			if len(C) == 0 {
				fmt.Println("C")
				return
			}
			t = C[0:1]
			if len(C) == 1 {
				C = ""
			} else {
				C = C[1:]
			}
		}
	}
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
using namespace std;
typedef pair<int,int> PII;
typedef pair<long,long> PLL;

int t;
int a,b;

int main() {
    ios::sync_with_stdio(false);
    cin>>t>>a>>b;
    for(int i=1;1;++i){
        if(i*t>=a && i*t<=b){
            puts("OK");
            break;
        }
        else if(i*t>b){
            puts("NG");
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(i, n) repr((i), 0, (n))
#define repr(i, a, t) reps((i), (a), (t), 1)
#define reps(i, a, t, s) for (long long (i) = (a); (i) < (long long)(t); (i) += (s))
#define rrep(i, n) rrepr((i), (n) - 1, 0)
#define rrepr(i, a, t) rreps((i), (a), (t), 1)
#define rreps(i, a, t, s) for (long long (i) = (a); (i) >= (long long)(t); (i) -= (s))
#define each(v, c) for (auto &&(v) : (c))
using namespace std;
namespace mp = boost::multiprecision;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ml = mp::cpp_int;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ifstream ifs;
  if (getenv("LOCAL") != nullptr) {
    ifs.open("src/_in.txt");
    cin.rdbuf(ifs.rdbuf());
  }

  ll N;
  cin >> N;
  vector<ll> T, A;

  rep (i, N) {
    ll t;
    cin >> t;
    T.push_back(t);
  }
  rep (i, N) {
    ll a;
    cin >> a;
    A.push_back(a);
  }

  vector<ll> mins(N, 1);
  vector<ll> maxes(N, INF);
  ll m = 0;
  rep (i, N) {
    maxes[i] = min(maxes[i], T[i]);
    if (T[i] > m) {
      mins[i] = max(mins[i], T[i]);
    }
    m = T[i];
  }
  m = 0;
  rrep (i, N) {
    maxes[i] = min(maxes[i], A[i]);
    if (A[i] > m) {
      mins[i] = max(mins[i], A[i]);
    }
    m = A[i];
  }



  ll ans = 1;
  rep (i, N) {
    ans *= max(0ll, maxes[i] - mins[i] + 1);
    ans %= MOD;
  }
  cout << ans << "\n";
}


Measured memory_bytes: 3572
//                                      KiSmAt
#include "bits/stdc++.h"
using namespace std;
 
using ll = long long;
 
const ll inf = 1e18;
const int N = 2 * 1e5 + 10;

ll res;
ll a[N], dp[N];

ll go(ll idx, ll n){
	if(idx == n)	return 0;
	if(dp[idx] != -1)	return dp[idx];
	ll xx = inf, yy = inf;
	xx = go(idx + 1, n) + abs(a[idx + 1] - a[idx]);
	if(idx + 2 <= n)	yy = go(idx + 2, n) + abs(a[idx + 2] - a[idx]);
	return dp[idx] = min(xx, yy);
}

void solve(){
	ll n;
	cin >> n;
	for(int i = 1; i <= n; ++i){
		cin >> a[i];
	}
	memset(dp, -1, sizeof dp);
	cout << go(1, n);
}
 
int main(int argc, char const *argv[]){
	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--){
    	solve();
    }
}
// nEro

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

int main () {
  long long a,b,k;
  cin >>a>>b>>k;

  if(k<=a){
    cout <<a-k<<" "<<b<<endl;
  } else if(k<a+b){
    cout <<0<<" "<<b-(k-a)<<endl;
  } else{
    cout <<0<<" "<<0<<endl;
  }

  
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;

long long MOD = 1000000007;

int main() {
  
    bool ans = false;
    int N,M,K;
    cin >> N >> M >> K;
    
    for ( int i = 0; i <= N; i++ ) {
    for ( int j = 0; j <= M; j++ ) {
        
        if ( N*j + M*i - (i*j*2) == K ) { ans = true; }
               
    }
    }
    
    cout << ( ans ? "Yes" : "No" ) << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long


void solve(long long N, long long M, long long X, long long Y, std::vector<long long> x, std::vector<long long> y){
    sort(ALL(x));
    sort(ALL(y));

//    cerr << x.back() << "," << y.front();
    if (X <= x.back() && x.back() < y.front() && y.front() <= Y) {
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }
}

signed main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    long long X;
    scanf("%lld",&X);
    long long Y;
    scanf("%lld",&Y);
    std::vector<long long> x(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&x[i]);
    }
    std::vector<long long> y(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&y[i]);
    }
    solve(N, M, X, Y, std::move(x), std::move(y));
    return 0;
}


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

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

int main()
{
	int N;
	string S;
	vector<vector<int>> su(2, vector<int>((unsigned int)(3 * 1e5 + 100), 0));

	cin >> N >> S;
	rep(i, N)
	{
		if (i == 0)
		{
			su.at(0).at(0) = 0;
			su.at(1).at(0) = 0;
		}

		if (S.at(i) == 'W')
		{
			su.at(0).at(i + 1) = su.at(0).at(i) + 1;
			su.at(1).at(i + 1) = su.at(1).at(i);
		}
		else
		{
			su.at(0).at(i + 1) = su.at(0).at(i);
			su.at(1).at(i + 1) = su.at(1).at(i) + 1;
		}

	}

	int ret = (int)(3 * 1e5);
	int l_min;
	rep(i, N)
	{
		l_min = (su.at(0).at(i) - su.at(0).at(0)) + (su.at(1).at(N) - su.at(1).at(i+1));
		ret = min(l_min, ret);
	}

	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 3712
//ABC092B
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;

int main(){
	int n, d, x;
	cin >> n >> d >> x;
	int a;
	int sigma = x;
	for(int i=0;i<n;i++){
		cin >> a;
		sigma += (d-1)/a+1;
	}
	cout << sigma << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main() {
	int n;
	cin >> n;
	vector < pair<pair<string, int>,int>> a(n);
	rep(i, n) {
		string s;
		int p;
		cin >> s >> p;
		p = -1 * p;
		a[i] = make_pair(make_pair(s, p),i+1);
	}
	sort(a.begin(), a.end());
	rep(i, n) {
		cout << a[i].second << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)


int main()
{
  int n,x;
  cin>>n>>x;
  int a[n];
  rep(i,n) cin>>a[i];
  ll ans=0;

  rep(i,n-1)
  {
    //a[i]とa[i+1]を同時に見る
    if(a[i]+a[i+1]<=x) continue;
    else
    {
      int over=a[i]+a[i+1]-x;
      if(a[i+1]<over)
      {
        a[i+1]=0;
        a[i]-=(over-a[i+1]);
      }
      else a[i+1]-=over;

      ans+=over;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
 
int main(){
    int N,M;
    int A, B;
    cin>>N>>M;
    int ans = N;
    int mountains[100001] = {};
    int list[100001]={};
    for(int i =1;i < N+1; i++){
        cin >>mountains[i];
    }
    for(int i =0; i< M; i++){
        cin >>A>>B;
        if(mountains[A]>mountains[B]){
            if(list[B]==0) ans = ans-1;
            list[B]=1;
        }else if(mountains[A]<mountains[B]){
            if(list[A]==0) ans = ans-1;
            list[A] = 1;
        } else{
            if(list[A]==0) ans = ans-1;
            if(list[B]==0) ans = ans-1;
            list[A]= 1;
            list[B] = 1;
        }
        //cout<<A<<" "<<B<<"list"<<list[A]<<" "<<list[B]<<endl;
        //cout <<"ans"<<ans<<endl;
    }
    cout <<ans<<endl;
    return 0;
}

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

a, b = [int(i) for i in input().split()]

start = int(((a * 100)/8) + 0.5)
if a % 2 == 0:
    candidate1 = list(range(start, start + 13))
else:
    candidate1 = list(range(start, start + 12))
start = (b * 10)
candidate2 = list(range(start, start + 10))

ans = -1
for i in candidate2:
    if i in candidate1:
        ans = i
        break
print(ans)


Measured memory_bytes: 38448
#include<stdio.h>
int main(void)
{
	int n,i,a=0,b=0;
	for(i=0;i<4;i++){
		scanf("%d",&n);
		if(i<2) a+=n;
		else b+=n;
	}
	//printf("%d %d\n",a,b);
	if(a>b) printf("Left\n");
	else if(a<b) printf("Right\n");
	else if(a==b) printf("Balanced\n");
	return 0;
}	
	

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <climits>
using namespace std;
/*------- Constants---- */

#define LL                      long long
#define Ulong                   unsigned long long
#define REP(i,n)                for(long long i=0; i < n ; i++ )
#define mp                      make_pair
#define pb                      push_back
#define all(x)                  (x).begin(),(x).end()
#define PI                      acos(-1.0)
#define EPS                     1e-14
#define F                       first
#define S                       second
#define di(x)                   int x; input(x)
#define in(x)                   input(x)
#define in2(x,y)                in(x),in(y)
#define in3(x,y,z)              in(x),in2(y,z)
#define lc                      ((n)<<1)
#define rc                      ((n)<<1|1)
#define db(x)                   cout << #x << " -> " << x << endl
#define nl                      cout<<endl
#define ms(ara_name,value)      memset(ara_name,value,sizeof(ara_name))
#define IO                      ios_base::sync_with_stdio(0);cin.tie(0)
#define READ                    freopen("/home/matrixcode/Desktop/in.txt","r",stdin)
#define WRITE                   freopen("out.txt","w",stdout)
template<class T> inline void input(T &x) {
  register char c = getchar();x = 0;
  int neg = 0;
  for(; ((c<48 || c>57) && c != '-'); c = getchar());
  if(c=='-'){neg = 1;c = getchar();}
  for(; c>47 && c<58 ; c = getchar()){x = (x<<1) + (x<<3) + c - 48;}
  if(neg) x = -x;
}
inline long long bigmod(long long p,long long e,long long M){
  long long ret = 1;
  for(; e > 0; e >>= 1){
    if(e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  } return ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

/***************************** END OF TEMPLATE *******************************/

const int N = 2e5+5;
LL dp[N];

LL query(int x) {
  LL ret = 0;
  while(x) {
    ret = max(ret, dp[x]);
    x -= x&-x;
  }
  return ret;
}

void update(int x, LL v) {
  while(x < N) dp[x] = max(dp[x], v), x += x&-x;
}

int main()
{
  int n;
  in(n);
  vector<int> vec;
  vector<int> f(n+1);
  for(int i = 0; i < n; i ++) {
    in(f[i]);
    vec.push_back(f[i]);
  }
  sort(vec.begin(), vec.end());
  for(int i = 0; i < n; i ++) f[i] = lower_bound(vec.begin(), vec.end(), f[i]) - vec.begin() + 1;

  LL ans = 0;
  for(int i = 0; i < n; i ++) {
    LL x;
    in(x);
    LL value = query(f[i]);
    update(f[i], value + x);
    ans = max(ans, value + x);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll a[101];
int main() {
	ll n,t;
	cin>>n>>t;
	for(int i=0;i<t;i++){
		cin>>a[i];
	}
	ll ans=0;
	for(int i=0;i<t;i++){
		ans=max(ans,a[i]);
	}
	ll zan=n-ans;
	cout << max(ll(0),ans-zan-1);
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

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

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

const int N = 3e4 + 10;
char s[N], t[3];

bool find(char s[], char t[], int n) {
  int i, j;
  for (i = 0, j = 0; i < n && j < 3; ) {
    if (s[i] == t[j]) {
      ++i;
      ++j;
    } else {
      ++i;
    }
  }
  return j == 3;
}

int main() {
  int n, ret = 0;
  scanf("%d%s", &n, s);
  for (int i = 0; i < 1000; ++i) {
    int k = i;
    for (int j = 0; j < 3; ++j) {
      t[j] = (char)('0' + k % 10);
      k /= 10;
    }
    reverse(t, t + 3);
    if (find(s, t, n)) ++ret;
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 256
// Problem : D - Leaping Tak
// Contest : AtCoder - AtCoder Beginner Contest 179
// URL : https://atcoder.jp/contests/abc179/tasks/abc179_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args&&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}
#define int long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define MOD 998244353
#define mod 998244353
#define bug cout<<"HY"<<endl
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define numize(A) A.numize(unique(A.begin(), A.end()) - A.begin())
typedef pair<int,int> P;
int power(int a,int b)
{
    if(b==0)
        return 1;
    if(b%2==0)
        return (power((a*a)%mod,b/2))%mod;
    return (a*(power((a*a)%mod,b/2))%mod)%mod;
}
int modInv(int n)
{
    return power(n, MOD-2);
}
int nCr(int n, int r, int p=MOD)
{
   if (r==0)
      return 1;
    int Fact[n+1];
    Fact[0] = 1;
    for (int i=1 ; i<=n; i++)
    {
        Fact[i] = (Fact[i-1]*i)%p;
    }
    return (((Fact[n]* modInv(Fact[r])) % MOD) *(modInv(Fact[n-r]) % MOD)) % MOD;
}
double PI=3.14159265359;
void solve()
{
	int n,k,i,j;
	cin>>n>>k;
	int L[k],R[k];
	int Pre[n+5];
	memset(Pre,0,sizeof(Pre));
	for(i=0;i<k;i++)
	{
		cin>>L[i]>>R[i];
	}
	int Ans[n+5];
	memset(Ans,0,sizeof(Ans));
	Ans[1]=1;
	for(i=1;i<=n;i++)
	{
		Pre[i]+=(Pre[i-1]+MOD)%MOD;
		Pre[i]%=MOD;
		for(j=0;j<k;j++)
		{
			
			Pre[min(i+L[j],n+1)]+=Ans[i]+Pre[i];
			Pre[min(i+R[j],n+1)+1]-=(Ans[i]+Pre[i]);
			Pre[min(i+L[j],n+1)]=(Pre[min(i+L[j],n+1)]+MOD)%MOD;
			Pre[min(i+R[j],n+1)+1]=(Pre[min(i+R[j],n+1)+1]+MOD)%MOD;
		}
		// for(j=1;j<=n;j++)
		// {
			// Pre[j]+=Pre[j-1];
			// cout<<Pre[j]%MOD<<" ";
		// }
		// cout<<endl;
	}
	// for(i=1;i<=n;i++)
	// {
		// cout<<Pre[i]<<" "; 
	// }
	// cout<<endl;
	cout<<Pre[n]<<endl;
	return;
}
int32_t main()
{
    boost;
    int  t=1;
    // cin>>t;
    while(t--)
    {
    	solve();
    }
}


Measured memory_bytes: 6736
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		a = scanner.nextInt();
		b = scanner.nextInt();
		slove(0, 0, "");
	}

	private void slove(int x, int y, String s) {
		if ((x == 5 && y < b && y != 4) || y == 5 && x < a && x != 4)
			return;
		if (x == a + 1 || y == b + 1)
			return;
		if (x == a && y == b)
			System.out.println(s);
		for (int i = 0; i < 2; i++) {
			if (i == 0) {
				slove(x + 1, y, s + "A");
			} else
				slove(x, y + 1, s + "B");
		}
	}

	int a, b;
}

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

int main()
{
    int N;
    cin>>N;
    int a[N];
    for(int i=0; i<N; i++)
    {
        cin>>a[i];
    }
    int count=0;
    for(int i=1;i<N-1;i++)
    {
        if(a[i-1]<a[i])
          {  if(a[i]<a[i+1])
               { count++;}
          }
        
        else if(a[i-1]>a[i])
           { if(a[i]>a[i+1])
                {count++;}
           }
    }
    cout<<count;
    return 0;
    
    
}

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

int main() {
  int a;
  cin >> a;
  if (a==1){
    cout << 0 << endl;
    return 0;
  }
  cout << 1 << endl;
  return 0;
}


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

int main()
{
  int a, b;
  char s[20];
  for(int i = 0; i < 9; i++)
  {
    cin >> s >> a >> b;
    cout << s << " " << a + b << " " << a * 200 + b * 300 << endl;
  }
}

Measured memory_bytes: 1164
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int D = Integer.parseInt(scan.next());
		switch (D) {
		case 22:
			System.out.println("Christmas Eve Eve Eve");
			break;
		case 23:
			System.out.println("Christmas Eve Eve");
			break;
		case 24:
			System.out.println("Christmas Eve");
			break;
		case 25:
			System.out.println("Christmas");
			break;
		}
	}
}


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

int main() {
  int x, y;
  string s;
  cin >> x >> y;
  
  s = "Yes";
  if(2*x - y/2.0 < 0 || y/2.0 - x < 0 ||y % 2 == 1){
  	s = "No";
  }
  cout << s << endl;
  
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =999999999;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}

//素数判定
ll isprime(ll n){
  bool prime=true;
  for(int i=2;i<n;i++){
    if(n%i==0){
      prime=false; break;
    }
  }
if(prime){cout<<n<<" is prime"<<endl;
         }else{cout<<n<<" is not prime"<<endl;}

}
//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




//10億7。　　　100000007
//2*2行列 H*W
//vector<vector<int>> vec(H,vector<int>(W));
//for(int i=0;i<H;i++){
//for(int j=0;j<W;j++){
//cin>>vec[i][j];
//  }
//}

//文字列→数列
//string S;int A=atoi(S.c_str());
//数列→文字列
//int A;string S=to_string(A);
//数字判定　isdigit(a)
//pair宣言　pair<int,int> p(5,7);
//ソート　sort(vec.begin(),vec.end());



int main(){
cout<<fixed<<setprecision(10);


  int N,K;cin>>N>>K;
  if(N>=10){
    cout<<K<<endl;
  }else{
  cout<<K+100*(10-N)<<endl;

  
  }
  
  
  
  
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <climits>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long;

int main() {
	int a,b;
	cin >> a >> b;
	string n;
	for (int i = 0; i < b + 2; i++) {
		cout << "#";
	}
	cout << endl;
	for (int i = 0; i < a; i++) {
		cin >> n;
		cout << "#"<<n <<"#"<< endl;
	}
	for (int i = 0; i < b + 2; i++) {
		cout << "#";
	}
	cout << endl;
}


Measured memory_bytes: 3632
/* it was worth becoming a chemist */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<int, long long> pil;
typedef vector<int> vi;
typedef vector<long long> vll;

#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
#define NAME "puts"
#define F first
#define S second

const int inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int MAXN = 1e5 + 5;

#define int long long

string s;

void solve() {
	int l = -1;
	cin >> s;
	for (int i = 0; i < sz(s); i++) {
		if (s[i] == 'B') {
			l = i;
			break;
		}
	}
	if (l == -1) {
		cout << 0;
		return;
	}
	int res = 0;
	for (int i = l + 1; i < sz(s); i++) {
		if (s[i] == 'W') {
			res += (i - l);
			l++;
		}
	}
	cout << res;
}


main() {


	ios_base::sync_with_stdio(0);
	cin.tie(0);            	
	cout.tie(0);

	int times = 1;
	for (int i = 1; i <= times; i++) {
		solve();
	}

	return 0;	
}	

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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

const int maxn = 405;
int n, e[maxn][maxn], dis[maxn][maxn];

int clr[maxn];

bool dfs(int u, int c) {
  clr[u] = c;
  for (int v = 1; v <= n; v++) {
    if (e[u][v]) {
      if (clr[v] == -1 && !dfs(v, c ^ 1)) {
        return 0;
      }
      if (clr[v] == c) {
        return 0;
      }
    }
  }
  return 1;
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%1d", &e[i][j]);
    }
  }
  memset(clr, -1, sizeof clr);
  if (!dfs(1, 0)) {
    return puts("-1"), 0;
  }
  for (int i = 1; i <= n; i++) {
    dis[i][i] = 0;
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        dis[i][j] = e[i][j] ? 1 : 1e9;
      }
    }
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        dis[i][j] = min(dis[i][j], dis[i][k] + dis[k][j]);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      ans = max(ans, dis[i][j]);
    }
  }
  printf("%d\n", ans + 1);
  return 0;
}

Measured memory_bytes: 896
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e4;

int a[MaxN + 5],b[MaxN + 5];

int main()
{
	int n;
	long long ans,sum;
	while(~scanf("%d",&n))
	{
		ans = 0;
		sum = 0;
		for(int i = 1;i <= n;i++) scanf("%d",&a[i]);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&b[i]);
			if(a[i] > b[i]) sum += a[i]-b[i];
			else ans += (b[i] - a[i])/2;
		}
		if(sum > ans) printf("No\n");
		else printf("Yes\n");
	}
	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i = 0; i < n; i++)

int main(void)
{
    int A,B,C,X;
    cin >> A >> B >> C >> X;
    int sum = 0;
    for(int i = 0; i <= A ; i++)
    {
        for(int j = 0; j <= B; j++)
        {
            for(int k = 0; k <= C; k++)
            {
                if(500 * i + 100 * j + 50 * k == X)
                    sum++;
            }
        }
    }

    cout << sum << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
const ll MOD = 1000000007;//998244353;
int main() {
   ios::sync_with_stdio(false);
   cin.tie(0);
   ll n; cin >> n;
   ll t_sum = 1, a_sum = 1;
   rep(i,n){
      ll t,a; cin >> t >> a;
      ll u = max((t_sum+t-1)/t, (a_sum+a-1)/a);
      t *= u; a *= u;
      t_sum = t;
      a_sum = a;
   }
   cout << t_sum + a_sum << endl;
}

Measured memory_bytes: 3648
#include<iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include<set>
using namespace std;
int main()
{
    int A, B;
    cin >> A;
    cin >> B;
    
    if (A <= 9 && B <= 9){
        cout << A * B << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256