akhauriyash/Code-Regression huggingface dataset:
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}
 
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }
 
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }
 
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    // let w: f64 = sc.read();
    // let h: f64 = sc.read();
    // let x: f64 = sc.read();
    // let y: f64 = sc.read();
    // let ans = (w * h) / 2.0;
    // let num = (((x * 2.0) == w) && ((y * 2.0) == h)) as u8;

    let w: u64 = sc.read();
    let h: u64 = sc.read();
    let x: u64 = sc.read();
    let y: u64 = sc.read();
    let ans = (w * h) as f64 / 2.0;
    let num = if ((x * 2) == w) && ((y * 2) == h) { 1 } else { 0 };
    println!("{:.6} {}", ans, num);
}

Measured memory_bytes: 4352
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <climits>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <cstring>
#include <numeric>
#include <set>

#define INF 2000000000
#define MOD 1000000007
#define sp ' '
#define endl "\n"
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define FOR(YY, yy) for(long long yy = 0; yy < YY; ++yy)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;
typedef vector<pair<int, pair<int, int> > > vpip;
typedef vector<bool> vb;
typedef priority_queue<int> pqi;

int main(int argc, char **argv)
{
    ios::sync_with_stdio(); cin.tie(0);
    int N, K; cin >> N >> K;

    int ans = 0;
    for(int i = 0; i < N; ++i)
    {
        int temp; cin >> temp;
        if(temp >= K) ans++;
    }
    cout << ans << endl;


    return 0;
}

//cikisir



Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    int i,n,a;
    int count = 0;
   
    scanf("%d", &n);
    for(i = 0; i < n; i++){
       scanf("%d",&a);
       if(sosu(a))
         count++; 
    }
       
    printf("%d\n",count);
    return 0;
}

int sosu(int a){
    int i;
    if (a <= 1) return 0;

    else if(a == 2)return 1;
    
    if(a%2==0) return 0;
    

    for(i = 3; i*i <= a; i+=2){
        if (a%i == 0)
           return 0;
           
    }
    return 1;
}






           

Measured memory_bytes: 596
import sys
# from collections import deque
# import bisect
# import math
# import itertools
# from queue import deque
# from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


N, M = inp_list()
X = inp_list()
X.sort()
# print(X)

if N >= M:
    print(0)
    exit()

d = [X[i + 1] - X[i] for i in range(M - 1)]
# for i in range(M - 1): d.append(X[i + 1] - X[i])
# print(d)
d.sort()
ans = sum(d[: M - 1 - (N - 1)])
# ans = 0
# for i in range(M - 1 -  (N - 1)):
    # ans += d[i]
print(ans)


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

using namespace std;

#define X first
#define Y second
#define eps  1e-5
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;

const int maxn = 1e5+7;
const int INF  = 1<<30;
const int mod  = 1e9+7;

int s[maxn];

void solve(){
    long long n;
    cin>>n;
    long long ans = n*(n+1)/2 - n;
    cout<<ans<<endl;
    return;
}

int main()
{
#ifndef ONLINE_JUDGE
   // freopen("in.txt","r",stdin);
#endif
//    freopen("out.txt","w",stdout);
//    ios::sync_with_stdio(false);
    int t = 1;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ",cas++);
        solve();
    }
#ifndef ONLINE_JUDGE
  //  printf("%.10f\n",1.0*clock()/CLOCKS_PER_SEC);
#endif
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long int lli;
const lli mod = 1e9 + 7;

