akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
    return os << "(" << P.first << "," << P.second << ")";}

// #define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
typedef long long ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()
   
const ll Mod = 1e9 + 7;
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
    int n , k; cin >> n >> k;
    if(k > (n-1)*(n-2)/2)
        cout << -1 << endl;
    else
    {
        vector<pii> edge;
        for(int i = 1 ;i <= n-1; i++)
            edge.pb(mp(n , i));
        ll curr = (n-1)*(n-2)/2;
        
        for(int i = 1 ;i <= n-1 ; i++){
            for(int j = i+1 ;j <= n-1 ; j++){
                if(curr == k){
                    cout << edge.size() << endl;
                    for(auto it : edge)
                        cout << it.F << " " << it.S << endl;
                    return 0;
                }
                edge.pb(mp(i , j));
                curr--;
            }
        }
        cout << edge.size() << endl;
        for(auto it : edge)
            cout << it.F << " " << it.S << endl;
    }
    
    return 0;
}

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

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

    int n = s.length(), ans = 0;
    for(int i=0; i<n; i++){
        if(s[i] != t[i]) ans += 1;
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;

void Main(){
	int a, b;
	cin >> a >> b;
	if(a <= b)cout << "unsafe" << endl;
	else cout << "safe" << endl;
	return;
}

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


Measured memory_bytes: 3648
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

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

func gcd(a, b int) int {
	if b == 0 {
		return a
	}

	return gcd(b, a % b)
}

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

func main() {
	sc.Split(bufio.ScanWords)

	a, b, c, d := nextInt(), nextInt(), nextInt(), nextInt()

	fmt.Println((b-a+1) - (b/c - (a-1)/c + b/d - (a-1)/d) + b/lcm(c, d) - (a-1)/lcm(c,d))
}

Measured memory_bytes: 640
open System

// prelude
let readStr () = stdin.ReadLine()

let read f () = readStr() |> f
let reads f () = readStr().Split() |> Array.map f

let pair = function
| [|a; b|] -> (a, b)
| _ -> failwith "owatta"

let triple = function
| [|a; b; c|] -> (a, b, c)
| _ -> failwith "owatta"

let readPair f g () =
  let (a,b) = readStr().Split() |> pair
  (f a, g b)

let readTriple f g h () =
  let (a,b,c) = readStr().Split() |> triple
  (f a, g b, h c)

let inc n = n + 1
let dec n = n - 1

let inline flip f a b = f b a
let rec fix f = fun x -> (f (fix f)) x

module Option =
  let getOr defaultValue = function
  | Some x -> x
  | None -> defaultValue

module Array =
  let modify (arr: _ []) i f =
    arr.[i] <- f arr.[i]

module Array2D =
  let modify (arr: _ [,]) i j f =
    arr.[i, j] <- f arr.[i, j]

// start
let N = read int64 ()

let rec nums n = 
  if n=1 then Seq.ofList [3L; 5L; 7L]
  else
    nums (n-1)
    |> Seq.collect (fun m -> nums 1 |> Seq.map (fun x -> m*10L+x))

seq {
  for n in 1..9 do
    yield! (nums n)
}
|> Seq.filter (fun n -> n<=N)
|> Seq.filter (fun n ->
  let s = (string n).ToCharArray() |> Set.ofArray
  ['3';'5';'7'] |> List.forall (fun c -> s |> Set.contains c)
)
|> Seq.length
|> printfn "%d"

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

int main(){
  int n, k; cin >> n >> k;
  int b[k][k], w[k][k];
  rep(i, k)rep(j, k) b[i][j] = w[i][j] = 0;
  rep(i, n){
    int x, y; char c; cin >> x >> y >> c;
    if(c == 'B'){
      if((x%(2*k) < k && y%(2*k) < k) || (x%(2*k) >= k && y%(2*k) >= k)) b[x%k][y%k]++;
      else w[x%k][y%k]++;
    }
    else{
      if((x%(2*k) < k && y%(2*k) < k) || (x%(2*k) >= k && y%(2*k) >= k)) w[x%k][y%k]++;
      else b[x%k][y%k]++;
    }
  }
  int sb[k+1][k+1], sw[k+1][k+1];
  rep(i, k+1)rep(j, k+1) sb[i][j] = sw[i][j] = 0;
  rep(i, k)rep(j, k) sb[i+1][j+1] = sb[i+1][j] + b[i][j], sw[i+1][j+1] = sw[i+1][j] + w[i][j];
  rep(i, k)rep(j, k) sb[i+1][j+1] += sb[i][j+1], sw[i+1][j+1] += sw[i][j+1];
  int ans = max(sb[k][k], sw[k][k]);
  rep(i, 2*k-1)rep(j, 2*k-1) {
    int l = max(0, i-k+1), r = min(k-1, i), u = min(k-1, j), d = max(0, j-k+1);
    int L = 0, R = k-1, U = k-1, D = 0;
    if(r < k-1) L = r + 1;
    if(l > 0) R = l - 1;
    if(l == 0 && r == k-1) R = -1;
    if(d > 0) U = d - 1;
    if(d == 0 && u == k-1) U = -1;
    if(u < k-1) D = u + 1;
    int bsum = sb[r+1][u+1]-sb[l][u+1]-sb[r+1][d]+sb[l][d] + sb[R+1][U+1]-sb[L][U+1]-sb[R+1][D]+sb[L][D];
    int wsum = sw[r+1][u+1]-sw[l][u+1]-sw[r+1][d]+sw[l][d] + sw[R+1][U+1]-sw[L][U+1]-sw[R+1][D]+sw[L][D];
    ans = max(ans, bsum + sw[k][k] - wsum);
  }
  cout << ans << endl;
}

Measured memory_bytes: 15872
inputs = input().split(' ')
h1 = int(inputs[0])
m1 = int(inputs[1])
h2 = int(inputs[2])
m2 = int(inputs[3])
k = int(inputs[4])

t1 = h1 * 60 + m1
t2 = h2 * 60 + m2
print(t2 - t1 - k)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000

multiset<long long> S;

struct trie{
	vector<trie*> next;
	bool flag;
	trie(){
		next.resize(2,0);
		flag=false;
	}
	
	void add(string &s){
		trie* now = this;
		for(int i=0;i<s.size();i++){
			int c=get(s[i]);
				
			if(now->next[c]==0){
				now->next[c] = new trie;
			}
			now = now->next[c];
		}
		now->flag=true;
	}
	
	
	int check(string s){
		int ret = 0;
		trie* now = this;
		for(int i=0;i<s.size();i++){
			int c=get(s[i]);
			if(now->next[c]==0){
				return ret;
			}
			now = now->next[c];
			if(now->flag)ret=i+1;
		}
		return ret;
	}
	
	int get(char c){
		return c-'0';
	}
	
	void dfs(int d){
		if(next[0]==0&&next[1]==0)return;
		for(int i=0;i<2;i++){
			if(next[i]==0){
				S.insert(d);
			}
			else{
				next[i]->dfs(d+1);
			}
		}
	}
		
	
};

long long get(long long t){
	for(long long i=60;i>=0;i--){
		if(t%(1LL<<i)==0)return (1<<i);
	}
	return 0LL;
}

int main(){
	
	int N;
	cin>>N;
	
	long long L;
	cin>>L;
	
	trie T;
	
	for(int i=0;i<N;i++){
		string s;
		cin>>s;
		T.add(s);
	}
	
	T.dfs(0);
	
	long long now = 0LL;
	for(auto a:S){
		now ^= get(L-a);
	}
	
	if(now==0)cout<<"Bob"<<endl;
	else cout<<"Alice"<<endl;
	
	return 0;
}


Measured memory_bytes: 23952
#include <iostream>
#include <cstdio>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <string>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <nmmintrin.h>
#include <chrono>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#ifdef _MSC_VER
#define __builtin_popcount _mm_popcnt_u32
#define __builtin_popcountll _mm_popcnt_u64
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}
template<int MOD>
struct ModInt{
		static const int Mod = MOD;
		unsigned x;
		ModInt() : x(0) {}
		ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
		ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
		int get() const { return (int)x; }
	
	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }
	ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }
	
	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
	ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }
	
	ModInt inverse() const {
		signed a = x, b = MOD, u = 1, v = 0;
		while (b) {
			signed t = a / b;
			a -= t * b; std::swap(a, b);
			u -= t * v; std::swap(u, v);

		}
		if (u < 0) u += Mod;
		ModInt res; res.x = (unsigned)u;
		return res;
	}
};
typedef ModInt<1000000007> mint;

