akhauriyash/Code-Regression huggingface dataset:
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//String S = sc.next();
		//int N = Integer.parseInt(sc.next());
		//out.println();
		// ArrayList<String> list = new ArrayList<String>();
		// list.stream().sorted().distinct();
		int N = Integer.parseInt(sc.next());
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		int cnt = N*100 + A*10 + B;
		if(cnt%4==0){
			out.println("YES");
		}else {
			out.println("NO");
		}
		out.flush();	
	}
}

Measured memory_bytes: 22996
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    n, k = map(int, input().split())
    p_list = list(map(int, input().split()))

    p_list.sort()

    ans = 0
    for i in range(k):
        ans += p_list[i]

    print(ans)

if __name__ == "__main__":
    resolve()



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

using namespace std;

typedef vector<long long> row;
typedef vector<row> mat;

const int M = 52;
const int MOD = 1e9 + 7;
int n;
long long k;

mat mltp(mat &a, mat &b){
	mat c(a.size(), row(a.size()));
	for(int k = 0; k < a.size(); k++)
		for(int i = 0; i < a.size(); i++)
			for(int j = 0; j < a.size(); j++)
				c[i][j] = (c[i][j]+a[i][k]*(long long)b[k][j])%MOD;
	return c;
}

mat mypow(mat &b, long long p){
	if(p == 1) return b;
	mat z = mypow(b, p/2ll);
	mat x = mltp(z, z);
	if(p&1)return mltp(x, b);
	return x;
}

int main () {
    scanf ("%d %lld", &n, &k);
    mat t(n,row(n));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            scanf ("%lld", &t[i][j]);
        }
    }
    t = mypow(t, k);
    long long ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            ans = (ans + t[i][j]) % MOD;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.first+a.second > b.first+b.second; }

signed main() {
  static const double pi = 3.141592653589793;
  SS(double,a,b,c,d);
  double A=30*c+(d/60)*30;
  debug(A);
  double B=6*d;
  double C=min(abs(A-B),360-abs(A-B));
  debug(C);
  C=C*pi/180;
  debug(cos(C));
  double ans=a*a+b*b-2*a*b*cos(C);
  p(sqrt(ans));
}

Measured memory_bytes: 4236
package main

import "fmt"

var subs = [...]string{"dream", "dreamer", "erase", "eraser"}

func reverse(s string) (r string) {
	var b []byte
	for i := len(s) - 1; i >= 0; i-- {
		b = append(b, s[i])
	}
	return string(b)
}

func main() {
	var s string
	fmt.Scan(&s)
	r := reverse(s)
	var ss []string
	for i := 0; i < len(subs); i++ {
		ss = append(ss, reverse(subs[i]))
	}
	// fmt.Println("s", s, "r", r, "ss", ss)
	var i int
	good := true
	for {
		ok := false
		for j := 0; j < len(ss); j++ {
			sslen := len(ss[j])
			// fmt.Printf("(%d,%d) sslen %d, ss[j] %s\n", i, j, sslen, ss[j])
			if i+sslen <= len(r) {
				if r[i:i+sslen] == ss[j] {
					ok = true
					i += sslen
					break
				}
			}
		}
		if !ok {
			good = false
			break
		}
		if i >= len(r) {
			break
		}
	}
	if good {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 1792
using System;

namespace ITP1_4_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] strAry = Console.ReadLine().Split(' ');
            int v0, v1;
            double v2;

            v0 = int.Parse(strAry[0]) / int.Parse(strAry[1]);
            v1 = int.Parse(strAry[0]) % int.Parse(strAry[1]);
            v2 = double.Parse(strAry[0]) / double.Parse(strAry[1]);

            Console.WriteLine("{0} {1} {2:F5}", v0, v1, v2);
        }
    }
}

Measured memory_bytes: 9172
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var a = cin.nextInt();
            var b = cin.nextInt();
            var c = cin.nextInt();
                       
            Console.WriteLine((a * b) / 2);
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define int long long

bool is(int x)
{
    if(x == 2) return true;
    if(x < 2) return false;
    if(x % 2 == 0) return false;
    for(int i = 2; i * i <= x; i++)
        if(x % i == 0)
            return false;
    return true;
}

int32_t main()
{
    int x;
    cin >> x;
    while(!is(x)) x++;
    cout << x << '\n';

	return 0;
}

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

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

	ll n = 1;
	for (int i = 0; i < a.length(); i++) {
		n += i;
	}

	ll m[26] = {};
	for (int i = 0; i < a.length(); i++) {
		m[a[i] - 'a']++;
	}
	for (int i = 0; i < 26; i++) {
		n -= m[i] * (m[i] - 1) / 2;
	}

	cout << n << endl;
	return 0;
}