int main(){
	int n;
	cin >> n;
	vector<lli> a(n+1);
	vector<lli> factor(n+1, 0);
	for(int i=0; i<=n; i++) a[i] = i;
	for(int i=2; i<=n; i++){
		if(a[i] == 1) continue;
		for(int j=2*i; j<=n; j+=i){
			while(a[j]%i == 0){
				a[j] /= i;
				factor[i]++;
			}
		}
		a[i] = 1;
		factor[i]++;
	}
	lli ans = 1;
	for(int i=2; i<=n; i++){
		ans = ans *(factor[i]+1) %mod;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define ff first
// #define mp make_pair
#define ss second
#define rep(i,a,b) for(int i = a; i < b; i++)
#define repp(i,a,b) for(int i = a; i <= b; i++)
#define endl '\n'
#define mod 1000000007
#define mod_in(a) bin(a, mod - 2)
#define ncr(n, r) (n >= r ? ((ft[n] * mod_in((ft[r] * ft[(n)-(r)]) % mod)) % mod) : (int)0)
#define pi 3.14159265358979323
#define INF 1e15
#define lb(v, a) lower_bound(v.begin(), v.end(), a)
#define ub(v, a) upper_bound(v.begin(), v.end(), a)

int power(int x, int n){
    int res=1;
    while(n>0){
        if(n&1)
            res=res*x;
        x*=x;
        n>>=1;
    }
    return res;
}

int bin(int x, int n){
    int res=1; x%=mod;
    while(n){
        if(n&1) res=(res*x)%mod;
        x=(x*x)%mod;
        n>>=1;
    }
    return res%mod;
}
// vector<int> ft;

// int ncr(int n, int r){
//     if(n>=r){
//         return (ft[n] * mod_in((ft[r] * ft[(n)-(r)]) % mod)) % mod;
//     }
//     else return 0;
// }

bool prime(int n){
    if(n==3)return 1;
    repp(i,2,sqrt(n)){
        if(n%i==0)return 0;
    }
    return 1;
}

// vector<int> adj[100001];
// int flag=0, x, y, f=0;
// int vis[100001]={0}, par[200001]={0}, top[500001], pop[100001]={0}, g[100001], b[100001];
// int p[100001], h[100001];

// void dfs(int n){
//     vis[n] = 1;
//     pop[n]=p[n];
//     for(auto i: adj[n]){
//         if(!vis[i]){ 
//             dfs(i);
//             pop[n] += pop[i];
//         }
//     }
// }


// vector<int> pr(2000005, 1), xx[2000005];
// void sieve(int n){ 
//     for(int p=2; p<n; p++){ 
//         if(pr[p]){ 
//             for(int i=p; i<n; i += p){
//                 pr[i]=0;
//                 xx[i].pb(p);
//             }
//         } 
//     } 
// }  

void solve(){
    int ans=0, x=0;
    string s; cin>>s;
    rep(i,0,3) if(s[i]=='R')x++; else{ ans= max(ans, x); x=0;}
    ans= max(ans, x);
    cout<<ans<<endl;
}

signed main(){
    fast
    // ft.pb(1);
    // rep(i,1,2000005) ft.pb((ft[i-1]*i)%mod);
    int t=1;
    // cin>>t;
    while(t--) solve();
}

Measured memory_bytes: 3696
package main

import (
    "fmt"
    // "sort"
)

func ds(x int) int {
	s:=0
	for ; x > 0 ; {
		s+=x%10
		x/=10
	}
	return s;
}

func main() {
    var n int
    // fmt.Scan(&n, &x)
    // nums := make([]int,n);
    fmt.Scan(&n)
    ans :=1000

    var d int 
    for i := 1; i < n; i++ {
    	d = ds(i) + ds(n-i)
    	if d<ans {
    		ans=d
    	}
    }


	fmt.Println(ans)
}

Measured memory_bytes: 512
#include<cstdio>
#include<stdlib.h>

int main(){
    int n, arr[201], m, r;
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        scanf("%d", &arr[i]);
        m+=arr[i];
    }
    for(int i=0;i<n;i++){
        int a = 0, b = 0;
        for(int j=0;j<i;j++){
            a+=arr[j];
        }
        for(int j=i;j<n;j++){
            b+=arr[j];
        }
        r = abs(a-b);
        if(r<m){
            m = r;
        }
    }
    printf("%d", m);
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
string to_str(int a){
	string s="";
	while(a){
		s=(char)(a%10+'0')+s;
		a/=10;
	}
	if(s=="")s="0";
	return s;
}
int main(){
	int q;
	cin>>q;
	while(q--){
		string s;
		cin>>s;
		int out=0;
		while(s.size()!=1){
			int t=s[0]+s[1]-'0'-'0';
			s=to_str(t)+s.substr(2);
			out^=1;
		}
		if(!out)cout<<"Audrey wins."<<endl;
		else cout<<"Fabre wins."<<endl;
	}
}

Measured memory_bytes: 1216
#include "bits/stdc++.h"
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define LL long long
int n;
int a[100000];
int v[100000];

int main(){
  cin >> n;
  REP(i,n)cin>>a[i];
  REP(i,n)v[a[i]-1]=i+1;
  REP(i,n){
    if(i==n-1)cout<<v[i];
    else cout<<v[i]<<" ";
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 1536
import java.util.*;
public class Main {
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] a = new int [n];
		for (int i = 0; i < n; ++i){
			a[i]=Integer.parseInt(scan.next());
		}

		long sum = 0;
		for (int i = 0; i < n; ++i){
			sum+=a[i];
		}
		System.out.print(sum-n);



}
}
//end

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

using namespace std;
using ll = long long;

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

int main() {
  int a, b;
  cin >> a >> b;
  string ans;
  rep(i, max(a, b)) ans += '0' + min(a, b);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define  rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first 
#define ss second 
#define pp pair<ll,ll>
#define eps 1e-6
#define ll  long long
#define endl '\n'
void solve()
{
  ll n, a,m=0,b=0, k=0, i, j,l=2e9+7;
  string s, r, y;
  cin>>n>>a>>m>>b;
  /*ll ar[n];
  rep(i,0,n){ cin>>ar[i];k+=ar[i];}
  m=abs(k-ar[0]);
  rep(i,0,n)
  {
    b+=ar[i];
    ll z=k-b;
    m=min(m,abs(z-b));*/
 double z=((double)(n)*(double)(a))/(double)(2);
 cout<<z<<" ";
 if(2*m==n && 2*b==a) cout<<1;
 else cout<<0;
  //k=min(n+a,min(n+b,a+b));
 // cout<<m;
  /*if(n<a) cout<<0;
  else cout<<10;*/
}
int main()
{
 ios_base::sync_with_stdio(false);
  cin. tie(0);cout. tie(0);
    ll t=1;
 //  cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}

Measured memory_bytes: 3776
#include<iostream>
#include<string>
using namespace std;
#define df 0
typedef long int li;

int main(){
  if(df) printf("*debug mode*\n");
  string s; cin >>s;
  li ans=0;
  int flag=(s.at(0)=='<')?0:1;
  li inc=0,dec=0;
  for(int i=0;i<s.size();i++){
    if(flag==0){
      if(s.at(i)=='<'){
	inc++;
      }else{
	flag=1;
	dec++;
      }
    }else{
      if(s.at(i)=='>'){
	dec++;
      }else{
	if(inc<dec)inc--;
	else dec--;
	ans+=inc*(inc+1)/2+dec*(dec+1)/2;
	dec=0;inc=1;flag=0;
      }
    }
  }
  if(flag==0){
    ans+=inc*(inc+1)/2;
  }else{
    if(inc<dec)inc--;
    else dec--;
    ans+=inc*(inc+1)/2+dec*(dec+1)/2;
  }
  cout << ans;
}

/// confirm df==0 ///


Measured memory_bytes: 900
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int m = 0;

    scanf("%d", &m);
    if (m == 25)
    {
        printf("Christmas\n");
    }
    if (m == 24)
    {
        printf("Christmas Eve\n");
    }
    if (m == 23)
    {
        printf("Christmas Eve Eve\n");
    }
    if (m == 22)
    {
        printf("Christmas Eve Eve Eve\n");
    }

    return 0;
}

Measured memory_bytes: 128
p = int(input())
a = list(map(int,input().split()))
mod = p
rng = 10100
fctr = [1]
finv = [1]
for i in range(1,rng):
  fctr.append(fctr[-1]*i%mod)
for i in range(1,rng):
  finv.append(pow(fctr[i],mod-2,mod))
def inv(x):
  return pow(x,mod-2,mod)
def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*finv[n-k]*finv[k]%mod
ans = [0]*p
for i in range(p):
  if a[i]:
    ans[0] += 1
    const = 1
    for j in range(p):
      ans[-j-1] -= ((-1)**(j%2))*cmb(p-1,j)*const
      ans[-j-1] %= mod
      const *= i
      const %= mod
print(*ans)

Measured memory_bytes: 45020
#include<stdio.h>
int main(void)
{
	int h,w,i,j;
	while(1){
		scanf("%d %d",&h,&w);
		if(h==0&&w==0) break;
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if((i+j)%2==0) printf("#");
				else printf(".");
				}
			puts("");
			}
		puts("");
	}
	return 0;
}

Measured memory_bytes: 588
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    abs <- sort . map (\(a : b : _) -> (b, a)) <$> replicateM n getIntList
    putStrLn $ if fst (foldl task (True, 0) abs) then "Yes" else "No"

task (tf, sa) (b, a) = (tf', sa')
    where sa' = sa + a
          tf' = tf && sa' <= b

Measured memory_bytes: 109948
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}
ll LCM(ll x, ll y) { 
  return x / GCD(x, y) * y;
}

