akhauriyash/Code-Regression huggingface dataset:
package main

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

const (
	INF int = 1<<62
	MOD int = 1000000007
)

var DX, DY []int

var H, W int
var M []string
var ans int

func Input(){
	H = NextInt()
	W = NextInt()
	M = NextStrings(H)
}

func Solve(){
	res := Ints3D(H, W, 4)
	for h := 0; h<H; h++{
		sum := 0
		for w:=0; w<W; w++{
			if M[h][w] == '#'{
				sum = 0
				continue
			}
			res[h][w][0] = sum
			sum++
		}
		sum = 0
		for w:=W-1; w>=0; w--{
			if M[h][w] == '#'{
				sum = 0
				continue
			}
			res[h][w][1] = sum
			sum++
		}
	}
	for w:=0; w<W; w++{
		sum:=0
		for h:=0; h<H; h++{
			if M[h][w] == '#'{
				sum = 0
				continue
			}
			res[h][w][2] = sum
			sum++
		}
		sum = 0
		for h:=H-1; h>=0; h--{
			if M[h][w] == '#'{
				sum = 0
				continue
			}
			res[h][w][3] = sum
			sum++
		}
	}
	for _, a := range(res){
		for _, b:=range(a){
			sum := 0
			for _, c := range(b){
				sum += c
			}
			ans = Max(ans, sum)
		}
	}
}

func Output(){
	fmt.Println(ans+1)
}

func main() {
	Initialize()
	for {
		Input()
		Solve()
		Output()
	}
}

// Initilize ===================
var io *IO;
func Initialize(){
	io = NewIO()
	DY = []int{-1, 0, 1, 0}
	DX = []int{0, 1, 0, -1}
}
// IO ====================

type IO struct{
	sc *bufio.Scanner
}
func NewIO() *IO {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return &IO{
		sc: sc,
	}
}
func Next() string{
	ok := io.sc.Scan()
	if !ok {
		os.Exit(0)
	}
	return io.sc.Text()
}
func NextInt() int {
	s := Next()
	a, err:= strconv.Atoi(s)
	if err != nil {
		print(err)
	}
	return a
}

func NextInts(N int) []int{
	ret := Ints(N)
	for i := range ret {
		ret[i] = NextInt()
	}
	return ret
}
func NextStrings(N int) []string {
	ret := Strings(N)
	for i := range ret {
		ret[i] = Next()
	}
	return ret
}

// =============
func Sort( a[]int){
	sort.Ints(a)
}
func Min(nums ...int) int {
	ret := int(nums[0])
	for _, n := range nums {
		if n < ret {
			ret = n
		}
	}
	return ret
}
func Max(nums ...int) int {
	ret := int(nums[0])
	for _, n := range nums {
		if n > ret {
			ret = n
		}
	}
	return ret
}
func Abs(n int)int{
	if n < 0{
		return -n
	}
	return n
}
func Ints(n int) []int{
	return make([]int, n)
}
func Ints2D(x, y int) [][]int{
	ret := [][]int{}
	for i:=0; i< x; i++{
		ret = append(ret, Ints(y))
	}
	return ret
}
func Ints3D(x, y, z int)[][][]int{
	ret := [][][]int{}
	for i:=0; i<x; i++ {
		ret = append(ret, Ints2D(y, z))
	}
	return ret
}
func Bools(n int) []bool{
	return make([]bool, n)
}
func Strings(n int) []string{
	return make([]string, n)
}


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

#define FOR(i, a, b) for(int i=a; i<b; i++)
#define FOR1(i, a, b, flag) for(int i=a; i<b && flag; i++)
typedef long long ll;

int a[16][16], n;
ll val[1<<16]={0};
ll dp[1<<16];
// bool vis[1<<16]={0};

// ll find(int mask){
//     if(vis[mask]){
//         return dp[mask];
//     }
//     vis[mask]=1;
//     vector<int> bits;
//     FOR(i1, 0, n){
//         if(mask&(1<<i1)){
//             bits.push_back(i1);
//         }
//     }
//     int m=(1<<bits.size());
//     ll ans=0;
//     FOR(i1, 1, m){
//         int mask1=0;
//         FOR(i2, 0, bits.size()){
//             if(i1&(1<<i2)){
//                 mask1=mask1|(1<<bits[i2]);
//             }
//         }
//         ans=max(ans, val[mask1]+find(mask^mask1));
//     }
//     dp[mask]=ans;
//     return ans;
// }

int main(){
    // ios_base::sync_with_stdio(false);
    // int n;
    scanf("%d", &n);
    FOR(i1, 0, n){
        FOR(i2, 0, n){
            scanf("%d", &a[i1][i2]);
        }
    }
    int maxmask=1<<n;
    FOR(i1, 0, maxmask){
        FOR(i2, 0, n){
            FOR(i3, i2+1, n){
                if((i1&(1<<i2))>0 && (i1&(1<<i3))>0){
                    val[i1]+=a[i2][i3];
                }
            }
        }
    }
    dp[0]=0;
    vector<int> bits(16);
    FOR(mask, 1, maxmask){
        int bitsize=0;
        FOR(i1, 0, n){
            if(mask&(1<<i1)){
                bits[bitsize]=i1;
                bitsize++;
            }
        }
        int m=(1<<bitsize);
        ll ans=0;
        FOR(i1, 1, m){
            int mask1=0;
            FOR(i2, 0, bitsize){
                if(i1&(1<<i2)){
                    mask1=mask1|(1<<bits[i2]);
                }
            }
            ll x=val[mask1]+dp[mask^mask1];
            if(ans<x)
                ans=x;
        }
        dp[mask]=ans;
    }
    printf("%lld\n", dp[maxmask-1]);
    return 0;
}

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