Measured memory_bytes: 640
N=int(input())
p=list(map(float,input().split()))

#i枚投げて，j枚が表である確率
dp=[[0]*(N+1) for _ in range(N+1)]

dp[0][0]=1

for i in range(N):
    for j in range(N):
        dp[i+1][j]+=dp[i][j]*(1-p[i])
        dp[i+1][j+1]+=dp[i][j]*p[i]
        if j==i:
            break
            
print(1.0-sum(dp[-1][:N//2+1]))




Measured memory_bytes: 254856
fn main(){
  let v: Vec<u32> = read_vec();
  let s: u32 = v.iter().sum();
  println!("{:?}", 15 - s);
}

fn read_vec<T>() -> Vec<T>
  where T: std::str::FromStr,
        T::Err: std::fmt::Debug
{
  let mut buf = String::new();
  std::io::stdin().read_line(&mut buf).expect("failed to read");
  buf.split_whitespace().map(|e| e.parse().unwrap()).collect()
}


Measured memory_bytes: 2108
#include <cstdio>
#include <cctype>
using namespace std;
int main(void){
    char ch;
    while(1){
        scanf("%c",&ch);
        if(!isalpha(ch)){
            printf("%c",ch);
            if(ch=='\n')break;
            continue;
        }
        if(isupper(ch))printf("%c",tolower(ch));
        else printf("%c",toupper(ch));
    }
    return 0;
}

Measured memory_bytes: 2544
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
}


Measured memory_bytes: 61248
#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct dat{
	ll h,p;
	bool operator <(const dat&x)const{return h+p<x.h+x.p;}
}p[5005];
ll dp[5005],n,ans,inf;
int main(){
	cin>>n;for(int i=1;i<=n;++i)cin>>p[i].h>>p[i].p;
	sort(p+1,p+n+1);memset(dp,127,sizeof(dp));inf=dp[0],dp[0]=0;
	for(int i=1;i<=n;++i)for(int j=i;j;--j)if(dp[j-1]<=p[i].h)dp[j]=min(dp[j],dp[j-1]+p[i].p);
	for(int i=n;i;--i)if(dp[i]!=inf)return cout<<i,0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod  1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long>vll;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

int main(){
  int N;
  cin >> N;
  if(N == 22)cout << "Christmas Eve Eve Eve" << endl;
  else if(N == 23) cout << "Christmas Eve Eve" << endl;
  else if(N == 24) cout << "Christmas Eve" << endl;
  else if(N == 25) cout << "Christmas" << endl;
  return 0;
}


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

namespace AtcoderTemplateForCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var ans = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == '+')
                {
                    ans += 1;
                }
                else
                {
                    ans -= 1;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13140
import statistics

n = int(input())
alist = []
blist = []
for i in range(n):
    a,b = map(int,input().split())
    alist.append(a)
    blist.append(b)
minMed = statistics.median(alist)
maxMed = statistics.median(blist)

if n%2 == 1:
    print(maxMed-minMed+1)
else:
    if (minMed*2) % 2 == 0:
        if (maxMed*2) % 2== 0:
            diff = maxMed - minMed
            print(int(2*diff + 1))
        else:
            print(int((maxMed*2 - minMed*2) +1))
    else:
        if (maxMed*2)%2 == 0:
            print(int((maxMed*2 - minMed*2) +1))
        else:
            diff = 2*maxMed - 2*minMed
            print(int(diff+1))



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

#define ll long long
#define pb push_back
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);

void solve() {
    int n;
    cin >> n;
    int a[n+1] = {};
    int ans = 0;
    map<int, int> mp;
    set<int> s;
    for(int i = 1; i<=n; i ++) {
        cin >> a[i];
        mp[a[i]] ++;
        s.insert(a[i]);
    }
    vector<int> v;
    for(auto it: s) {
        v.push_back(it);
    }
    bool hash[1000005];
    memset(hash, false, sizeof(hash));

    for(int i = 0; i<int(v.size()); i++) {
        if(mp[v[i]] <= 1 && !hash[v[i]]) ans++;
        for(int j = v[i]; j<=1000000; j += v[i]) {
            hash[j] = true;
        }
    }
    cout << ans << '\n';
}

int main() {_
    int t = 1;
    //cin >> t;
    // Please remember to uncomment for taking test cases
    for(int i = 1; i<=t; i++) {
        solve();
    }
    return 0;
}


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

typedef long long ll;
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define REP(i,n) for (int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
 
using namespace std;

int main(){
    
    int a,b;
    cin >> a>>b;
    if(a+b == 15)cout <<"+";
    else if(a*b == 15)cout <<"*";
    else cout <<"x";
}


Measured memory_bytes: 256
import numpy as np

N,K = map(int,input().split())
S = list(input())

State = [0] * N
counter0 = 0
counter1 = 0
flag = -1
jj = 0
for i in range(N):
    if S[i] == '0':
        if flag == 1:
            State[jj] = counter1
            jj +=1
            counter1 = 0
        counter0 += 1
        flag = 0
    if S[i] == '1':
        if flag == 0:
            State[jj] = counter0
            jj += 1
            counter0 = 0
        counter1 += 1
        flag = 1
    if i == N-1:
        State[jj] = max(counter0,counter1)
        
N2 = np.count_nonzero(State)
State = int(S[0] == '0') * [0] + State[:N2] + int(S[N-1] == '0') * [0]
N2 = len(State)
ans = 0
total = 0
K2 = 2*K+1

if K2 >= N2:
    K2 = N2

for i in range(K2):
    total += State[i]
        
ans = total
for i in range(0,N2-K2,2):
    total2 = total - State[i] - State[i+1] + State[i+K2] + State[i+1+K2]
    ans = max(ans,total2)
    total = total2
    
print(ans)

Measured memory_bytes: 20636
# coding: utf-8

import sys
input = sys.stdin.readline

mod = int(1e9 + 7)

def f(K, D):
    l = len(K)
    dp = [[[0] * D for _ in range(2)] for _ in range(l + 1)]
    dp[0][0][0] = 1
    for i in range(l):
        ki = int(K[i])
        for j in range(2):
            uki = 9 if j else ki
            dpij = dp[i][j]
            for d in range(D):
                for k in range(uki + 1):
                    dpij_ = dp[i + 1][j or k < ki]
                    d_ = (d + k) % D
                    dpij_[d_] += dpij[d]
                    dpij_[d_] %= mod
    # K = 0 の場合が含まれるので -1
    return((dp[-1][0][0] + dp[-1][1][0] - 1 + mod) % mod)

K = input().rstrip() # 1 <= K <= 10^10000
D = int(input()) # 1 <= D <= 100

print(f(K, D))


Measured memory_bytes: 61532
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    cout << (a == b ? c : a == c ? b : a) << '\n';
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

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

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

int main() {
  int N, M;
  cin >> N >> M;
  typedef pair<int, int> P;

  vector<P> BA(N);
  rep(i, N) {
    cin >> BA[i].se >> BA[i].fi;
    BA[i].se *= -1;
  }
  sort(all(BA), greater<P>());

  rep(i, N) { BA[i].se *= -1; }

  set<int> s;
  repp(i, 1, M) { s.insert(i); }

  ll ans = 0;
  rep(i, N) {
    set<int>::iterator it = s.lower_bound(BA[i].se);
    if (it == s.end())
      continue;
    else {
      s.erase(it);
      ans += BA[i].fi;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 5760
/*
 * @Author: Sky Dreamer 
 * @Date: 2020-02-16 20:13:21 
 * @Last Modified by: Sky Dreamer
 * @Last Modified time: 2020-02-16 20:15:11
 * @Problem Url: 
 * @Status: 
 */
#include <cstdio>

int n;
bool suc = true;

inline int read() {
#define gc c = getchar()
    int d = 0,f = 0,gc;
    while(c < 48 || c > 57) f |= (c == '-'),gc;
    while(c > 47 && c < 58) d = (d << 1) + (d << 3) + (c ^ 48),gc;
#undef gc
    return f ? -d : d;
}

int main() {
#ifndef ONLINE_JUDGE
#define register
#endif
    n = read();
    for(;n;n --) {
        int tmp = read();
        if(tmp & 1) continue;
        if(tmp % 3 && tmp % 5) suc = false;
    }
    if(suc) puts("APPROVED");
    else puts("DENIED");
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define FOR(i, b, n) for (ll i = b; i <= n; ++i)

using namespace std;
using ll = long long;
using P = pair<int, int>;

void solve(ll N) {
  vector<ll> ans(N + 1, 0);
  FOR(z, 1, N / 6) {
    FOR(y, 1, z) {
      FOR(x, 1, y) {
	ll i = x * x + y * y + z * z + x * y + y * z + z * x;
	if (i > N)
	  continue;
	// printf("%lld %lld %lld %lld\n", x, y, z, i);
	if (x == y && y == z)
	  ans[i] += 1;
	else if (x != y && y != z)
	  ans[i] += 6;
	else
	  ans[i] += 3;
      }
    }
  }
  REP(i, N)
    cout << ans[i + 1] << endl;
}

int main(){
  // int 3E4  long 2E9  ll 9E18
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N;
  cin >> N;

  solve(N);

  return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>
#include <math.h>

int main(void){
    int a,b,c;
    double S,L,h,rad;
    scanf("%d %d %d", &a,&b,&c);
    rad = M_PI / 180.0 * c;
    h = b * sin(rad);
    S = a*b*sin(rad)/2.0;
    L = a + b + sqrt(a*a+b*b-2.0*a*b*cos(rad));
    printf("%f\n%f\n%f\n",S,L,h);
    return(0);
}

Measured memory_bytes: 636
while 1:
    n, p = map(int, raw_input().split())
    if n==0: break
    cnt = [0] * n; w = p; pos = 0
    while 1:
        if w:
            cnt[pos] += 1
            w -= 1
            if w==0 and cnt[pos]==p:
                print pos
                break
        else:
            w = cnt[pos]
            cnt[pos] = 0
        pos = (pos + 1) % n

Measured memory_bytes: 6264
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
const long long int mod=1000000007;
int Asearch(string s){
	for (int i = 0; i < s.size(); i++){
		if (s[i] == 'A'){
			return i;
		}
	}
}
int Zsearch(string s){
	for (int i = s.size()-1; i>=0; i--){
		if (s[i] == 'Z'){
			return i;
		}
	}
}

int main(){
	string s;
	cin >> s;
	int A = Asearch(s);
	int Z = Zsearch(s);
	cout << Z - A+1 << endl;
}

Measured memory_bytes: 772
import static java.lang.System.out;
import java.util.Scanner;                                                       

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();

        if (a < b && b < c) {
            out.println("Yes");
        } else {
            out.println("No");
        }

    }   
}

Measured memory_bytes: 26112
#include <stdio.h>

int main(void)
{
	int N;
	int i, j, max, min;
	scanf("%d", &N);
	int a[N];
	for(i=0; i<N; i++){
		scanf("%d", &a[i]);
	}
	max=a[1]-a[0];
	min=a[0];
	for(j=1; j<N; j++){
		if(max>=a[j]-min) ;
		else max=a[j]-min;
		
		if(min<=a[j]) ;
		else min=a[j];
	}
	
	printf("%d\n", max);
	
	return 0;
}


Measured memory_bytes: 2620
def LIS(A):
    dp = [-A[0]]
    for a in A[1:]:
        if -a >= dp[-1]:
            dp.append(-a)
        else:
            dp[bisect_right(dp, -a)] = -a
    return len(dp)

##################################################################################################################

import sys
input = sys.stdin.readline
from bisect import bisect_right

N = int(input())
A = list(map(int, sys.stdin.readlines()))

print(LIS(A))

Measured memory_bytes: 97276
import java.util.Scanner;

class Main{

	public static void main(String[] args) {




		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int K = scan.nextInt();

		long a = 0;
		for(int i = 1;i <= N;i++){
			if(i % K == 0){
				a++;
			}
			
		}
		if(K % 2 ==0){
			long b = 0;
			for(int i = 1;i <= N ;i++){
				if(i % K ==K /2){
					b++;
				}
			}
			System.out.println((long)(Math.pow(a, 3) + Math.pow(b, 3)));
			
		}else{
			System.out.println((long)(Math.pow(a, 3)));

		}


	}






}


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

using namespace std;
#define int long long
const int INF=1LL<<55LL;

int cnt;
void merge(int *A,int left,int mid,int right){
    int n1=mid-left;
    int n2=right-mid;
    int L[n1+1],R[n2+1];
    for(int i=0;i<n1;i++) L[i]=A[left+i];
    for(int i=0;i<n2;i++) R[i]=A[mid+i];
    L[n1]=INF;
    R[n2]=INF;
    int i=0,j=0;
    for(int k=left;k<right;k++){
        cnt++;
        if(L[i]<=R[j]) A[k]=L[i++];
        else A[k]=R[j++];
    }
}


void mergesort(int *A,int left,int right){
    if(left+1 < right){
        int mid = (left+right)/2;
        mergesort(A,left,mid);
        mergesort(A,mid,right);
        merge(A,left,mid,right);
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0); //この2行はより速度を向上させる
    int n;
    cin >> n;
    int S[n];
    for(int i=0;i<n;i++) cin>>S[i];
    cnt=0;
    mergesort(S,0,n);
    for(int i=0;i<n;i++) cout<<S[i]<<" \n"[i==n-1];
    cout<<cnt<<endl;
    return 0;
}



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

int main(){
    int a; string s; cin >> a >> s;
    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;
}
   

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

using namespace std;

int main(int argc, const char *argv[]) {
  int a, b, c;
  cin >> a >> b >> c;
  if (a > b) {
    swap(a, b);
  }

  if (a <= c && c <= b) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    int q;
    cin >> q;
    while(q--) {
        int s, t;
        cin >> s >> t;
        reverse(a.begin() + s, a.begin() + t);
    }
    for(int i = 0; i < n; i++) {
        cout << a[i] << (i == n - 1 ? '\n' : ' ');
    }
}


Measured memory_bytes: 3096
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

// -------------------</optimizations>--------------------
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define d long double
#define pii pair<int,int>
#define pb push_back
#define pf push_front
#define cases int t;cin>>t;while(t--)
#define N 100003
#define M 103
#define inf LLONG_MAX
//int mod=1e9+7;
//int mod=998244353;

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

    int x,y,z,k;
    cin>>x>>y>>z>>k;
    int a[x+1],b[y+1],c[z+1],i,j;
    for(i=1;i<=x;++i)
        cin>>a[i];
    sort(a+1,a+x+1);
    for(i=1;i<=y;++i)
        cin>>b[i];
    sort(b+1,b+y+1);
    for(i=1;i<=z;++i)
        cin>>c[i];

    vector<int> h;  h.clear();
    for(i=1;i<=x;++i)
    {
        for(j=1;j<=y;++j)
        {
            h.pb(a[i]+b[j]);
        }
    }
    sort(h.begin(),h.end(),greater<int>());
    vector<int> f;  f.clear();
    for(i=0;i<min(k,(int)h.size());++i)
    {
        for(j=1;j<=z;++j)
        {
            f.pb(h[i]+c[j]);
        }
    }
    sort(f.begin(),f.end(),greater<int>());
    i=0;
    while(k--)
    {
        cout<<f[i++]<<"\n";
    }


    return 0;
}


Measured memory_bytes: 43364
X,N=map(int,input().split())
P=list(map(int,input().split()))

chk=[0 for _ in range(109)]

for i in range(N):
    p=P[i]
    chk[p]=1
ans=10**7
res=-1
for x in range(-1,109):
    if x==-1:
        val=abs(X-x)
    else:
        if chk[x]==1:
            continue
        val=abs(X-x)
    if val<ans:
        ans=val
        res=x

print(res)

Measured memory_bytes: 9212
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==0)
		break;
		int a,b,suma=0,sumb=0;
		for(int i=0;i<n;i++){
			scanf("%d %d",&a,&b);
			if(a>b)
			suma+=a+b;
			else if(b>a)
			sumb+=a+b;
			else{
				suma+=a;
				sumb+=b;
			}
		}
		printf("%d %d\n",suma,sumb);
	}
}

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

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  cin >> x;
  cout << (x+110)/111*111 << endl;
}


