akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define res(i,n) for(int i=n;;i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(long long x, long long y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(long long x, long long y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N; cin >> N;
    vector<int>a(N);
    vector<int>b(100010);
    rep(i, N) {
        cin >> a[i];
        b[a[i]]++;
        b[a[i]+1]++;
        b[a[i] + 2]++;
    }
    sort(b.begin(), b.end());
    cout << b[100009] << endl;
}

Measured memory_bytes: 4024
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
typedef long long ll;

bool check(ll n, ll k, vector<ll> &a, vector<ll> &f) {
    int m = a.size();
    ll sum = 0;
    rep(i, m) {
        if(a[i] * f[i] > n)
            sum += a[i] - n / f[i];
    }
    return (sum <= k);
}

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N), F(N);
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> F[i];
    sort(All(A));
    sort(All(F));
    reverse(All(F));

    ll ok = 1e13, ng = -1;
    while(ok - ng > 1LL) {
        ll mid = (ng + ok) / 2;
        if(check(mid, K, A, F))
            ok = mid;
        else
            ng = mid;
    }

    cout << ok << endl;
    return 0;
}

Measured memory_bytes: 3328
import java.util.*;
public class Main {

	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
			
		String a = sc.next();
		
		
		for(int i=0; i<a.length(); i++) {
			System.out.print("x");
		}
	}
	


}

 

Measured memory_bytes: 21972
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    buka=[0]*(n+1)
    for i in range(n-1):
        buka[a[i]]+=1
    return buka[1:n+1]

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    for i in range(n):
        print(ans[i])



Measured memory_bytes: 32216
#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;

int main() {
	std::string s, t; cin >> s >> t;
	
	std::vector<int> A(26, 0), B(26, 0);
	for(int i = 0; i < s.size(); i++) {
		if(A[s[i] - 'a']) {
			if(A[s[i] - 'a'] != t[i]) {
				cout << "No" << endl;
				return 0;
			}
		} else {
			A[s[i] - 'a'] = t[i];
		}
		
		if(B[t[i] - 'a']) {
			if(B[t[i] - 'a'] != s[i]) {
				cout << "No" << endl;
				return 0;
			}
		} else {
			B[t[i] - 'a'] = s[i];
		}
	}
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 776
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<(n);i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll
// #define MAX 20
#define INF (int)1e18

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}