int main()
{
    int N,C,K; cin >> N >> C >> K;
    int T[100000];
    for (int i = 0; i < N; i++) cin >> T[i];
    sort(T,T+N);
    int res = 0;
    for (int i = 0; i < N; i++){
        int count = 1;
        while (i + count < N && count < C && (T[i] + K) >= T[i+count]){
            count++;
        }
        i = i + count - 1;
        res++;
    }
    cout << res << endl;
}

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

count = 0
for n,a in enumerate(A):
  if(n != 0):
    if(A[n] <= A[n-1]):
      count = count + (A[n-1] - A[n])
      A[n] = A[n-1]
      
print(count)
  
        
     

Measured memory_bytes: 32232
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n, w;
    cin >> n >> w;
    int val[n + 1], cost[n + 1];
    for (int i = 1; i <= n; i++) cin >> cost[i] >> val[i];
    long long dp[n + 1][w + 1];
    for (int i = 0; i <= n; i++) dp[i][0] = 0;
    for (int i = 0; i <= w; i++) dp[0][i] = 0;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= w; j++){
            if (j >= cost[i]){
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - cost[i]] + val[i]);
            }
            else dp[i][j] = dp[i - 1][j];
        }
    }
    cout << dp[n][w] << endl;
}

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

int compareValue(int a, int b)
{
    cout << "a ";
    if (a < b)      cout << "<";
    else if (a > b) cout << ">";
    else            cout << "==";
    cout << " b" << endl;
}

int main()
{
    int a = 0, b = 0;
    cin >> a >> b;
    compareValue(a, b);
    
    return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    ll a[500005]={};
    ll b[500005]={};
    ll ans=0;
    cin>>s;
    for(int i=1;i<=s.size();i++)
    {
        if(s[i-1]=='<')
            a[i]=a[i-1]+1;
    }
    for(int i=s.size()-1;i>=0;i--)
    {
        if(s[i]=='>')
            b[i]=b[i+1]+1;
    }
    for(int i=0;i<=s.size();i++)
        ans+=max(a[i],b[i]);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 11700
# DPL 1 C

def solve():
    n, w = map(int, input().split())
    items = [list(map(int, input().split())) for _ in range(n)]
    dp = [[0] * (w+1) for _ in range(n+1)]
    for i in range(1, n+1):
        for j in range(1, w+1):
            item = items[i-1]
            if j - item[1] < 0:
                dp[i][j] = dp[i-1][j]
            else:
                dp[i][j] = max(dp[i-1][j], dp[i][j-item[1]] + item[0])

    print(dp[-1][-1])


if __name__ == "__main__":
    solve()



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

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int maxA = *max_element(all(a));
  
  int ng = 0;
  int ok = maxA;
  
  while(abs(ok-ng) > 1){
    int mid = (ok + ng)/2;
    int tmp = 0;
    if (mid == 0) break;
    rep(i,n){
      tmp += (a[i]+mid-1)/mid - 1;
    }
    if(tmp <= k) ok = mid;
    else ng = mid;
  }
  cout << ok << endl;
}


Measured memory_bytes: 3964
#include<bits/stdc++.h>
#define _LIBCPP_DEBUG 0
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;
int INF = 1 << 30;
    
int main(void){

    int N;cin>>N;
    vector<int> A(2*100000+3,0);

    for (int i = 2; i <= N; ++i) {
        int tmp; cin>>tmp;
        A[tmp] ++;
    }

    for (int i = 1; i <= N; ++i) {
        cout<<A[i]<<endl;
    }

}

Measured memory_bytes: 4048
#include <iostream>

int main() {
    char a, b;
    std::cin >> a >> b;

    if (a == 'H') {
        if (b == 'H')
            std::cout << 'H' << '\n';
        else
            std::cout << 'D' << '\n';
    } else {
        if (b == 'H')
            std::cout << 'D' << '\n';
        else
            std::cout << 'H' << '\n';
    }
    return 0;
}


Measured memory_bytes: 3512
#include <bits/stdc++.h>
#define REV(v) reverse(v.begin(), v.end());
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, start, stop) for (int i = start; i < stop; i++)
#define FORR(i, start, stop) for (int i = start; i > stop; i--)
#define SORT(v, n) sort(v, v + n);
#define SORTR(v, n) sort(v, v + n,greater<int>());
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.begin(), v.end(),greater<int>());
#define REMOVE(v,n) remove(vector<int> v,v+v.size(),int n)
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
#define V(v,i,j) vector(v.begin() + i, v.begin() + j)
#define INSERT(va,vb) va.insert(va.end(), vb.begin(), vb.end())
using namespace std;
typedef vector<int> vint;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
const int MOD = 1000000007;
void chmin(int &a, int b) { if (a > b) a = b; }