Measured memory_bytes: 256
def main():
    N, K = map(int, input().split())
    x = list(map(int, input().split()))

    ans = float('inf')
    for i in range(N - K + 1):
        left = x[i]
        right = x[i + K - 1]
        dis = min(abs(left), abs(right)) + right - left
        ans = min(ans, dis)

    print(ans)



main()

Measured memory_bytes: 62576
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAXN 100100
const ll inf = (ll)1e10;
const ll mod = (ll)1e9+7;
ll dp[21][1 << 21];
bool chk ( int pos, int mask ) {
	return mask & (1 << pos);
}
int on ( int pos, int mask ) {
	return mask | (1<<pos);
}
int n, done;
int mat[21][21];
ll solve ( int pos, int mask ) {
	if ( pos == n ) {
		if ( mask == done-1 ) return 1;
		return 0;
	}
	if ( dp[pos][mask] != -1 ) return dp[pos][mask];
	ll ret = 0;
	for ( int i = 0; i < n; i++ ) {
		if ( mat[pos][i] && !chk(i,mask) ) ret = (ret+solve(pos+1,on(i,mask)))%mod;
	}
	return dp[pos][mask] = ret;
}
int main()
{
	#ifdef __APPLE__
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	for ( int i = 0; i < n; i++ ) {
		for ( int j = 0; j < n; j++ ) {
			cin >> mat[i][j];
		}
	}
	done = (1<<n);
	memset(dp,-1,sizeof(dp));
	cout << solve(0,0) << endl;
	return 0;
}