ll mod_pow(ll x, ll n, ll mod) {
		ll res = 1;
		while (n > 0) {
				if (n & 1) res = res * x%mod;
				x = x*x%mod;
				n >>= 1;
		
	}
		return res;
	
}

signed main() {
	int n;
	string str;

	cin >> n >> str;
	
	mint dp[5002][5002];

	dp[0][0] = 1;

	rep(i, 1, n+1){
		REP(j, n+1){
			dp[i][j] += (j ? dp[i - 1][j - 1]*2 : dp[i-1][j]) + dp[i-1][j + 1];
		}
	}


	printf("%d\n", (dp[n][str.length()] / (mint)mod_pow(2, str.length(), MODU)).get());

	return 0;
}

Measured memory_bytes: 98048
S = str(input())
K = int(input())

ans = '1'
count = 0
for s in S:
    if s == '2' or s == '3' or s == '4' or s == '5' or s == '6' or s == '7' or s == '8' or s == '9':
        ans = s
        break
    count += 1
    if count == K:
        break
    
print(ans)

Measured memory_bytes: 3060
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
int main(){
	long long I,O,T,J,L,S,Z;
	scanf("%lld%lld%lld%lld%lld%lld%lld",&I,&O,&T,&J,&L,&S,&Z);
	long long ret=0;
	ret+=O*2;
	if(J&&L&&I&&J%2+L%2+I%2>=2){
		ret+=6;
		J--;L--;I--;
	}
	ret+=4*(J/2);
	ret+=4*(L/2);
	J%=2;L%=2;
	
	ret+=4*(I/2);
	ret/=2;
	printf("%lld\n",ret);
}
// J********L
// JJJ****LLL

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define reprr(i, m, n) for (ll i = m; i < n; i++)
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll A, B, C, K; cin >> A >> B >> C >> K;
    if (K <= A) {
        cout << K << endl;
    } else if (K <= A + B) {
        cout << A << endl;
    } else {
        cout << A - (K - A - B) << endl;
    }

    return 0;
}