//vector< vector<int> > v (size1, vector<int>(size2) );

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

    string L;
    cin>>L;
    ll l=L.size();

    ll dp1[100005],dp2[100005];

    dp1[1]=1;
    dp2[1]=2;

    FOR(i,1,l){
        dp1[i+1]=dp1[i]*3%MOD;
        if(L[i]=='1'){
            dp2[i+1]=dp2[i]*2;
            dp1[i+1]+=dp2[i];
        }else dp2[i+1]=dp2[i];

        dp1[i+1]%=MOD;
        dp2[i+1]%=MOD;
    }

    cout<<(dp1[l]+dp2[l])%MOD<<endl;

}
//688

Measured memory_bytes: 2000
import std.algorithm;
import std.array;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	int n;
	int m;
multitest_loop:
	while (readf (" %s %s", &n, &m) > 0)
	{
		readln;
		bool [] [] a;
		foreach (row; 0..n)
		{
			a ~= readln.strip.map !(x => x == '#').array;
		}
		bool [] [] b;
		foreach (row; 0..m)
		{
			b ~= readln.strip.map !(x => x == '#').array;
		}
		foreach (row; 0..n - m + 1)
		{
			foreach (col; 0..n - m + 1)
			{
				if (equal (a.drop (row).take (m)
				    .map !(x => x.drop (col).take (m)), b))
				{
					writeln ("Yes");
					continue multitest_loop;
				}
			}
		}
		writeln ("No");
	}
}


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

#define ll long long
#define ull unsigned long long

using namespace std;

const int INF = 10010010;

int main() {
	int N, M;
	cin >> N >> M;

	vector <int> a(M);
	vector <int> dec(M);	//ベクタc[ii]をinteger値に変換したもの
	for (int ii = 0; ii < M; ++ii){
		int b;
		cin >> a[ii] >> b;
		for (int jj = 0; jj < b; ++jj){
			int c;
			cin >> c;
			c--;
			dec[ii] += (1<<c);
		}
	}

	int stateNum = (1<<N);
	vector <int> dp(stateNum, INF);	//最小値
	vector <bool> visit(stateNum, false);
	visit[0] = true;
	dp[0] = 0;
	for (int state = 0; state < stateNum; ++state){
		if (!visit[state]) continue;
		for (int jj = 0; jj < M; ++jj){
			int newState = state | dec[jj];
			visit[newState] = true;
			dp[newState] = min(dp[newState], dp[state] + a[jj]);
		}
	}

	if (visit[stateNum-1]){
		cout << dp[stateNum-1] << "\n";
	} else {
		cout << -1 << "\n";		
	}

	return 0;
}


Measured memory_bytes: 256
s = input()

if s.count("N") >= 1 and s.count("W") >= 1 and s.count("S") >= 1 and s.count("E") >= 1 :
    print("Yes")
    exit()

if s.count("N") >= 1 and s.count("S") >= 1 and s.count("N") + s.count("S") == len(s):
    print("Yes")
    exit()
elif s.count("W") >= 1 and s.count("E") >= 1 and s.count("W") + s.count("E") == len(s):
    print("Yes")
    exit()

print("No")





Measured memory_bytes: 3064
#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

int main(void)
{
  int N,i = 0;
  scanf("%d",&N);
  double x,ans = 0;
  for(i = 0;i < N;i++) {
    string u;
    cin >> x >> u;
    if(u.find('JPY') != -1) { 
      ans = ans + x;
    } else if(u.find('BTC') != -1) {
      ans = ans + x * 380000;
    }
  }
  printf("%lf\n",ans);
  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void)
{
    double  b[200000];
    int i=0,j,m,n,x;
     double p=1.0,z=0.0;
    double a[2000],y=0.0;
    char c[10100],s[10100];

    scanf("%d",&n);

    for (size_t i = 0; i < n; i++)
    {
        scanf("%lf",&b[i]);
        p=(double)b[i]*p;//300
    }
    for (size_t i = 0; i < n; i++)
    {
        a[i]=(double)p/b[i];// 300/10
        z=z+a[i];
    }
   // printf("%lf /%lf",p,z);
    y=(double)p/z;

    printf("%lf",y);  
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
// square869120Contest #4-B
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
namespace you {
    std::string to_string(char val) {
        return std::string(1, val);
        // return std::string{val};
        // you::to_string(char)
    }
}

vector<ll> h(16);
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);

    int n,k;
    cin>>n>>k;
    rep(i,n) cin>>h[i];
    int now=h[0];
    int see=1;
    for(int i=1;i<n;i++){
        if(now<h[i]){
            see+=1;
            now=h[i];
        }
    }
    if(k<=see) cout<<0<<endl;
    else{
        ll ans=pow(10,12);
        int num=pow(2,n-1);
        for(int i=0;i<num;i++){
            ll cur=0;
            int max_h=h[0];
            int c=1; //見える数
            for(int j=0;j<n-1;j++){
                int now_h=h[j+1];
                if((i>>j)&1){
                    if(now_h<=max_h){
                        cur+=(max_h+1-now_h);
                        now_h=max_h+1;
                    }
                    c+=1;
                }
                if(max_h<now_h) max_h=now_h;
            }
            //cout<<i<<" "<<
            if(k<=c) ans=min(ans,cur);
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

namespace atcoder135
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] info = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int sm = info.Sum();
            if(sm % 2 == 0)
                Console.WriteLine(sm / 2);
            else
                Console.WriteLine("IMPOSSIBLE");
        }
    }
}