Measured memory_bytes: 344448
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> P;
#define pb push_back
#define mp make_pair
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)
ll n,a,b,h[100010];
bool f(ll m){
  ll q=0;
  fr(i,n){
    if(h[i]<=b*m) continue;
    q+=(h[i]-b*m-1)/(a-b)+1;
  }
  return q<=m;
}

int main(){
  cin>>n>>a>>b;
  fr(i,n) cin>>h[i];
  sort(h,h+n);
  ll l=0,r=1e9,m;
  while(r-l>1){
    m=(l+r)/2;
    if(f(m)) r=m;
    else l=m;
  }
  cout<<r<<endl;
}

Measured memory_bytes: 1024
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <utility>
#include <algorithm>
#include <vector>
#include <cmath>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
  int d;
  cin>>d;
  cout<<"Christmas";
  rep(i,abs(d-25))cout<<" Eve";
  cout<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

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

    ll cnt = 0;
    ll sum = 0;
    rep(i, size(s)){
        if(s[i] == 'W'){
            sum += (i - cnt);
            cnt++;
        }
    }

    println(sum);
}


Measured memory_bytes: 640
#include<stdio.h>
    #include<string.h>
    int main (void){
        char S[100];
        char *s1 = "Sunny";
        char *s2 = "Rainy";
        char *s3 = "Cloudy";
        scanf("%s",S);
     
        if(strcmp(S,s1)== 0){
            printf("Cloudy\n");
        }else if(strcmp(S,s2)==0){
            printf("Sunny\n");
        }else if(strcmp(S,s3)==0){
            printf("Rainy\n");
        }
        return 0;
    }

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

