akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("4");
            WillReturn.Add("3");
            //10
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("10");
            WillReturn.Add("10");
            //76
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int N = int.Parse(InputList[0]);
        int K = int.Parse(InputList[1]);

        int Answer = int.MaxValue;
        for (int LoopACnt = 0; LoopACnt <= N; LoopACnt++) {
            int BCnt = N - LoopACnt;

            int CurrVal = 1;
            for (int I = 1; I <= LoopACnt; I++) {
                CurrVal *= 2;
            }
            CurrVal += BCnt * K;

            if (CurrVal < Answer)
                Answer = CurrVal;
        }
        Console.WriteLine(Answer);
    }
}


Measured memory_bytes: 13140
N = int(input())
A = []
B = []
for i in range(N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)

A.sort()
B.sort()

if N % 2 == 1:
	A_median = A[N // 2]
	B_median = B[N // 2]
	print(B_median - A_median + 1)
else:
	A_median2 = A[(N - 1) // 2] + A[N // 2]
	B_median2 = B[(N - 1) // 2] + B[N // 2]
	print(B_median2 - A_median2 + 1)

Measured memory_bytes: 104688
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;


void solve(long long N, std::vector<std::string> S){
	map<string,int> cnt;
	int m=0;
	for(auto s:S){
		cnt[s]++;
		m=max(m,cnt[s]);
	}
	for(auto v:cnt){
		if(v.second==m){
			cout << v.first << endl;
		}
	}
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> S(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> S[i];
    }
    solve(N, std::move(S));
    return 0;
}


Measured memory_bytes: 26752
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef vector<int>vi;
#define pb push_back
#define sc(n) scanf("%d",&n)
#define lsc(n) scanf("%lld",&n)
#define all(x) x.begin(),x.end()
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(i,n) for(i=1;i<=n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define rev1(i,n) for(i=n;i>0;i--)
#define in insert
#define IT ::iterator
#define pr(n) printf("%d\n",n)
#define lpr(n) printf("%lld\n",n);
int a[100005],memo[100005],n;
ll mx;
ll dp(int i)
{
	ll ans=mx;
	int j;
	if(i==n-1)
	{
		return 0;
	}
	if(memo[i]!=-1)
	{
		return memo[i];
	}
	for(j=i+1;j<=i+2 && j<n;j++)
	{
		ans=min(ans,dp(j)+(ll)abs(a[j]-a[i]));
	}
	
	memo[i]=ans;
	return memo[i];
}

int main()
{
	int i;
	cin >> n;
	rep(i,n)
	{
		cin >> a[i];
		mx+=(ll)a[i];
	}
	memset(memo,-1,sizeof(memo));
	cout << dp(0) << endl;
    return 0;
}


Measured memory_bytes: 10628
#include <iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
#include<map>
using namespace std;
#define N 1e9
int n,k,a,i,j=0;
int s;
int main()
{
    scanf("%d %d %d",&n,&k,&s);
    for(i=0;i<n;i++)
    {
        j++;
        if(j>k&&s<N)
            a=s+1;
        if(j>k&&s==N)
            a=s-1;
        else if(j<=k)
            a=s;
        if(i==0)
            printf("%d",a);
        else
            printf(" %d",a);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 1280
import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int total = sc.nextInt();
    if(total < 1200){
      System.out.println("ABC");
    }else if(total < 2800){
      System.out.println("ARC");
    }else{
      System.out.println("AGC");
    }
    
  }
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET    (26)
#define INF         INT_MAX
#define MOD         (1000000007LL)

using LL  = long long;
// }}}

int main() {
    std::ios::sync_with_stdio(false);
    string a, b, c;cin >> a >> b >> c;
    cout << "A" << b[0] << "C" << endl;
    return 0;
}


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

int main()
{
    int n;
    int tmp;
    int asum,bsum = 0;
    cin >> n;
    vector<int> a;
    
    for(int i=0; i < n; i++){       
        cin >> tmp;
        a.push_back(tmp);
    }
    sort(a.begin(), a.end());
    
    
    for(int i=0; i < n; i++){
        if(i % 2 == 0){
           asum += a[i]; 
        }else{
           bsum += a[i];
        }
    }
    
    cout << abs(asum - bsum) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
const int N=400020;
int n,h[N],t[N],v[N],a,b,i,k;
int g[N];
void add(int a,int b){
	t[++k]=h[a];
	h[a]=k;
	v[k]=b;
}
void dfs(int i,int fa){
	for(int j=h[i];j;j=t[j])
		if(v[j]!=fa){
			dfs(v[j],i);
			g[i]^=g[v[j]]+1;
		}
}
int main(){
	scanf("%d",&n);
	for(i=1;i<n;i++){
		scanf("%d%d",&a,&b);
		add(a,b);
		add(b,a);
	}
	dfs(1,0);
	printf("%s",g[1]?"Alice":"Bob");
}


Measured memory_bytes: 9856
N, M, P = map(int, input().split())
E = [list(map(int, input().split())) for _ in range(M)]
reachable = [False] * (N+1)
reachable[N] = True
for v in range(N):
    for a, b, c in E:
        if reachable[b]:
            reachable[a] = True
A = [-float("inf")] * (N+1)
A[1] = 0
for v in range(N):
    for a, b, c in E:
        t = A[a] + c - P
        if t > A[b]:
            A[b] = t
A_copy = A[:]
for v in range(N):
    for a, b, c in E:
        t = A[a] + c - P
        if t > A[b]:
            A[b] = t
for a_copy, a, r in zip(A_copy, A, reachable):
    if r and a_copy != a:
        print(-1)
        exit()
else:
    print(max(0, A[N]))


Measured memory_bytes: 54616
import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

A = np.array(A)
c = np.bincount(A)
e = np.bincount(abs(np.arange(N - 1, -N, -2)))
if c.shape == e.shape and all(c == e):
    print(pow(2, N // 2, 10 ** 9 + 7))
else:
    print(0)


Measured memory_bytes: 23436
import fractions
A,B,C,D=map(int,input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
'''
def get_factors(x,retlist):
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            if i not in retlist:
              retlist.append(i)
            x = x // i
    if x!=1:
      retlist.append(x)
    return retlist
  
prime=[]
prime=get_factors(C,prime)
prime=get_factors(D,prime)
'''
AmodC=A%C
AmodD=A%D
BmodC=B%C
BmodD=B%D
CD=lcm(C,D)
AmodCD=A%CD
BmodCD=B%CD

BA=B-A+1
Cbaisu=BA//C
Dbaisu=BA//D
CDbaisu=BA//CD
#print(BA)

if BA-(Cbaisu*C)>=C-((A+(Cbaisu*C))%C)+1:
  Cbaisu+=1
if BA-(Dbaisu*D)>=D-((A+(Dbaisu*D))%D)+1:
  Dbaisu+=1
if BA-(CDbaisu*CD)>=CD-((A+(CDbaisu*CD))%CD)+1: 
  CDbaisu+=1
#print(Cbaisu)
#print(Dbaisu)
#print(CDbaisu)
print(BA-Cbaisu-Dbaisu+CDbaisu)

Measured memory_bytes: 5048
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
    	Scanner sc = new Scanner(System.in);
    	String[] arr = sc.nextLine().split( "[,. ]" );
    	StringBuilder sb = new StringBuilder();
    	for(String s : arr)
    		if(2 < s.length() && s.length() < 7)
    			sb.append(s+" ");
    	System.out.println(sb.toString().trim());
    }
}

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

#define int long long int 

int v[100001],a[100001];
    int n,k;

int dp(int i)
{
    if(i==0)
    {
    	v[0]=0;
    	return 0;
    }
    if(i==1)
    {
    	v[1]= (abs(a[0]-a[1]));
    	return v[1];
    }
    
    if(v[i]!=-1)
    return v[i];
    
    int m=1000000000;
    for(int j=1;j<=k;j++)
    {
    	if(i-j>=0) 
    		m=min(m,(abs(a[i]-a[i-j])+dp(i-j)));
    		
    	else break;
    }

    return v[i]=m;
}

int32_t  main()
{
	

    cin>>n>>k;
    
    
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n+10;i++)v[i]=-1;
    cout<<dp(n-1);    
   
    
    
}

Measured memory_bytes: 6528
#include<stdio.h>
#include<string.h>
 
int n,i;
char mozi[6];
int me;
 
int main(){
 
int sum,
    saikoro1,
    saikoro2,
    saikoro3;
     
while(1){
    scanf("%d",&n);
    if(n==0)break;
 
    saikoro1 = 1;
    saikoro2 = 2;
    saikoro3 = 3;
    sum = saikoro1;
    for(i=0;i<n;i++){
        scanf("%s",mozi);
        if(strcmp("North",mozi)==0){
            me = 7 - saikoro1;
            saikoro1 = saikoro2;
            saikoro2 = me;
        }
        if(strcmp("East",mozi)==0){
            me = 7-saikoro3;
            saikoro3 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("West",mozi)==0){
            me = 7-saikoro1;
            saikoro1 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("South",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("Right",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("Left",mozi)==0){
            me = 7 - saikoro3;
            saikoro3 = saikoro2;
            saikoro2 = me;
        }
        sum +=saikoro1;
    }
    printf("%d\n",sum);
}
return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> H(N);
  for(int i=0; i<N; i++){
    cin >> H.at(i);
  }
  int max=0;
  int count=0;
  for (int i=0;i<N;i++) {
    if(H.at(i)>=max){
      count=count+1;
      max=H.at(i);
    }
    else{
    }
  }
  cout << count << endl;
  
}


Measured memory_bytes: 256
N, X = map(int, input().split())
c = [1] * (N + 1)
p = [1] * (N + 1)
for i in range(1, N + 1):
    c[i] = c[i - 1] * 2 + 3
    p[i] = p[i - 1] * 2 + 1
def solve(l, x):
    if l == 0:
        return x
    res = 0
    x -= 1
    if x <= 0: return res
    if x < c[l - 1]:
        res += solve(l - 1, x)
    else:
        res += p[l - 1]
        x -= c[l - 1]
        if x >= 1:
            res += 1
            x -= 1
        if x <= 0: return res
        if x < c[l - 1]:
            res += solve(l - 1, x)
        else:
            res += p[l - 1]
    return res
print(solve(N, X))


Measured memory_bytes: 61908
IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST129.

 ENVIRONMENT DIVISION.

 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01 INP      PIC X(100).
 01 P        PIC 9(3).
 01 Q        PIC 9(3).
 01 R        PIC 9(3).
 01 A1       PIC 9(5).
 01 A2       PIC 9(5).
 01 A3       PIC 9(5).
 01 ANS      PIC ZZZZ9.

 PROCEDURE DIVISION.

 ACCEPT INP.
 UNSTRING INP DELIMITED BY ALL ' '
  INTO P Q R.

 COMPUTE A1 = P + Q.
 COMPUTE A2 = Q + R.
 COMPUTE A3 = P + R.

 EVALUATE TRUE
  WHEN (A1 < A2) AND (A1 < A3)
  WHEN (A1 = A2) AND (A1 < A3)
    MOVE A1 TO ANS 
  WHEN (A2 < A1) AND (A2 < A3)
  WHEN (A2 = A3) AND (A2 < A1)
    MOVE A2 TO ANS
  WHEN (A3 < A1) AND (A3 < A2)
  WHEN (A3 = A1) AND (A3 < A2)
    MOVE A3 TO ANS
  WHEN OTHER
    MOVE A1 TO ANS
 END-EVALUATE.

 DISPLAY ANS.
 
 STOP RUN. 

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

int main(){
  char a,b;
  cin>>a>>b;
  if(a=='H'){
    cout<<b<<endl;
    return 0;
  }
  if(b=='H'){
    cout<<"D"<<endl;
  }else{
    cout<<"H"<<endl;
  }
  return 0;

}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	char in[12][13];
	int st[144][2], ch[12][12]={{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}};
	int inn, i, j, x, y, p, q, now=0, ans=0;
	char end[1]="0";
	//入力
	for(inn=0;inn<12;inn++)
	{
		gets(in[inn]);
	}
	st[0][0]=13;
	
	while(1)
	{
		//debug
		//for(p=0;p<12;p++) printf("input = %s\n", in[p]);
		//debug
		for(i=0;i<12;i++)
		{
			for(j=0;j<12;j++)
			{
				x = i;
				y = j;
				if(in[x][y]=='1' && ch[x][y]==0)
				{
					st[now][0]=x;
					st[now][1]=y;
					now++;
					ans++;
					ch[x][y]=1;
				}
				while(st[0][0]!=13)
				{
					x=st[now-1][0];
					y=st[now-1][1];
					if(x>0 && in[x-1][y]=='1' && ch[x-1][y]==0) 
					{
						st[now][0]=x-1;
						st[now][1]=y;
						now++;
						ch[x-1][y]=1;
					}
					else if(x<11 && in[x+1][y]=='1' && ch[x+1][y]==0) 
					{
						st[now][0]=x+1;
						st[now][1]=y;
						now++;
						ch[x+1][y]=1;
					}
					else if(y>0 && in[x][y-1]=='1' && ch[x][y-1]==0) 
					{
						st[now][0]=x;
						st[now][1]=y-1;
						now++;
						ch[x][y-1]=1;
					}
					else if(y<11 && in[x][y+1]=='1' && ch[x][y+1]==0) 
					{
						st[now][0]=x;
						st[now][1]=y+1;
						now++;
						ch[x][y+1]=1;
					}
					else
					{
						st[now-1][0]=13;
						now--;
					}
				}
			}
		}
		printf("%d\n", ans);
		now=0;
		ans=0;
		for(p=0;p<12;p++)
		{
			for(q=0;q<12;q++)
			{
				ch[p][q] = 0;
			}
		}
		
		if(gets(end)==NULL)break;
		for(inn=0;inn<12;inn++)
		{
			gets(in[inn]);
		}
		st[0][0]=13;
	}
	return 0;
}

Measured memory_bytes: 524
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i <=(int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
int main(){
    int k,s;cin>>k>>s;
    int count=0;
    rep(x,k){
        rep(y,k){
            if(s-x-y>=0&&s-x-y<=k)count++;
        }
    }
    cout<<count<<endl;

}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdlib>
#include <utility>
#include <cmath>
#include <queue>
#include <stack>
#include <cstring>

using namespace std;

#define ll long long

#ifndef ONLINE_JUDGE
#define debug(format, ...) fprintf(stderr, \
    "%s:%d: " format "\n", __func__, __LINE__,##__VA_ARGS__)
#else
#define debug(format, ...)
#define NDEBUG
#endif

void gray(int n, vector<int>& res)
{
    if (n == 0) {
        res.push_back(0); return;
    }
    vector<int> lower;
    gray(n - 1, lower);
    for (int i = 0; i < 1 << (n - 1); i++) {
        res.push_back(lower[i]);
    }
    reverse(lower.begin(), lower.end());
    for (int i = 0; i < 1 << (n - 1); i++) {
        res.push_back(lower[i] | (1 << (n - 1)));
    }
}

void all_on(int n, vector<int>& res)
{
    if (n == 1) {
        res.push_back(0); res.push_back(1); return;
    }
    if (n == 3) {
        res.push_back(0);
        res.push_back(4);
        res.push_back(5);
        res.push_back(1);
        res.push_back(3);
        res.push_back(2);
        res.push_back(6);
        res.push_back(7);
        return;
    }
    vector<int> gray_vec;
    gray(n - 3, gray_vec);
    vector<int> prev_vec;
    all_on(n - 2, prev_vec);
    for (int i = 0; i < (1 << (n - 3)); i++) res.push_back(gray_vec[i]);
    for (int i = 0; i < (1 << (n - 2)); i++) {
        res.push_back(prev_vec[i] ^ (1 << (n - 1)) ^ (1 << (n - 4)));
    }
    for (int i = 0; i < (1 << (n - 3)); i++) {
        res.push_back(gray_vec[i] ^ (1 << (n - 3)) ^ ((1 << (n - 4)) - 1));
    }
    reverse(prev_vec.begin(), prev_vec.end());
    for (int i = 0; i < (1 << (n - 2)); i++) {
        res.push_back(prev_vec[i] ^ (1 << (n - 2)));
    }
    reverse(prev_vec.begin(), prev_vec.end());
    for (int i = 0; i < (1 << (n - 2)); i++) {
        res.push_back(prev_vec[i] ^ (1 << (n - 2)) ^ (1 << (n - 1)));
    }
}

int bitperm[30];

int main()
{
    int n, a, b;
    scanf("%d%d%d", &n, &a, &b);
    int change_cnt = 0;
    for (int i = 0; i < n; i++) {
        if ((a ^ b) & (1 << i)) {
            bitperm[change_cnt] = i; change_cnt++;
        }
    }
    int curbt = 0;
    for (int i = change_cnt; i < n; i++) {
        while ((a ^ b) & (1 << curbt)) curbt++;
        bitperm[i] = curbt;
        curbt++;
    }
    if (change_cnt % 2 == 0) {
        printf("NO"); return 0;
    }
    vector<int> low, high;
    vector<int> ans;
    all_on(change_cnt, low);
    gray(n - change_cnt, high);
    for (int i = 0; i < low.size(); i++) {
        for (int j = 0; j < high.size(); j++) {
            ans.push_back(low[i] | (high[j] << change_cnt));
        }
        reverse(high.begin(), high.end());
    }
    for (int i = 0; i < ans.size(); i++) {
        int newv = 0;
        for (int j = 0; j < n; j++) {
            if (ans[i] & (1 << j)) newv |= (1 << bitperm[j]);
        }
        ans[i] = newv ^ a;
    }
    printf("YES\n");
    for (int i = 0; i < ans.size(); i++) {
        printf("%d ", ans[i]);
    }
    return 0;
}


Measured memory_bytes: 3520
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a,b;
string s;
int main()
{
    cin>>n>>a>>b;
    ll ans=0;
    if(a==0) cout<<ans;
    else{
        if(b==0) cout<<n;
        else{
            ll c=n/(a+b);
            ll mod=n%(a+b);
            if(c==0){
                if(n>=a) ans=a;
                else ans=n;
            }
            else{
                ans=c*a;
                if(mod>=a) ans+=a;
                else ans+=mod;
            }
            cout<<ans;
        }
        
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

bool isprime(int x)
{
    int y = 2;
    while (y * y <= x)
    {
        if (x % y == 0)
        {
            return false;
        }
        y++;
    }
    return true;
}
int main()
{
    int x;
    cin >> x;
    while (isprime(x) != true)
    {
        x++;
    }
    cout << x << endl;
    return 0;
}


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

int main() {
	string s;
	cin>>s;
	vector<int> arr(s.size()+1,0);
	for(int i=0;i<s.size();i++){
		if(s[i]=='<')
			arr[i+1]= arr[i]+1;
	}
	

	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='>')
			if(arr[i]<=arr[i+1])
				arr[i] =arr[i+1]+1;
	}
	long long sum=0;

	for(int i=0;i<arr.size();i++){
		
		sum+=arr[i];
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 2820
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll check = 1000000000000000000;
	ll n;cin>>n;
	ll ara[n+5];
	ll ans = 1;
	bool flag = false;
	for(ll j=0;j<n;j++)
	{
	    cin>>ara[j];
	    if(ara[j] == 0) flag = true;
    }
    if(flag)
    {
		cout<<"0"<<endl;
		return 0;
	}
     
	for(ll i=0;i<n;i++)
	{
		if(ara[i] == 0)
		{
			cout<<"0"<<endl;
			return 0;
		}
		else
		{
			if(ara[i] <= (check/ans))
			{
			    ans *= ara[i];
			}
			else
			{
				cout<<"-1"<<endl;
				return 0;
			}
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 4424
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <queue>
#include <cmath>
#define INF 0x3f3f3f
#define MAX 100005
using namespace std;
int main()
{
    int a,b,c;
    while(~scanf("%d%d%d",&a,&b,&c))
    {
        if(c>=a&&c<=b)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}


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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(x) (x).erase(unique(all(x)), (x).end());
#define REPIT(x) for(auto it=(x).begin(), end=(x).end(); it!=end; ++it)
#define perm(c) sort(all(c)); for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
  cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
	cout << a;
	if (&a != &vec.back()) cout << " ";
  }
  cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
	print(vec);
  }
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

signed solve()
{
	i64 n;
	cin >> n;
	i64 ans = 1;
	FOR(i, 1, n + 1)
	{
		ans *= i;
		ans %= MOD;
	}
	print(ans);
	return 0;
}

#ifndef LOCALCODE
signed main()
{
	return solve();
}
#endif


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

int main(){
    int a[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k; cin >> k;

    cout << a[k-1] << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
//ll const INF=1001001001;
//ll const INF=1001001001001001001;
ll const MOD=998244353;

ll mpow(ll x,ll n){
    if(n==0) return 1;
    else if(n%2) return x*mpow(x,n-1)%MOD;
    return mpow(x*x%MOD,n/2)%MOD;
}

ll N;
ll D[100000];
ll cnt[100000];

int main(){
    cin>>N;
    rep(i,N) cin>>D[i];

    if(D[0]!=0){
        cout<<0<<endl;
        return 0;
    }

    ll maxi=0;
    rep(i,N) maxi=max(maxi,D[i]);
    rep(i,N) cnt[D[i]]++;

    if(cnt[0]!=1){
        cout<<0<<endl;
        return 0;
    }

    ll ans=1;
    rep(i,maxi){
        ans*=mpow(cnt[i],cnt[i+1]);
        ans%=MOD;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 5080
N,X,Y = map(int,input().split())
ans = [0] * (N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d = min(j-i, abs(X-i) + abs(j-Y) + 1)
        ans[d-1] += 1
print(*ans, sep='\n')

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

int main() {
  int h,w;
  cin >> h >> w;
  vector<string> board(h);
  for(int i = 0; i < h; i++){
    cin >> board.at(i);
  }
  vector<int> dx = {-1,0,1,-1,1,-1,0,1};
  vector<int> dy = {-1,-1,-1,0,0,1,1,1};
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      if(board.at(i).at(j) == '#') continue;
      int count = 0;
      for(int k = 0; k < 8; k++){
        int nx = i + dx.at(k);
        int ny = j + dy.at(k);
        if(nx < 0 || nx >= h)continue;
        if(ny < 0 || ny >= w)continue;
        
        if(board.at(nx).at(ny) == '#') count++;
      }
      board.at(i).at(j) = char(count + '0');
    }
  }
  for(int i = 0; i < h; i++){
    cout << board.at(i) << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define srt(x) sort((x).begin(), (x).end())
#define rsrt(x) sort((x).rbegin(), (x).rend())
#define g(a, b) __gcd((a), (b))
#define l(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<long long>;
using vllvll = vector<vll>;
using vc = vector<char>;
using vs = vector<string>;
using um = unordered_map<long long, long long>;
template<class T>void print(T x) { cout << '\n' << "== " << x << " ==" << '\n'; }
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
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; }
template<class T, class U>T rem(T a, U b) { return a - b*floor(a/b); }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long double doublepi = M_PI * 2.0;
const long double halfpi = M_PI / 2.0;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long MOD = 1e9 + 7;


struct Edge
{
        ll to;
        ll cost;
};

ll MAX = 200010;
vector<vector<Edge> > Mat(MAX);
vll seen(MAX, 0);
set<ll> ans;
set<ll> ans2;

void rec(ll node, ll length)
{
        //cout << "node: " << node << " length: " << length << endl;
    seen[node] = 1;
    if (length % 2 == 0) {
            ans.insert(node);
    } else {
            ans2.insert(node);
    }

        //cout << "len "  << len(Mat[node]) << endl;
    for (auto adj : Mat[node]) {
        if (seen[adj.to] == 1) continue;
        rec(adj.to, length+adj.cost);
    }
}

void dfs(ll start)
{
    fill(seen.begin(), seen.end(), 0);
    rec(start, 0);
}

int main()
{
    ll N;
    cin >> N;
    rep(i, 0, N-1) {
            ll u, v, w;
            cin >> u >> v >> w;
            Edge e;
            e.to = v;
            e.cost = w;
            Mat[u].push_back(e);
            e.to = u;
            Mat[v].push_back(e);
    }
    ans.insert(1);
    dfs(1);

    vll ansset(all(ans));
    vll ansset2(all(ans2));

    vll tmp(N+1, 0);
    rep(i, 0, len(ans)) {
            tmp[ansset[i]] = 1;
    }

    rep(i, 1, N+1) {
            cout << tmp[i] << endl;
    }

    //print1d(ansset);
    //print1d(ansset2);
}



Measured memory_bytes: 19200
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
void Change(string,int);
string Change2(int);
int cal1,cal2,len;
int main(){
  int Q,Max,cal,i,j,k,cnt;
  string N;
  cin >> Q;
  for(i=0;i<Q;i++){
    cnt=0;
    cin >> N;
    while(1){
      Max=0; 
      len=N.size();
      if(len==1) break;
      for(j=1;j<len;j++){
    cal1=cal2=0;
    Change(N,j);
    cal=cal1*cal2;
    Max=max(cal,Max);
    if(Max==0){
      cnt++;
      break;
    }
      }
      if(Max==0) break;
      N=Change2(Max);
      cnt++;
      if(cnt==100000000) break;
    }
    if(cnt==100000000) cout << -1 << endl;
    else cout << cnt << endl;
  }
  return 0;
}
void Change(string N,int s){
  int x=1,i,cnt;
  i=0;
  cnt=s;
  while(cnt){
    cal1=cal1*x+(N[i]-'0');
    x=10;
    i++;
    cnt--;
  }
  x=1;
  i=s;
  cnt=len-s;
  while(cnt){
    cal2=cal2*x+(N[i]-'0');
    x=10;
    i++;
    cnt--;
  }
}
string Change2(int n){
  string retstr;
  int l=0,cp=n,i;
  while(cp){
    cp/=10;
    l++;
  }
  for(i=0;i<l;i++){
    retstr+=n%10+'0';
    n/=10;
  }
  reverse(retstr.begin(),retstr.end());
  return retstr;
}

Measured memory_bytes: 1216
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a!=b&&b!=c&&c!=a) cout<<3<<endl;
	else if(a==b&&b==c) cout<<1<<endl;
	else if(a==b&&b!=c) cout<<2<<endl;
	else if(a==c&&b!=c) cout<<2<<endl;
	else if(b==c&&c!=a) cout<<2<<endl;
	
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
const int MAX = 1000000;


struct Card{char suit, value; };

void bubble(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        for(int j = N - 1; j >= i; j--){
            if(A[j].value < A[j - 1].value){
                Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
            }
        }
    }
}

void selection(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        int minj = i;
        for(int j = i; j < N; j++){
            if(A[j].value < A[minj].value) minj = j;
        }
    Card t = A[i]; A[i] = A[minj]; A[minj] = t;
    }
}

void print(struct Card A[], int N){
    for(int i = 0; i < N; i++){
        if(i > 0) cout << " ";
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

//バブルソートと選択ソートの結果を比較
bool isStable(struct Card C1[], struct Card C2[], int N){
    for(int i = 0; i < N; i++){
        if(C1[i].suit != C2[i].suit) return false;
    }
    return true;
}

int main(){
    Card C1[100], C2[100];
    int N;
    char ch;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> C1[i].suit >> C1[i].value;
    }

    for(int i = 0; i < N; i++){
        C2[i] = C1[i];
    }

    bubble(C1, N);
    selection(C2, N);

    print(C1, N);
    cout << "Stable" << endl;
    print(C2, N);
    if(isStable(C1, C2, N)){
        cout << "Stable" << endl;
    } else {
        cout << "Not stable" << endl;
    }
	return 0;
}


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

typedef struct{int num[6];}dice;

bool compare(dice A[]){
    if (A[0].num[0] == A[1].num[0] && A[0].num[1] == A[1].num[1] &&
        A[0].num[2] == A[1].num[2] && A[0].num[3] == A[1].num[3] &&
        A[0].num[4] == A[1].num[4] && A[0].num[5] == A[1].num[5]){
            return true;
        }
    else return false;
}

bool simulation(dice A[]){
    int u, v, w;
    bool a = false;
    for(int i = 0; i < 4; i++){
        u = A[1].num[0];
        A[1].num[0] = A[1].num[1];
        A[1].num[1] = A[1].num[5];
        A[1].num[5] = A[1].num[4];
        A[1].num[4] = u;
        for(int j = 0; j < 4; j++){
            v = A[1].num[0];
            A[1].num[0] = A[1].num[2];
            A[1].num[2] = A[1].num[5];
            A[1].num[5] = A[1].num[3];
            A[1].num[3] = v;
            for(int k = 0; k < 4; k++){
                w = A[1].num[1];
                A[1].num[1] = A[1].num[2];
                A[1].num[2] = A[1].num[4];
                A[1].num[4] = A[1].num[3];
                A[1].num[3] = w;
                if(compare(A) == true){
                    a = true;
                }
            }
        }
    }
    return a;
}

int main(){
    dice A[2];
    for(int i = 0; i < 2; i++){
        for(int j = 0; j < 6; j++){
            cin >> A[i].num[j];
        }
    }
    
    bool a = simulation(A);
    
    if(a == true){
        cout << "Yes" << endl;
    }else if(a == false){
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3108
#include "bits/stdc++.h"
#define rep(i, a) for (int i = 0; i < (a); ++i)
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<double> p(N);
  for (auto &i : p) cin >> i;

  double df[N + 1][N + 1];
  rep(i, N + 1) rep(j, N + 1) df[i][j] = 0.0;
  df[0][0] = 1.0;
  rep(i, N) {
    rep(j, i + 1) {
      df[i + 1][j + 1] += df[i][j] * p[i];
      df[i + 1][j] += df[i][j] * (1 - p[i]);
    }
  }
  double ans = 0;
  for (int i = N / 2 + 1; i < N + 1; ++i) ans += df[N][i];
  printf("%.10lf\n", ans);
}

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

using namespace std;

typedef long long ll;

const long long MOD = 1e9 + 7;
const int INF = 1e9;

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  int res = 0;
  for (int i = 0; i < N; ++i) res += a[i] - 1;
  cout << res << endl;
}

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

int main(){
  int N;
  cin >> N;
  vector<long long> A(N+1);
  vector<long long> B(N);
  long long res = 0;
  long long power;
  long long sum = 0;

  for(int i = 0; i < N+1; i++){
    cin >> A.at(i);
    sum += A.at(i);
  }

  for(int i = 0; i < N; i++){
    cin >> B.at(i);
  }

  for(int i = 0; i < N; i++){
    if(A.at(i) > B.at(i)){
      res += A.at(i) - B.at(i);
    }
    else{
      power = B.at(i) - A.at(i);
      if(A.at(i+1) > power){
        A.at(i+1) -= power;
      }
      else{
        A.at(i+1) = 0;
      }
    }
  }
  res += A.at(N);

  cout << sum - res << endl;

  return 0;
}


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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

const string YES = "Yes";
const string NO = "No";

void solve(long long N, std::string S){
    if(N % 2 == 1) cout << NO << endl;
    else {
        bool ans = true;
        REP(i, N/2) {
            ans &= (S[i] == S[i+N/2]);
        }
        cout << (ans ? YES : NO) << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::string S;
    std::cin >> S;
    solve(N, S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>
#include <list>

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 reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
#define dbgv(x) cout<<#x<<endl;reps(y,x){cout<<y<<" ";}cout<<endl

int main(){
  ll n,k;cin>>n>>k;
  if(k%2){
  	cout<<ll(pow(n/k,3))<<endl;
  }else{
  	cout<<ll(pow((n/k),3))+ll(pow((ll(n/k)+(n%k>=k/2)),3))<<endl;
  }
  return 0;
}

Measured memory_bytes: 640
#include<iostream> 
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
//#define _LIBCPP_DEBUG 0
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define all(a) (a).begin(),(a),end()
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)	

int max(int a, int b) {
	int max;
	if (a > b) max = a;
	else max = b;
	return max;
}
int min(int a, int b) {
	int min;
	if (a < b) min = a;
	else min = b;
	return min;
}


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

	if(s.at(0) == s.at(1) && s.at(1) == s.at(2)) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<deque>
#include<set>
#include<map>
#include<bitset>
#include<ctime>
#include<queue>
using namespace std;
#define int long long
#define pii pair <int, int>
#define XX first
#define YY second

// constants:
const int mn = 7;
const int mod = 1000000007;
const long long inf = 4444444444444444444;
const int sminf = 1111111111;
const bool is_multitest = 0;
const bool is_interactive = 0;

// i/o methods:
const bool input_from_file = 0;
const bool output_to_file = 0;
#define filename ""
#define in_extension "inp"
#define out_extension "out"

// data preprocessing: (e.g.: divisor generating, prime sieve)
void preprocess()
{
    
}

// global variables:
int h, w, k;
char A[mn][mn];
bool c[mn], r[mn];

int ans = 0;

void check() {
    int cnt = 0;
    for (int i=1; i<=h; i++) {
        for (int j= 1; j<=w; j++) {
            if (A[i][j] == '#' && !c[j] && !r[i]) cnt++;
        }
    }
    ans += (cnt==k);
}

void brute(int u) {
    if (u > h+w) {
        check();
        return;
    }

    if (u > h) {
        c[u-h] = 0;
        brute(u+1);
        c[u-h] = 1;
        brute(u+1);
        return;
    }

    r[u] = 0;
    brute(u+1);
    r[u] = 1;
    brute(u+1);
}

// main solution goes here:
void execute(int test_number)
{
    cin>>h>>w>>k;
    for (int i=1; i<=h; i++) for (int j=1; j<=w; j++) cin>>A[i][j];
    brute(1);
    cout<<ans<<"\n";
}
// REMEMBER TO CHOOSE TEST METHODS
// PLEASE REMOVE cout AND cerr DEBUG LINES BEFORE SUBMITTING PROBLEMS
// Solution by low_



















signed main()
{
#ifdef lowie
    if (!is_interactive)
    {
        freopen("test.inp", "r", stdin);
        freopen("test.out", "w", stdout);
    }
#else
    if (input_from_file) freopen(filename"."in_extension, "r", stdin);
    if (output_to_file) freopen(filename"."out_extension, "w", stdout);
#endif
    if (!is_interactive)
    {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
    }

    preprocess();
    int ntest;
    if (is_multitest) cin >> ntest;
    else ntest = 1;

    for (int testno = 1; testno <= ntest; testno++)
    // use for instead of while to serve facebook hacker cup test format
    {
        execute(testno); // only start coding in this function, not in main
    }
}
// Template by low_
// Contact me via mail: ttuandung1803@gmail.com
// ...or codeforces: www.codeforces.com/profiles/low_
// ...or if you're interested in food: www.instagram.com/lowie.exe/

Measured memory_bytes: 3628
using System;
using System.Collections.Generic;

namespace AtCoder {
    class MainClass {
        public static void Main(string[] args) {

            var n = int.Parse(Console.ReadLine());

            var inputArray = new int[n];

            for(var i = 0; i < n; i++) {

                inputArray[i] = int.Parse(Console.ReadLine());

            }

            int maxv = -2000000000;
            int minv = inputArray[0];

            for(var i = 1; i < n; i++) {

                maxv = Math.Max(maxv, inputArray[i] - minv);
                minv = Math.Min(minv, inputArray[i]);

            }

            Console.WriteLine(maxv);
        }
    }
}



Measured memory_bytes: 20324
#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (ll)1e9 //10^9:∞
#define LLINF (ll)1e12
#define MOD (ll)(1e9+7) //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)
#define endl "\n"

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__


	ll a,b,c,d;
	cin>>a>>b>>c>>d;

	ll ans=max(a*c,max(a*d,max(b*c,b*d)));

	cout<<ans<<endl;

	



	

		return 0;
}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
int main(){
     int a,b;
	 char op;
     cin>>a>>op>>b;	
     if(op=='+'){
     	cout<<a+b;
	 }
	 if(op=='-'){
	 	cout<<a-b;
	 }
     
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if((a==1 && b==2) || (a==2 && b==1))
       {
        cout<<"3"<<endl;
       }
    else if((a==1 && b==3) || (a==3 && b==1))
        {
            cout<<"2"<<endl;
        }
        else
        cout<<"1"<<endl;
}

Measured memory_bytes: 256
program main
    implicit none
    integer(4):: n,k,i,j
    integer(4),allocatable:: p(:)
    real(8),allocatable:: s(:), ar(:)
    real(8):: ans=0
    read*, n, k
    allocate(p(n),s(0:n))
    read*, p(:)
    ! p(:) = [(i,i=1,n)]

    s(1:) = dble(p(:)-1)/2d0+1
    s(0) = 0
    do i=1,n
        s(i) = s(i) + s(i-1)
    end do


    do i=0,n-k+1
        ans = max(ans, s(i+k)-s(i))
    end do
    print*, ans
end program main

Measured memory_bytes: 3200
#include<stdio.h>

int main(void)
{
  int n, m, i, tmp = -1, cnt = 0;
  
  scanf("%d %d", &n, &m);
  
  for(i = 1;i <= n;i++)
  {
    if(i != tmp + 1)
    {
      tmp = i;
      cnt++;
    }
  }
  
  if(cnt >= m)
  {
    printf("YES\n");
  }
  else
  {
    printf("NO\n");
  }
}

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

#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}

template<typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	print_tuple<Cdr...>(os,t);
	os<<(sizeof...(Cdr)?",":"")<<get<sizeof...(Cdr)>(t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int main()
{
	for(ll n,a,b;cin>>n>>a>>b&&n|a|b;){
		vl hs(n);
		rep(i,n) cin>>hs[i];

		ll lo=0,hi=*max_element(all(hs));
		while(lo<hi){
			ll mi=(lo+hi)/2;
			ll sum=0;
			rep(i,n){
				ll num=hs[i]-b*mi,den=a-b;
				if(num<0)
					continue;
				sum+=(num+den-1)/den;
			}
			if(sum<=mi)
				hi=mi;
			else
				lo=mi+1;
		}
		cout<<lo<<endl;
	}
}


Measured memory_bytes: 1024
n=int(input())
a=input()
ans=0
for i in range(1000):
    i=str(i).zfill(3)
    x=a.find(i[0])
    y=a.find(i[1],x+1)
    z=a.find(i[2],y+1)
    if x!=-1 and y!=-1 and z!=-1:
        ans+=1
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define ll_MAX LONG_LONG_MAX
#define ll_MIN LONG_LONG_MIN
#define pi pair<int, int>
#define endl "\n"
#define MAXN 100005
using namespace std;

int n, x;
vector<int> v;
map<int,int> m;

void solve()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        v.pb(x);
    }
    int flag=0;
    for(int i=0;i<n;i++)
    {
        for(int j=1;j*j<=v[i];j++)
        {
            if(v[i]%j==0)
            {
                m[j]++;m[v[i]/j]++;
                if(j==(v[i]/j)) m[j]--;
                if(j>1 && m[j]>1)
                {
                    flag=1;
                    break;
                }
                if(v[i]/j>1 && m[v[i]/j]>1)
                {
                    flag=1;
                    break;
                }
            }
        }
        if(flag==1) break;
    }
    if(flag==0)
    { 
        cout<<"pairwise coprime"<<endl; 
        return;
    }
    int temp = 0;
    for (int i = 0; i < n; i++)
    {
        temp = __gcd(temp, v[i]);
    }
    if(temp==1)
    {
        cout<<"setwise coprime"<<endl;
        return;
    }
    cout<<"not coprime"<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
}

Measured memory_bytes: 7348
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

void debug_out() { cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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;
}

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    ll sum = 0;
    ll m = INF;
    bool same = true;
    Rep(i,n){
        cin >> a[i] >> b[i];
        sum += a[i];
        if(a[i]>b[i]) chmin(m,b[i]);
        if(a[i]!=b[i]) same = false;
    }
    sum -= m;
    if(same){
        cout << 0 << endl;
    }        
    else{
        cout << sum << endl;
    }
}

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 998244353

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define part(v, s, e) v.begin() + s, v.begin() + e
#define prll(v) for (auto i: v) cout << i << " ";

int main() {
    fast
	ll n, k;
	cin >> n >> k;
	string s;
	cin >> s;
	ll d = 0, t = 0;
	REP(i, 0, n) {
		ll j = i, c = 0;
		while (j < n && s[j] == s[i]) {
			j++;
			c++;
		}
		d++;
		t += c-1;
		i = j - 1;
	}
	if (d%2 == 0) {
		t += min(k, d/2 - 1) * 2;
		if (k > d/2 - 1)
			t++;
	}
	else
		t += min(k, d/2) * 2;
	cout << t << endl;
}


Measured memory_bytes: 512