Measured memory_bytes: 13396
#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, const char * argv[]) {
    int N,X;
    cin>>N>>X;
    int m[N];
    int sum = N;
    for(int i=0;i<N;++i){
        cin>>m[i];
        X-=m[i];
    }
    sort(m, m+N);
    sum+=X/m[0];
    
    cout<<sum<<endl;
    return 0;
}


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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


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

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  // ll N; cin >> N;
  // ll N, K; cin >> N >> K;
  // ll x, y, z; cin >> x >> y >> z;
  ll a; cin >> a;
  // string s; cin >> s;
  // vector<ll> a(N); rep(i, N) cin >> a[i];
  
  ll ans = a + a* a + a* a*a;
  // bool ok = false;

  cout << ans << endl;
  // cout << (ok?"Yes":"No") << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 3680
#include "bits/stdc++.h"

using namespace std;

#define pb push_back
#define mp make_pair
constexpr int INF = 1 << 29;
constexpr int MOD = 1000000007;
typedef long long ll;
typedef unsigned long long ull;

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

int main() {
	ll a, b;
	cin >> a >> b;
	ll h = (1 + (b - a)) * (b - a) / 2;
	cout << h - b << endl;

	return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;
#[allow(dead_code)]
const MOD:i64 = 1e9 as i64 + 7;


fn main() {
    input!{s:chars};
    let mut fc = false;
    for i in 0..s.len() {
        if s[i] == 'C' { fc = true; }
        if fc && s[i] == 'F' {
            println!("Yes");
            return ();
        }
    }
    println!("No");
}


Measured memory_bytes: 4352
import numpy as np
words = lambda t : list(map(t, input().split()))

str = input()
s = [c for c in str]
total = 0
i = 0
preva = 0
while i < len(s):
    #print("i:", i ,s[i:], preva)
    cnta = preva
    preva = 0
    cntbc = 0
    if s[i] == 'A':

        while i < len(s):
            #print(j, s[j])
            if s[i] == 'A':
                cnta += 1
                i+=1
            else:
                break
        while i < len(s) - 1:
            #print(k, s[k], s[k+1])
            if s[i] == 'B' and s[i+1] == 'C':
                cntbc += 1
                i += 2
            else:
                break
        if cnta > 0 and cntbc > 0:
            total += cnta * cntbc
            preva = cnta
        else:
            preva = 0
    else:
        i += 1
print(total)


Measured memory_bytes: 14416
#include "bits/stdc++.h"
#pragma GCC optimize "-O3"
#pragma GCC target "tune=native"
using namespace std;
const int N = 1e9;
int main(){
    int n;
    cin >> n;
    long long a = 0, b = 0, c = 0, d = 0, e = 0;
    while(n--){
        string dd; cin >> dd;
        if(dd[0] == 'M') a++;
        if(dd[0] == 'A') b++;
        if(dd[0] == 'R') c++;
        if(dd[0] == 'C') d++;
        if(dd[0] == 'H') e++;
    }
    cout << a*b*c + a*b*d + a*b*e + a*c*d + a*c*e + a*d*e + b*c*d + b*c*e + b*d*e + c*d*e << endl;
	return 0;
}


Measured memory_bytes: 256
a = list(input())
b = list(input())
c = list(input())

tgt = a.pop(0)

while True:
    if tgt == 'a':
        if a:
            tgt = a.pop(0)
        else:
            ans = 'A'
            break
    elif tgt == 'b':
        if b:
            tgt = b.pop(0)
        else:
            ans = 'B'
            break
    else:
        if c:
            tgt = c.pop(0)
        else:
            ans = 'C'
            break
print(ans)

Measured memory_bytes: 9052
#include<bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define forz(i,n) for(lli i=0;i<n;i++)
 
#define pb push_back
#define fi first
#define se second
#define mp make_pair 
#define pll pair < lli , lli >
#define vll vector < lli > 

#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
 
 
 
#define kira ios::sync_with_stdio(0), cin.tie(0),cout.tie(0) 
#define deb(x) cout << #x << "=" << x << endl
#define debvec(v) {cout<<#v<<'=';for(auto itr=v.begin();itr!=v.end();itr++)cout<<*itr<<' ';cout<<endl;}
#define deb2(x,y) cout << #x << ',' << #y << "=(" << x << "," << y << ")" << endl;
#define deb2dvec(v) cout<<#v<<"=";for(auto x:v){for(auto y:x)cout<<y<<' ';cout<<endl;}



lli gcd(lli a, lli b) { 
   if (b == 0) 
      return a; 
   return gcd(b, a % b);  
} 


lli power(lli x, lli y, lli p)  
{  
    lli res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  

lli modInverse(lli n, lli p) 
{ 
    return power(n, p-2, p); 
} 

lli nCrModPFermat(lli n, lli r, lli p) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
  
    // Fill factorial array so that we 
    // can find all factorial of r, n 
    // and n-r 
    lli fac[n+1]; 
    fac[0] = 1; 
    for (lli i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
} 

vector<int> flip(string A) {
    int max_so_far = INT_MIN, max_ending_here = 0, 
       start =0, end = 0, s=0,r=0,l=0,maxsum = 0; 
  vector < int > v;
  int a[A.size()+10];
    for (int i=0; i< A.size(); i++ ) 
    { 
        if(A[i]=='1')
        {
            s--;
            start++;
        }
        else
        s++;
        
        s= max(s,0);
        a[i] = s;
        if(maxsum<s)
        {
            maxsum = s;
            r = i;
        }
    } 
    
    
    int v1 = r,er = 0;
    while(v1>=0)
    {
        if(A[v1]=='1')
        er--;
        else
        er++;
        if(er==maxsum)
        l = v1;
        
        v1--;
    }
    
    if(start==A.size())
    return v;
    else
    {
        v.push_back(l+1);
        v.push_back(r+1);
        return v;
    }
    
}
lli a[1000010]={0};


lli solve(lli n)
{
	lli i=1;
	while(a[i]<=n)
	{
		i++;
	}
	i--;
	n = n - a[i];
	if(n<0 || i==0)
	return 0;
	else
	{
		return (lli)1 + solve(n);
	}
}





int main()
{
	kira;
	string s,t;
	cin>>s>>t;
	if(t.size()==s.size()+1)
	{
		string s1 = t.substr(0,s.size());
		if(s1==s)
		cout<<"Yes";
		else
		cout<<"No";
	}
	else
	cout<<"No";
	return 0;
}







Measured memory_bytes: 3616
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = Is()
if a%2 == 1 and b % 2 == 1:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3316
p = 998244353

n, k = map(int, input().split())
num = [tuple(map(int, input().split())) for _ in range(k)]

dp = [0] * (2*n + 1)

dp[0] = 1
dp[1] = -1

for i in range(n):
    for l, r in num:
        dp[i+l] += dp[i]
        dp[i+r+1] -= dp[i]
    dp[i+1] += dp[i]
    dp[i+1] %= p

print(dp[n-1])

Measured memory_bytes: 24652
#include<iostream>   /AA06( 21/ 06/ 20) If u see my code, Have a Good Day! (^_^)
#include<bits/stdc++.h>

using namespace std;

int  main()
{
    int n, k, i, A[10000];

    cin >> n >> k;

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

        cin >> A[i];
    }

    sort(A, A + n);

    cout << accumulate(A, A + k, 0) << endl;

    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define meow(args...) fprintf(stderr, args)
int *f[1<<21], trans[1<<21][2];
char str[(1<<20)+1];
int main() {
	int n, k;
	assert(scanf("%d%d", &n, &k)==2);
	f[1]=new int[1<<(n+1)];
	f[1][0]=0;
	for(int i=0; i<=n; ++i) {
		int p=1<<i;
		assert(scanf("%s", str)==1);
		for(int j=0; j<p; ++j) f[1][p+j]=str[j]-'0';
		for(int j=0; j<p; ++j) trans[p+j][1]=j;
		trans[2*p-1][0]=0;
		for(int j=1; j<p; ++j) trans[2*p-j-1][0]=j^((1<<(31-__builtin_clz(j)))-1);
	}
	int ans=1;
	for(int i=1; i<=n; ++i) {
		int p=1<<i;
		for(int j=2*p; j-->p; ) {
			f[j]=new int[1<<(n-i+1)];
			memset(f[j], 0, sizeof(int)<<(n-i+1));
			for(int k=1; k<(1<<(n-i+2)); ++k) f[j][trans[k][j&1]]+=f[j>>1][k];
			f[j][0]=0;
			if(std::accumulate(f[j], f[j]+(1<<(n-i+1)), 0)>=k) ans=j;
		}
	}
	for(int i=31-__builtin_clz(ans); i--; ) printf("%d", ans>>i&1);
	puts("");
	return 0;
}


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

using namespace std;

int main(){
int n;

cin>>n;
int value;
map<int,int>map;

for(int i=0;i<n;i++){
cin>>value; map[value]++;

if(map[value]>1){cout<<"NO"<<endl; return 0;
}
}
cout<<"YES"<<endl;
}

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

using namespace std;

long long pow(long long a, long long b, long long P) {
    a %= P;
    long long res = 1;
    while (b) {
        if (b & 1) res = res * a % P;
        a = a * a % P;
        b >>= 1;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> M(1000001, 0);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        int x = a[i];
        for (int j = 2; (long long)j * j <= x; ++j) {
            if (x % j == 0) {
                int cnt = 0;
                while (x % j == 0) {
                    x /= j;
                    ++cnt;
                }
                M[j] = max(M[j], cnt);
            }
        }
        if (x != 1) {
            M[x] = max(M[x], 1);
        }
    }
    int ans = 0;
    const int P = 1e9 + 7;
    vector<pair<int, int>> d;
    for (int i = 1; i <= 1000000; ++i) {
        if (M[i] != 0) {
            d.push_back(make_pair(i, M[i]));
        }
    }
    for (int i = 0; i < n; ++i) {
        int x = a[i];
        long long res = 1;
        for (auto p : d) {
            int tmp = p.second;
            while (x % p.first == 0) {
                --tmp;
                x /= p.first;
            }
            res = res * pow(p.first, tmp, P) % P;
        }
        ans = (ans + res) % P;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4480
n,m,x,y=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
if y-x>=1:
  kouho=[]
  for k in range(x+1,y+1):
    kouho.append(k)
  p.sort()
  q.sort()
  c=0
  for i in range(0,len(kouho)):
    c+=1
    if p[-1]<kouho[i]<=q[0]:
      print("No War")
      break
    if c==len(kouho):
      print("War")
else:
  print("War")

Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int x = 0, ans = 0, n;
	char s[101];
	scanf("%d %s",&n,s);
	for(int i=0;i<n;i++){
		if(s[i]=='I') x++;
		else x--;
		ans = max(ans,x);
	}
	printf("%d\n",ans);
}


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

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

    string N;
    cin >> N;
    int ans = 0;
    ans += (N.length() - 1) * 9;
    ans += ((N[0] - '0') - 1);
    int origin = 0;
    for (int i = 0; i < N.length(); i++) {
        origin += N[i] - '0';
    }
    ans = max(ans, origin);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	int n;
	cin >> n;
	map<int, int> a, b;
	for(int i = 0; i < n; i++) {
		int x;
		cin >> x;
		(i % 2 == 0 ? a[x]++ : b[x]++);
	}
	int s = 0, t = 0, p = 0, q = 0;
	int m1 = 0, m2 = 0;
	for(int i = 0; i < 100005; i++) {
		if(a[i] >= s) {
			t = s;
			s = a[i];
			m1 = i;
		}
		if(b[100005 - i] >= p) {
			q = p;
			p = b[100005 - i];
			m2 = 100005 - i;
		}
	}
	cout << (m1 != m2 ? n - s - p : min(n - s - q, n - t - p)) << endl;
	return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

    int n;
    cin >> n;

    if(n == 1){
        n = 0;
    }
    else{
        n = 1;
    }
    cout<< n << endl;


}


Measured memory_bytes: 3648
N = int(input())
check = 0

kuku = []

for a in range(1, 10):
    for b in range(1, 10):
        kuku.append(a * b)

for x in range(0, 81):
    if N == kuku[x]:
        check = 0
        break
    else:
        check = 1

if check == 0:
    print("Yes")
elif check == 1:
    print("No")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
  
    ll n; cin>>n;
    vector<ll> op;
    while(abs(n)){
        ll s = (n%2+4)%2;
        op.push_back(s);
        n = -(n-s)/2;
    }
    for(ll i=0; i<op.size(); i++){
        cout<<op[op.size()-i-1];
    }
    if(op.size()==0)cout<<0;
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
int n ;
vector<vector<int> > a ;
int dp[22][(1LL << 21) + 10] ;
int dfs(int x, int cur){
    if ( x == n ) {
        return 1 ;
    }
    if ( dp[x][cur] != -1 ) return dp[x][cur] ;
    int ans = 0 ;
    for(int i = 0; i < n; i++){
        if ( ((1LL << i) & cur) == false && a[x][i] == true ){
            ans += dfs(x + 1, cur | (1LL << i)) ;
            ans %= MOD ;
        }
    }
    return dp[x][cur] = ans ;
}
signed main(){
    fastio
    memset(dp, -1, sizeof dp) ;
    cin >> n ;
    a = vector<vector<int> >(n, vector<int>(n)) ;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            cin >> a[i][j] ;
        }
    }
    int ans = dfs(0, 0) ;
    cout << ans << endl;
    return 0; 
}

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