Measured memory_bytes: 3620
/*  -*- coding: utf-8 -*-
 *
 * 3064.cc: AOJ50M
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int t0, t1, a0, a1;
  scanf("%d%d%d%d", &t0, &t1, &a0, &a1);

  if (a0 >= 0 && a1 >= 0) {
    if (a0 > a1) puts("Alice");
    else if (a0 < a1) puts("Bob");
    else puts("Draw");
  }
  else {
    if (t0 < t1) puts("Alice");
    else if (t0 > t1) puts("Bob");
    else puts("Draw");
  }
  return 0;
}



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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

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

void Main()
{
    int n, a;
    cin >> n;
  	rep(i,n){
    	cin >> a;
      	if(a%2==0){
        	if(a%3 && a%5){
            	cout << "DENIED" << endl;
           		return;
            }
        }
    }

	cout << "APPROVED" << endl;   	 
  	return;
}

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


Measured memory_bytes: 256
/*
                    Author: Ankit Kaul
    **********************Code Belongs to Respective Author Only************************************
    */
    /*#pragma GCC optimize("O3")
    #pragma GCC optimize("Ofast")
    #pragma GCC optimize("unroll-loops")
    #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
    #include <bits/stdc++.h>
    #define endl       '\n'
    #define PI          3.141592653589
    #define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    #define M           1000000007
    #define int         long long int
    #define inf         INT_MAX
    #define pb          emplace_back
    #define pf          emplace_front
    #define pii         pair<int,int>
    #define vi          vector<int>
    #define vii         vector<pii>
    #define mi          map<int,int>
    #define mii         map<pii,int>
    #define all(a)      (a).begin(),(a).end()
    #define rall(a)     (a).rbegin(),(a).rend()
    using namespace std;
    int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
    int power(int x,int n){
        int result=1;
        while(n>0)
        {   if(n % 2 ==1)
            result=(result * x) % M;
            x=(x*x)% M;
            n=n/2;
        }
    return result % M;
    }      
    bool isPrime(int n) 
    { 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
    return true; 
    } 
    signed main()
    {   jaldi
        int n;
        cin>>n;
        
        cout<<(n*(n-1))/2;
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Pair = pair<int, int>;
using Vec = vector<int>;
using Graph = vector<Vec>;
#define INF 1000000007
#define MOD 1000000007
#define SEP " "

int		main(void)
{
	ll n, a, b;
	cin >> n >> a >> b;
	ll ans = (b - a) / 2;
	if ((b - a) % 2 == 1)
	{
		if (b-1 < n-a)
			ans += a;
		else
			ans += n-b + 1;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	char S[200001];
	int i, j;

	scanf("%s", S);

	for (i = 0; S[i] != 'A'; i++)
		;

	for (j = 0; S[j] != '\0'; j++)
		;

	while (S[j] != 'Z')
		j--;

	printf("%d\n", j - i+1);

	return 0;
}

Measured memory_bytes: 384
x1,x2,x3,x4,x5 = map(int,input().split())
if x1 == 0:
    print(1)
elif x2 == 0:
    print(2)
elif x3 == 0:
    print(3)
elif x4 == 0:
    print(4)
elif x5 == 0:
    print(5)

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

int main(){
    int n,m,ans=1;
    cin>>n>>m;
    vector<int> a(n),b(n),c(m),d(m);
    for(int i=0; i<n; i++) cin>>a[i]>>b[i];
    for(int i=0; i<m; i++) cin>>c[i]>>d[i];
    for(int i=0; i<n; i++) {
        int dist = 200001000;
        for(int j=m-1; j>=0; j--) {
            if(dist >= abs(a[i]-c[j])+abs(b[i]-d[j])) {
                ans = j+1;
            }
            dist = min(dist, abs(a[i]-c[j])+abs(b[i]-d[j]));
        }
        cout<<ans<<"\n";
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////


int main() {
    int a, b; cin >> a >> b;
    if (a <= 9 && b <= 9) {
        cout << a*b << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}

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

int main() {
  
  int n;
  cin >> n;
  
  vector<int> b(n);
  
  for(int i=0; i<n; i++) {
    int a;
	cin >> a;
    b.at(n-i-1) = a;
  }
  
  for(int i=0; i<n; i++) {
	cout << b.at(i);
    if ( i!=n-1 ) {
      cout << ' ';
    }
  }
  
  cout << endl;
  
  return 0;
}



Measured memory_bytes: 3068
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
using namespace std;
long long int sss(long long int H){
    if(H==1) return 1;
    return sss((H/2))*2+1;
}

int main(){
    long long int H;
    cin>>H;
    cout<<sss(H)<<endl;
    
}

Measured memory_bytes: 888
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int w = in.nextInt();

        int[] weight = new int[n+1];
        int[] prize = new int[n+1];

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

                int x = in.nextInt();
                int y = in.nextInt();
                weight[i] = x;
                prize[i] =y;

        }




        long[][] dp = new long[n+1][w+1];


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

            for(int j=0;j<=w;j++){

               if(i==0 || j==0) dp[i][j] = 0;

               else if (j<weight[i-1]) dp[i][j] = dp[i-1][j];

               else {

                   dp[i][j] = Math.max(dp[i-1][j] , prize[i-1] + dp[i-1][j-weight[i-1]]);


               }
            }


        }


//        for(int i=0;i<=n;i++){
//
//            for(int j=0;j<=w;j++){
//
//                System.out.print(dp[i][j]+" ");
//            }
//
//            System.out.println();
//
//        }
//

        System.out.println(dp[n][w]);



    }

}


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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    
    int n, ans = 0;
    string s;
    char p = '!';

    cin >> n >> s;

    for (int i = 0; i < n; i++) {
        if (s[i] != p) {
            ans++;
        }
        p = s[i];
    }

    cout << ans << '\n';
 
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<utility>
using namespace std;
#define int long long
#define veb vector<bool>
#define vveb vector<veb>
#define vel vector<long long>
#define vvel vector<vel>
#define vvvel vector<vvel>
void mmin(int &a, int b) { a = min(a, b); }
void mmax(int &a, int b) { a = max(a, b); }
void sor(vel &v) { sort(v.begin(), v.end()); }
void rev(vel &v) { reverse(v.begin(), v.end()); }
int zero(void) { return 0; }
signed main() {
	int a, b;
	cin >> a >> b;
	if ((a*b) % 2 == 1) { cout << "Yes"; }
	else { cout << "No"; }
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T>
using max_priority_queue = priority_queue<T>;
template <class T>
using min_priority_queue = priority_queue<T, std::vector<T>, std::greater<T>>;

const int INF = 1 << 29;
const ll LL_INF = 1LL << 60;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
const int MAX_N = 100010;
int N;
vector<int> heights;
ll dp[MAX_N];
void init()
{
    for (int i = 0; i < MAX_N; i++)
    {
        dp[i] = LL_INF;
    }
}

int main()
{
    init();
    cin >> N;
    heights.resize(N);
    for (auto &val : heights)
    {
        cin >> val;
    }
    dp[0] = 0;
    for (int i = 1; i < N; i++)
    {
        if (i - 1 >= 0)
        {
            dp[i] = min(dp[i], dp[i - 1] + abs(heights[i] - heights[i - 1]));
        }
        if (i - 2 >= 0)
        {
            dp[i] = min(dp[i], dp[i - 2] + abs(heights[i] - heights[i - 2]));
        }
        // cout << dp[i] << endl;
    }
    cout << dp[N - 1] << endl;
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

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

	int a, b, c;
	a = A % 3;
	b = B % 3;
	c = (A + B) % 3;

	if (!a || !b || !c) {
		cout << "Possible" << endl;
	}
	else {
		cout << "Impossible" << endl;
	}
}

Measured memory_bytes: 3632
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
using namespace std;

typedef long long int64;
const int64 MOD = 1000000007;

class CTypicalStairs {
 public:
  void solve(std::istream &in, std::ostream &out) {
    int n, m, x;
    in >> n >> m;
    vector<bool> fb(n + 1, false);
    forn(i, m) {
      in >> x;
      fb[x] = true;
    }

    vector<int64> dp(n + 1, 0);
    dp[0] = 1L;
    fore(i, 1, n) {
      if (!fb[i]) {
        dp[i] = dp[i - 1];
        if (i >= 2)dp[i] += dp[i - 2];
        dp[i] %= MOD;
      }
    }
    out << dp[n] << endl;
  }
};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  CTypicalStairs solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}

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


int main()
{
	ll X,A,B;
	cin>>X>>A>>B;
	int eat=B-A;
	if(eat<=0)
	{
		cout<<"delicious"<<endl;
	}
	else if(eat<=X)
	{
		cout<<"safe"<<endl;
	}
	else
	{
		cout<<"dangerous"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdint>
#include <map>
#include <unordered_map>
#include <set>
#include <cmath>
#include <cstdlib>
#include <sstream>

#include <boost/range/irange.hpp>
using boost::irange;

#include <boost/utility/string_ref.hpp>
using boost::string_ref;

using namespace std;

template<class T, size_t N, class F>
struct compare_n
{
    bool operator() (const T& t1, const T& t2, const F& f)
    {
        return f(get<N>(t1), get<N>(t2));
    }
};

template<class T>
using less_1st = compare_n<T, 0, less<T>>;

template<class T>
using less_2nd = compare_n<T, 1, less<T>>;

int op1(int& x, int& y, int& z)
{
    if(x == y)
    {
        if(x < z)
        {
            x += 1;
            y += 1;
            return 1;
        }
        else if(x > z)
        {
            z += 2;
            return 1;
        }
    }
    return 0;
}

int op2(int& x, int& y, int& z)
{
    if(x > max(y, z))
    {
        y += 1;
        z += 1;
        return 1;
    }
    return 0;
}

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

    int a,b,c;
    cin >> a >> b >> c;

    int count = 0;
    while(a != b || b != c || c != a)
    {
        count += op1(a, b, c);
        count += op1(b, c, a);
        count += op1(c, a, b);
        count += op2(a, b, c);
        count += op2(b, c, a);
        count += op2(c, a, b);
        //cout << '(' << a << ',' << b << ',' << c << ')' << endl;
    }
    
    cout << count << '\n';

    return 0;
}



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

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

    long long r = 0;
    long long g = 0;
    long long b = 0;
    for(int i = 0; i < n; i++) {
        if(s[i] == 'R') r++;
        if(s[i] == 'G') g++;
        if(s[i] == 'B') b++;
    }

    long long ans = r * g * b;
    for(int i = 0; i < n - 2; i++) {
        for(int j = 1; i + 2*j < n; j++) {
            if(s[i] != s[i + j] && s[i + j] != s[i + 2*j] && s[i + 2*j] != s[i]) {
                ans--;
            }
        }
    }

    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 3608
module tax
  sub Main(ByVal args() as String)
    dim a,b,c,g,n,x as integer
    dim counta,countb,countc as integer
    dim arr(2) as string
    arr=Split(Console.ReadLine())
 
    n=arr(0)
    g=arr(1)
    x=0

if g<=1 then
counta = 0
else
counta = (g-1)*10
end if

for a= counta to counta + 100

if int(a*0.08)=n then
    if int(a*0.1)=g then
    Console.WriteLine(a)
    Return
    end if
end if
next
a=-1
    Console.WriteLine(a)
  end sub
end module

Measured memory_bytes: 13536
inputs = readlines.map {|line| line.strip.split.map(&:to_i) }

N, M = inputs.shift
ab = inputs

$n = N

def find_path(current, graphs, stops)
  current_stops = stops.dup
  current_stops.push(current).uniq!
  return 1 if current_stops.length == $n
  targets = graphs.select {|graph| graph.include?(current) }.flatten.uniq - current_stops

  targets.map {|target| find_path(target, graphs, current_stops + [target]) }.flatten
end

p find_path(1, ab, []).length



Measured memory_bytes: 2300
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  string s;
  cin >>s;
  int m=a+b+1;
  for(int i=0;i<m;i++){
    if(i==a){
      if(s[i]!='-'){
        cout <<"No" << endl;
        return 0;
      }
    }
    else{
      if(!isdigit(s[i])) {
        cout <<"No" << endl;
        return 0;
    }
  }
}
cout <<"Yes" << endl;
}


Measured memory_bytes: 256
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15


def main():
    n = input().strip()
    # print(n)
    ans = 0
    n = [int(s) for s in n[::-1] + "0"]
    # print(n)
    for i in range(len(n)):
        if n[i] < 5:
            ans += n[i]
        elif n[i] == 5:
            if n[i+1] >= 5:
                n[i+1] += 1
            ans += 5
        else:
            ans += 10 - n[i]
            n[i+1] += 1

    print(ans)


if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Measured memory_bytes: 124132
<?php
$input = STDIN;

$str = trim(fgets($input));
$q = intval(trim(fgets($input)));

for ($i = 0; $i < $q; $i++) {
    $cmd = explode(' ', trim(fgets($input)));
    $a = intval($cmd[1]);
    $b = intval($cmd[2]);
    
    switch ($cmd[0]) {
        case 'print':
            print substr($str, $a, $b - $a + 1) . "\n";
            break;
        case 'reverse':
            $str = substr($str, 0, $a) .
            strrev(substr($str, $a, $b - $a + 1)) . substr($str, $b + 1);
            break;
        default:
        $str = substr($str, 0, $a) . $cmd[3] . substr($str, $b + 1);
            break;
    }
}


Measured memory_bytes: 9324
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvl vector<vector<ll>>
#define print(n) cout<<n<<endl
const int M=100111;
const int mod=1000000007;
const long long inf=1000000000000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


int main(){
	int n,h,w,a[M];
	cin>>h>>w>>n;
	//1-index.
	rep(i,1,n+1)cin>>a[i];
	int b[101][101];
	int cnt=0,x=1,y=1,num=1;
	while(1){
		cnt++;
		if(x%2==1){
			if(a[num]>0){
				a[num]--;
				b[x][y]=num;
				if(y!=h)y++;
				else{
					x++;
				}
			}else{
				num++;
				cnt--;
			}
		}else{
			if(a[num]>0){
				a[num]--;
				b[x][y]=num;
				if(y!=1)y--;
				else{
					x++;
				}
			}else{
				num++;
				cnt--;
			}
		}
		if(cnt==h*w)break;
	}
	rep(j,1,h+1){
		rep(i,1,w+1){
			cout<<b[i][j];
			if(i!=w)cout<<" ";
			else cout<<endl;
		}
	}
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define INIT2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"
#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"

int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a*b /gcd(a,b);}

int main(){
  ll N; cin>>N;
  ll a[N+1]; CINA(a,N+1);
  ll b[N]; CINA(b,N);
  ll r = 0;
  ll buf = 0;
  REP(i,N){
    if(a[i]<=buf){
      r += a[i];
      buf = b[i];
    }else{
      a[i] -= buf;
      r += buf;
      if(a[i]<=b[i]){
        r += a[i];
        buf = b[i]-a[i];
      }else{
        r += b[i];
        buf = 0;
      }
    }
  }
  r += min(a[N],buf);
  cout << r;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[30];
vector<int> vec;
signed main(){
	int h, w;
	scanf("%lld%lld", &h, &w);
	rep(i,h){
		string str;
		cin >> str;
		rep(j,w)a[str[j]-'a']++;
	}
	rep(i,30)if(a[i]%4 > 0)vec.pb(a[i]%4);
	int m = 0;
	if(h%2 == 1)m += w;
	if(w%2 == 1)m += h;
	int f = 0, ans = 1;
	if(h%2 == 1 and w%2 == 1){m -= 2;f = 1;}
	rep(i,vec.size()){
		if(f and vec[i]%2 == 1){f = 0;m -= vec[i]-1;continue;}
		if(vec[i]%2 == 1)ans = 0;
		m -= vec[i];
		if(m < 0)ans = 0;
	}
	printf("%s\n", ans ? "Yes" : "No");
	return 0;
}






Measured memory_bytes: 256
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A = [int(x) for x in readline().split()]
K = int(readline())
A.sort()

A[-1] = A[-1] * 2 ** K
print(sum(A))


Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <queue>
#include <algorithm>
using namespace std;

deque<long long int> dq;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,i;
	cin >> n;
	string s;
	int value;
	deque<long long int>::iterator it = dq.begin();
	for(i=0;i<n;++i){
		cin >> s;
		if(s=="insert"){
			cin >> value;
			dq.push_front(value);
		} else if (s=="delete"){
			cin >> value;
			deque<long long int>::iterator itr = dq.begin();
			while(itr!=dq.end()){
				if(*itr==value){
					dq.erase(itr);
					break;
				}
				itr++;
			}
		} else if (s=="deleteFirst"){
			dq.pop_front();
		} else if (s=="deleteLast"){
			dq.pop_back();
		}
	}
	int cnt=0;

	for(it=dq.begin();it!=dq.end();++it){
		cnt++;
	}
	for(i=0 ; i<cnt-1 ; ++i){
		cout << dq[i] << " ";
	}
	cout << dq[i];
        cout << endl;
	return 0; 
}

Measured memory_bytes: 9232
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
int INF = INT_MAX / 2;
double EPS = 1e-10;
 
void unko(bool x) {
	if (x) cout << "unko" << endl;
}
 
int main() {
    int N, M; cin >> N >> M;
    vector<int> K(N);
    vector<vector<int> > S(N), H(N);
	int sumK = 0;
    for (int i = 0; i < N; i++) {
        cin >> K[i];
		sumK += K[i];
        for (int k = 0; k < K[i]; k++) {
            int s, h; cin >> s >> h;
            S[i].push_back(s);
            H[i].push_back(h);
        }
    }
	unko(sumK >= 4000 * 0.75 && M >= 200 * 0.75);
    double maxi = 0;
    for (int t = 0; t < N; t++) {
        vector<int> dp(M + 1, -INF);
        dp[M] = 0;
        for (int i = 0; i < N - 1; i++) {
            vector<int> _dp = dp;
            for (int j = 0; j <= M; j++) {
                int h = 0, v = 0;
                for (int k = 0; k < K[i]; k++) {
                    h += H[i][k];
                    v += S[i][k] * H[i][k];
                    if (v > j) break;
                    _dp[j - v] = max(_dp[j - v], dp[j] + h);
                }
            }
            dp = _dp;
        }
        for (int j = 0; j <= M; j++) {
            double h = dp[j], v = j;
            for (int k = 0; k < K[N - 1]; k++) {
                double dh = min((double)H[N - 1][k], v / S[N - 1][k]);
                h += dh; v -= S[N - 1][k] * dh;
            }
            maxi = max(maxi, h);
        }
        rotate(K.begin(), K.begin() + 1, K.end());
        rotate(S.begin(), S.begin() + 1, S.end());
        rotate(H.begin(), H.begin() + 1, H.end());
    }
    printf("%.20f\n", maxi);
}

Measured memory_bytes: 1272
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//nCrを返す関数.
long long int comb(long long int n, long long int r){
	if(n < r || n < 0)
		return 0;
	long long int x = 1, y = 1;
	if (n-r < r) r = n - r;
	for (long long int i = 0; i < r; i++)
	{
		x = x * (n - i);
		y = y * (i + 1);
	}
	return x / y;
}


int main(){
	int n;
	cin >> n;
	vector<ll> a(n + 1);
	vector<ll> b(n);
	rep(i, n + 1) cin >> a[i];
	rep(i, n) cin >> b[i];
	vector<ll> c = b;
	rep(i, n)
	{
		ll e1 = b[i] - a[i];
		a[i] = max(-e1, 0LL);
		b[i] = max(e1, 0LL);
		ll e2 = b[i] - a[i + 1];
		a[i + 1] = max(-e2, 0LL);
		b[i] = max(e2, 0LL);
	}
	ll ans = 0;
	rep(i,n){
		ans += c[i] - b[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,ans=1e15;
  cin >> n;
  long long a[n],sum=0,snuke=0;
  for(int i=0;i<n;i++){
    cin >> a[i];
    sum+=a[i];
  }
  for(int i=0;i<n-1;i++){
    snuke+=a[i];
    ans=min(ans, abs(sum-snuke-snuke));
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
    int x,y; cin >> x >> y;
    for(int i=0; i<=x; i++) {
        if(2*i+4*(x-i)==y){
            cout << "Yes" << endl;
            return 0;
        } else if (2*i+4*(x-i) < y) break;
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3636
<?php
    $str = trim(fgets(STDIN));

    $weekDays = array('SUN','MON','TUE','WED','THU','FRI','SAT');
    foreach($weekDays as $Num => $weekDay){
        if($str == $weekDay){
            $label = $Num;
        }
    }
    echo 7 - $label;
?>

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

int main(){
    ll x;
    cin >> x;
    ll cnt = x/11;
    x -= cnt*11;
    cnt *= 2;
    if(x>6){
        cnt += 2;
    }else if(x>0){
        cnt += 1;
    }
    cout << cnt << endl;
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h> 
#include <math.h>
int main(void)
{
    int num ,x[1000],y[1000],i;
    double z1 =0, z2 = 0, z3 = 0, z =0,A;
    scanf("%d",&num);
    for(i=0;i<num;i++){
        scanf("%d",&x[i]);
    }
    for(i=0;i<num;i++){
        scanf("%d",&y[i]);
    }
    for(i=0;i<num;i++){
        A = y[i] - x[i];
        if(A<0){
            A = A*(-1);
        }
        z1 = z1 + A;
        z3 = z3 + A * A * A;
        z2 = z2 + (x[i] - y[i]) * (x[i] - y[i]);
    
        if(x[i]<y[i]){
            if(z<y[i] - x[i]){
                z =y[i] - x[i];
            }
        }
        if(x[i]>y[i]){
            if(z<x[i] -y[i]){
                z = x[i] -y[i];
            }
        }
    }
    printf("%f\n%f\n%f\n%f\n",z1,sqrt(z2),pow(z3,1.0/3.0),z);
    return 0 ;
}


Measured memory_bytes: 2112
import java.util.*;

public class Main{
    
    static int n;
    static int m;
    static ArrayList<Integer>[] g;
    static boolean[] used;
    static int[] cmp;
    static ArrayList<Integer>[] cos;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        n = sc.nextInt();
        m = sc.nextInt();
        
        g = new ArrayList[n];
        for(int i=0; i<n; i++){
            g[i]= new ArrayList<Integer>();
        }
        
        used = new boolean[n];
        cmp = new int[n];
        
        int[] a = new int[n];
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        
        for(int i=0; i<m; i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            addEdge(x, y);
        }
        
        int k = scc();
        
        cos = new ArrayList[k];
        for(int i=0; i<k; i++){
            cos[i] = new ArrayList<Integer>();
        }
        
        for(int i=0; i<n; i++){
            cos[cmp[i]].add(a[i]);
        }
        
        if(k==1){
            System.out.println(0);
            return;
        }
        
        long cost = 0;
        
        ArrayList<Integer> nkr = new ArrayList<Integer>();
        for(int i=0; i<k; i++){
            Collections.sort(cos[i]);
            cost += cos[i].get(0);
            for(int j=1; j<cos[i].size(); j++){
                nkr.add(cos[i].get(j));
            }
        }
        
        int pick = k-2;
        if(nkr.size() < pick){
            System.out.println("Impossible");
            
        }else{
            Collections.sort(nkr);
            
            for(int i=0; i<pick; i++){
                cost += nkr.get(i);
            }
            
            System.out.println(cost);
        }
    }
    
    public static int scc(){
        usedReset();
        
        int k =0;
        for(int i=0; i<n; i++){
            if(!used[i]) dfs(i, k++);
        }
        
        return k;
    }
    
    
    public static void usedReset(){
        Arrays.fill(used, false);
    }
    
    public static void addEdge(int from, int to){
        g[from].add(to);
        g[to].add(from);
    }
    
    public static void dfs(int v, int k){
        used[v] = true;
        cmp[v] = k;
        for(int i=0; i<g[v].size(); i++){
            if(!used[(int)g[v].get(i)]) dfs((int)g[v].get(i), k);
        }
    }
    
}


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

void __print(int x) {cerr << x;};void __print(long x) {cerr << x;};void __print(long long x) {cerr << x;};void __print(unsigned x) {cerr << x;};void __print(unsigned long x) {cerr << x;};void __print(unsigned long long x) {cerr << x;};void __print(float x) {cerr << x;};void __print(double x) {cerr << x;};void __print(long double x) {cerr << x;};void __print(char x) {cerr << '\'' << x << '\'';};void __print(const char *x) {cerr << '\"' << x << '\"';};void __print(const string &x) {cerr << '\"' << x << '\"';};void __print(bool x) {cerr << (x ? "true" : "false");}

#define int             long long
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define endl             '\n'
#define pb              push_back
#define all(x)          x.begin(),x.end()
#define ff              first
#define ss              second
int powmod(int a,int b) {int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int string_to_int(string s){int ans = 0;int p=1;for(int i=s.size()-1;i>=0;i--){ans += (s[i]-'0')*p;p *= 10;}return ans;}

//DEBUGGING-LINES
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr <<'}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i);cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

void t_c_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/*#ifndef ONLINE_JUDGE
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif*/

	int n,m,k; cin >> n >> m >> k;
	int c; cin >> c;
	while(m<=n and c){
		m*=2;
		c--;
	}
	while(k<=m and c){
		k*=2;
		c--;
	}
	//debug(n,m,k);
	if(m>n and k>m){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
}