int main(){
  int n; cin >> n;
  double ans;
  if(n % 2 == 0) ans = (double)1 / (double)2;
  else ans = (double)(n/2 + 1) / (double)n;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
int main() {
	int n,S=0;
	char a[10];
	std::string str0, str1;
	std::cin >> str0 >> n;
	for (int i = 0; i < n; i += 1) {
		for (int j = 0; j < 10; j += 1)
			std::cin >> a[j];
		int flag = 0;
		for (int j = 0; j < 20; j += 1) {
			if (str0[flag] == a[j%10])
				flag += 1;
			if (flag == str0.size()) {
				S += 1;
				break;
			}
		}
	}
	std::cout << S << std::endl;
	return 0;
}

Measured memory_bytes: 3152
import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val n = nextInt()
    var v = listOfFloat().sorted().toMutableList()

    while (v.size > 1) {
        v[1] = (v[0] + v[1]) / 2f
        v.removeAt(0)
        v = v.sorted().toMutableList()
    }

    println(v[0])
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfFloat() = listOfString().map { it.toFloat() }

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 38052
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
  int n;
  cin >> n;
  vector<ll> v(3*n);
  rep(i,3*n) cin >> v[i];
  sort(v.rbegin(), v.rend());
  ll ans = 0;
  int c = 0;
  for(int i = 0; i < 3*n; i++) {
    if (c == n) break;
    if (i%2 != 0) {
      c++;
      ans += v[i];
    }
  }
  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}

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

int main(){
  int a,b;
  //string a, b, c, d;
  cin >> a >> b;// >> x;
  //cin >> s;
  //if(a<=x&&x<b)cout << "YES" << endl;
  //else cout << "NO" << endl;
  //else cout << (a+b)/2 << endl;
  //int x, y;
  //x = min(a,b);
  //y = min(c,d);
  cout << max(max(a+b, a-b), a*b) << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long
ll res[10000001];

int main(){
ll n; cin>>n;
/*for(int i=1;i<=n;i++)
    res[i]=1;*/

for(ll i=1;i*i<=n;i++){
	for(ll j=i;i*j<=n;j++){
        if(i!=j)
            res[i*j]=res[i*j]+2;
        else
            res[i*j]++;
	}
}
res[0]=0;
ll sum=0;
for(ll i=1;i<=n;i++)
    sum=sum+(i*res[i]);
cout<<sum;
}


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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    LL N;
    cin >> N;
    map<string, LL> dic;
    REP(i, N) {
        string s;
        cin >> s;
        sort(ALL(s));
        dic[s]++;
    }
    LL res = 0;
    for(auto i = dic.begin();i != dic.end();i++) {
        res += (i->second)*(i->second - 1)/2;
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 11136
//PRINCE
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
#define PI acos(-1)
#define ll long long int 
typedef vector<ll> vll;
typedef vector<int> vii;

#define MOD 1000000007
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";

ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll power(ll x,ll n){if(n==0)return 1;if(n%2)return x*power(x*x,(n-1)/2);return power(x*x,n/2);}
ll powerm(ll x,ll n){if(n==0)return 1;if(n%2)return (x*powerm((x*x)%MOD,(n-1)/2))%MOD;return powerm((x*x)%MOD,n/2);}
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 1e9+5;
int32_t main()
{

    //kiimati 4 line for sublime text
   
    ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);//FAST
  	int N;cin>>N;
  	vector<long long int> cache(N,INF);
  	vector<int> A(N);
  	cache[0]=0;
  	for(int i=0;i<N;i++)
  	{
  		cin>>A[i];
  	}
  	for(int i = 0; i<N ; i++)
  	{
  		for(int j : {i+1, i+2})
  		{
  			if(j<N)
  			{
  				cache[j]=min(cache[j],cache[i]+abs(A[i]-A[j]));
  			}
  		}	
  	}
  	cout<<cache[N-1]<<"\n";
    return 0;
}


Measured memory_bytes: 1408
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		String[] str = line.split(" ");
		int n = Integer.parseInt(str[0]);
		int a = Integer.parseInt(str[1]);
		int b = Integer.parseInt(str[2]);
		if ((b - a) % 2 == 1) {
			System.out.println("Borys");
		} else {
			System.out.println("Alice");
		}
	}
}