signed main()
{
	fio
	string s;
	cin>>s;
	int n=s.size();
	int ans=0;
	int prev=2;
	int i=0;
	while(i<n)
	{
		if(prev==2)
		{
			ans++;
			i++;
			prev=1;
		}
		else
		{
			if(s[i]==s[i-1])
			{
				if(i+1==n)
					break;
				ans++;
				i+=2;
				prev=2;
			}
			else
			{
				ans++;
				i++;
			}
		}
	}
	cout<<ans<<'\n';
	printclock;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int main(void){
    int N, H, W; cin >> N >> H >> W;
    int ans = 0;
    int width = N*W;
    bool state[width] = {}; //state[i] = true -> iからi+1は覆われている
    rep(i, N){
        int mv; cin >> mv;
        int beg;
        if(i % 2) beg = i*W - mv;
        else beg = i*W + mv;
        rep(j, W) state[beg+j] = true;
    }
    rep(i, width) if(!state[i]) ans += H;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3116
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();

        String o = sc.next();
        String e = sc.next();
        
        for (int i = 0; i < o.length(); i++) {
            sb.append(o.charAt(i));
            if (i < e.length())
                sb.append(e.charAt(i));
        }
        
        System.out.println(sb.toString());
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
typedef signed long long int ll;
int l;
ll a;
ll dp[200005][5]={0};
int main(){
    cin>>l;

    for(int i=1;i<=l;i++){
        cin>>a;
        int b=(a==0?2:(a%2));
        
        int c=!(a%2);
        
        dp[i][0]=dp[i-1][0]+a;
        
        dp[i][1]=min(dp[i][0],dp[i-1][1]+b);
        
        dp[i][2]=min(dp[i][1],dp[i-1][2]+c);
        
        dp[i][3]=min(dp[i][2],dp[i-1][3]+b);
        
        dp[i][4]=min(dp[i][3],dp[i-1][4]+a);
        
    }
    cout<<dp[l][4]<<endl;
    return 0;
    
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  REP(i, n) cin >> p[i];
  int cnt = 0;
  for(int i = 1; i < n-1; ++i){
    if(p[i] > p[i-1] && p[i] < p[i+1]) ++cnt;
    if(p[i] < p[i-1] && p[i] > p[i+1]) ++cnt;
  }

  cout << cnt << endl;



  return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b[200000],c=-2000000000,d;
  cin>>a;
  for(int i=0;i<a;i++){
    cin>>b[i];
  }
  d=b[0];
  for(int i=0;i<a-1;i++){
    if(d>b[i])d=b[i];
    if(b[i+1]-d>c)c=b[i+1]-d;
    }
  cout <<c<<endl;
  return 0;
}

Measured memory_bytes: 3860
#include <iostream>

using namespace std;
using ll = long long;

int main() {
    int n; ll t;
    cin >> n >> t;
    ll a = 0, b = 0;
    for (int i = 0; i < n; i++) {
        ll x;
        cin >> x;
        b = max(x, b);
        a += x;
        if (t < a) {
            cout << 1 << endl;
        } else {
            cout << (t - a) / b + 2 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3096
/*
Author : Xinyuan
*/
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int  ll;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int nxt() {int x;scanf("%d", &x);return x;}


int main(){
    int cost = INF;
    int n = nxt();
    VI dist(n);
    generate(all(dist), nxt);
    for(int i = 1; i < 101; i++){
        int temp = 0;
        REP(j, n){
            temp += (dist[j]-i) * (dist[j] - i);
        }
        cost = min(cost, temp);
    }
    printf("%d\n", cost);
    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>


int size;
int *S;
int *L;
int *R;
long cnt;

void merge(int left,int mid,int right){
  int i;
  int r,l;
  for(i=left;i<mid;i++) L[i-left]=S[i];
  L[mid-left]=INT_MAX;
  for(i=mid;i<right;i++) R[i-mid]=S[i];
  R[right-mid]=INT_MAX;
  l=r=0;
  for(i=left;i<right;i++){
    if(L[l]<R[r]){
      S[i]=L[l];
      l++;
    }
    else{
      cnt+=mid-left-l;
      S[i]=R[r];
      r++;
    }
  }
}


void m_sort(int left,int right){
  if(right <= left+1) return;
  int mid;
  mid=(left +right)/2;
  m_sort(left,mid);
  m_sort(mid,right);
  merge(left,mid,right);
}






int main(){
  scanf("%d",&size);
  S=malloc(size*sizeof(int));
  L=malloc(size*sizeof(int));
  R=malloc(size*sizeof(int));
  int i;
  for(i=0;i<size;i++) scanf("%d",&S[i]);
  cnt=0;
  m_sort(0,size);
  printf("%ld\n",cnt);
  return 0;
}

  
  

Measured memory_bytes: 2164
//#pragma GCC target("avx2")
//#pragma GCC optimization("O3")
//#pragma GCC optimization("unroll-loops")
//assert(q==w) если q!=w --> runtime error
#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define ub upper_bound
#define lb lower_bound
#define bit __builtin_popcount
#define memset(x) memset(x,0,sizeof(x))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<vector<int>> matrix;

inline void boost(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

const ll maxn=2e5+123;
const ll inf=1e9+123;
const ll linf=1e18+123;
const ll mod=1e9+7;
const double eps=1e-9;
const double pi=acos(-1);
int dx[8]={0,1,-1,0,1,-1,1,-1};
int dy[8]={1,0,0,-1,1,1,-1,-1};
bool prime(int x){
    for(int i=2;i<=sqrt(x);i++){
        if(x%i==0){
            return 0;
        }
    }
    return 1;
}
int main(){
    boost();
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int x;
    cin>>x;
    if(x==1){
        x++;
    }
    while(prime(x)==0){
        x++;
    }
    cout<<x;
	exit(0);
}


Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <cstdio>
#include <vector>
using namespace std;

int main(void)
{
	int num;
	vector<int> nums;
	for(int f1 = 0; f1 < 5; f1++)
	{
		scanf("%d", &num);
		nums.push_back(num);
	}
	sort(nums.begin(), nums.end(), greater<int>());
	vector<int>::iterator t = nums.begin();
	for(int f1 = 0; f1 < 5; f1++)
	{	
		if(f1 + 1 < 5)
		{
			printf("%d ",*(t + f1));
		}
		else
		{
			printf("%d\n",*(t + f1));
		}
	}
	return 0;
}

Measured memory_bytes: 1048
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
 
  int a,b,c;
  cin >> a;
  cin >>b;
  cin >> c;
  
  
  if(c>=a && a+b>=c){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
  
   return 0;
}


Measured memory_bytes: 256
package main

import(
    "fmt"
    "sort"
    "strings"
)



func main() {
    var x,y,z int
    fmt.Scan(&x,&y,&z)
    ans := 0
    for i:=1;i<=100000;i++{
        if y*i + (i+1)*z <= x{
            ans++
        } else {
            break
        }
    }
    fmt.Println(ans)
}





// Pairsort
type Pair struct {
    first,second int64
}

type By func(p1, p2 *Pair) bool

func (by By) Sort(pairs []Pair) {
    ps := &pairSorter{
            pairs : pairs,
            by: by,
    }
    sort.Sort(ps)
}

type pairSorter struct {
    pairs []Pair
    by func(p1, p2 *Pair) bool
}

func (s *pairSorter) Len() int {
    return len(s.pairs)
}

func (s *pairSorter) Swap(i, j int) {
    s.pairs[i], s.pairs[j] = s.pairs[j], s.pairs[i]
}

func (s *pairSorter) Less(i, j int) bool {
    return s.by(&s.pairs[i], &s.pairs[j])
}

func first (p1, p2 *Pair) bool {
        return p1.first < p2.first
}

func second (p1, p2 *Pair) bool {
        return p1.second < p2.second
}
// end



func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}

func scanNums(len int) (nums []int){
    var num int
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanNums64(len int) (nums []int64){
    var num int64
    for i:=0; i<len; i++{
        fmt.Scan(&num)
        nums = append(nums,num)
    }
    return
}

func scanString(len int) (str []string){
    var s string
    for i:=0; i<len; i++{
        fmt.Scan(&s)
        str = append(str,s)
    }
    return
}

func scanTwoNums(n,m int) ([][]int){
    Nums := make([][]int, n)
    for i:=0; i<n; i++{
        Nums[i] = make([]int, m)
    }
    return Nums
}

func sortString(s string) string{
    t := strings.Split(s, "")
    sort.Strings(t)
    return strings.Join(t, "")
}

func reverseString(s string) string{
    t := []rune(s)
    for i,j := 0, len(s)-1 ; i < j ; i, j = i+1, j-1 {
        t[i], t[j] = t[j], t[i]
    }
    return string(t)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n)     for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n)    for (int i = 1; i <= (int)(n); ++i)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define rrep(i, n)    for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n)   for (int i = (int)(n); i >= 1; --i)
#define allrep(V, v)  for (auto &&V : v)
#define all(x)        (x).begin(), (x).end()
using lint = long long;
constexpr int    INF  = 1 << 30;
constexpr lint   INFL = 1LL << 62;
constexpr int    MOD  = 1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);

  int n;
  cin >> n;
  vector<int> p(n);
  rep (i, n) cin >> p[i];
  int cnt = 0;
  rep (i, n - 2) {
    int p1 = p[i], p2 = p[i + 1], p3 = p[i + 2];
    if (p1 < p2 && p2 < p3) ++cnt;
    if (p1 > p2 && p2 > p3) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
def main():
    N = int(input())
    slimes = list(map(int, input().split()))
    ans = 0

    for i in range(1, N):
        if slimes[i-1] == slimes[i]:
            slimes[i] = 10001 + ans
            # assert slimes[i] != slimes[i-1]                                 
            # assert slimes[i] != slimes[i+1]                                 
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()






Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
long long cnt[1000000];
using namespace std;
int main(void){
    long long n,i,j,ans=0;
    cin >> n;
    for(i=2;i<sqrt(n);i++){
        if(n==1) break;
        j=1;
        while(n%i==0){
            n/=i;
            cnt[i-1]++;
            if(cnt[i-1]==j){
                ans++;
                j++;
                cnt[i-1]=0;
            }
        }
    }
    if(n!=1) ans++;
    cout << ans;
}

Measured memory_bytes: 3544
//#pragma GCC diagnostic error "-std=c++11"
#include<set>
#include<map>
#include<cmath>
#include<ctime>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define pb push_back
#define lowbit(x) x&(-x)
#define PII  pair<int, int> 
#define all(x) x.begin(), x.end()
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)2e5 + 5;
using namespace std;

char s[maxn], t[maxn];
set<int> x[26], y[26];

int main()
{
	scanf("%s %s", s, t);
	int len = strlen(s);
	for(int i = 0; i < len; i++){
		x[s[i]-'a'].insert(t[i]-'a');
		y[t[i]-'a'].insert(s[i]-'a');
	}
	for(int i = 0; i < 26; i++){
		if(x[i].size() > 1 || y[i].size() > 1){
			return 0 * puts("No");
		}
	}
	puts("Yes");
	return 0;
}

Measured memory_bytes: 640
A = []

A.append(input().split(' '))
A.append(input().split(' '))
A.append(input().split(' '))

N = int(input())

bingo = [['0']*3 for i in range(3)]

b = 0
for i in range(N):
    b = input()
    for j in range(3):
        for k in range(3):
            if(b == A[j][k]):
                bingo[j][k] = '1'


if(bingo[0][0] == '1' and bingo[0][1] == '1' and bingo[0][2] == '1'):
    print("Yes")
elif(bingo[1][0] == '1' and bingo[1][1] == '1' and bingo[1][2] == '1'):
    print("Yes")
elif(bingo[2][0] == '1' and bingo[2][1] == '1' and bingo[2][2] == '1'):
    print("Yes")
elif(bingo[0][0] == '1' and bingo[1][0] == '1' and bingo[2][0] == '1'):
    print("Yes")
elif(bingo[0][1] == '1' and bingo[1][1] == '1' and bingo[2][1] == '1'):
    print("Yes")
elif(bingo[0][2] == '1' and bingo[1][2] == '1' and bingo[2][2] == '1'):
    print("Yes")
elif(bingo[0][0] == '1' and bingo[1][1] == '1' and bingo[2][2] == '1'):
    print("Yes")
elif(bingo[2][0] == '1' and bingo[1][1] == '1' and bingo[0][2] == '1'):
    print("Yes")
else:
    print("No")



Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fs first
#define sc second
#define task "tst"
using namespace std;
const ll N = 5e3 + 9;
const ll inf = 1e9 + 7;
typedef pair<ll,ll> LL;

string s,t;
ll n,i,cnt;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if (fopen(task".inp", "r")){
        freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    }
    cin>>s>>t;
    n = s.size();
    for (i = 0;i < n;i++) if (s[i] != t[i]) cnt++;
    cout<<cnt;
}



Measured memory_bytes: 3788
import std.stdio, std.conv, std.string, std.algorithm, std.math, std.array, std.container;

bool solve() {
  long a, b, c;
  readf("%d %d %d\n", &a, &b, &c);
  if(c-a-b>0) return a*a+b*b+c*c-2*a*b-2*a*c-2*b*c > 0;
  else return false;
}

void main() {
  if(solve) writeln("Yes");
  else writeln("No");
}



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



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;
    static int[] num = { 1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049 };

    static void Main(string[] args)
    {
        Solve();
    }




    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();

        int N = sc.intarr[0];

        int[] dp = new int[N + 1];


        dp[0] = 0;
        for(int i = 1; i <= N; ++i)
        {
            dp[i] = INF;
        }
        for(int i = 1; i <= N; ++i)
        {
            for(int j = 0; j < 12; ++j)
            {
                if (i - num[j] >= 0)
                {
                    dp[i] = Math.Min(dp[i], dp[i - num[j]] + 1);
                }
            }
        }

        wr.wri(dp[N]);

    }
}
    




class Scan
{
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
    public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}


Measured memory_bytes: 13340
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;$n:expr) => {
        (0..$n).map(|_| scan!()).collect::<Vec<_>>()
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let n = scan!();
    for (c0, c1) in n.chars().zip(n.chars().rev()) {
        if c0 != c1 {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int N, M;
	cin >> N >> M;
	vector<bool> isBroken(N, false);
	for (int i = 0; i < M; i++)
	{
		int tmp;
		cin >> tmp;
		isBroken[tmp] = true;
	}
	vector<int> s(N+1, 0);
  	s[N] = 1;
	for (int i = N; i > 0; i--)
	{
		if(isBroken[i]) continue;
		if(i>0&&!isBroken[i-1]) {
			s[i-1]+=s[i];
			s[i-1]%=mod;
		}
		if(i>1&&!isBroken[i-2]) {
			s[i-2]+=s[i];
			s[i-2]%=mod;
		}
	}
	cout << s[0] << endl;
}

Measured memory_bytes: 640
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = 2000000000;
// const ll MOD = 1000000007;

int N, H;
int max_a;
vector<int> a, b;
vector<int> use_b;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> H;
  a.resize(N);
  b.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
    max_a = max(max_a, a[i]);
  }

  for (int i = 0; i < N; i++) {
    if (max_a < b[i]) {
      use_b.push_back(b[i]);
    }
  }
  sort(use_b.begin(), use_b.end(), greater<int>());

  int cnt = 0;
  for (int i = 0; i < use_b.size(); i++) {
    H -= use_b[i];
    cnt++;
    if (H <= 0) {
      cout << cnt << endl;
      return 0;
    }
  }

  if (H > 0) {
    if (H % max_a == 0) {
      cnt += (H / max_a);
    } else {
      cnt += ((H / max_a) + 1);
    }
  }

  cout << cnt << endl;
  return 0;
}

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

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