int main(){
  int h;
  int n,k;
  int total = 0;
  int i;
  
  cin >> n >> k;
  
  for(i=0;i<n;i++){
    cin >> h;
    if(h >= k){total++;}
  }
  
  cout << total << "\n";
  
  return 0;
  
}
 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,dp[100009][2],x,y;
vector<vector<ll> >v;
const ll mod=1e9+7;
ll best(ll d,ll p,bool b)
{
    ll &r=dp[d][b];
    if(r!=-1)return r;
    r=1;
    for(auto z:v[d])
    if(z!=p){

        if(b)
        r=(r*(best(z,d,0)+best(z,d,1)))%mod;
        else
        r=(r*best(z,d,1))%mod;
    }
    return r;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
v.resize(n+1);
for(ll i=1;i<n;i++){
    cin>>x>>y;
    v[x].push_back(y);
    v[y].push_back(x);
}
memset(dp,-1,sizeof dp);
cout<<(best(1,0,0)+best(1,0,1))%mod;
return 0;
}


Measured memory_bytes: 19940
#include<stdio.h>

int array[50];
int suretu(int);

int main(){
  int num;
  int i;

  for(i = 0;i < 50;i++){
    array[i] = -1;
  }

  scanf("%d",&num);
  printf("%d\n",suretu(num));

  return 0;
}