Measured memory_bytes: 23252
#%%
n, m, k = map(int, input().split())

l = []

for i in range(n+1):
    for j in range(m+1):
        tmp = i*j + (n-i)*(m-j)
        l.append(tmp)

l = list(set(l))
l.sort()

if k in l:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 54956
#include<bits/stdc++.h>
using namespace std;
char s[150];
int main()
{
	cin>>s;
	int n;
	n=strlen(s);
	int i;
	for(i=0;i<n;i++)
	{
		if(i%2==0)
		{
			if(s[i]=='R'||s[i]=='U'||s[i]=='D')
			continue;
			else
			break;
		}
		if(i%2==1)
		{
			if(s[i]=='L'||s[i]=='U'||s[i]=='D')
			continue;
			else
			break;
		}
	}
	if(i==n)
	printf("Yes");
	else
	printf("No");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, to) for (int i = 0; i < (to); ++i)
#define repf(i, from, to) for (int i = (from); i < (to); ++i)
#define unless(cond) if (!(cond))
using namespace std;
using ll = long long;
template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;

int main() {
  int a, b;
  cin >> a >> b;

  int product = a * b;

  if(product % 2 == 1) {
    cout << "Odd" << endl;
  } else {
    cout << "Even" << endl;
  }
}

Measured memory_bytes: 3648
#include <iostream>
using namespace std;
int main(void)
{
    int N = 0;
    cin >> N;

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

    int kaisu = 0;
    int max = 0;

    for (int i = 0; i < N - 1; i++)
    {
        for (int j = 0; j < N-i-1; j++)
        {
            if (H[i+j] >= H[i+j+1])
            {
                kaisu++;
                
            }
            else
            {
                //cout << kaisu;
                break;
            }
            
        }
        i += kaisu;
        if (kaisu > max)
        {
            max = kaisu;
        }
        kaisu = 0;
        
    }
    //cout << endl;
    
    cout << max << endl;
    
    return 0;
}

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

int main()
{
	int n,m,c;
	cin>>n>>m>>c;
	int a[n][m], b[m];
	for(int i=0;i<m;i++) cin>>b[i];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
			cin>>a[i][j];
	}
	int ans = 0;
	for(int i=0;i<n;i++)
	{
		int p = 0;
		for(int j=0;j<m;j++)
		{
			p+=a[i][j]*b[j];
		}
		if(p+c>0) ans++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int c=0;
  int arr[n+1];
  for(int i=1;i<=n;i++){
    cin>>arr[i];
    if(i%2!=0 && arr[i]%2!=0)
      c++;
  }
  cout<<c<<"\n";
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (auto& e : p) cin >> e;
  sort(p.rbegin(), p.rend());
  int i = 0;
  for (; i < n; i++) {
    if (i + 1 > p[i]) break;
  }
  cout << i << "\n";
}


Measured memory_bytes: 3100
N, W = map(int, input().split())
a = [list(map(int, list(input().split()))) for i in range(N)]
dp = [[0]*(W+1) for i in range(N)]  # initialize dp

for i in range(N):
    for k in range(W+1):
        if i == 0:
            if a[0][0] <= k and k <= W:
                dp[0][k] = a[0][1]
        else:
            if a[i][0] <= k and k <= W:
                dp[i][k] = max(dp[i-1][k], dp[i-1][k-a[i][0]] + a[i][1])
            else:
                dp[i][k] = dp[i-1][k]
print(dp[N-1][W])

Measured memory_bytes: 120048
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))

typedef long long ll;
typedef __int128_t lll;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
void dout(double d){printf("%.12f\n",d);}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int n, c[3];
double DP[302][302][302];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n){
    int a;
    cin >> a;
    c[a-1]++;
  }
  FOR(i, 0, c[2]+1)FOR(j, 0, c[1]+c[2]-i+1)FOR(k, 0, n-i-j+1) if(i||j||k){
    DP[i+1][j+1][k+1] = (
        DP[i][j+2][k+1]*i +
        DP[i+1][j][k+2]*j +
        DP[i+1][j+1][k]*k +
        n
      ) / (i+j+k);
  }
  dout(DP[c[2]+1][c[1]+1][c[0]+1]);
}

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

int x[60];
long long f[60][3010];

int main(){
	int n, A;
	scanf("%d%d", &n, &A);
	for (int i = 0; i < n; i++){
		scanf("%d", &x[i]);
	}
	f[0][0] = 1;
	for (int i = 0; i < n; i++){
		for (int j = n; j >= 1; j--){
			for (int k = 3000; k >= x[i]; k--){
				f[j][k] += f[j - 1][k - x[i]];
			}
		}
	}
	long long ans = 0;
	for (int i = 1; i <= n; i++){
		ans += f[i][i * A];
	}
	printf("%lld\n", ans);
	return 0;
}


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

class Class_
{
	void Test()
	{
		var card = A_Int_();
		var c0 = card[0];
		var c1 = card[1];
		if (c0 == 1) c0 = 14;
		if (c1 == 1) c1 = 14;
		string s = "";
		if (c0>c1) {
			s ="Alice";
		} else if(card[0] == card[1]) {
			s = "Draw";
		}	 else {
			s = "Bob";
		}
	
		Console.WriteLine(s);
	}

