akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

int main() {
  int n, k, c;
  string s;
  cin >> n >> k >> c >> s;
  int R[k], L[k];
  int day = 0;
  rep(i, n) {
    if (s[i] == 'o') {
      L[day] = i;
      i += c;
      ++day;
    }
    if (day == k) break;
  }
  day--;
  repr(i, n) {
    if (s[i] == 'o') {
      R[day] = i;
      i -= c;
      --day;
    }
    if (day == -1) break;
  }
  // rep(i, k) { cout << R[i] << " " << L[i] << endl; }
  rep(i, k) {
    if (L[i] == R[i]) cout << L[i] + 1 << endl;
  }
  return 0;
}


Measured memory_bytes: 3332
#include <iostream>

using namespace std;

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

  int m1, m2, d1, d2;
  cin >> m1 >> d1 >> m2 >> d2;

  if (m1 == m2)
    cout << 0 << endl;
  else
    cout << 1 << endl;
    
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string>
#include <sstream>

#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define repr(i, a, b) for(int i = (a); i >= (b); i--)
#define range(x) begin(x), end(x)

#define dump(x) cerr << #x << " : " << x << '\n'

#define pb push_back

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const int iinf = 1 << 29;
const ll linf = 1l << 61;

int N;
int size[3][100800];
ll sum[3][100800];

int main(int argc, char* argv[])
{
	scanf("%d", &N);
	rep(j, 0, 3)
	{
		size[j][0] = 0;
		for(int i = 1; i <= N; i++)
		{
			scanf("%d", &size[j][i]);
		}
		sort(size[j] + 1, size[j] + N + 1);
	}

	for(int i = 2; i >= 0; i--)
	{
		int k = 1;
		sum[i][0] = 0;
		for(int j = 1; j <= N; j++)
		{
			if(i == 2)
			{
				sum[i][j] = j;
			}
			else
			{
				while(k <= N && size[i][j] >= size[i + 1][k]) k++;
				sum[i][j] = sum[i][j - 1] + (sum[i + 1][N] - sum[i + 1][k - 1]);
			}
		}
	}
	printf("%lld\n", sum[0][N]);

	return 0;
}


Measured memory_bytes: 3840
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
def factorial(n):
    if (n==0) or (n==1):
        return 1
    ret = 1
    for i in range(2, n+1):
        ret *= i
    return ret
def combination(n, k):
    return factorial(n)//factorial(k)//factorial(n-k)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N, M = LI()
xy = LIR(M)

utov = [[] for i in range(N+1)]
for x, y in xy:
    utov[x].append(y)

dp = [-1]*(N+1)

def rec(u):
    if (dp[u] != -1):
        return dp[u]
    res = 0
    for v in utov[u]:
        res = max(res, rec(v)+1)
    dp[u] = res
    return res

ans = 0
for i in range(N+1):
    ans = max(ans, rec(i))
print(ans)


Measured memory_bytes: 76812
n,k = (int(i) for i in input().split())
s = input()

start = s[0]
arr = []
pre = start
cnt = 0
for x in s:
    if x == pre:
        cnt+=1
        continue
    else:
        pre = x
        arr.append(cnt)
        cnt = 1

arr.append(cnt)

if len(arr) == 1:
    print(arr[0])
    exit()