int suretu(int n){
  if(n == 0 || n == 1){
    return array[n] = 1;
  }
  if(array[n] != -1){
    return array[n];
  }

return array[n] = suretu(n - 1) + suretu(n - 2);
}



Measured memory_bytes: 2112
#include <iostream>
using namespace std;
 
int main() {
	int N, x, p, w, g, y;
	cin >> N;
	x = 0;
	p = 0;
	w = 0;
	g = 0;
	y = 0;
	for (int i = 0; i < N; i++)
	{
		string s;
		cin >> s;
		if (s == "P")
		{
			p = 1;
		}
		if (s == "W")
		{
			w = 1;
		}
		if(s == "G")
		{
			g = 1;
		}
		if(s == "Y")
		{
			y = 1;
		}
	}
	x = p + w + g + y;
 
	if(x == 3)
	{
		cout << "Three"<<endl;
	}
	if (x == 4)
	{
		cout << "Four"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1012345678;
const int mod = 469762049;
const int base = 311;
int main() {
	string S, T;
	cin >> S >> T;
	int LS = S.size(), LT = T.size();
	int sh = 0, th = 0, pw = 1;
	for (int i = 0; i < LT; ++i) {
		sh = (1LL * sh * base + S[i % LS]) % mod;
		th = (1LL * th * base + T[i]) % mod;
		pw = 1LL * pw * base % mod;
	}
	vector<bool> flag(LS, false);
	for (int i = 0; i < LS; ++i) {
		if (sh == th) {
			flag[i] = true;
		}
		sh = (1LL * sh * base - 1LL * S[i] * pw % mod + S[(i + LT) % LS] + mod) % mod;
	}
	vector<bool> vis(LS, false);
	int ans = 0;
	for (int i = 0; i < LS; ++i) {
		if (vis[i]) continue;
		string str;
		int pos = i;
		while (!vis[pos]) {
			vis[pos] = true;
			str += (flag[pos] ? '1' : '0');
			pos = (pos + LT) % LS;
		}
		str += str;
		if (str == string(str.size(), '1')) {
			ans = inf;
		}
		else {
			int cont = 0;
			for (int j = 0; j < str.size(); ++j) {
				if (str[j] == '1') ++cont;
				else cont = 0;
				ans = max(ans, cont);
			}
		}
	}
	cout << (ans != inf ? ans : -1) << endl;
	return 0;
}

Measured memory_bytes: 6964
#include<bits/stdc++.h>
#include<climits>
using namespace std;
#define ll long long
#define INF (LLONG_MAX / 2 - 2)

int main(void){
    int N;
    cin >> N;
    vector<ll> A(N + 1);
    for(int i = 0; i <= N; i++) cin >> A[i];
    if(N == 0 && A[0] != 1){
        cout << -1 << endl;
        return 0;
    }
    vector<ll> descend(N + 1), ascend(N + 1);
    descend[0] = 1;
    for(int i = 1; i <= N; i++){
        descend[i] = (descend[i - 1] - A[i - 1]) * 2;
        if(descend[i] > INF) descend[i] = INF;
        if(descend[i] < A[i]){
            cout << -1 << endl;
            return 0;
        }
    }

    ascend[N] = A[N];
    for(int i = N - 1; i >= 0; i--){
        if(descend[i + 1] < A[i + 1]){
            cout << -1 << endl;
            return 0;
        }
        ascend[i] = min(descend[i], ascend[i + 1] + A[i]);
    }
    ll ans = 0;
    for(int i = 0; i <= N; i++) ans += ascend[i];
    if(0) for(int i = 0; i <= N; i++){
        cout << descend[i] << " " << ascend[i] << endl;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5568
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;


int main(int argc, const char* argv[]){
    int l,r,d;


    cin >> l >> r >> d;
    int count = 0;
    for(int i = l; i <= r; i++){
        if(i % d == 0)count++;
    }


    cout << count << endl;

    return 0;
}



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

using namespace std;

#define all(x) begin(x), end(x)

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;

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

    string s, t;
    cin >> s >> t;
    int n = s.size();
    int m = t.size();
    vector<vi> dp(n + 1, vector<int>(m + 1, 0));
    vector<vi> moves(n + 1, vector<int>(m + 1, 0));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            dp[i + 1][j + 1] = dp[i][j + 1];
            moves[i + 1][j + 1] = 0;
            if (dp[i + 1][j] > dp[i + 1][j + 1]) {
                moves[i + 1][j + 1] = 1;
                dp[i + 1][j + 1] = dp[i + 1][j];
            }

            if (s[i] == t[j] and dp[i][j] + 1 > dp[i + 1][j + 1]) {
                moves[i + 1][j + 1] = 2;
                dp[i + 1][j + 1] = 1 + dp[i][j];
            }
        }
    }

    string res;
    int i = n;
    int j = m;
    while (i > 0 and j > 0) {
        if (moves[i][j] == 0) {
            --i;
        } else if (moves[i][j] == 1) {
            --j;
        } else {
            --i; --j;
            res.push_back(s[i]);
        }
    }

    reverse(all(res));
    cout << res << '\n';
    
    return 0;
}


Measured memory_bytes: 70912
N = int(input())
M = 10**6 + 1

counts = [0 for _ in range(M)]
for a in map(int, input().split()):
  counts[a] += 1

max_count = 0
for i in range(2,M):
  max_count = max(max_count,sum(counts[i::i]))

if max_count == N:
  answer = 'not coprime'
elif max_count >= 2:
  answer = 'setwise coprime'
else:
  answer = 'pairwise coprime'

print(answer)

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

using namespace std;

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

    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int happy = 0;
    for (int i = 0; i < n; i++) {
        int j;
        if (s[i] == 'L') {
            j = i - 1;
        } else {
            j = i + 1;
        }
        if (0 <= j && j < n && s[i] == s[j]) happy++;
    }
    
    happy += 2 * k;
    cout << min(happy, n - 1) << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define re register
using namespace std;
string a,b;
int main() 
{
    getline(cin,a);
    b=a;
    reverse(a.begin(),a.end());
    for ( re int i=0;i<a.length();i++ ) 
    {
        if(a[i]=='b') a[i]='d';
        else if(a[i]=='d') a[i]='b';
        else if(a[i]=='p') a[i]='q';
        else if(a[i]=='q') a[i]='p';
    }
    if(a==b) return printf("Yes\n"),0;
    else printf("No\n"),0;
    return 0;
}
        

Measured memory_bytes: 512
// A java program to find minimum possible 
// time by the car chassis to complete 
import java.io.*; 
import java.util.*;

class Main
{ 
	
	
	
	// Driver code 
	public static void main (String[] args) throws IOException
	{ 
		    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        
	        String[] ip;
	       
	            
	            int n = Integer.parseInt(br.readLine());
	            
	            ip = br.readLine().trim().split("\\s+");
	            int[] arr = new int[n];
	            for(int i=0;i<n;i++){
	                arr[i] = Integer.parseInt(ip[i]);
	            }
	            fun(arr,n);


	
	} 

	static void fun(int[] arr,int n){

		int[] dp = new int[n];

		dp[0]=0;
		dp[1] = Math.abs(arr[1]-arr[0]);
		for(int i=2;i<n;i++){
			

			int gap1=0,gap2=0;

			if(i-1>=0){
				gap1 = Math.abs(arr[i]-arr[i-1]);
				gap1 = gap1 + dp[i-1];
			}
			

			if(i-2>=0){
				gap2 = Math.abs(arr[i]-arr[i-2]);
				gap2 = gap2 + dp[i-2];
			}
			

			dp[i] = Math.min(gap1,gap2);

		


		}

		
			System.out.print(dp[n-1]);
	}

	
} 



Measured memory_bytes: 45664
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

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

	int n;
	cin >> n;

	cout << (n - 2) * 180 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define concat(xs, ys) (xs).insert((xs).end(), (ys).begin(), (ys).end())

const int mod = 1000000007;

int dp[45][405][405];

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

  long n, a, b, c, d;
  cin >> n >> a >> b >> c >> d;

  a = abs(a-b);
  b = 0;

  bool canDo = false;
  rep(i, n) {
    int j = n-1-i;
    if (d * i - c * j >= a && c * i - d * j <= a) {
      canDo = true;
    }
  }

  cout << (canDo ? "YES":"NO") << endl;
}