	static void Main(string[] args)
  {
    new Class_().Test();
  }

  #region

  string S_String_()
  {
    return Console.ReadLine();
  }

	//
	string[] A_String_()
  {
    return Console.ReadLine().Split();
  }

  int[] A_Int_(int n)
  {
    var x = new int[n];
    for (var i = 0; i < n; i++)
    {
      x[i] = int.Parse(Console.ReadLine());
    }
    return x;
  }

	//
	int[] A_Int_()
  {
    var ss = Console.ReadLine().Split();

    var x = new int[ss.Length];
    for (var i = 0; i < ss.Length; i++)
      x[i] = int.Parse(ss[i]);

    return x;
  }
  #endregion
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()

int main() {
 ll n,k;
  cin>>n>>k;
  vector<ll> a(n);
  rep(i,n) cin>>a[i];
  vector<ll> count(n+1);
  rep(i,n) count[a[i]]++;
  sort(all(count));
  reverse(all(count));
  ll ans=0;
  rep2(i,k,n+1) ans+=count[i];
  cout<<ans<<endl;
return 0;
}


Measured memory_bytes: 3328
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdint>
using namespace std;
using i64 = int64_t;

int main(void){
    i64 a, b, k;
    cin >> a >> b >> k;
    if(k <= a) a -= k;
    else if(k <= a + b){b -= k - a; a = 0;}
    else{a = 0; b = 0;}
    cout << a << ' ' << b << '\n';
    return 0;
}

Measured memory_bytes: 3608
N = int(input())
S = list(input())
a = 0
b = 0
A = []
for i in range(N):
  if S[i] == '.':
    a += 1
  else:
    b += 1
  A.append(b-a)
A.sort()
ans = min(a, b, a+A[0])
print(ans)

Measured memory_bytes: 19524
#include <iostream>

using namespace std;

int main(void){
    int N,M;
    int K[30],A[30][30];
    int L[30]={},res=0;

    cin >> N >> M;
    for(int i=0; i<N; i++){
        cin >> K[i];
        for(int j=0; j<K[i]; j++) cin >> A[i][j];
    }

    for(int i=0; i<N; i++){
        for(int j=0; j<K[i]; j++) {
            L[ A[i][j]-1 ]++;
        }
    }
    
    for(int i=0; i<M; i++){
        if(L[i] == N) res++;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//--<for debugging>
#define whatis(x) cout << #x << " is " << x<<" ";
#define whatisl(x) cout << #x << " is " << x<<"\n";
#define parr(array,end)for(ll loop=0;loop<end;loop++)cout<<array[loop]<<" ";cout<<"\n";
#define lline cout<<"\n";
#define errorl(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"\n";}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"___";}
    
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a <<" , ";
    err(++it, args...);
}
//--</for debugging> 
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define testcase ll tt; cin >> tt; while(tt--)
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define vars ll h,i,j,k,d,l,p,q,r,x,y,a,b,c,v,var,n,m,z,s,ans,ind1,ind2,flag,limit1,limit2,limit3,mod;
#define vll vector<ll>
#define pll pair<ll,ll>
#define sll set<ll>
#define pint pair<int,int>
const ll INF=1e9+7;
const ll MOD=1e9+7;
int main()
{
    boost vars
    cin>>n;
    ll arr[n+1]={0};
    for(i=0;i<n-1;i++)
    {
        cin>>v;
        arr[v]++;
    }
    for(i=1;i<=n;i++)
    {
        cout<<arr[i]<<"\n";
    }
}

Measured memory_bytes: 5224
while t = gets
	cards = Array.new(11,1)
	a,b,c = t.split.map &:to_i
	cards[a] = 0
	cards[b] = 0
	cards[c] = 0
	r = 20 - a - b
	count = 0
	r = 10 if r > 10
	r.times { |i|
		count += cards[i + 1]
	}
	puts ["NO", "YES"][count/4]
end

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

using namespace std;
typedef long long ll;
const int N=110000;
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll a[N],save,i,j,dp[N],n,k;
	cin>>n>>k;
	for(i=0;i<n;++i) cin>>a[i];
	dp[0]=0; dp[1]=abs(a[0]-a[1]);
	for(i=2;i<n;i++){
		save=((save=i-k)<0?0:save);
		dp[i]=abs(a[i]-a[save])+dp[save++];
		for(j=save;j<i;++j) dp[i]=min(dp[i],abs(a[i]-a[j])+dp[j]);
	}
	cout<<dp[n-1];
}

Measured memory_bytes: 1792
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int c = sc.nextInt();
    int a,b,d;
    a = sc.nextInt();
    int x[] = new int [a];
    d = 0;
    for(b =0;b < a;b++){
      x[b] = sc.nextInt();
      d = d + x[b];
    }
    int e = c-d;
    if(e >= 0){
      System.out.println(e);
    }else{
      System.out.println("-1");
    }
  }
}

Measured memory_bytes: 46440
#include <stdio.h>
#include <string.h>

#define M 1046527
#define NIL (-1)
#define L 14

char H[M][L];

// 文字から数値
int getChar(char ch) {
  if (ch == 'A') return 1;
  else if (ch == 'C') return 2;
  else if (ch == 'G') return 3;
  else if (ch == 'T') return 4;
  else return 0;
}

