akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

const int INF = 1e9;
const long long LINF = 1e18;
const double PI=3.14159265358979323846;

typedef priority_queue<int, vector<int>, greater<int>> priority_queue_asc;

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

    vector<ll> A(N);
    vector<ll> B(M);

    for (size_t i = 0; i < N; i++) {
        cin >> A[i];
    }

    for (size_t i = 0; i < M; i++) {
        cin >> B[i];
    }

    ll lastK = K;
    ll readA = 0;
    while (lastK - A[readA] >= 0 && readA < N) {
        lastK -= A[readA++];
    }

    ll readB = 0;
    ll ans = readA + readB;
    ll cur = ans;

    // cout << "readA: " << readA << endl;

    while (readA >= 0) {
        while (lastK - B[readB] >= 0 && readB < M) {
            lastK -= B[readB++];
        }
        ans = max(ans, readA + readB);

        lastK += A[readA - 1];
        --readA;
    }

    cout << ans << endl;

    return 0;
}


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

using namespace std;

int main() {
    string str;
    cin>>str;
    if(str=="RRR") cout<<"3";
    else if (str=="RRS") cout<<"2";
    else if (str=="SRR") cout<<"2";
    else if (str=="SSS") cout<<"0";
    else cout<<"1";
    
    
    
    
    
}

Measured memory_bytes: 3620
import sys
input = sys.stdin.readline
#str 注意

class Combination:
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv


def main():
    h,w,a,b = map(int,input().split())
    cmb = Combination(10**6)
    roop = min(h-a,w-b)
    ans = 0
    for i in range(roop):
        before = cmb(h-a+b-1,b+i) % (10**9+7)
        after  = cmb(w+a-b-1,a+i) % (10**9+7)
        ans  = (ans+(before*after)%(10**9+7)) % (10**9+7)
    print(ans)
if __name__=='__main__':
    main()

Measured memory_bytes: 125640
from collections import*
(n,m),a,*q=[[*map(int,o.split())]for o in open(0)]
t=[-1]*n
def r(x):
 while-1<t[x]:x=t[x]
 return x
def u(L):
 x,y=map(r,L)
 if x!=y:
  if t[x]>t[y]:x,y=y,x
  t[x]+=t[y];t[y]=x
d=defaultdict(list)
for l in q:u(l)
i=c=0;b=[];k=(n+~m)*2
for v in a:d[r(i)]+=v,;i+=1
print(k<1and'0'or k>n and'Impossible'or exec("for r,p in d.items():p.sort();c+=p.pop(0);b+=p;k-=1")or c+sum(sorted(b)[:k]))

Measured memory_bytes: 106672
#include <bits/stdc++.h>
//#include <tr1/unordered_map>
#define debug(x) (cout << "#x = " << (x) << endl)
#define lowbit(x) (x & -x)
#define Set(x, i) memset(x, i, sizeof x)
#define R register
#define For( i, j, k ) for(R int i = (j); i <= (k); ++i)
#define Rep( i, j, k ) for(R int i = (j); i >= (k); --i)
#define Cross( i, j, k ) for(R int i = (j); i; i = (k))
typedef long long ll;
using namespace std;
const ll N = 100011;
const ll INF = 5e16;
const ll P = 1e9 + 7;

namespace IO {

	#define dd ch = getchar()
	inline ll read() {
		ll x = 0; bool f = 0; char dd;
		for (; !isdigit (ch); dd) f ^= (ch == '-');
		for (; isdigit (ch); dd)  x = x * 10 + (ch ^ 48);
		return f? -x: x;
	}
	#undef dd

	inline void write ( ll x ) {
		if (x < 0) putchar ('-'), x = -x;
		if (x > 9) write (x / 10); putchar ( x % 10 | 48 );
	}

	inline void wrn ( ll x ) { write(x); putchar (' '); }

	inline void wln ( ll x ) { write(x); putchar ('\n'); }

	inline void wlnn ( ll x, ll y ) { wrn(x); wln (y); }

}

using namespace IO;

namespace Cesare {
	