Measured memory_bytes: 256
n,k=list(map(int,input().split(" ")))
s=list(input())
s_str = ""
if s[k-1]=="A":
    s[k-1]="a"
elif s[k-1]=="B":
    s[k-1]="b"
else:
    s[k-1]="c"
for i in s:
    s_str += i
print(s_str)
  
    


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd_calc(T a, T b){ if(b){ return gcd_calc(b, a % b); }else{ return a; }}
template<class T> T gcd(T a, T b){ if(a < b) swap(a, b); return gcd_calc(a, b); }
template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
inline int at(int x, int k){ return (x >> k) & 1; }
random_device rnd;

int main(){
    int N;
    cin >> N;
    int diff = 0;
    for(int i = 1; i <= N; i++){
        int p;
        cin >> p;
        diff += (p != i);
    }
    YES(diff <= 2);
}


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

int main()
{
    int n;
    cin>>n;
    map<string,int> m;
    while(n--)
    {
        string s;
        cin>>s;
        m[s]++;
    }
    int maxi=-99;
    for(auto g:m)
    {
        if(g.second>maxi)
            maxi=g.second;
    }
    for(auto g:m)
    {
        if(g.second==maxi)
            cout<<g.first<<endl;
    }



}


Measured memory_bytes: 25344
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
using namespace std;
#define INF 10000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;