// 文字列から数値
long long getKey(char str[])
{
  long long sum = 0, p = 1;
  for (int i = 0; i < strlen(str); i++) {
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key) {return key % M;}
int h2(int key) {return 1 + (key % (M-1));}

int find(char str[]) {
  long long key = getKey(str), h;
  for (int i = 0; ; i++) {
    h = (h1(key) + i * h2(key)) % M;
    if (strcmp(H[h], str) == 0) return 1;
    else if (strlen(H[h]) == 0) return 0;
  }
  return 0;
}

int insert(char str[]) {
  long long key = getKey(str), h;
  for (int i = 0; ; i++) {
    h = (h1(key) + i * h2(key)) % M;
    if (strcmp(H[h], str) == 0) return 1;
    else if (strlen(H[h]) == 0) {
      strcpy(H[h], str);
      return 0;
    }
  }
  return 0;
}

int main(void)
{
  int n, h;
  char str[L], com[9];
  for (int i = 0; i < M; i++)
    H[i][0] = '\0';
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s%s", com, str);
    if (com[0] == 'i') {
      insert(str);
    } else {
      if (find(str)) {
        printf("yes\n");
      } else {
        printf("no\n");
      }
    }
  }
  return 0;
}



Measured memory_bytes: 16048
#include<iostream>
using namespace std;
int main()
{
  int h,w;
  cin >> h >> w;
  char s[h+1][w+1];
  for(int i=1;i<=h;++i){
    for(int j=1;j<=w;++j){
      cin >> s[i][j];
    }
  }
  
  for(int i=1;i<=h;++i){
    for(int j=1;j<=w;++j){
      if(s[i][j]=='.'){
        int x=0;
        if(s[i-1][j-1]=='#'){++x;}
        if(s[i-1][j]=='#'){++x;}
        if(s[i-1][j+1]=='#'){++x;}
        if(s[i][j-1]=='#'){++x;}
        if(s[i][j+1]=='#'){++x;}
        if(s[i+1][j-1]=='#'){++x;}
        if(s[i+1][j]=='#'){++x;}
        if(s[i+1][j+1]=='#'){++x;}
        cout << x;
      }else{
        cout << s[i][j];
      }
    }
    cout << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define input for(i=1;i<=n;i++)cin>>a[i];

int main()
{
   ll n,t,i,x=0,ans=0;
   cin>>n>>t;
   ll a[n+5];
   ans+=t;
   input;
   for(i=1;i<n;i++)
   {
     x=a[i+1]-a[i];
     if(x>=t)ans+=t;
     else ans+=x;
   }
   cout<<ans<<endl;
}


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

int main() {
    int64_t n; cin >> n;
    vector<int64_t> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }
    vector<int64_t> l(n);
    vector<int64_t> r(n);
    for (int64_t i = 0; i < n; i++) {
        int64_t l_idx = i - a.at(i);
        int64_t r_idx = i + a.at(i);
        if (l_idx > 0) {
            l.at(l_idx)++;
        }
        if (r_idx < n-1) {
            r.at(r_idx)++;
        }
    }
    int64_t cnt = 0;
    for (int i = 1; i < n-1; i++) {
        cnt += l.at(i) * r.at(i);
    }
    cout << cnt << endl;
}

Measured memory_bytes: 8004
// atcoder/abc128/D/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, x;
  while (cin >> n >> x) {
    vector<int> v(n);
    cin >> v;

    lli mx = -(1LL << 60);
    for (int i = 0; i < v.size(); ++i) {
      for (int j = i; j <= v.size(); ++j) {
        lli sum = 0;
        priority_queue<int> q;
        for (int k = 0; k < v.size(); ++k) {
          if (i <= k && k < j) {
          } else {
            sum += v[k];
            q.push(-1 * v[k]);
          }
        }
        if (x < q.size()) {
          continue;
        }
        setmax(mx, sum);
        int y = x - q.size();
        while (y-- && q.size()) {
          sum -= -1 * q.top();
          q.pop();
          setmax(mx, sum);
        }
        setmax(mx, sum);
      }
    }

    cout << mx << endl;
  }

  return 0;
}


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