m = 0
if start == "1":
    now = sum(arr[:2*k+1])
    m = now
    for i in range(1, (len(arr)//2)-k+1):
        now = now - arr[2*i-1] - arr[2*i-2] + sum(arr[2*i+2*k-1:2*i+2*k+1]) 
        m = max(now, m)

else:
    m = sum(arr[:2*k])
    now = sum(arr[1:2*k+2])
    m = max(now, m)
    for i in range(1, ((len(arr)+1)//2)-k):
        now = now - arr[2*i] - arr[2*i-1] + sum(arr[2*i+2*k:2*i+2*k+2])
        m = max(now, m)
    
print(m)
        

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

using namespace std;

int main(){
	int n;
	cin >> n;
	int x = 0;
	for(int i=0;i<n;i++){
		string s;
		cin >> s;
		if(s == "A") x++;
		if(s == "Un"){
			if(x<=0){
				cout << "NO" << endl;
				return 0;
			}
			x--;
		}
	}
	if(x == 0) cout << "YES" << endl;
	else cout << "NO" << endl;
	
	return 0;
}

Measured memory_bytes: 3136
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int K = scan.nextInt();
        String S = scan.next();
        if (S.length() <= K) {
            System.out.println(S);
        } else {
            System.out.println(S.substring(0, K) + "...");
        }
    }
}


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

int main()
{
    int n;
    int sum = 0, ans = 0;
    cin >> n;
    int h[n];
    for (int i = 0; i < n; i++) cin >> h[i];
    for (int i = 0; i < n-1; i++)
    {
        if(h[i] >= h[i+1])
        {
            sum++;
        }
        else
        {
            ans = max(ans, sum);
            sum = 0;
        }
    }
    ans = max(ans, sum);
    cout << ans;
    return 0;
}


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

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
struct Edge {
	int src;
	int dst;
	long long int A;
	long long int B;
};
struct aa {
	int now;
	long long int cost;
};
bool operator <(const aa&l, const aa&r) {
	return l.cost>r.cost;
}
long long int ce(long long int a,long long  int b) {
	return (a-1)/b+1;
}
int main() {
	int N,M,S,G;cin>>N>>M>>S>>G;
	S--;G--;
	vector<vector<Edge>>g(N);

	for (int i = 0; i < M; ++i) {
		int a,b;
		long long int A,B;cin>>a>>b>>A>>B;a--;b--;
		g[a].push_back(Edge{ a,b,A,B });
		g[b].push_back(Edge{ b,a,A,B });
	}

	vector<long long int>memo(N,1e18);
	memo[S]=0;
	priority_queue<aa>que;
	que.push(aa{ S,0 });
	while (!que.empty()) {
		auto atop(que.top());
		que.pop();
		const int now=atop.now;
		const long long int now_cost=atop.cost;
		if(memo[now]!=now_cost)continue;
		for (auto e : g[now]) {
			int next=e.dst;
			long long int next_cost=now_cost;
			if (e.A >= 1e8) {
				next_cost=now_cost+ce(e.B,e.A+now_cost);
			}
			else {
				long long int needt=sqrt(e.B)-e.A;

				long long int this_cost=1e18;
				for (long long int stop_t = needt - 1; stop_t <= needt + 1; ++stop_t) {
					long long int at = max(stop_t, now_cost);
					{
						this_cost=min(this_cost,at+ce(e.B,e.A+at));
					}
				}
				next_cost=this_cost;
			}
			if (memo[next] > next_cost) {
				memo[next]=next_cost;
				que.push(aa{ next,next_cost });
			}
		}
	}
	if(memo[G]>7e17)memo[G]=-1;
	cout<<memo[G]<<endl;
	return 0;
}


Measured memory_bytes: 26648
#include <bits/stdc++.h>
using namespace std;
map<int,int> m;
int a[100000];
int count1=0;
int main()
{
	int i,n,tmp,s=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&tmp);
		if(m.count(tmp)==0)
		{
			m[tmp]=1;
			a[count1++]=tmp;
		}
		else
		{
			m[tmp]++;
		}
	}
	for(i=0;i<count1;i++)
	{
		if(m[a[i]]>=a[i])
			s+=(m[a[i]]-a[i]);
		else if(m[a[i]]<a[i])
			s+=m[a[i]];
	}
	printf("%d",s);
	return 0;
}


Measured memory_bytes: 5120
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define xx first
#define yy second
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int inf=0x3f3f3f3f;
const LL INF=0x3f3f3f3f3f3f3f3f;
const int N=3e5+10;
const int M=1e6+10;
int n,x,y,ans[N];

int main(){
	scanf("%d%d%d",&n,&x,&y);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int dis=j-i;
			dis=min(dis,abs(y-j)+1+abs(x-i));
			dis=min(dis,abs(x-j)+1+abs(y-i));
			ans[dis]++;
		}
	for(int i=1;i<n;i++) printf("%d\n",ans[i]);
	return 0;
}

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

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ll long long
#define rep(i,j,n) for(int i=j; i<n; i++)
#define INF 1000000000000000000 // If you use it, make sure not to put in "int" type variable ;(, use long long int
void optimizeIO() { ios_base::sync_with_stdio(false); cin.tie(NULL); }
const ll mod=1000000007;