struct P {
	int x, y;
	P() : x(0), y(0) {}
	P(int x, int y) : x(x), y(y) {}
};

int state[10000][10000];

int H, W;

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

int main()
{
	int w, h, n;
	while (cin >> w >> h, w | h) {
		cin >> n;
		vector<int> xval, yval;
		vector<int> x1(n), x2(n), y1(n), y2(n);
		xval.push_back(0);
		xval.push_back(w);
		yval.push_back(0);
		yval.push_back(h);
		for (int i = 0; i < n; i++) {
			cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
			xval.push_back(x1[i]);
			if (x1[i] != 0) xval.push_back(x1[i] - 1);
			if (x1[i] != w) xval.push_back(x1[i] + 1);
			xval.push_back(x2[i]);
			if (x2[i] != 0) xval.push_back(x2[i] - 1);
			if (x2[i] != w) xval.push_back(x2[i] + 1);

			yval.push_back(y1[i]);
			if (y1[i] != 0) yval.push_back(y1[i] - 1);
			if (y1[i] != h) yval.push_back(y1[i] + 1);
			yval.push_back(y2[i]);
			if (y2[i] != 0) yval.push_back(y2[i] - 1);
			if (y2[i] != h) yval.push_back(y2[i] + 1);
		}
		sort(xval.begin(), xval.end());
		xval.erase(unique(xval.begin(), xval.end()), xval.end());
		sort(yval.begin(), yval.end());
		yval.erase(unique(yval.begin(), yval.end()), yval.end());
		H = yval.size(); W = xval.size();

		for (int i = 0; i < n; i++) {
			int X1 = lower_bound(xval.begin(), xval.end(), x1[i]) - xval.begin();
			int Y1 = lower_bound(yval.begin(), yval.end(), y1[i]) - yval.begin();
			int X2 = lower_bound(xval.begin(), xval.end(), x2[i]) - xval.begin();
			int Y2 = lower_bound(yval.begin(), yval.end(), y2[i]) - yval.begin();
			state[Y1][X1]++;
			state[Y1][X2]--;
			state[Y2][X1]--;
			state[Y2][X2]++;
		}
		for (int i = 0; i < H; i++) {
			for (int j = 1; j < W; j++) {
				state[i][j] += state[i][j - 1];
			}
		}
		for (int j = 0; j < W; j++) {
			for (int i = 1; i < H; i++) {
				state[i][j] += state[i - 1][j];
			}
		}
		for (int i = 0; i < H - 1; i++) {
			for (int j = 0; j < W - 1; j++) {
				if (state[i][j]) {
					state[i][j] = 0;
				}
				else {
					state[i][j] = 1;
				}
			}
		}
		int res = 0;
		for (int i = 0; i < H - 1; i++) {
			for (int j = 0; j < W - 1; j++) {
				if (state[i][j]) {
					vector<P> q;
					q.push_back(P(i, j));
					state[i][j] = 0;
					while (!q.empty()) {
						auto tmp = q; q.clear();
						for (auto p : tmp) {
							for (int k = 0; k < 4; k++) {
								int tx = p.x + dx[k], ty = p.y + dy[k];
								if (tx >= 0 && tx < H && ty >= 0 && ty < W && state[tx][ty] == 1) {
									state[tx][ty] = 0;
									q.push_back(P(tx, ty));
								}
							}
						}
					}
					res++;
				}
			}
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 15440
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

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

  function<bool(int, int)> check = [&](int r, int cnt){
    return !(s[r-1] == '1' && s[r] == '0' && cnt == k);
  };

  s = s + '1';

  int ans = 0;
  for(int l=0, r=1, cnt=0; l<n; l++){
    while(r < n && check(r, cnt)){
      if(s[r-1] == '0' && s[r] == '1') cnt++;
      r++;
    }

    ans = max(ans, r-l);

    if(s[l] == '0' && s[l+1] == '1') cnt--;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 512
n,x = map(int,input().split())
li = list(map(int,input().split()))

li.sort()
ans = 0

for i in range(n):
    if x >= li[i]:
        x -= li[i]
        ans += 1
    elif x < li[i]:
        x = 0
else:
    if x > 0:
        ans -= 1
        
print(ans)

Measured memory_bytes: 3064
function main(input) {
    var array = input.split('\n');
    var string1=array[0].split('');
    var string2=array[1].split('');
    var flag = 0;

    if(string1.toString() == string2.toString()) flag = 1;
    else{
        for(var i = 0; i < string1.length-1; i++){
            var last = string1[string1.length-1];
            string1.pop();
            string1.unshift(last);
            if(string1.toString() == string2.toString()){
                flag =1;
                break;
            }
        }
    }

    if(flag == 1) console.log('Yes');
    else console.log('No');
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21064
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

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

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = in.readLine()) != null) {
            String[] s1 = s.split(" ");
            String[] t = in.readLine().split(" ");

            TreeSet<Integer> a = new TreeSet<>();
            for (int i = 0; i < s1.length; i++) {
                a.add(Integer.parseInt(s1[i]));
            }

            int hit = 0;
            int blow = 0;

            for (int i = 0; i < t.length; i++) {
                int j = Integer.parseInt(t[i]);
                int k = Integer.parseInt(s1[i]);
                if (j == k) hit++;
                else if (a.contains(j)) blow++;
            }

            System.out.println(hit + " " + blow);


        }

    }

}

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


int main(){
  int n; cin >> n;
  vector<int> l(n);
  rep(i,n) cin >> l[i];
  sort(l.rbegin(),l.rend());
  ll cnt = 0;
  for(int i=0; i<n; i++){
    for(int j = i+1; j<n; j++){
      for(int k = j+1; k<n; k++){
        if(l[i] < l[j]+l[k]) cnt++;
      }
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 384
import Control.Applicative

main = do
    _ <- read <$> getLine :: IO Int
    ls <- map read.words <$> getLine :: IO [Int]
    putStrLn.show $ answer ls

answer = sum.map (f 0)
f k 0 = k
f k v = if mod v 2 /= 0 then k else f (k+1) (div v 2)

Measured memory_bytes: 7548
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>

std::string output(int k,int h) {

	return (k >= h  ? "Yes\n" : "No\n");

}

int main() {

	int h, n;
	int a;
	int ans = 0;

	std::cin >> h >> n;

	for (int i = 0; i < n; ++i) {
		std::cin >> a,ans += a;
	}

	std::cout << output(ans, h);
	return 0;
}

Measured memory_bytes: 384
//#pragma warning disable
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System;
using System.Numerics;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
class Z { static void Main() => new K(); }
class K
{
	int F() => int.Parse(ReadLine());
	long FL() => int.Parse(ReadLine());
	int[] G() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	long[] GL() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
	public const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var I = G();
		int l1 = I[0], r1 = I[1];
		int l2 = I[2], r2 = I[3];
		if (r1 < l2 || r2 < l1) Console.WriteLine(0);
		else Console.WriteLine(Min(r1, r2) - Max(l1, l2));
	}
}


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

int main() {
    int N, K;
    cin >> N >> K;
    vector <int> p(N);
    for (int i=0; i<N; i++) {
        cin >> p.at(i);
    }
    sort(p.begin(), p.end());
    int ans=0;
    for (int i=0;i<K; i++) ans+=p.at(i);
    cout << ans;
}

Measured memory_bytes: 3632
n=gets.to_i
r=[];b=[]
n.times{r<<(gets.split.map &:to_i)}
n.times{b<<(gets.split.map &:to_i)}
r=r.sort_by{|x,y|-x}
b=b.sort_by{|x,y|y}
s=0
b.each{|bx,by|
i= r.index{|rx, ry| bx > rx && by > ry}
  unless  i==nil
    r.delete_at(i)
    s += 1
  end
}
p s

Measured memory_bytes: 1788
H = int(input())
W = int(input())
N = int(input())

big = 0
small = 0

if H >= W:
  big = H
  small = W
else:
  big = W
  small = H
  
for i in range(1, small + 1):
  if big * i >= N:
    print(i)
    exit()
  

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

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

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	double T, X;
	cin >> T >> X;
	cout << fixed << setprecision(10) << T/X << endl;
}


Measured memory_bytes: 764
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int MOD = 1000000007;

class Mint {
public:
  typedef long long val_type;

  Mint(val_type x=0, int m=MOD) : val((x%m+m)%m), mod(m) {}
  val_type value() const { return val; }
  Mint& operator+=(const Mint a) {
    if ((val += a.val) >= mod) val -= mod;
    return *this;
  }
  Mint& operator-=(const Mint a) {
    if ((val += mod-a.val) >= mod) val -= mod;
    return *this;
  }
  Mint& operator*=(const Mint a) {
    (val *= a.val) %= mod;
    return *this;
  }
  Mint operator+(const Mint a) const {
    Mint res(*this);
    return res+=a;
  }
  Mint operator-(const Mint a) const {
    Mint res(*this);
    return res-=a;
  }
  Mint operator*(const Mint a) const {
    Mint res(*this);
    return res*=a;
  }
  Mint pow(val_type 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 {
    Mint res(*this);
    return res/=a;
  }

private:
  val_type val;
  int mod;
};

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

    int N;
    cin >> N;
    vector<Mint> A(N);
    Mint tot = 0;
    rep(i, N) {
        int a;
        cin >> a;
        A[i] = Mint(a);
        tot += A[i];
    }

    Mint ans = 0;
    rep(i, N) {
        ans += A[i] * (tot - A[i]);
    }
    ans /= Mint(2);

    cout << ans.value() << endl;

    return 0;
}


Measured memory_bytes: 6364
S = [int(a) for a in input()[::-1]]
m = 2019
N = len(S)
s = 0
p = 1
X = [0] * 2019
X[0] = 1
ans = 0
for a in S:
    s = (s + a * p) % m
    ans += X[s]
    X[s] += 1
    p = p * 10 % m
 
print(ans)

Measured memory_bytes: 10944
#include<stdio.h>

int main(void){
  long long n , m;
  scanf("%lld %lld",&n ,&m);

  long long max , min;
  if(n >= m){
    max = n;
    min = m;
  }
  else{
    max = m;
    min = n;
  }

  long long ans = 1;
  if(max - min > 1){
    ans = 0;
  }
  else{
    for(long long i = 2;i <= min;i ++){
      ans *= i;
      if(ans > 1000000007){
        ans %= 1000000007;
      }
      ans *= i;
      if(ans > 1000000007){
        ans%= 1000000007;
      }
    }

    if(min != max){
     ans *= max;
      if(ans > 1000000007){
        ans %= 1000000007;
      }
    }
    else{
      ans *= 2;
      if(ans > 1000000007){
        ans %= 1000000007;
      }
    }
  }

  printf("%lld\n",ans);

  return 0;
}

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

int main() {
  char c;
  cin >> c;
  
  if ( c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
    cout << "vowel" << endl;
  }

  else {
    cout << "consonant" << endl;
  }
  
}



Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int> v(n);
	int out = 0;
	for(int i=0;i<n;i++)
	{
		cin>>v[i];
		out = out^v[i];
	}
	//cout<<out<<endl;
	for(int i=0;i<n;i++)
	{
		int a = out^v[i];
		cout<<a<<" ";
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 4040
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1}; // 移動方向

int n;
int a[100010], b[100010], c[100010];

void input(){
    cin >> n;
    for(int i=0;i<n;i++) cin >> a[i];
    for(int i=0;i<n;i++) cin >> b[i];
    for(int i=0;i<n;i++) cin >> c[i];
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    sort(a,a+n);
    sort(c,c+n);
    ll ans = 0;
    for(int i=0;i<n;i++) ans += (n-(upper_bound(c,c+n,b[i])-c))*(lower_bound(a,a+n,b[i])-a);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1408