typedef long long ll;

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if(a*b >= c*d){
        cout << a*b << endl;
    }else{
        cout << c*d << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
A, B, C = map(int,input().split())
k = int(input())
count=0
for i in range(k):
    if A>=B:
        count+=1
        B=B*2
    if B>=C:
        count+=1
        C=C*2

if count>k or not(B<C and A<B):
    print('No')
else:
    print('Yes')

Measured memory_bytes: 9132
#include<iostream>
#include<string>

int main() {
	int n = 0;
	std::string str;

	std::cin >> str;

	for (int i = 0; i < 4; i++) {
		if (str[i] == '+') {
			n++;
		}
		if (str[i] == '-') {
			n--;
		}
	}

	std::cout << n << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
void trace(int A[],int N){
    for(int i=0;i<N;i++){
        if(i>0) cout<<' ';
        cout<<A[i];
    }
    cout<<endl;
}

void insertionSort(int A[], int N){
    int j,v;
    for(int i=1;i<N;i++){
        v = A[i];
        j = i-1;
        while(j>=0 && A[j] >v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        trace(A,N);
    }
}
int main(int argc, const char * argv[]){
    int N;
    int A[100];
    
    cin>>N;
    for(int i=0;i<N;i++)cin>>A[i];
    
    trace(A,N);
    insertionSort(A,N);
    
    return 0;
}




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

int main() {
	string s, t;
	cin >> s >> t;
	bool flag = false;
	string ans = string(s.size(), 'z');
	for (int i = 0; i < s.size(); i++) {
		if (i + t.size() - 1 == s.size()) {
			break;
		}
		string u = s;
		bool f = true;
		for (int j = 0; j < t.size(); j++) {
			f &= u[i + j] == '?' || u[i + j] == t[j];
			if (u[i + j] == '?') {
				u[i + j] = t[j];
			}
		}
		if (f) {
			flag = true;
			for (auto &c : u) {
				if (c == '?') {
					c = 'a';
				}
			}
			ans = min(ans, u);
		}
	}
	cout << (flag ? ans : "UNRESTORABLE") << endl;
	return 0;
}

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

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

using namespace std;
using lint=long long;

const long long INF=1LL<<61;

int main(){
	int h,w,k; scanf("%d%d%d",&h,&w,&k);
	vector B(h,vector(w,0));
	rep(i,k){
		int x,y,v; scanf("%d%d%d",&x,&y,&v); x--; y--;
		B[x][y]=v;
	}

	static lint dp[3000][3000][4];
	rep(i,h) rep(j,w) rep(k,4) dp[i][j][k]=-INF;
	dp[0][0][0]=0;
	if(B[0][0]>0) dp[0][0][1]=B[0][0];
	rep(i,h) rep(j,w) rep(k,4) if(dp[i][j][k]!=-INF) {
		if(i<h-1){
			dp[i+1][j][0]=max(dp[i+1][j][0],dp[i][j][k]);
			if(B[i+1][j]>0){
				dp[i+1][j][1]=max(dp[i+1][j][1],dp[i][j][k]+B[i+1][j]);
			}
		}
		if(j<w-1){
			dp[i][j+1][k]=max(dp[i][j+1][k],dp[i][j][k]);
			if(B[i][j+1]>0 && k<3){
				dp[i][j+1][k+1]=max(dp[i][j+1][k+1],dp[i][j][k]+B[i][j+1]);
			}
		}
	}
	printf("%lld\n",*max_element(dp[h-1][w-1],dp[h-1][w-1]+4));

	return 0;
}


Measured memory_bytes: 319564
// goto campaign
#include<iostream>
using namespace std;

int main(){
	int H,W,K;
	cin >> H >> W >> K;

	bool c[H][W];
	
	int i = 0, j;
	char tmp;

	INPUT_LOOP_I:
	if(i == H) goto FINE_INPUT;

	j = 0;
	INPUT_LOOP_J:
	if(j == W){
		i++;
		goto INPUT_LOOP_I;
	}
	
	cin >> tmp;
	if(tmp == '.') c[i][j] = false;
	else if(tmp == '#') c[i][j] = true;

	j++;
	goto INPUT_LOOP_J;


	FINE_INPUT:

	int ret = 0;

	int R = 0, C, black;

	LOOP_R:
	if(R == 1 << H) goto FINE_LOOP;

	C = 0;

	LOOP_C:
	if(C == 1 << W){
		R++;
		goto LOOP_R;
	}
	i = 0;
	black = 0;

	LOOP_I:
	if(i == H){
		C++;
		if(black == K) ret++;
		goto LOOP_C;
	}

	j = 0;
	
	LOOP_J:
	if(j == W){
		i++;
		goto LOOP_I;
	}

	if( ((R >> i) & 1) == 0 and ((C >> j) & 1) == 0 and c[i][j]) black++;
		
	j++;
	goto LOOP_J;

	FINE_LOOP:
	
	cout << ret << endl;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s1,s2;
	int n;
	cin>>n>>s1>>s2;
	long long ans=1;
	int k=0;
	while(k<n){
		if(k==0){
			if(s1[k]==s2[k]){
				ans=3;
				k++;
			}
			else{
				ans=6;
				k+=2;
			}
		}
		else{
			if(s1[k]==s2[k]){
				if(s1[k-1]==s2[k-1])ans*=2;
				k++;
			}
			else{
				if(s1[k-1]==s2[k-1]){
					ans*=2;
					k+=2;
				}
				else{
					ans*=3;
					k+=2;
				}
			}
			if(ans>=1000000007)ans%=1000000007;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());

        string[] astr = Console.ReadLine().Split(' ');
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
        {
            a[i] = int.Parse(astr[i]);
        }

        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            ans += a[i] - 1;
        }

        Console.WriteLine("{0}", ans);
    }
}


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

int main() {
  int h,w;
  cin>>h>>w;
  vector<vector<char>> s(h,vector<char> (w,'k'));
  for(int i=0;i<h;i++){
    string g;
    cin>>g;
    for(int j=0;j<w;j++){
      s[i][j]=g[j]; 
    }   
  }
  vector<vector<int>> t(h,vector<int> (w,1));
  vector<vector<int>> pp(h,vector<int> (w,0));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]=='#') {
        t[i][j]=0;
        continue;
      }
      int a=i+1;
      int b=j+1;
      while(1){
       
        if(j>0){
          if(s[i][j-1]=='.'){

          t[i][j]+=t[i][j-1]-1;
           break;
          }
          
        } 
        if(b==w||s[i][b]=='#') break;
        t[i][j]+=1;
        b++;
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]=='#') {
        pp[i][j]=0;
        continue;
      }
      int a=i+1;
      int b=j+1;
      while(1){
       
        if(i>0 && s[i-1][j]=='.'){
          pp[i][j]+=pp[i-1][j];
          break;
        }
        if(a==h||s[a][j]=='#') break;
        pp[i][j]+=1;
        a++;
      } 
     
    }
  }
  int ans=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      ans=max(ans,t[i][j]+pp[i][j]);

    }
  }
  cout<<ans<<endl;
}
  


Measured memory_bytes: 35584
import sys
from copy import copy

S = input()
N = len(S)
Scopy = copy(S)
Ns = {}

for i in range(1, len(S)+1):
    Ns[i] = 0


i = 0
lenR = 0
for s in Scopy:
    i +=1
    if s == 'R':
        lenR += 1
        continue
    elif s == 'L':
        if lenR == 0:
            continue
        Ns[i-1] += (lenR+1)//2
        Ns[i] += lenR//2
        lenR = 0