	/*
		设 f[i][j] 表示做到第 i 位， % 13 为 j 的方案数。 
		每次转移枚举当前位。
		if (s[i] != '?') f[i][(j + s[i]) % 13] += f[i - 1][j]
		if (s[i] == '?') f[i][(j + k) % 13] += f[i - 1][j]
	*/
	
	char s[N];
	ll num[N], f[N][14];
	
	int main() {
		cin >> s + 1;
		ll n = strlen(s + 1);
		For ( i, 1, n ) if (isdigit(s[i])) num[i] = s[i] ^ 48;
		if (s[1] != '?') f[1][num[1]] = 1;
		if (s[1] == '?') For ( i, 0, 9 ) f[1][i] = 1;
		For ( i, 2, n ) For ( j, 0, 12 ) {
			if (s[i] != '?') 
				(f[i][(j * 10 + num[i]) % 13] += f[i - 1][j]) %= P;
			if (s[i] == '?') 
				For ( k, 0, 9 ) (f[i][(j * 10 + k) % 13] += f[i - 1][j]) %= P;
		} return wln(f[n][5]), 0;
	}
	
}

int main()
{
	return Cesare::main();
}

/*

*/



Measured memory_bytes: 12032
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;

class Prog
{
    public Prog() { }
    public static int Main()
    {
        new Prog().calc();
        return 0;
    }

    Scanner cin;

    public void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();

        int[] a = new int[N];
        for (int i = 0; i < N; i++) a[i] = cin.nextInt();

        int min = int.MaxValue / 2;
        for(int i = - 100;i<=100;i++)
        {
            int sum = 0;
            for (int j = 0; j < N; j++) sum += (a[j] - i) * (a[j] - i);

            min = Math.Min(sum, min);
        }

        Console.WriteLine(min);
    }
}


class Scanner
{
    string[] s;
    int i;

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

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

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

    public int nextInt()
    {
        return int.Parse(next());
    }

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

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

}

Measured memory_bytes: 2776
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll a, b, m;
    cin >> a >> b >> m;
    vector<ll> va(a+1), vb(b+1), x(m), y(m), c(m);
    ll ma = 1e9, mb = 1e9;
    rep(i, 1, a+1){
        cin >> va[i];
        ma = min(va[i], ma);
    } 
    rep(i, 1, b+1){
      cin >> vb[i];
        mb = min(vb[i], mb);  
    } 
    rep(i, 0, m) cin >> x[i] >> y[i] >> c[i];

    ll mn = ma + mb;

    rep(i, 0, m){
        mn = min(mn, va[x[i]]+vb[y[i]]-c[i]);
    }  

    cout << mn << endl;
    return 0;
}

Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    long long n,m;
    long long a[21];
    cin >>m>>n;
    long long dp[n][m+1];
    
    for(int i=0;i<n;i++){
        cin>>a[i];
    }

    sort(a,a+n);

    for(int i=0;i<m+1;i++){
        dp[0][i]=i;
    }

    for(int i=1;i<n;i++){
        for(int j=0;j<m+1;j++){
            if(j<a[i]){
                dp[i][j]=dp[i-1][j];
            }
        else{
            dp[i][j]=fmin(dp[i-1][j],dp[i][j-a[i]]+1);
        }
        }
    }

    cout<<dp[n-1][m]<<endl;
}



Measured memory_bytes: 10988
import java.util.Arrays;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int a = keyboard.nextInt();
		int b = keyboard.nextInt();
		int c = keyboard.nextInt();
		
		int count = 0;
		if(a == b && b == c) {
			count = 1;
		}else if(a != b && b != c &&  c != a){
			count = 3;
		}else {
			count = 2;
		}

			System.out.println(count);
			
		keyboard.close();	
	}
}


Measured memory_bytes: 23380
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<climits>//long long型の最大値(LLONG_MAX)など
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;
typedef long double ld;

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


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

    ll ans=0;
    if(s[0] == 'R'){
        if(s[1] == 'R'){
            if(s[2] == 'R'){
                ans = 3;
            }else{
                ans = 2;
            }
        }else{
            ans = 1;
        }

    }else if(s[1] == 'R'){
        if(s[2] == 'R'){
            ans = 2;
        }else{
            ans = 1;
        }

    }else if(s[2] == 'R'){
        ans = 1;
    }

    cout << ans << endl;
}