int main()
{
    optimizeIO();
    int nT; nT=1;
	while(nT--)
	{
		ll n,k,cur=0; cin>>n>>k;
        string s; cin>>s;
        if(n==1) { cout<<0; return 0; }
        rep(i,1,n-1) if((s[i]=='L' && s[i-1]=='L') || (s[i]=='R' && s[i+1]=='R')) cur++;
        if(s[0]=='R' && s[1]=='R') cur++;
        if(s[n-1]=='L' && s[n-2]=='L') cur++;
        // cout<<cur<<'\n';
        cout<<min(n-1,cur+2*k);
	}
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> x(n,0);
    for(int i = 0; i < x.size(); i++) cin >> x[i];
    
    int distance = 0;

    for(int i = 0; i < x.size(); i++) {
        int a = abs(x[i]) * 2;
        int b = abs(x[i] - k) * 2;
        if (a > b){
            distance = distance + b;
        }else{
            distance = distance + a;
        }
    }

    cout << distance << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(int i=0;i<(int)n;i++)
struct edge{int from, to;};
#define MAX 1e6
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    for(ll i=a;i<a*MAX;i+=a){
        if(i%b==c){
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<< "NO"<<endl;
    return 0;
}

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

#define endl "\n"
#define INF (int) 9e18
#define HELL (int) (1e9 + 7)
#define int long long
#define double long double
#define uint unsigned long long
#define deb(x) cerr << #x << " => " << x << "\n"
#define deba(x) cerr << #x << "\n"; for (auto a : x) cerr << a << " "; cerr << "\n";
#define debm(x) cerr << #x << "\n"; for (auto a : x){for(auto b : a) cerr << b << " "; cerr << "\n";}
#define getMat(x, n, m, val) vector<vector<int>> x(n, vector<int> (m, val))
#define fastio ios_base :: sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pout cout << fixed << setprecision(10)

int fastpow(int a, int b, int m) {
    int res = 1; a %= m; while (b > 0) {
        if (b & 1) res = (res * a) % m;
        a = (a * a) % m; b >>= 1;
    } return res;
}

int now() {
    return chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now()
    .time_since_epoch()).count();
}

int32_t main() { fastio;
    time_t start = now();

    string a, b, c;
    int x, y;
    cin >> a >> b >> x >> y >> c;
    if (c == a) {
        cout << x - 1 << " " << y << endl;
    } else {
        cout << x << " " << y - 1 << endl;
    }

    cerr << "TIME => " << now() - start << endl;
    return 0;
}

Measured memory_bytes: 256
/*
                                             ::                     ::
                                             ':                     :
                                              :.                    :
                                           ;' ::                   ::  '
                                          .'  ';                   ;'  '.
                                         ::    :;                 ;:    ::
                                         ;      :;.             ,;:     ::
                                         :;      :;:           ,;"      ::
                                         ::.      ':;  ..,.;  ;:'     ,.;:
                                          "'"...   '::,::::: ;:   .;.;""'
                                              '"""....;:::::;,;.;"""
                                          .:::.....'"':::::::'",...;::::;.
                                         ;:' '""'"";.,;:::::;.'""""""  ':;
                                        ::'         ;::;:::;::..         :;
                                       ::         ,;:::::::::::;:..       ::
                                       ;'     ,;;:;::::::::::::::;";..    ':.
                                      ::     ;:"  ::::::"""'::::::  ":     ::
                                       :.    ::   ::::::;  :::::::   :     ;
                                        ;    ::   :::::::  :::::::   :    ;
                                         '   ::   ::::::....:::::'  ,:   '
                                          '  ::    :::::::::::::"   ::
                                             ::     ':::::::::"'    ::
                                             ':       """""""'      ::
                                              ::                   ;:
                                              ':;                 ;:"


                                                     P_r_A_d_Y
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl "\n"
#define mod 1000000007
#define inf 1e18
const int N = 300005;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
void cs(int &x)
{
    cout << "Case #" << x << ": ";
}
bool cmp(string a, string b)
{
    return a + b < b + a;
}

int32_t main()
{
    fastIO;
    // int t; cin >> t;
    // int x = 1;
    // while (t--)
    // {

    int n,m;cin>>n>>m;
    vector<int>h(n+1);

    for(int i=0;i<n;i++)
    cin >> h[i+1];

    vector<pair<int,int>>adj(n+1,{-1,-1});

    for(int i=0;i<m;i++)
    {
        int x,y;cin >> x>>y;
        if(adj[x].first==-1)
        adj[x]={y,h[y]};
        else
        {
            if(h[y]>adj[x].second)
                adj[x]={y,h[y]};
        }
        
        if(adj[y].first==-1)
        adj[y]={x,h[x]};
        else
        {
            if(h[x]>adj[y].second)
                adj[y]={x,h[x]};
        }
    }

    int c=0;

    for(int i=1;i<=n;i++)
    {
        if(adj[i].first==-1)
            c++;
        else
        {
            if(h[i]>adj[i].second)
                c++;
        }
    }

    cout<<c<<endl;



    //}
    return 0;
}

Measured memory_bytes: 5556
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
int main()
 {
 	string s;
 	cin>>s;
 	if((s[2]==s[3])&&(s[4]==s[5]))
 		cout<<"Yes"<<endl;
 	else
 		cout<<"No"<<endl;
 	return 0;
}
 	
 					

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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvp vector<vector<pair<int,int>>>

const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>; //Caution!! Segmentation Fault!! Don't forget to add +1!

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i--)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template<typename TypeInt> //最大公約数
TypeInt GCD(TypeInt a,TypeInt b){
    if(a%b==0) return b;
    else return GCD(b,a%b);
}
template<typename TypeInt> //最小公倍数
TypeInt LCM(TypeInt a,TypeInt b){
    return a*b/GCD(a,b);
}

int IN_int(){
    int x;
    scanf("%d",&x);
    return x;
}

//----------------------library------------------------//

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

const int NMAX = 200;
bool flag;

bool comp(int x,int y){
    return abs(0-x)<abs(0-y);
}


signed main(){
    CIN(K);
    queue<ll> que;
    int cnt=1;
    RepS(i,1,9) que.push(i);
    while(cnt!=K){
        ll sum=que.front();
        que.pop();
        cnt++;
        int a=sum%10;
        if(a==0){
            que.push(sum*10+a);
            que.push(sum*10+1+a);
        }
        else if(a==9){
            que.push(sum*10-1+a);
            que.push(sum*10+a);
        }else{
            que.push(sum*10+a-1);
            que.push(sum*10+a);
            que.push(sum*10+a+1);
        }
    }
    ll ans=que.front();
    printf("%lld\n",ans);

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main() {
    int n;
    cin >> n;
    ll ans = 1;
    for(int i=2;i<=n;i++){
        ans = (ans*i)%MOD;
    }
    cout << ans%MOD << endl;
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl
#define Vecpr(K,L1,L2,N) vector<pair<L1,L2>> K(N)
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<int,int>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define ceili(x,y) (x+y-1)/y  
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  lli A,B,C,D,E,L,R,X,Y,W,H,N,M,K,sum=0,num=0,flag=0;string S,T;
  cin >> N;
  Vec(P,lli,N,0);
  Vec(Q,lli,N,0);
  rep(i,0,N)cin >> P[i];
  rep(i,0,N)cin >> Q[i];
  Rev(Q);
  rep(i,1,N)P[i]+=P[i-1];
  rep(i,1,N)Q[i]+=Q[i-1];
  rep(i,0,N)sum=max(sum,P[i]+Q[N-i-1]);
  Out(sum);
}

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

int main()
{
	int n, d, x; cin >> n >> d >> x;
	
	vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i];

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

		int t = 0;
		while (true) {

			int day = t * a[i] + 1;
			if (day <= d) {
				cnt++;
			}
			else if (d < day) {
				break;
			}
			t++;

		}

	}
	cout << cnt + x << endl;

	return 0;
}

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

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

bool right(char c){
  char a[11]={'y', 'u', 'i', 'o', 'p', 'h', 'j', 'k', 'l', 'n', 'm'};
  rep(i,11){
    if(c==a[i])return true;
  }
  return false;
}
int main(){
  while(true){
    string s;
    cin>>s;
    if(s=="#")break;
    bool flag=right(s[0]);
    int cn=0;
    for(int i=1; i<s.length(); i++){
      if(flag!=right(s[i])){flag=right(s[i]); cn++;}
    }
    cout<<cn<<endl;
  }
  return 0;
}

Measured memory_bytes: 1188
require "bigdecimal"
require "bigdecimal/util"

def gi() gets.to_i end
def gs() gets.chomp end
def gim() gets.split.map(&:to_i) end
def gsm() gets.split.map(&:chomp) end
def YesNo1(bool, yes="Yes", no="No") puts (bool ? yes : no) end
def YESNO2(bool, yes="YES", no="NO") puts (bool ? yes : no) end

#####
n,k = gim
nums = gim

nums = [0] + nums
#print nums
max = 0
lastSum = nums[0..k-1].inject(:+)
(n-k+1).times do |i|
  sum = lastSum + nums[i+k] - nums[i]
  lastSum = sum
  max = [max, sum].max
end

puts (max+k)/2.0

Measured memory_bytes: 20396
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX_N = 8;

int N, A, B, C;
int l[MAX_N];

int main(){
	scanf("%d %d %d %d", &N, &A, &B, &C);
	for(int i = 0; i < N; i++) scanf("%d", &l[i]);
	int res = 1 << 30;
	for(int i = 0; i < (1 << 2 * N); i++){
		int cnt[4];
		int sum[4];
		fill(cnt, cnt + 4, 0);
		fill(sum, sum + 4, 0);
		int num = i;
		for(int j = 0; j < N; j++){
			sum[num % 4] += l[j];
			cnt[num % 4]++;
			num /= 4;
		}
		if(cnt[1] == 0 || cnt[2] == 0 || cnt[3] == 0) continue;
		res = min(res, abs(sum[1] - A) + abs(sum[2] - B) + abs(sum[3] - C) + (cnt[1] + cnt[2] + cnt[3] - 3) * 10);
	}
	printf("%d\n", res);
	return 0;
}

Measured memory_bytes: 384
#!/usr/bin/env python3
import sys
import numpy as np

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, K: int, Q: int, A: "List[int]"):
    score = [0]*N

    for a in A:
        score[a-1]+=1
    
    for i in range(N):
        if K-Q+score[i]>0:
            print(YES)
        else:
            print(NO)
    
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(Q)]  # type: "List[int]"
    solve(N, K, Q, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 17596
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimise ("ofast")
#pragma GCC optimise("unroll-loops")

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 200000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 10000000000;
const ll LOG = 25;

ll n, k, h[N], st[N], ft[N], inv[N], par[N][LOG], a[N], ans, Time, lazy[N << 2];
pair<ll, ll> seg[N << 2];
vi G[N];

void DFS(int v = 1, int H = 0, int p = 1){
	st[v] = ++Time;
	inv[Time] = v;
	h[v] = H;
	par[v][0] = p;
	for (int i = 1; i < LOG; i++){
		par[v][i] = par[par[v][i - 1]][i - 1];
	}
	for (auto u:G[v]){
		if (u == p) continue;
		DFS(u, H + 1, v);
	}
	ft[v] = Time;
}

void build(int id, int l, int r){
	if (r - l == 1){
		seg[id] = {0, l};
		return;
	}
	int mid = (l + r) >> 1;
	build(id << 1, l, mid);
	build(id << 1 | 1, mid, r);
	return;
}

void modify(int id, ll x){
	seg[id].F += x;
	lazy[id] += x;
}

void shift(int id){
	modify(id << 1, lazy[id]);
	modify(id << 1 | 1, lazy[id]);
	lazy[id] = 0;
}

void add(int id, int lq, int rq, ll x, int l, int r){
	if (rq <= l || r <= lq) return;
	if (lq <= l && r <= rq){
		modify(id, x);
		return;
	}
	shift(id);
	int mid = (l + r) >> 1;
	add(id << 1, lq, rq, x, l, mid);
	add(id << 1 | 1, lq, rq, x, mid, r);
	if (seg[id << 1] > seg[id << 1 | 1]){
		seg[id] = seg[id << 1];
	}else{
		seg[id] = seg[id << 1 | 1];
	}
	return;
}

int walk(int v, int k){
	for (int i = 0; i < LOG; i++){
		if (k & (1 << i)) v = par[v][i];
	}
	return v;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> k;
	for (int i = 1; i <= n; i++) cin >> a[i];
	if (a[1] != 1) ans ++;
	for (int i = 2; i <= n; i++){
		G[i].pb(a[i]), G[a[i]].pb(i);
	}
	build(1, 1, n + 1);
	DFS();
	//for (int i = 1; i <= n; i++) cout << i << ' ' << h[i] << ' ' << st[i] << ' ' << ft[i] << '\n';
	for (int i = 1; i <= n; i++) add(1, st[i], st[i] + 1, h[i], 1, n + 1);
	
	while (seg[1].F > k){
		ans ++;
		int v = inv[seg[1].S];
		v = walk(v, k - 1);
		add(1, st[v], ft[v] + 1, -INF, 1, n + 1);
	}
	cout << ans;










	return 0;
}


Measured memory_bytes: 52608
#include<bits/stdc++.h>
#define ll 	 long long
#define pb push_back
#define mp make_pair
using namespace std;

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


int main()
{

mmm;

    string s,t;
    cin>>s>>t;
    s=' '+s;
    t=' '+t;
    int n=s.length(),m=t.length();
    int dp[n][m];
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            if(i==0 || j==0){
                dp[i][j]=0;
                continue;
            }
            if(s[i]==t[j]){
                dp[i][j]=1+dp[i-1][j-1];
            }
            else{
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
    }
    int i=n-1,j=m-1;
    string ans="";
    while(i>0 && j>0){
        if(s[i]==t[j]){
            ans=s[i]+ans;
            i--;
            j--;
        }
        else{
            if(dp[i-1][j]>dp[i][j-1]){
                i--;
            }
            else{
                j--;
            }
        }
    }
    cout<<ans<<endl;

     return 0;
}

Measured memory_bytes: 38824
N = int(input())

S = str(input())

char_list = list(S)

a = str(char_list[0])
n = int(N / 2)
b = str(char_list[n])

for i in range(1,n):
    a = str(a + char_list[i])
    b = str(b + char_list[i + n])

if((a == b) and (N % 2 == 0)):
    print("Yes")
elif((a != b) or (N % 2 != 0)):
    print("No")


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    string s;
    cin>>s;
    string ans="";
    for (int i=0;i<s.size();i+=2){
        ans+=s[i];
    }cout<<ans;
    return 0;
}


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

using namespace std;
int main(){
    string str;
    string restr;

    cin >> str;
    restr = str;
    reverse(restr.begin(),restr.end());
    int a;
    int b = str.length();
    for(int i=0;b> i; i++){
    if(str[i] != restr[i])
    a ++;
    }
    cout << a/2 << endl;
    
}

Measured memory_bytes: 256
import sys

readline = sys.stdin.buffer.readline


def main():
    N, A, B, C, D = map(int, readline().split())
    S = readline().decode('UTF-8')
    A -= 1
    B -= 1
    C -= 1
    D -= 1

    if C < D:
        s = A
        g = D
        for i in range(s, g):
            if S[i:i+2] == "##":
                print('No')
                sys.exit()
        else:
            print('Yes')

    else:
        s = A
        g = C
        for i in range(s, g):
            if S[i:i+2] == "##":
                print('No')
                sys.exit()

        s = B
        g = D
        for i in range(s-1, g):
            if S[i:i+3] == "...":
                print('Yes')
                sys.exit()
        else:
            print('No')


main()


Measured memory_bytes: 3520
# coding: utf-8


def solve(*args: str) -> str:
    S = args[0]
    A = [0 for _ in range(len(S)+1)]

    h = []

    cnt = 0

    # for n in range(len(S)):

    #     if 0 < n and S[n-1] != S[n]:
    #         h.append(cnt)
    #     else:
    #         cnt += 1 if S[n] == '<' else -1

    # for n in range(1, len[h]):
    #     if abs(h[n-1]) < abs(h[n]):
    #         for i in range(h[n-1]):
    #         h.append(cnt)
    #     else:

    m = 0
    for n in range(1, len(S)+1):
        if 0 < m:
            A[n] = m
            m -= 1
        elif S[n-1] == '<':
            A[n] = A[n-1]+1
        else:
            m = 0
            while n+m < len(S) and S[n+m] == '>':
                m += 1

            A[n-1] = max(m+1, A[n-1])
            A[n] = m
            m -= 1

    # for n in range(0, len(S)):
    #     print('{}{}'.format(A[n], S[n]), end='')
    # print(A[-1])

    return str(sum(A))


if __name__ == "__main__":
    print(solve(*[input() for _ in range(1)]))


Measured memory_bytes: 24096
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define x first
#define y second
#define pb push_back
#define pf push_front
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll M = 1000000007;


void solve()
{
	deque<char>ans;
	string s;
	cin>>s;
	bool stand=true;
	rep(i,s.size()){
		ans.push_back(s[i]);
	}
	int q;
	cin>>q;
	rep(i,q){
		int type;
		cin>>type;
		
		if(type==1){
			if(stand){
				stand=false;
			}else{
				stand=true;
			}
		}else{
			int f;
			cin>>f;
			char c;
			cin>>c;
			if(f==1){
				if(stand)ans.push_front(c);
				else ans.push_back(c);
			}else{
				if(stand)ans.push_back(c);
				else ans.push_front(c);
			}

		}
	}
	if(stand){
		rep(i,ans.size()){
			cout<<ans[i];
		}cout<<endl;
	}else{
		reverse(all(ans));
		rep(i,ans.size()){
			cout<<ans[i];
		}cout<<endl;
	}
}

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


Measured memory_bytes: 976
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl

int main(){
   int N, A;
    cin >> N >> A;
    int mod = N%500;
    if(mod <= A) puts("Yes");
    else puts("No");

}

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

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


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

typedef vector<int> vi;

const int INF = (int)(1e+9) + 9;
int N;
vi A, B, C;
vector<vi> dp;

void input_init(void) {
	cin >> N;
	A.resize(N);
	B.resize(N);
	C.resize(N);
	for (int i = 0; i < N; ++i)
		cin >> A[i] >> B[i] >> C[i];
	dp.resize(N, vi(3, -INF));
}

void solve(void) {
	dp[0][0] = A[0];
	dp[0][1] = B[0];
	dp[0][2] = C[0];
	for (int i = 1; i < N; ++i) {
		dp[i][0] = A[i] + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = B[i] + max(dp[i - 1][2], dp[i - 1][0]);
		dp[i][2] = C[i] + max(dp[i - 1][0], dp[i - 1][1]);
	}
}

int main(void) {
	input_init();
	solve();
	int ans = max(dp[N - 1][0], dp[N - 1][1]);
	ans  = max(dp[N - 1][2], ans);
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll N;
  cin>>N;
  vector<ll> vec1(N-1);
  vector<ll> vec2(N);
  for(ll i=1;i<N;i++){cin>>vec1.at(i-1);}
  for(ll j=0;j<N;j++){vec2.at(j)=0;}
  for(ll k=1;k<N;k++){vec2.at(vec1.at(k-1)-1)++;}
  for(ll l=0;l<N;l++){cout<<vec2.at(l)<<endl;}
}

Measured memory_bytes: 6428
#include<bits/stdc++.h>
#define MAXN 55
#define LL long long
using namespace std;
const int C = 2500;
int N,A;
int x[MAXN];
LL dp[MAXN][MAXN][C+5]; 

int main(){
	
	cin>>N>>A;
	
	for(int i=0;i<=N;i++) dp[i][0][0] = 1;
	for(int i=1,x;i<=N;i++){
		cin>>x;
		
		for(int j=1;j<=N;j++){
			for(int s=0;s<=C;s++){
				dp[i][j][s] = dp[i-1][j][s];
				if(s>=x) dp[i][j][s] += dp[i-1][j-1][s-x];
			}
		}
	}
	
	LL ans = 0;
	for(int j=1;j<=N;j++){
		ans += dp[N][j][j*A];
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 54400
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll n,m ;
	cin >> n >> m ;
	ll sum = 0 ;
	vll a(n) ;
	for(auto &i:a) cin >> i ;
	sort(all(a)) ;
	reverse(all(a)) ;
	for(int i=0;i<n;i++) sum += a.at(i) ;
	yorn(a.at(m-1)*4*m>=sum) ;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  double a,b,c,d,e,f;
  while(cin>>a){
    cin>>b>>c>>d>>e>>f;
    double x=(f*b-e*c)/(b*d-e*a);
    double y=(c-a*x)/b;
    if(abs(x)==0)x=0.000;
    if(abs(y)==0)y=0.000;
    printf("%.3f %.3f\n",x,y);
  }
  return 0;
}

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



int main(){
	cin.tie(0)->sync_with_stdio(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(auto i = 0; i < n; ++ i){
		cin >> a[i];
	}
	int res = 0;
	for(auto i = 0; i < n; i += 2){
		if(a[i] % 2){
			++ res;
		}
	}
	cout << res << "\n";
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

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

int main() {

    int a, b, c; cin >> a >> b >> c;
    if (b < a) swap(a, b);
    string ans = "No";
    if (a <= c && c <= b) {
        ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3516
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string S;
	int Q;
	cin >> S>>Q;
	int count = 0;
	string cr, cl;
	for (int i = 0; i < Q; i++) {
		int t, f;
		char c;
		cin >> t;
		if (t == 1)count++;
		else if (t == 2) {
			cin >> f>>c;
			if (f == 1) {
				if (count % 2 == 0) {
					cl.push_back(c);
				}
				else {
					cr.push_back(c);
				}
			}
			else if (f == 2) {
				if (count % 2 == 0) {
					cr.push_back(c);
				}
				else {
					cl.push_back(c);
				}
			}
		}
	}
	if (count % 2 == 1) {
		reverse(S.begin(), S.end());
		reverse(cr.begin(), cr.end());
		S = cr + S + cl;
	}
	else {
		reverse(cl.begin(), cl.end());
		S = cl + S + cr;
	}
	cout << S;
}

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

// macros
#define overload_rep(_1, _2 ,_3 ,name, ...) name
#define re_p(i, n) for(int i = 0; i < (n); ++i)
#define r_ep(i, x, y) for(int i = (x); i <= (y); ++i)
#define rep(...) overload_rep(__VA_ARGS__, r_ep, re_p,)(__VA_ARGS__)
#define all(a) a.begin(), a.end()
#ifndef STOP_DEBUG
#define debug(...)\
    do { cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_cerr(__VA_ARGS__); cerr << noboolalpha; } while (0)
#else
#define debug(...)
#endif

// functions
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; }
void debug_cerr(){ cerr << '\n'; }
template<class Head, class... Tail>
void debug_cerr(Head head, Tail... tail){
    cerr << ' ' << head;
    debug_cerr(tail...);
}

// cin/cout setup
struct IoSetup{
    IoSetup(){
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cerr << setprecision(20);
        cout << setprecision(20);
    }
} iosetup;

// SOLVE

const double pi = 3.1415926535897932384626;
const double eps = 1e-10;
int N;
double L;
double T[3000];

int main(){

    cin >> N >> L;
    rep(i, N)cin >> T[i];

    double ansx = 0, ansy = 0, cnt = 0;
    rep(i, N)rep(j, i){
        double now = pi * (T[i] + T[j]) / L;
        {
            double coeff = N - (i - j + 1);
            ansx += cos(now) * coeff;
            ansy += sin(now) * coeff;
            cnt += coeff;
        }
        {
            double coeff = i - j - 1;
            ansx += -cos(now) * coeff;
            ansy += -sin(now) * coeff;
            cnt += coeff;
        }
    }

    cout << ansx / cnt * 3 << ' ' << ansy / cnt * 3 << '\n';
    return 0;

}

Measured memory_bytes: 256
def prime_factor(n):
    factors = [0] * (n+1)
    for i in range(2, int(n**0.5)+1):
        count = 0
        while n % i == 0:
            count += 1
            n //= i
        if count != 0:
            factors[i] = count
    if n != 1:
        factors[n] = 1
    return factors

n = int(input())
nl = [0] * (n+1)
for i in range(1, n + 1):
    l = prime_factor(i)
    for i, num in enumerate(l):
        nl[i] += num
over4 = 0
over2 = 0
over74 = 0
over14 = 0
over24 = 0
for i in nl:
    if i >= 74:
        over74 += 1
    if i >= 24:
        over24 += 1
    if i >= 14:
        over14 += 1
    if i >= 4:
        over4 += 1
    if i >= 2:
        over2 += 1
cnt = 0
cnt += over4*(over4-1)/2*(over2-2)
cnt += over24*(over2-1)
cnt += over14*(over4-1)
cnt += over74
print(int(cnt))

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

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REP1(i, n) for(ll i = 1;i < n;i++)
#define REPR(i, n) for(ll i = n-1;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)

#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())

#define ll long long
#define ALL(a)  (a).begin(),(a).end()

#define pb(a) push_back(a)

ll k,a,b;


int main(){
  ll ans=0;
  cin >> k>>a>>b;
  if (b-a>2){
    ll t=b-a;//2回で増やせるビスケット数
    ll x=k-a+1;
    if (x<=0){
      ans=k+1;
      cout<<ans<<endl;
      return 0;
    }
    
    ans=a+(x/2)*t;
    if (x%2==1)ans++;
    
      cout<<ans<<endl;
      return 0;

  }else{
    ans=k+1;
    cout<<ans<<endl;
    return 0;
  }
return 0;

}

Measured memory_bytes: 256
#include <cstdio>

int n,k;
int s[100];

int main(){
	while(scanf("%d%d", &n, &k)){
		if(n == 0 && k == 0) break;
		for(int i = 0; i < k; i++) scanf("%d", &s[i]);
		for(int i = 0; i < n; i++){
			for(int j = 0; j < k; j++){
				int b; scanf("%d", &b);
				s[j] -= b;
			}
		}
		bool ok = true;
		for(int i = 0; i < k; i++) if(s[i] < 0) ok = false;
		if(ok) printf("Yes\n");
		else printf("No\n");
	}
}

Measured memory_bytes: 1012
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
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; }


int main() {
    ll n, m;
    cin >> n >> m;
    ll ans = ((n-m)*100 + m*1900) * pow(2.0, m); 
    cout << ans << endl;
    //printf("%.12f", ans);
}

Measured memory_bytes: 4048
#include<stdio.h>
int main(void)
{
int a,b,c,tmp;
scanf("%d %d\n" ,&a,&b);


if(a<b){
tmp = a;
a = b;
b = tmp;
}
c = a % b;
while(c != 0){
a = b;
b = c;
c = a % b;
}
printf("%d\n",b);
return 0;
}

Measured memory_bytes: 1812
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(readline())
s = []
t = []
for i in range(n):
    p,q = map(str,input().split())
    s.append(p)
    t.append(int(q))
x = input()
#print(n,s,t,x)
idx = s.index(x)
#print(idx)
print(sum(t[idx+1:]))



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

using namespace std;


  int main(){

   int x;

   cin>>x;

   int h = x / 3600;

   int m = (x / 60)%60;

   int s = x % 60;

   cout<<h<<":"<<m<<":"<<s<<endl;

   return 0;

}


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

#define int long long
#define sz(x) (int)(x.size())
const int N = 300, K = 123456;
int dp[K], a[N];
int n;
bool solve(int k){
    if(k == 0){
        return 0;
    }
    if(dp[k] != -1){
        return dp[k];
    }
    for(int i = 0; i < n;i++){
        if(k >= a[i]){
            if(solve(k - a[i]) == 0){
                return dp[k] = 1;
            }
        }
    }
    return dp[k] = 0;
}
signed main(){
    ios::sync_with_stdio(false);
    int k;
    cin >> n >> k;
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    fill(dp, dp + K, -1);
    cout << (solve(k) ? "First\n" : "Second\n");
}

Measured memory_bytes: 4352
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt(),b = sc.nextInt();
    if((a * b)%2==0){
      System.out.println("Even");
    }else{
      System.out.println("Odd");
    }
  }
}


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

#define ll long long
#define F first
#define S second
#define ii pair < int , int >
#define ever (;;)

const int N = 3010;

int n;
double dp[N][N],p[N];

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%lf",&p[i]);

    for(int i=(n+1)/2;i<=n;i++)
        dp[n+1][i] = 1.0;

    for(int i=n;i>=1;i--)
        for(int j=0;j<=n;j++)
            dp[i][j] = p[i]*dp[i+1][j+1] + (1.0-p[i])*dp[i+1][j];

    printf("%.9f\n",dp[1][0]);
}


Measured memory_bytes: 74212
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n");
while(true){
   var arr=(Arr.shift()).split(" ").map(Number);
   if(arr[0]==0)break;
   var q1=arr[0];
   var b=arr[1];
   var c1=arr[2];
   var c2=arr[3];
   var q2=arr[4];
   var x=0;
   var y=0;
   var flag=true;
   while(true){
      if(b>=c1*(x+1) &&  (x+1)<=q2)x++;
      else break;
   }
   while(true){
      if(b>=c1*x+c2*(y+1))y++;
      else break;
   }   
   while(true){
      if(x==0){flag=false;break;}
      if(c1*x+c2*y>b){flag=false;break;}
      if(q1>x+y){
         x--;
         while(true){
            if(b>=c1*x+c2*(y+1))y++;
            else break;         
         }    
      }else{
         break;
      }
   }
   console.log((flag)?x+" "+y:"NA");
}

Measured memory_bytes: 7644
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

const int MAX_N=10005;
int dp[MAX_N], w[MAX_N], v[MAX_N];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int H, n;
    cin >> H >> n;
    
    REP(i,n) {
        cin >> w[i] >> v[i];
    }
    REP(i, H+1) dp[i] = 1e9;
    dp[0] = 0;
    REP(i, n) {
        for(int j=0; j<=H; j++) {
            int nj = min(j+w[i], H);
            dp[nj] = min(dp[nj], dp[j]+v[i]);
        }
    }

    cout << dp[H] << endl;
    return 0;
}

Measured memory_bytes: 384
/*  Success may not come to me immediately,
 *  but it will come definitely....
 */
#include <bits/stdc++.h>
//=====================================================================
using namespace std;
//=====================================================================
#define opt ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
//=====================================================================
#define li      int64_t
#define ld      double_t
#define ulli    uint64_t
//=====================================================================
#define rep(i,a,b)  for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define repi(i,v)   for(i=v.begin();i!=v.end();i++)
#define repir(i,v)  for(i=v.rbegin();i!=v.rend();i++)
#define elif        else if
#define mset(a,b)   memset(a,b,sizeof(a))
#define nl          cout<<'\n'
//=====================================================================
typedef vector<li>       vli;
typedef vector<string>   vstr;
typedef pair<li,li>      pli;
typedef pair<li,pli >    ppli;
typedef pair<li,ppli >   pppli;
typedef vector<pli >     vpl;
typedef vector<ppli >    vppli;
typedef vector<pppli >   vpppli;
//=====================================================================
#define pb  push_back
#define pob pop_back
#define pf  push_front
#define pof pop_front
#define all(v)  v.begin(),v.end()
#define itr iterator
#define rtr reverse_iterator
#define sz  size()
#define lb  lower_bound
#define ub  upper_bound
#define bs  binary_search
#define mp  make_pair
#define F   first
#define S   second
//=====================================================================
#define mod (li)(1e9+7)
#define inf (li)(1e18)
#define MX1 (li)(1e5+5)
#define MX2 (li)(1e6+5)
#define pi  acos(-1)
//=====================================================================
li power(li a,li b){li ans=1;while(b){if(b&1){ans=(ans*a)%mod;}
a=(a*a)%mod;b>>=1;}return ans;}
//=====================================================================
li mmi(li n){return power(n,mod-2);}
//=====================================================================
li two(li n){return (1LL<<n);}
//=====================================================================
void onbit(li &n,li x){n|=two(x);}
//=====================================================================
void offbit(li &n,li x){n&=~two(x);}
//=====================================================================
li cntbit(li n){li res=0;while(n and ++res)n-=n&-n;return res;}
//=====================================================================
li dx[]={-1,0,1,0},dy[]={0,-1,0,1};
//=====================================================================
/*------------------------MAIN CODE BEGINS NOW!------------------------*/

void solve(){
  li x,t;cin>>x>>t;
  x-=t;
  if(x<=0) x=0;
  cout<<x;
}

int main(){
  opt
  #ifndef ONLINE_JUDGE
  #endif
  li t=1;
  //cin>>t;
  while(t--){
    solve();
  }
  return 0;
}

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

int main() {
  string s;
  cin >> s;
  if (s == "SUN") cout << 7 << endl;
  else if(s == "MON") cout << 6 << endl;
  else if(s == "TUE") cout << 5 << endl;
  else if(s == "WED") cout << 4 << endl;
  else if(s == "THU") cout << 3 << endl;
  else if(s == "FRI") cout << 2 << endl;
  else if(s == "SAT") cout << 1 << endl;
}

Measured memory_bytes: 256