Scopy = copy(S)

i = len(S)+1
lenL = 0
for s in Scopy[::-1]:
    i -=1
    if s == 'L':
        lenL += 1
        continue
    elif s == 'R':
        if lenL == 0:
            continue
        Ns[i] += lenL//2
        Ns[i+1] += (lenL+1)//2
        lenL = 0

print(' '.join([str(x) for x in [Ns[i] for i in range(1,N+1)]]))


Measured memory_bytes: 58728
#include<iostream>
#include<vector>
#include<atcoder/segtree>

using namespace std;
using namespace atcoder;

int64_t vi;
int64_t op(int64_t a,int64_t b){return a<b?b:a;}
int64_t e(){return -1;}
bool f(int64_t aj){return aj<vi;}

int32_t main(){
  int n,q;
  cin>>n>>q;
  vector<int64_t> a(n);
  for(auto& ai:a)cin>>ai;
  
  using RMQ = segtree<int64_t,op,e>;
  RMQ seg(a);
  
  while(q--){
    int t;cin>>t;
    if(t==1){
      int x,v;cin>>x>>v;x--;
      seg.set(x,v);
    }
    if(t==2){
      int l,r;cin>>l>>r;l--;r--;
      cout<<seg.prod(l,r+1)<<endl;
    }
    if(t==3){
      int x;cin>>x>>vi;x--;
      int res = seg.max_right<f>(x);
      cout<<res+1<<endl;
    }
  }
}


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

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

int main(){
    int A, B;
    cin >> A >> B;

    int price;

    if(A >= 13){
        price = B;
    }else if(A >= 6 && A <= 12){
        price = B /2;
    }else{
        price = 0;
    }

    cout << price << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int order(int n,int p){
  int num = 0;
  double bin = (double) n;
  while(1){
    bin = bin/(double)p;
    if(bin < 0.999) break;
    else num += (int)bin;
  }
  return num;
}

int main(){
  int n;
  scanf("%d",&n);
  int prime[25];
  prime[0] = 2;
  int num = 1,flag;
  for(int i = 3; num < 25; i++){
    flag = 0;
    for(int j = 0; j < num; j++){
      if(i % prime[j] == 0){
        flag = 1;
        break;
      }
    }
    if(flag == 0){
      prime[num] = i;
      num++;
    }
  }
  int ord[25]; // n! = 2^ord[0]*... <= [97,48,24,16,9,7,5,..]
  for(int i = 0; i < 25; ++i){
    ord[i] = order(n,prime[i]);
  }
  int answer = 0;
  num = 0;
  for(int i = 0; i < 25; ++i){
    if(ord[num] < 2) break;
    num++;
  }
  for(int i = 0; i < num; ++i){
    if(ord[i] >= 74) answer++;
    for(int j = 0; j < num; ++j){
      if(i == j) break;
      if(ord[i] >= 2 && ord[j] >= 24) answer++;
      if(ord[i] >= 24 && ord[j] >= 2) answer++;
      if(ord[i] >= 4 && ord[j] >= 14) answer++;
      if(ord[i] >= 14 && ord[j] >= 4) answer++;
      for(int k = 0; k < num; ++k){
        if(j == k || k == i) break;
        if(ord[i] >= 2 && ord[j] >= 4 && ord[k] >= 4) answer++;
        if(ord[i] >= 4 && ord[j] >= 2 && ord[k] >= 4) answer++;
        if(ord[i] >= 4 && ord[j] >= 4 && ord[k] >= 2) answer++;
      }
    }
  }
  printf("%d\n",answer);
  return 0;
}

Measured memory_bytes: 128
L = 'abcdefghij'
N = int(input())

list = [['a', 0]]
if N > 1:
    for n in range(N -1):
        new_list = []
        for i in range(len(list)):
            old_string = list[i][0]
            max_num = list[i][1]
            for j in range(max_num + 1):
                new_string = old_string + L[j]
                new_list.append([new_string, max_num])
            new_string = old_string + L[max_num + 1]
            new_list.append([new_string, max_num + 1])
        list = new_list
for i in range(len(list)):
    print(list[i][0])

Measured memory_bytes: 25716
num = int(input())
A = list(map(int,input().split(" ")))

for i in range(num):
	v = A[i]
	j = i -1

	while j >= 0 and A[j] > v:
		A[j+1] = A[j]
		j -= 1
	A[j+1] = v

	#出力用
	list2 = [str(k) for k in A]
	print(" ".join(list2))



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

using namespace std;

const int N = 2e5 + 3;

int k, n;
int a[N];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cin >> n >> k;
	a[0] = 0;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		++a[i];
		a[i] = a[i - 1] + a[i];
	}
	int ans = a[k];
	for (int i = k + 1; i <= n; ++i) {
		ans = max(ans, a[i] - a[i - k]);
	}
	
	cout << fixed << setprecision(10) << 1.0 * ans / 2 << '\n';
	return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int k,s,count=0;
  cin>>k>>s;
  for(int i=0;i<=k;i++){
    for(int j=0;j<=k;j++){
      int l=s-i-j;
      if(l>=0 and l<=k){
        count++;
      }
    }
  }  
  cout<<count<<endl;
}


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

#define ll long long

ll lucas(vector<ll> &r, int n) {
  if (!r[n]) {
    r[n] = lucas(r, n - 1) + lucas(r, n - 2);
  }

  return r[n];
}

int main() {
  int n;
  cin >> n;
  
  vector<ll> r(n + 1);
  r[0] = 2;
  r[1] = 1;

  cout << lucas(r, n) << endl;
}


Measured memory_bytes: 256