int main(){
    int N,S[110000];
    P A[110000];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>A[i].first;
        A[i].second=i+1;
    } 
    sort(A,A+N);
    for(int i=0;i<N;i++){
        S[A[i].second]=i+1;
    }
    int count=0;
    for(int i=1;i<=N;i++){
        if(S[i]%2!=i%2) count++;
    }
    cout<<count/2<<endl;


}


Measured memory_bytes: 2432
S = input()
C = 10**9+7
T = S[::-1]
N = len(S)
dp = [0]*N
dp[0] = 1+2*(int(T[0]))

for i in range(1, N):
    if T[i] == '0':
        dp[i] = dp[i-1]
    else:
        dp[i] = (pow(3, i, C)+2*dp[i-1]) % C
print(dp[-1])

Measured memory_bytes: 66448
use std::io::Read;

pub fn read_stdin() -> String {
    let mut s = String::new();
    ::std::io::stdin().read_to_string(&mut s).unwrap();
    s
}

pub trait Parse {
    fn to<T>(&mut self) -> T
    where
        T: std::str::FromStr;
}

impl<'a> Parse for std::str::SplitWhitespace<'a> {
    fn to<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let word = self.next().unwrap();
        word.parse().ok().unwrap()
    }
}

fn main() {
    let source = read_stdin();
    let mut iter = source.split_whitespace();
    let a: i32 = iter.to();
    let b: i32 = iter.to();
    println!("{}", std::cmp::max(0, a - b * 2));
}

Measured memory_bytes: 4352
n,a[100],b[100],M[100][100];C(s,e,i,m,c){m=M[s][e];if(!m)for(m=(s<e)*2e9,i=s;i++<e;m=c<m?c:m)c=C(s,i-1)+C(i,e)+a[s]*b[e]*b[i-1]*a[i];return M[s][e]=m;}main(i){for(scanf("%d",&n);n--;i--)scanf("%d%d",b+n,a+n);exit(!printf("%d\n",C(0,-i)));}

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

using namespace std;

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

  vector<char> v;
  string s;
  cin >> s;

  for (char c: s) {
    if (c != 'B') v.emplace_back(c);
    else if (!v.empty()) v.pop_back();
  }

  string res(begin(v), end(v));
  cout << res << "\n";
}


Measured memory_bytes: 3636