int32_t main()
{
	t_c_c();
	return 0;
}


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

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

    // for prime mod
    mint inv() const
    {
        return pow(mod - 2);
    }
    mint &operator/=(const mint a)
    {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const
    {
        mint res(*this);
        return res /= a;
    }
};


vector<vector<int>> tree;
int k;
mint dfs(int now, int upper){

    int remained_color = k - 2;
    if(now == 1){
        remained_color++; //親がない最上位だけ特別
    }

    if(k < tree[now].size() + 1){
        return 0; //塗分けられない。
    }

    mint count(1);
    for (auto i = tree[now].begin(); i < tree[now].end(); i++)
    {
        if(*i == upper) continue;
        mint rc(remained_color);
        count *= rc;
        remained_color--;
    }

    for (auto i = tree[now].begin(); i < tree[now].end(); i++)
    {
        if(*i == upper) continue;
        count *= dfs(*i, now);
    }
    

    return count;
}


int main(void)
{
    int n;
    cin >> n >> k;

    tree.resize(n + 1);
    
    for (size_t i = 0; i < n - 1; ++i)
    {
        int a, b;
        cin >> a >> b; 
        tree[a].push_back(b);
        tree[b].push_back(a);
    }
    
    mint answer(k);
    answer *= dfs(1, -1);
    cout << answer.x << endl; 
    return 0;   
}

Measured memory_bytes: 9216
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}
int main() {
	int n,k; rd(n),rd(k);
	printf("%d",n-k+1);
	return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
using namespace std;

int main(){
  string n;
  cin >> n;
  int sum = 0;
  for(int i = 0; i < n.length(); i++){
    sum += n[i]-'0';
  }
  int x = stoi(n);
  if(x%sum==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256