template<class T> using v = std::vector<T>;
template<class T> using vv = v<v<T>>;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


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

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    set<int> st; rep(i, 3) st.insert(i+1);
    int a, b; cin >>  a >> b;

    st.erase(a); st.erase(b);
    for(int x: st) {
        cout << x << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e10
using namespace std;
typedef pair<ll, ll> P;

ll dp[50][2] = { 0 };
int main(void) {
	int a, b, c;
	cin >> a >> b >> c;
	if (a <= c) {
		if (c <= b) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	else {
		if (c >= b) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}

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

int main() {
  int n;
  cin >> n;
  int cnt1=0,cnt2=0,cnt3=0,cnt4=0;
  vector<string>s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  for (int i = 0; i < n;i++) {
    if (s.at(i) == "AC") cnt1++;
    else if (s.at(i) == "WA") cnt2++;
    else if (s.at(i) == "TLE") cnt3++;
    else if (s.at(i) == "RE") cnt4++;
  }
  cout << "AC x " << cnt1 << endl;
  cout << "WA x " << cnt2 << endl;
  cout << "TLE x " << cnt3 << endl;
  cout << "RE x " << cnt4 << endl;
}

Measured memory_bytes: 6368
S=str(input())
if len(S)%2 != 0:
  print("No")
  exit()
for i in range(int(len(S)/2)):
  if S[i*2]!="h":
    print("No")
    exit()
  if S[i*2+1]!="i":
    print("No")
    exit()
print("Yes")

Measured memory_bytes: 3060
N, M = map(int, input().split())

# 各行のスイッチ
switches_list = []
for i in range(M):
    line = input().split()
    switch_count = int(line[0])
    switches = [0] * N
    for j in range(switch_count):
        switches[int(line[j + 1]) - 1] = 1
    switches_list.append(switches)
# print(switches_list)

# 余り
surpluses = input().split()

count = 0
# bit全検索
# on/offのような二択なら、自分で組み合わせを作らなくても
# 2のN乗の数値のビット演算で表現ができる
for k in range(2 ** N):
    for i in range(len(switches_list)):
        switches = switches_list[i]
        surplus = int(surpluses[i])
        on_count = 0
        for j in range(len(switches)):
            if switches[j] == 1 and ((k >> j) & 1):
                on_count += 1
        if on_count % 2 != surplus:
            break
        # 全電球分のチェックを通ったらOKとする
        if i == len(switches_list) - 1:
            count += 1
print(count)


Measured memory_bytes: 41456
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
using namespace std;

int main() {
	ll N, A, B;
	cin >> N >> A >> B;
	vector<ll> h(N);
	for(ll i=0; i<N; ++i){
	    cin >> h[i];
	}
	sort(h.begin(), h.end(), greater<ll>());
	if(N==1){
	    cout << (h[0]+A-1)/A << endl;
	    return 0;
	}
	if(h[0]<=A && h[1]<=B){
	    cout << 1 << endl;
	    return 0;
	}
	ll left=1, right=(h[0]+B-1)/B;
	while(left+1<right){
	    ll mid=(left+right+1)/2, cnt=0;
	    for(ll i=0; i<N; ++i){
	        if(h[i]>B*mid) cnt += (h[i]-B*mid+A-B-1)/(A-B);
	        else break;
	    }
	    if(cnt<=mid) right=mid;
	    else left=mid;
	}
	cout << right << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <cstdio>

using namespace std;

long long dp[6001][2001];

int main() {
    int n, m, i, j;
    long long ans = 0;
    
    scanf("%d %d", &n, &m);
    
    dp[0][0] = 1;
    
    for (i = 1; i <= n * 3; i++) {
        for (j = 0; j <= n; j++) {
            dp[i][j] += dp[i - 1][j];
            if (dp[i][j] >= m) dp[i][j] -= m;
            
            if (i >= 2 && j > 0) {
                dp[i][j] += dp[i - 2][j - 1] * (i - 1) % m;
                if (dp[i][j] >= m) dp[i][j] -= m;
            }
            
            if (i >= 3 && j > 0) {
                dp[i][j] += dp[i - 3][j - 1] * (i - 1) % m * (i - 2) % m;
                if (dp[i][j] >= m) dp[i][j] -= m;
            }
        }
    }
    
    for (i = 0; i <= n; i++) ans += dp[n * 3][i];
    printf("%lld\n", ans % m);
    
    return 0;
}


Measured memory_bytes: 93952
#include <cstdio>
#include <cmath>
#include <limits>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdint>
#include <functional>
#define rep(i, s, g) for (i = s; i < g; i++)
using namespace std;
using ll = long long;

const ll mod = 1000000000 + 7; //10^9

int main() {
    string S,T;
    cin >> S >> T;
    int a = S.size();
    int b = T.size();
    int c = a - b + 1;
    vector<int> N(c, 0);

    for (int i = 0; i < c; i++)
    {
        for (int j = 0; j < b; j++)
        {
            if (S[i + j] != T[j])
            {
                N[i] ++;
            }   
        }
    }
    sort(N.begin(), N.end());
    cout << N[0] << endl;
    
    

    
    
    
}

Measured memory_bytes: 3632
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main()
{
    int XMAX = 100'001;
    vector<int> v(XMAX + 1, 0);

    int n;
    cin >> n;
    rep(i, n)
    {
        int a;
        cin >> a;
        a++;
        v[a - 1]++;
        v[a]++;
        v[a + 1]++;
    }

    int m = 0;
    rep(i, XMAX + 1)
    {
        m = max(m, v[i]);
    }
    cout << m << endl;

    return 0;
}

Measured memory_bytes: 640
import java.io.*;

public class Main {
	public static void main(String[] args) throws IOException
	{
		int x = -1;
		int a[] = new int[10000];
		String s;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
		int i = 1;
		while(true) {
			s = br.readLine();
			x = Integer.parseInt(s);
			if(x == 0) break;
			else {
				System.out.println("Case "+i+": "+x);
				i++;
			}
		}
	}
}

Measured memory_bytes: 27012
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int n, i, j, tmp;
    int[] a = new int[4];
    int[] d = new int[4];
    n = sc.nextInt();
    for(i = 0;i < 4;i++)a[i] = sc.nextInt() - 1;
    int min = 100000;
    for(i = 1;i <= n;i++){
      for(j = 0;j < 4;j+=2){
        d[j] = a[j] / i - a[j + 1] / i;
        d[j + 1] = a[j] % i - a[j + 1] % i;
      }
      for(j = 0;j < 4;j++)if(d[j] < 0)d[j] *= -1;
      if(min > d[0] + d[1] + d[2] + d[3])min = d[0] + d[1] + d[2] + d[3];
    }
    out.println(min);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}

Measured memory_bytes: 26352
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

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

func main() {
	N := nextInt()
	s := make([]int, N)
	for i := 0; i < N; i++ {
		s[i] = nextInt()
	}
	sort.Slice(s, func(i int, j int) bool { return s[i] < s[j] })
	fmt.Println(s[N/2] - s[N/2-1])
}


Measured memory_bytes: 3804
#include <bits/stdc++.h>
#define mp make_pair
#define X first
#define Y second
#define pii pair<ll,ll>
#define x1 dlfjl
#define x2 dkfj
#define x3 dflgkg
#define MOD 1000000007
#define y1 dskgj
#define y2 dskfj
#define y3 dfhgdh
#define SQ 320
#define PI 3.14159265359
typedef long long ll;
using namespace std;
ll n,i,j,k,x,y,z,m,q,h,r,timer,mx,l,sum, ans;
ll a[200500];
pii  b[200500];
vector<ll> g[100500];
set<ll> f;
bool cmp(pii x, pii y) {
    if (x.X < y.X)
        return true;
    if (x.X > y.X)
        return false;
    return (x.Y > y.Y);
}
int main() {
    //freopen("input.txt","r",stdin);
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] == 0) {
            f.insert(i);
        }
        b[i].X = a[i];
        b[i].Y = i;
    }
    sort(b, b+n, cmp);
    if (a[0] != 0) {
        cout << -1 << endl;
        return 0;
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        if (b[i].X == 0)
            continue;
        ll pos = b[i].Y;
        auto itr = f.upper_bound(pos);
        itr--;
        ll x = *itr;
        ll val = b[i].X;
        if (a[pos] - a[x] > pos - x) {
            cout << -1 << endl;
            return 0;
        }
        ll val1 = MOD;
        if (a[pos] - a[x] == pos - x)
            val1 = pos-x;
        else
            val1 = a[pos];
        f.insert(pos);
        ans += val1;
        //cout << i << " " << ans << " " << pos << endl;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

#define MAX_V 334
#define INF 1e9

struct Edge{
    int to,cap,rev;
    Edge(int to,int cap,int rev) :
        to(to),cap(cap),rev(rev) {}
};

vector<Edge> G[MAX_V];
int level[MAX_V],iter[MAX_V];

void add_edge(int from,int to,int cap){
    G[from].push_back(Edge(to,cap,G[to].size()));
    G[to].push_back(Edge(from,0,G[from].size()-1));
}

void bfs(int s){
    memset(level,-1,sizeof(level));
    queue<int> Q;
    level[s] = 0;
    Q.push(s);
    while(!Q.empty()){
        int v = Q.front(); Q.pop();
        for(int i = 0 ; i < (int)G[v].size() ; i++){
            Edge &e = G[v][i];
            if(e.cap > 0 && level[e.to] < 0){
                level[e.to] = level[v] + 1;
                Q.push(e.to);
            }
        }
    }
}

int dfs(int v,int t,int f){
    if(v == t) return f;
    for(int &i = iter[v] ; i < (int)G[v].size() ; i++){
        Edge &e = G[v][i];
        if(e.cap > 0 && level[v] < level[e.to]){
            int d = dfs(e.to,t,min(f,e.cap));
            if(d > 0){
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

int max_flow(int s,int t){
    int flow = 0;
    for(;;){
        bfs(s);
        if(level[t] < 0) return flow;
        memset(iter,0,sizeof(iter));
        int f;
        while((f = dfs(s,t,INF)) > 0){
            flow += f;
        }
    }
}

int main(){
    int N,M,S,T,a,b;
    int edge[MAX_V][MAX_V];
    memset(edge,-1,sizeof(edge));
    cin >> N >> M;
    for(int i = 0 ; i < M ; i++){
        cin >> a >> b;
        a--; b--;
        add_edge(a,b,1);
        add_edge(b,a,1);
        edge[b][a] = i;
    }
    cin >> S >> T; S--; T--;
    int res = max_flow(S,T);
    cout << res << endl;
    vector<int> v;
    for(int i = 0 ; i < N ; i++){
        for(int j = 0 ; j < (int)G[i].size() ; j++){
            int to = G[i][j].to;
            if(edge[i][to] == -1) continue;
            if(G[i][j].cap == 0){
                v.push_back(edge[i][to]);
            }
            edge[i][to] = -1;
        }
    }
    sort(v.begin(),v.end());
    int size = v.size();
    cout << size << endl;
    for(int i = 0 ; i < size ; i++){
        cout << v[i]+1 << endl;
    }
    return 0;
}

Measured memory_bytes: 1760
N,M = gets.chomp.split(" ").map(&:to_i)
like_food_hash = {}
N.times do |i|
    like_food =  gets.chomp.split(" ").map(&:to_i)
    like_food.delete_at(0)
    if i == 0
        like_food.each do |food|
            like_food_hash[food] = true
        end
    else
        like_food_hash.each do |k,v|
            if !like_food.include?(k) 
                like_food_hash[k] = false
            end
        end
    end
end
sum = 0
like_food_hash.each do |k,v|
    if v 
        sum += 1
    end
end
puts sum


Measured memory_bytes: 1788
//gauravsinghh
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define db double
#define pii pair<int,int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int> 
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define os cout<<" "
#define bitcount __builtin_popcount
#define gcd __gcd
#define endl "\n"
#define present(s,x) (s.find(x) != s.end()) 
#define cpresent(s,x) (find(all(s),x) != s.end()) 
#define ford(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++) 
#define fors(container, it, a, b) for(__typeof(container.begin()) it = a; it != b; it++) 
#define MOD 998244353
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 1000005
#define fbo find_by_order
#define ook order_of_key
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(ll i = a; i <= b; i++)
#define ffo(i, a, b) for(ll i = a; i >= b; i--)
#define MAX 100005
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
void io_set() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

bool comp(const pair < ll, ll >&a, const pair < ll, ll >&b){
    return ((a.ff < b.ff) || (a.ff == b.ff && a.ss < b.ss));
}

ll count9(string s){
    ll c = 0;
    ffo(i, sz(s) - 1, 0){
        if(s[i] == '9'){
            c++;
        }
        else{
            break;
        }
    }
    return c;
}

ll power(ll a, ll b){
    if(!b){
        return 1;
    }
    if(b&1){
        return a * power(a*a, b/2);
    }
    return power(a*a, b/2);
}

unordered_map < ll, ll > mpp;

signed main(){ 
    IOS
    //io_set();
    ll a, b;
    cin >> a >> b;
    if(a <= 0 && b >= 0){
        cout << "Zero\n" << endl;
    }
    else{
        ll f = 0;
        if(a < 0){
            a = abs(a);
            b = abs(b);
            swap(a, b);
            f = 1;
        }
        ll x = b - a;
        x++;
        if(f){
            if(x&1){
                cout << "Negative\n";
            }
            else{
                cout << "Positive\n";
            }
        }
        else{
            cout << "Positive\n";
        }
    }
    return 0;
} 

Measured memory_bytes: 256
#include <cstdio>

int main(){
    char b;
    scanf("%c", &b);
    if(b == 'A'){
        b = 'T';
    } else if(b == 'T'){
        b = 'A';   
    } else if (b == 'C'){
        b = 'G';
    } else if (b == 'G'){
        b = 'C';
    }
    printf("%c", b);
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long int;
using ULL = unsigned long long;

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


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int W = l[0], H = l[1], N = l[2];
            int x = 0, y = 0, xEnd = W, yEnd = H ;

            for (var i = 0; i < N; i++)
            {
                var line = Console.ReadLine().Split().Select(int.Parse).ToArray();

                switch (line[2])
                {
                    case 1:
                        x = Math.Max(line[0], x);
                        break;
                    case 2:
                        xEnd = Math.Max(x, Math.Min(line[0], xEnd));
                        break;
                    case 3:
                        y = Math.Max(line[1], y);
                        break;
                    case 4:
                        yEnd = Math.Max(y, Math.Min(line[1], yEnd));
                        break;
                    default:
                        break;
                }
            }

            Console.WriteLine((xEnd-x)*(yEnd-y));
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define ranger(i, a, b) for (int i = (a)-1; i >= (b); i--)
#define repr(i, b) for (int i = (b)-1; i >= 0; i--)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
#define int long long
using namespace std;

template <typename X, typename T>
auto vectors(X x, T a) {
	return vector<T>(x, a);
}
template <typename X, typename Y, typename Z, typename... Zs>
auto vectors(X x, Y y, Z z, Zs... zs) {
	auto cont = vectors(y, z, zs...);
	return vector<decltype(cont)>(x, cont);
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
	rep(i, v.size()) { os << v[i] << (i == v.size() - 1 ? "" : " "); }
	return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S>& p) {
	os << '(' << p.first << ',' << p.second << ')';
	return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
	for (T& x : v) { is >> x; }
	return is;
}

signed main() {
	int n, k, s;
	cin >> n >> k >> s;

	if (s == 1) {
		vector<int> ans;
		rep(i, k) { ans.emplace_back(s); }
		rep(i, n - k) { ans.emplace_back(10000); }

		assert(ans.size() == n);
		rep(i, n) {
			if (i) cout << ' ';
			cout << ans[i];
		}
		cout << endl;
		return 0;
	}

	vector<int> ans;
	rep(i, k) { ans.emplace_back(s); }
	rep(i, n - k) { ans.emplace_back(s - 1); }

	assert(ans.size() == n);
	rep(i, n) {
		if (i) cout << ' ';
		cout << ans[i];
	}
	cout << endl;
}


Measured memory_bytes: 2292
#define SUBMIT

#include <bits/stdc++.h>

using namespace std;

int main() {
#ifdef SUBMIT
    auto& in = cin;
#else
    stringstream in(R"(9 10
0 3 5 7 100 110 200 300 311
)");
#endif
    int N, T;

    in >> N >> T;

    vector<int> t(N);
    for (int i = 0; i < N; ++i) in >> t[i];

    int64_t ans = 0;
    for (int i = 0; i < N - 1; ++i) {
        if (t[i + 1] - t[i] < T) ans += t[i + 1] - t[i];
        else ans += T;
    }
    ans += T;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int64;
typedef pair< int64, int64 > Pi;
const int64 INF = 1LL << 58;
 
int N, L, A[100000], B[100000], C[100000];
vector< Pi > drinks;
priority_queue< Pi > que, que2;
int64 v[100000];
 
int solve()
{
  int my_height = 0;
  int enemy_height = 0;
  int deletable = 0;
 
  for(int i = 0; i < N; i++) {
    while(!que.empty() && v[que.top().second] < i) que.pop();
    if(!que.empty() && my_height + que.top().first >= L) return (i + 1);
    my_height += drinks[i].first;
    que2.emplace(B[drinks[i].second], drinks[i].second);
    while(my_height - drinks[deletable].first <= enemy_height) ++deletable;
    while(!que2.empty() && v[que2.top().second] < deletable) que2.pop();
    if(!que2.empty() && my_height + que2.top().first >= L) return (i + 1);
    v[drinks[i].second] = i;
    enemy_height += C[i];
    if(enemy_height >= my_height) return (-1);
  }
  return (-1);
}
 
int main()
{
  cin >> N >> L;
  for(int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    que.emplace(A[i], i);
    drinks.emplace_back(A[i] - B[i], i);
    v[i] = INF;
  }
  sort(begin(drinks), end(drinks));
  reverse(begin(drinks), end(drinks));
  for(int i = 0; i < N; i++) {
    cin >> C[i];
  }
  cout << solve() << endl;
}

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)


void func(string &S){

    lli cnt1=0,cnt0=0;

    REP(i,0,S.size()){
        if(S.at(i)=='0')cnt0++;
        else cnt1++;
    }

    cout<<2*min(cnt0,cnt1)<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    std::string S;
    cin>>S;
    func(S);
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
ll n,i,j,k,l,m,a[301010];
char c;
string s[201010];
std::vector<string> q1 ;
map<string,ll> q2;
set<ll> q3;
int main() {
   cin>>n;
   for(i=1;i<=n;i++)
   {
       cin>>s[i];
       q2[s[i]]++;
       k=max(k,q2[s[i]]);
   }
   for(i=1;i<=n;i++)
   {
       if(q2[s[i]]==k)
       {
           q1.push_back(s[i]);
           q2[s[i]]=-1;
       }
   }
   sort(q1.begin(),q1.end());
   for(i=0;i<q1.size();i++)
   {
       cout<<q1[i]<<"\n";
   }
   
}

Measured memory_bytes: 28532
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){

  string str;
  int a,b;
  string p;
  string command;
  int q;

  cin >> str >> q;
  for( int i = 0; i < q; ++i){
    cin >> command;
    if( command == "print"){
      cin >> a >> b;
      cout << str.substr( a, b-a+1) << endl;
    }else if( command == "reverse"){
      cin >> a >> b;
      reverse( str.begin()+a,str.begin()+ b+1);
    }else{
      cin >> a >> b >> p;
      str.replace( a, b-a+1, p);
    }
  }
  return 0;
}

Measured memory_bytes: 3164
#define MAXN 100000+15
#include<stdio.h>

int a[MAXN]={0},b[MAXN]={0},c[MAXN]={0};
int main()
{
	int n,t;
	scanf("%d%d",&n,&t);
	for(int i=0;i<n;i++){
		scanf("%d%d",&a[i],&b[i]);
	}
	int min=0x3f3f3f3f;
	int flag=0;
	for(int i=0;i<n;i++){
		if(b[i]<=t){
			flag=1;
			if(a[i]<min){
				min=a[i];
			}
		}
	}
	if(flag){
		printf("%d\n",min);
	}else{
		printf("TLE\n");
	}
}


Measured memory_bytes: 128