Measured memory_bytes: 3592
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>                        // uncomment before submission
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e15 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Pushback to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s, t;
    cin >> s >> t;

    int n = s.length(), m = t.length();
    vvi C(n + 1, vi(m + 1));
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            if (s[i - 1] == t[j - 1]) C[i][j] = C[i - 1][j - 1] + 1;
            else C[i][j] = max(C[i - 1][j], C[i][j - 1]);
        }
    }

    int i = n, j = m, k = C[n][m];
    char str[k + 1];
    str[k] = '\0';
    while (i > 0 && j > 0)
    {
        if (s[i - 1] == t[j - 1])
        {
            str[k - 1] = s[i - 1];
            i--;
            j--;
            k--;
        } else if (C[i - 1][j] > C[i][j - 1])
            i--;
        else
            j--;
    }

    cout << str << endl;
    return 0;
}


Measured memory_bytes: 70784
n = gets.to_i
arr = n.times.map { |i| gets.chomp }
ac = 0
wa = 0
tle = 0
re = 0

arr.each do |i|
  case i
  when "AC"
    ac += 1
  when "WA"
    wa += 1
  when "TLE"
    tle += 1
  when "RE"
    re += 1
  end
end

puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"


Measured memory_bytes: 20752
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/





string S; int K;
//---------------------------------------------------------------------------------------------------
int memo[303][303][303];
int f(int l, int r, int k) {
    if (memo[l][r][k]) return memo[l][r][k];

    int res = 0;
    if (l == r) res = 1;
    else if (l + 1 == r) {
        if (S[l] == S[r] or 0 < k) res = 2;
        else res = 1;
    } else {
        chmax(res, f(l + 1, r, k));
        chmax(res, f(l, r - 1, k));
        
        if (S[l] == S[r]) chmax(res, f(l + 1, r - 1, k) + 2);
        else if (0 < k) chmax(res, f(l + 1, r - 1, k - 1) + 2);
    }

    return memo[l][r][k] = res;
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> S >> K;
    int N = S.length();

    cout << f(0, N - 1, K) << endl;
}

Measured memory_bytes: 108928
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> weaters = new ArrayList<>(Arrays.asList("Sunny", "Cloudy", "Rainy"));
        int index = weaters.indexOf(sc.next());
        System.out.println(weaters.get((index + 1) % 3));
    }
}

Measured memory_bytes: 19156
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int D = sc.nextInt();
		int T = sc.nextInt();
		int S = sc.nextInt();

		if(S*T>=D) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}


	}
}


Measured memory_bytes: 35600
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
//#include <ctype.h>
#include <vector>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <bitset>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repm(i, a, n) for (int i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vs vector<string>
#define vii vector<vector<int>>
#define vll vector<ll>
#define vllll vector<vector<ll>>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second

void print(bool c)
{
    if (c)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

void Print(bool c)
{
    if (c)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}

ll gcdll(ll a, ll b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

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

bool cmp(const pii &a, const pii &b)
{
    if (a.second != b.second)
        return a.second < b.second;
    return a.first < b.first;
}

ll C(int a, int b)
{
    b = min(b, a - b);
    //cout << a << " " << b << endl;
    if (b == 0)
        return 1;
    ll ans = 1;
    rep(i, a - b + 1, a + 1)
    {
        ans *= i;
        //cout << i << " " << ans << endl;
    }
    rep(i, 1, b + 1)
    {
        ans /= i;
        //cout << ans << endl;
    }
    return ans;
}

ll pow(int a, int b)
{
    ll ans = 1;
    rep(i, 0, b) ans *= a;
    return ans;
}

int main(void)
{
    int n, p, a;
    cin >> n >> p;
    int odd = 0, even = 0;
    rep(i, 0, n)
    {
        cin >> a;
        (a % 2 == 0) ? (even++) : (odd++);
    }
    //cout << odd << " " << even << endl;

    if (p == 0)
    {
        ll comb = 0;
        rep(i, 0, odd / 2 + 1) comb += C(odd, i * 2);
        cout << comb * pow(2, even) << endl;
    }
    else
    {
        if (odd == 0)
        {
            cout << 0 << endl;
            return 0;
        }
        ll comb = 0;
        rep(i, 0, (odd - 1) / 2 + 1) comb += C(odd, i * 2 + 1);
        cout << comb * pow(2, even) << endl;
    }

    //cout << pow(2, 50) << endl;
    //cout << C(5, 5) << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

def is_m(n):
    if n > 0 and n < 13:
        return True
    return False


def solve(S: str):
    a = int(S[:2])
    b = int(S[2:])
    if is_m(a) and not is_m(b):
        ret = 'MMYY'
    elif not is_m(a) and is_m(b):
        ret = 'YYMM'
    elif is_m(a) and is_m(b):
        ret = 'AMBIGUOUS'
    else:
        ret = 'NA'
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
 
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
 
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())
 
#define pb push_back
#define mp make_pair
#define mt make_tuple
 
#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

set<long long> getPrimeFactorsSet(long long n){
    set<long long> ret;
    while(!(n % 2)){
        n /= 2;
        ret.insert(2);
    }
    for(int i = 3; i <= n; i += 2){
        while(!(n % i)){
            n /= i;
            ret.insert(i);
        }
    }
    return ret;
}
 
int popcount(int n) {
    int ret = 0;
    while(n) {
        if (n % 2) ++ret;
        n /= 2;
    }
    return ret;
}

// 1??????n?????§?????´??°????????????a????????°??§????????????????????°?????????
ll multiples(int n, int a) {
    return n / a;
}

// ?????????????????????
int main(void)
{
    ll N;
    cin >> N;

    auto factorsSet = getPrimeFactorsSet(N);
    vector<ll> factors(factorsSet.begin(), factorsSet.end());

    ll ret = 0;
    REP(i, 1 << SIZE(factors)) {
        int ones = popcount(i);
        if (ones == 0) continue;

        ll a = 1;
        REP(j, SIZE(factors)) {
            if ((1 << j) & i) a *= factors[j];
        }
        if (ones % 2) {
            ret += multiples(N, a);
        }
        else {
            ret -= multiples(N, a);
        }
    }

    ret = N - ret;
    cout << ret << endl;
     
    return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,k,n)       for(i=k;k<=n?i<=n:i>=n;k<=n?i++:i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
#define inf             1e18
#define mod             1000000007
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}void _p() {cout << "]\n";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p,int m = inf) {int ans=1;x%=m;while(p>0){if(p&1)ans=(ans*x)%m;p=p>>1;x=(x*x)%m;}return ans;}
int inv(int x,int m=mod){return po(x,m-2,m)%m;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
//=========================================================




const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r;








void sol()
{   
    cin>>n>>k;
    in(a,n);
    sort(all(a));
    c=0;
    fo(i,k)c+=a[i];
    
    
    
    cout<< c <<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //sp(10);
    // w(t)
    sol();
    return 0;
}

Measured memory_bytes: 3664
package main

import (
  "fmt"
)

func main(){
  
  var N int
  var D int
  
  fmt.Scan(&N)
  fmt.Scan(&D)
  
  
  if((N%((D*2)+1)) > 0){
    fmt.Println(N/((D*2)+1) + 1)
  }else{
    fmt.Println(N/((D*2)+1))
  }
}

Measured memory_bytes: 512
n,m = gets.chomp.split(" ").map(&:to_i)

if n == 1 then
  if m == 1 then
    puts 1
  elsif m == 2 then
    puts 0
  else
    puts m - 2
  end
elsif n == 2 then
  puts 0
else
  if m == 1 then
    puts n - 2
  elsif m == 2 then
    puts 0
  else
    puts (n - 2) * (m - 2)
  end
end


Measured memory_bytes: 3836
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
 
var line;
while (line = lines.shift()) {
    var nums = line.split('').map(function(n){return +n;});
    var n = nums.length;
    while (n > 1) {
        var a = [];
        for (var i = 0; i < n - 1; i++) {
            a.push((nums[i] + nums[i+1]) % 10);
        }
        n--;
        nums = a;
    }
    console.log(nums[0]);
}

Measured memory_bytes: 7644
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

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

    int n, q;
    cin >> n >> q;
    vector<tuple<int, int, int>> event;
    rep(i, n) {
        int s, t, x;
        cin >> s >> t >> x;
        event.emplace_back(s - x, 1, x);
        event.emplace_back(t - x, -1, x);
    }
    sort(all(event));
    
    multiset<int> st;
    int k = 0;
    rep(i, q) {
        int d;
        cin >> d;
        while (k < 2*n) {
            int t, type, x;
            tie(t, type, x) = event[k];
            if (t > d) break;
            if (type == 1) {
                st.insert(x);
            } else {
                st.erase(st.find(x));
            }
            k++;
        }
        if (st.empty()) {
            cout << -1 << endl;
        } else {
            cout << *st.begin() << endl;
        }
    }
}


Measured memory_bytes: 17248
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;// 998244353;// ;
constexpr long long INF = numeric_limits<LL>::max() / 2;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourd; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge { LL from, to, cost; };
vector<vector<LL>>g, rev;
vector<edge>edges;
vector<LL>v;
map<LL, LL>ma;
set<LL>st;
LL h, w, n, m, k, t, s, p, q, last, cnt, sum, ans, a[510000], b[510000];
bitset<30>dp[50000];
string str, ss;
bool f;
char c;
struct Seg {
	LL n;
	vector<bitset<30>>node;
	Seg(LL n_) {
		n = 1; while (n < n_)n *= 2;
		node.resize(n * 2 - 1);
		rep(i, n)node[n + i - 1] = 0;
	}
	void update(LL i, LL x) {
		i = i + n - 1;
		node[i].reset();
		node[i][x] = 1;
		while (i > 0) {
			i = (i - 1) / 2;
			node[i] = node[i * 2 + 1] | node[i * 2 + 2];
		}
	}
	bitset<30> getsum(LL l, LL r) {
		return getsum(0, 0, n - 1, l, r);
	}
	bitset<30> getsum(LL i, LL a, LL b, LL l, LL r) {
		if (b < l || r < a)return 0;
		if (l <= a && b <= r)return node[i];
		return (getsum(i * 2 + 1, a, (a + b) / 2, l, r) | getsum(i * 2 + 2, (a + b + 1) / 2, b, l, r));
	}
};
Seg seg(500000);
int main() {
	cin >> n;
	cin >> str;
	rep(i, n) {
		seg.update(i, str[i] - 'a');
	}
	cin >> q;
	LL B = sqrt(n), Size = sqrt(n) + 1;
	rep(i, q) {
		LL x, y, z;
		cin >> x;
		if (x == 1) {
			cin >> y >> c;
			seg.update(y - 1, c-'a');
		}
		else {
			cin >> y >> z;
			y--, z--;
			cout<<seg.getsum(y, z).count() << endl;
		}
	}
	return 0;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    ll cookie[2];
    ll a, b;
    int k;
    cin >> cookie[0] >> cookie[1] >> k;
    for(int i = 0; i < k; i++){
        int checker = i % 2;
        if(cookie[checker] % 2 == 1){
            cookie[checker]--;
        }
        cookie[1 - checker] += cookie[checker] / 2;
        cookie[checker] = cookie[checker] / 2;
    }
    cout << cookie[0] << " " << cookie[1] << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def main():
    K = int(readline())
    dq = []
    for i in range(1, 10):
        dq.append(i)
    for i in range(K):
        v = dq[i]
        r = v%10
        if r == 9:
            dq.append(v*10+8)
            dq.append(v*10+9)
        elif r == 0:
            dq.append(v*10)
            dq.append(v*10+1)
        else:
            dq.append(v*10+(r-1))
            dq.append(v*10+r)
            dq.append(v*10+(r+1))
    print(dq[K-1])

if __name__ == '__main__':
    main()



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

int i, j, k, l = 1, m, n, e[100005], f[100005];
long long ans, tmp;
map<int, int> mp;
int main() {
	scanf("%d", &n);
	for(i = 0; i < n; i++) scanf("%d", &e[i]);
	sort(e, e + n);
	
	for(i = 0; i < n; i++) ++mp[e[i]];
	for(i = 1; i < n; i++) if(e[i] != e[i - 1]) e[l++] = e[i];
	for(i = 0; i < l; i++) if(mp[e[i]] >= 2) f[k++] = e[i];
	sort(f, f + k);
	if(!k || k == 1 && mp[f[0]] < 4) {
		printf("0\n");
		return 0;
	}
	if(k == 1 && mp[f[0]] >= 4) {
		tmp = f[0];
		printf("%lld\n", tmp * tmp);
		return 0;
	}
	if(mp[f[k - 1]] >= 4) f[k - 2] = f[k - 1];
	tmp = f[k - 1];
	tmp *= f[k - 2];
	printf("%lld\n", tmp);
	return 0;
}

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

#define rep(i,n) for(ll i = 0; i < n; i++)
#define per(i,n) for(ll i = n-1; i >= 0; i--)
#define REP(i,n) for(ll i = 1; i < n; i++)
#define PER(i,n) for(ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

  int a, b;
  cin >> a >> b;
  rep(i,1e7) {
    int c = double(i) * 0.1;
    int d = double(i) * 0.08;
    if(c == b && d == a) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}

Measured memory_bytes: 256
/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
**/

#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define     F           first
#define     S           second
#define     pb          push_back
#define     lb          lower_bound
#define     ub          upper_bound
#define     pii         pair<int,int>
#define     all(x)      x.begin(),x.end()
#define     fix         fixed<<setprecision(10)
#define     setbits(x)  __builtin_popcountll(x)
#define     rep(i,a,b)  for(int i=int(a);i<=int(b);i++)
#define     repb(i,b,a) for(int i=int(b);i>=int(a);i--)
#define     FastIO      ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

typedef double db;
typedef long long ll;

const int N=10005;
const int mod=1e9+7;

int n,p,f[N];
string s;
signed main(){
    FastIO;
    cin>>n>>p>>s;
    ll ans=0;
    if(p==2 or p==5){
        rep(i,0,n-1) if((s[i]-'0')%p==0) ans+=i+1;
    }
    else{
        int t=0,k=1;
        f[0]=1;
        repb(i,n-1,0){
            t=(k*(s[i]-'0')+t)%p;
            ans+=f[t];
            k=k*10%p;
            f[t]++;
        }
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 720
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int sub(int a,vector<char>b,int c,int d){
  if(c%2019==0&&c!=0)return 1;
  return sub(a+1,b,c+b[d]*a,d+1);
}
int main(){ 
  int a;cin>>a;
  cout<<a*(a+1)/2;
}


Measured memory_bytes: 256
#e
n=int(input())
a=list(map(int,input().split()))

sa = [i-a[i] for i in range(n)]
wa = [i+a[i] for i in range(n)]

from collections import Counter

c_sa = Counter(sa)
c_wa = Counter(wa)
cand = set(c_sa.keys()) & set(c_wa.keys())
print( sum(c_sa[c]*c_wa[c] for c in cand) )

Measured memory_bytes: 170176
#include <iostream>                                                  
#include <cstdio>                                                    
#include <cstring>                                                   
using namespace std;                                                 
                                                                     
int main() {                                                         
  int n, m, l;                                                       
  cin >> n >> m >> l;                                                
  int a[n][m], b[m][l];                                              
  long long c[n][l];                                                 
  memset(c,0,sizeof(c));                                             
  for (int i=0; i<n; i++) {                                          
    for (int j=0; j<m; j++) {                                        
      cin >> a[i][j];                                                
    }                                                                
  }                                                                  
  for (int i=0; i<m; i++) {                                          
    for (int j=0; j<l; j++) {                                        
      cin >> b[i][j];                                                
    }                                                                
  }                                                                  
  for (int i=0; i<n; i++) {                                          
    for (int j=0; j<l; j++) {                                        
      for (int k=0; k<m; k++) {                                      
        c[i][j] += a[i][k]*b[k][j];                                  
      }                                                              
    }                                                                
  }                                                                  
  for (int i=0; i<n; i++) {                                          
    for (int j=0; j<l; j++) {                                        
      cout << (i>=0 && j==0?"":" ") << c[i][j] << flush;             
    }                                                                
    printf("\n");                                                    
  }                                                                  
  return 0;                                                          
}               

Measured memory_bytes: 3168
#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; }

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(ll i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const double PI = 3.1415926535;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;

int main(){
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<int>l(n);
    rep(i, 0, n)cin >> l[i];
    int MP = 100100100;
    int cnt = 0;
    for(int bit1=0; bit1<(1<<n); bit1++){
        for(int bit2=0; bit2<(1<<n); bit2++){
            int tempMP = 0;
            vector<int>v(4);
            rep(i, 0, n){
                if(bit1&(1<<i)&&bit2&(1<<i)){
                    if(v[0]!=0)tempMP += 10;
                    v[0]+=l[i];
                }else if(!(bit1&(1<<i))&&bit2&(1<<i)){
                    if(v[1]!=0)tempMP += 10;
                    v[1]+=l[i];
                }else if(bit1&(1<<i)&&!(bit2&(1<<i))){
                    if(v[2]!=0)tempMP += 10;
                    v[2]+=l[i];
                }else{
                    v[3]+=l[i];
                }
            }
            if(v[0]==0||v[1]==0||v[2]==0)continue;
            tempMP += abs(v[0]-a);
            tempMP += abs(v[1]-b);
            tempMP += abs(v[2]-c);
            MP = min(MP, tempMP);
            cnt++;
        }
    }
    //cout << cnt << endl;
    cout << MP << endl;
}

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

typedef long long ll;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

int main(){
    string S,x,ans;
    int a_num,b_num;
    cin >> S;
    ans ="";
    rep(i,0,S.length()){
        ans += "x";
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
    int n, i;
    long long int R, Rmin = 1000000000, Rdmax = -1000000000;
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &R);
	if (i != 0 && Rdmax < R - Rmin) 
            Rdmax = R - Rmin;
	if (R < Rmin) 
	    Rmin = R;
    }
    printf("%d\n", Rdmax);
    return 0;
}





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

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int a, b, c, d; cin >> a >> b >> c >> d;
	if (abs(a-c) <= d || max(abs(a-b), abs(b-c)) <= d) {
		cout << "Yes" << '\n';
	} else {
		cout << "No" << '\n';
	}

	return 0;
}


Measured memory_bytes: 256
#include <string.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define REP1(i,n) for(int i=1;i<=(n);++i)

#define SORT(V) sort((V).begin(), (V).end())

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double


int N, M;
map<int, int> pp;
vector<int> p1;
vector<int> p2;
vector<int> a;

int main() {
  cin >> N >> M;
  int n = 2;
  int m = M;
  while (true) {
    if (n > m) {
      break;
    }
    if (N > 1 && (n * N > M)) {
      break;
    }
    if (m % n == 0) {
      pp[n]++;
      // cout << p << endl;
      m = m / n;
    } else {
      n++;
    }
  }
  if (pp.size() == 0) {
    cout << 1 << endl;
    return 0;
  }
  for (auto p : pp) {
    p1.push_back(p.ST);
    p2.push_back(p.ND);
    //cout << p.ST << " " << p.ND << endl;
  }
  a.resize(p1.size());
  int i = 0;
  bool ok = true;
  int max = 0;
  while (ok) {
    // eval
    int v = 1;
    REP(i, a.size()) {
      //cout << p1[i]<<"^"<<a[i] << "*";
      REP(j, a[i]) {
        v *= p1[i];
      }
    }
    //    cout << endl;
    if (M / v >= N) {
      if (v > max) {
        max = v;
      }
    }
    while (true) {
      if (a[i] < p2[i]) {
        a[i]++;
        i = 0;
        break;
      } else {
        a[i] = 0;
        i++;
        if (i == p2.size()) {
          ok = false;
          break;
        }
      }
    }
  }
  cout << max << endl;
  // 2^9*5^9
  // 2,4,8,10,16,
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
  int d;
  cin>>d;
  if(d==25)cout<<"Christmas"<<endl;;
  if(d==24)cout<<"Christmas Eve"<<endl;;
  if(d==23)cout<<"Christmas Eve Eve"<<endl;
  if(d==22)cout<<"Christmas Eve Eve Eve"<<endl;
}
  

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59



int main(){
  ll i,j;
  ll n;
  cin>>n;
  ll ans=0;
  ll p[n];
  for(i=0;i<n;i++) cin>>p[i];
  for(i=1;i+1<n;i++){
    if(p[i-1]<p[i]&&p[i]<p[i+1]) ans++;
    if(p[i-1]>p[i]&&p[i]>p[i+1]) ans++;
  }
  cout<<ans<<endl;
  return 0;  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}


int main(){
	string S;
	cin >> S;
	bool C = false, F = false;
	for(auto& c : S){
		if(c == 'C') C = 1;
		if(c == 'F' && C) F = 1;
	}

	Cout(Yes(C & F));
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scanf("%d", &N)
	for i := 0; i <= N; i += 7 {
		if (N-i)%4 == 0 {
			fmt.Printf("Yes\n")
			return
		}
	}
	fmt.Printf("No\n")
}


Measured memory_bytes: 512
import java.util.Scanner;
import java.lang.Math;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);	
		double n = scan.nextInt();
		int[] data = new int[(int)n];
		double sum=0;
		while(n!=0){
			for(int i=0;i<n;i++){
				data[i]=scan.nextInt();
			}
			double ave=average(data,n);
			for(int i=0;i<n;i++){
				sum+=(data[i]*data[i]);
			}
			System.out.println(Math.sqrt(sum/n-ave*ave));
			n=scan.nextInt();
			data = new int[(int)n];
			sum=0;
		}
	}
	public static double average(int[] data,double n){
		double sum=0;
		for(int i=0;i<n;i++){
			sum+=data[i];
		}
		return sum/n;
	}
}

Measured memory_bytes: 23752
#入力取得
N, K = map(int, input().split())

p = 0

for i in range(1, N + 1):
    point = i
    temp_p = 1/N
    while point < K:
        point = 2 * point
        temp_p = temp_p * 1/2

    p = p + temp_p


print(p)


Measured memory_bytes: 3060
#include <cstdio>
#include <iostream>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;

int n, m;
int a[110], b[110], c[110], d[110], e[110];
const int inf = 1000000;

int main(void){
    cin >> n >> m;
    if (m == 1){
        int ans = 1;
        rep(i, 0, n){
            ans = (ans * 2) % inf;
        }
        cout << ans << endl;
    }else{
        a[0] = 1;
        b[0] = c[0] = d[0] = e[0] = 0;
        rep(i, 1, n){
            a[i] = (a[i - 1] + b[i - 1] + c[i - 1] + e[i - 1]) % inf;
            b[i] = (a[i - 1] + b[i - 1] + c[i - 1]) % inf;
            c[i] = (a[i - 1] + b[i - 1] + c[i - 1] + d[i - 1]) % inf;
            d[i] = (a[i - 1] + d[i - 1]) % inf;
            e[i] = (c[i - 1] + e[i - 1]) % inf;
        }
        int ans = (4 * a[n - 1] + 3 * (b[n - 1] + c[n - 1]) + 2 * d[n - 1] + e[n - 1]) % inf;
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 3124
$<.gets.to_i.times do
  given = $<.gets.chomp.split(/(->|<-)/)
  train = [given.shift]
  while (dir = given.shift)
    car = given.shift
    next if train.include?(car)
    (dir == "->") ? train.push(car) : train.unshift(car)
  end
  puts train.join
end


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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    string s, t;
    cin >> s >> t;
    cout<<t<<s<<endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string A,B;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B;
	if(A[0]!=B[2]) return _P("NO\n");
	if(A[1]!=B[1]) return _P("NO\n");
	if(A[2]!=B[0]) return _P("NO\n");
	_P("YES\n");
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256