akhauriyash/Code-Regression huggingface dataset:
// D - Semi Common Multiple
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}

int f(int x){
	int c;
	for(c=0; !(x&1); c++) x>>=1;
	return c;
}

int solve(int N, int M, vi &A){
	ll L = 1;
	int T = f(A[0]/2);
	M >>= T;
	for(int a:A){
		int b = a/2;
		if(f(b) != T) return 0;
		if((L=lcm(L, b>>T)) > M) return 0;
	}
	return (M/L+2-1)/2;//round up
}

int main(){
	int N,M; cin>>N>>M;
	vi A(N); rp(i, 0, N) cin>>A[i];
	cout<< solve(N,M,A) <<endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] heap = new int[n];
        for (int i = 0; i < n; i++) {
            heap[i] = in.nextInt();
        }
        buildMaxHeap(heap);
        for (int i : heap) {
            System.out.print(" " + i);
        }
        System.out.println();
    }

    private static void buildMaxHeap(int[] heap) {
        for (int i = heap.length / 2; i > 0; i--) {
            maxHeapify(heap, i);
        }
    }

    private static void maxHeapify(int[] heap, int i) {
        int left = i*2-1;
        if (left < heap.length) {
            int right = i * 2;
            int maxChild = left;
            if (right < heap.length && heap[right] > heap[left]) {
                maxChild = right;
            }

            if (heap[maxChild] > heap[i - 1]) {
                int temp = heap[maxChild];
                heap[maxChild] = heap[i - 1];
                heap[i - 1] = temp;
                maxHeapify(heap, maxChild+1);
            }
        }
    }
}



Measured memory_bytes: 167636
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_B main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif


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

    int N, D; cin >> N >> D;
    vvi X(N, vi(D));
    REP(i, N)
        REP(j, D) cin >> X[i][j];

    set<int> st;
    FOR(i, 1, 401) st.insert(i*i);

    int ans = 0;
    REP(i,N-1){        
        FOR(j,i+1,N) {
            double dist = 0;
            REP(k, D) {
                dist += (X[i][k] - X[j][k])*(X[i][k] - X[j][k]);
            }
            if (st.count(dist) > 0) ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#define cs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define rep(i,b)  for(int i=0;i<(int)(b);i++)
#define Rep(i,n) for(int i=1;i<(int)(n);i++)
#define repp(i,a,b)  for(int i=a;i<=(int)(b);i++)
#define Repp(i,a,b)  for(int i=a;i>=(int)(b);i--)
typedef long long ll;
typedef long double ld;
using namespace std;

int main(){
    cs;
    int n,x,y;
    cin>>n>>x>>y;
    vector<int> v(n);
    x--;y--;
    rep(i,n){
        repp(j,i+1,n-1){
            int t=min(abs(i-j),abs(i-x)+abs(j-y)+1);
            v[t]++;
        }
    }
    repp(i,1,n-1) cout<<v[i]<<'\n';

}

Measured memory_bytes: 256
class Node{
  constructor(id, parent, children) {
    this.id = id;
    this.parent = parent;
    this.children = children;
  }

  get type() {
    if (this.parent === null) return 'root';
    if (this.children.length === 0) return 'leaf';
    return 'internal node';
  }

  get depth() {
    const getDepth = (node, i) => {
      return node.parent === null ? i : getDepth(node.parent, i + 1);
    };
    return getDepth(this, 0);
  }

  toString() {
    return `node ${this.id}: parent = ${this.parent !== null ? this.parent.id : -1}, depth = ${this.depth}, ${this.type}, [${this.children.map(n => n.id).join(', ')}]`;
  }
};

class Tree {
  constructor(n) {
    this.nodes = [];
  }

  add(id, childrenIds) {
    let node = this.find(id);
    childrenIds.forEach((cid) => {
      let c = this.find(cid);
      c.parent = node;
      c.id = cid;
      node.children.push(c);
    })
  }

  find(id) { return this.nodes[id] || (this.nodes[id] = new Node(id, null, []));}

  print() { console.log(this.nodes.sort((a, b) => a.id - b.id).map(n => n.toString()).join('\n')); }
}

(function main(){
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
  const n = Number(lines.shift());
  let tree = new Tree(n);
  let id, k, childrenIds;
  lines.map(l => l.split(' ').map(Number)).forEach(function(line) {
    id = line.shift();
    k = line.shift();
    childrenIds = line;
    tree.add(id, childrenIds);
  });
  tree.print();
})();



Measured memory_bytes: 148064
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define EPS 0.0000000001
#define INF 1000000000
#define MOD 1000000007
typedef long long ll;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b){
        cout<<c;
    }
    else if(b==c){
        cout<<a;
    }
    else{
        cout<<b;
    }
}


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

#define null				""
#define all(dat)			dat.begin(), dat.end()
#define over(msg)			cout << msg << endl, exit(0);
#define loop(i, to)			for (int i = 0; i < to; ++i)
#define cont(i, to)			for (int i = 1; i <= to; ++i)
#define foreach(i, dat)		for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long			num;

using namespace std;

bool g[25][25];
int n, dp[(1 << 21) + 5], mod = 1e9 + 7;

int main() {
	ios_base::sync_with_stdio(0);
	cin >> n;
	loop (i, n) {
		loop (j, n) {
			cin >> g[i][j];
		}
	}
	dp[0] = 1;
	cont (S, (1 << n) - 1) {
		int i = __builtin_popcount(S) - 1;
		loop (j, n) {
			if (((S >> j) & 1) && g[i][j]) {
				dp[S] += dp[S ^ (1 << j)];
				dp[S] %= mod;
			}
		}
	}
	cout << dp[(1 << n) - 1] << endl;
}


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

int main(){
	int N,K; cin>>N>>K;
	int dmy;
	for (int i=0;i<N;i++){
		cin>>dmy;
	}
	
	cout << (N-1+K-1-1)/(K-1) << '\n';
	
	return 0;
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        var ab = Console.ReadLine().Split(' ');
        var a = int.Parse(ab[0]);
        var b = int.Parse(ab[1]);
        Console.WriteLine((a * b) % 2 == 1 ? "Yes" : "No");
    }
}


Measured memory_bytes: 11092
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::{i32, i64, i128, u32, u64, u128, f64};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};
#[allow(unused_imports)]
use proconio::marker::{Isize1, Usize1, Bytes, Chars};

#[proconio::fastout]
fn main() {
    proconio::input!{
        n: i32,
    }
    match n % 10 {
        3 => println!("bon"),
        0 | 1 | 6 | 8 => println!("pon"),
        _ => println!("hon"),
    }
}


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

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

	bool bSmooth = true;
	for (int i = 0; i < (int)S.size(); i++) {
		if (i == 0) {
			if (S[i] != 'R' && S[i] != 'U' && S[i] != 'D') {
				bSmooth = false;
			}
		}
		else {
			if ((i+1) % 2 == 0) {
				if (S[i] != 'L' && S[i] != 'U' && S[i] != 'D') {
					bSmooth = false;
				}
			}
			else {
				if (S[i] != 'R' && S[i] != 'U' && S[i] != 'D') {
					bSmooth = false;
				}
			}
		}
	}

	if (bSmooth) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>

using namespace std;

int main() {
	int n, k;

	while( true ) {
		cin >> n >> k;
		if( !n && !k ) {
			break;
		}

		vector< bool > num(n + 1, false);

		for(int i = 0; i < k; i++) {
			int tmp;
			cin >> tmp;
			num[tmp] = true;
		}

		int s = 0, t = 0, ans = 0;
		int used = 0;

		while( s < n ) {
			while( !num[++s] );
			t = s;
			if( t == n ) {
				break;
			}
			while( num[++t] && t < n );
			if( t == n ) {
				break;
			}
			if( num[0] ) {
				while( num[++t] && t < n );
				if( num[t] ) {
					t++;
				}
			}
			ans = max(ans, t - s);
		}

		cout << ans << endl;
	}
}

Measured memory_bytes: 1208
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int N, M;
	cin >> N >> M;
	VI cost(M);
	vector<VI>can(M);
	vector<bool> F(N+1,false);
	REP(i, M) {
		int b;
		cin >> cost[i] >> b;
		REP(j, b) {
			int a;
			cin >> a;
			can[i].push_back(a);
			F[a] = true;
		}
	}
	bool P = true;
	eFOR(i,1, N) {
		if (F[i] == false)P = false;
	}
	/*if (P==false) {
		cout << -1 << endl;
		return 0;
	}*/
	
	int dp[5000];
	REP(i, 5000)dp[i] = INF;

	REP(i, M) {
		int k = 0;
		int tmp = 0;
		
		REP(j, N) {
			if (k!=can[i].size()&&can[i][k] == j+1) {
				tmp++;
				k++;
			}
			tmp *= 2;
		}
		tmp /= 2;
		dp[tmp] = min(dp[tmp],cost[i]);
		
		REP(j, (1<<N)) {
			dp[j | tmp] = min(dp[j|tmp], dp[j] + cost[i]);
		}
	}
	if (dp[(1 << N) - 1] == INF)cout << -1 << endl;
	else cout << dp[(1 << N) - 1] << endl;
	return 0;
}



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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "POSSIBLE" : "IMPOSSIBLE") << endl;
typedef long long ll;

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__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

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

  CIN(N, M);
  set< int > from;
  set< int > to;
  REP(i, M) {
    CIN(a, b);
    if (a == 1) {
      from.insert(b);
    }
    if (b == N) {
      to.insert(a);
    }
  }

  bool ok = false;
  EACH(f, from) {
    if (to.find(f) != to.end()) ok = true;
    if (ok) break;
  }
  OK(ok);

  return 0;
}



Measured memory_bytes: 9600
require 'prime'

MOD = 10**9 + 7
N = gets.to_i

factors = {}
(1..N).each do |n|
    primes = n.prime_division
    primes.each do |k, v|
        if factors.key?(k)
            factors[k] += v
        else
            factors[k] = v
        end
    end
end

ans = 1
factors.each do |k, v|
    ans *= (v + 1) % MOD
    ans = ans % MOD
end

puts ans

Measured memory_bytes: 2300
# -*- coding: utf-8 -*-

N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [0] * N
for i in range(0,N):
    A[i] = list(map(int,input().split()))

ans = 0

for index, item in enumerate(range(0,N)):
    sum = 0
    for ind, itm in enumerate(range(0,M)):
        sum += B[ind] * A[index][ind]
    sum += C
    if sum > 0:
        ans += 1

print(ans)


Measured memory_bytes: 3064
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X,Y,A,B,C = map(int, readline().split())

P = sorted(list(map(int, readline().split())),reverse=True)
Q = sorted(list(map(int, readline().split())),reverse=True)
R = sorted(list(map(int, readline().split())),reverse=True)

lis = P[:X] + Q[:Y] + R

print(sum(sorted(lis,reverse=True)[:X+Y]))

Measured memory_bytes: 23368
// Author :
// Date :
// Problem:
// Solution:
// Comment:

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>

#define pp push
#define pb push_back
#define mp make_pair
#define xx first
#define yy second

using namespace std;

double calculate(double vx, double vy, double x){
    return -(x*x)/(2*vx*vx)+(vy*x)/vx;
}

double calc(double x , double x0 , double y){
    return sqrt((x*(-x+x0))/(2*y));
}

main(){
    double d;
    int n , b;
    vector < pair <double , double> > obs;
    
    cin >> d >> n >> b;
    
    for(int i = 0 ; i < n ; i ++){
        double a,b;
        
        cin >> a >> b;
        
        obs.pb(mp(a,b));
    }
    
    
    double ans = 10e15;
    
    //cout << endl << endl;
    for(int i = 0 ; i <= b ; i++){
        double x0 = d / double(i+1);
        
        //cout << "x0 " << x0 << endl;
        
        double miXX = 10e10;
        
        int flag = 1;
        
        for(int j = 0 ; j < n ; j++){
            double kk = obs[j].xx;
            while(kk >= x0) kk-=x0;
            double miX = calc( kk , x0 , obs[j].yy);
            double miY = x0 / (2*miX);
            
            if(kk <= 0 ) flag = 0;
            
            //cout << "W " << miX << " " << miY << " " << sqrt(miX*miX + miY*miY) << endl;
            //cout << "H " << kk << " " << calculate(miX,miY,kk) << endl;
            
            double maa = 2*miX*miY;
            
            if(maa > kk){
                if(miX < miXX) miXX = miX;
            }
        }
        
        //cout << miXX << endl;
        
        double miYY = x0 / (2*miXX);
        
        //cout << "tan" << miYY / miXX;
        
        double tanX = miYY / miXX;
        
        if(tanX < 1.00){
            miXX = sqrt(x0/2.00);
            miYY = miXX;
        }
        
        //cout << "t " << tanX << endl;
        //cout << flag << endl;
        if(flag == 1){
            //cout << sqrt(miXX*miXX + miYY * miYY) << endl;
            ans = min(ans , sqrt(miXX*miXX + miYY * miYY));
        }
        //cout << "aa " << miXX << " " << miYY << " " << sqrt(miXX*miXX + miYY * miYY) << endl << endl;
        
        //cout << endl << endl;
    }
    
    cout << setprecision(10) << ans << endl;
    #ifdef GEREL
        for(;;);
    #endif

    return 0;
}

Measured memory_bytes: 1300
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	ll a,b,x;
	cin >> a >> b >>x;
	ll c = b / x;
	if (a % x != 0){
		a /= x;
		a += 1;
		a *= x;
	}
	ll ans = b / x - a / x + 1;
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
package main

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

func solve(sc *scanner, wr *bufio.Writer) {
	a, b := sc.getInt2()
	if a == 1 {
		a = 14
	}
	if b == 1 {
		b = 14
	}

	ans := "Draw"
	if a > b {
		ans = "Alice"
	} else if a < b {
		ans = "Bob"
	}
	fmt.Fprintln(wr, ans)
}

func main() {
	sc := newScanner()
	wr := bufio.NewWriter(os.Stdout)
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)

	solve(sc, wr)
	wr.Flush()
}

// input ------------------------
type scanner struct {
	*bufio.Scanner
}

func newScanner() *scanner {
	sc := bufio.NewScanner(os.Stdin)
	return &scanner{sc}
}
func (sc *scanner) getInt() int {
	sc.Scan()
	ret, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getInt2() (int, int) {
	return sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt3() (int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInt4() (int, int, int, int) {
	return sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()
}
func (sc *scanner) getInts(n int) []int {
	ret := make([]int, n)
	for i := range ret {
		ret[i] = sc.getInt()
	}
	return ret
}
func (sc *scanner) getString() string {
	sc.Scan()
	return sc.Text()
}
func (sc *scanner) getRunes() []rune {
	return []rune(sc.getString())
}
func (sc *scanner) getFloat() float64 {
	sc.Scan()
	ret, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return ret
}
func (sc *scanner) getFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := range ret {
		ret[i] = sc.getFloat()
	}
	return ret
}

// math ----------------------------
func sum(ns ...int) int {
	var sum int
	for _, n := range ns {
		sum += n
	}
	return sum
}

func max(ns ...int) int {
	max := ns[0]
	for i := 1; i < len(ns); i++ {
		if max < ns[i] {
			max = ns[i]
		}
	}
	return max
}

func min(ns ...int) int {
	min := ns[0]
	for i := 1; i < len(ns); i++ {
		if min > ns[i] {
			min = ns[i]
		}
	}
	return min
}

func pow(a, b int) int {
	ret := 1
	for b > 0 {
		if b&1 > 0 {
			ret = ret * a
		}
		a = a * a
		b >>= 1
	}
	return ret
}


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

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int cnt[100005];

int main() {
    int n;
    scanf("%d", &n);
    forn(i, n) {
        int x;
        scanf("%d", &x);
        ++cnt[x];
        ++cnt[x + 1];
        ++cnt[x + 2];
    }
    int ans = 0;
    forn(i, 100005) {
        ans = max(ans, cnt[i]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 764
<?php
fscanf(STDIN, "%d%d%d", $N, $K, $C);
$S = str_split(trim(fgets(STDIN)));
$rest = 10**10;
$c = 1;
for($i = 0; $i < $N; $i++){
    if($S[$i] == "o" && $rest > $C){
        $work[$i] = $c++;
        $rest = 0;
    }else{
        $work[$i] = 0;
    }
    $rest++;
}
$rest = 10**10;
$c = $K;
for($i = $N-1; $i >= 0; $i--){
    if($S[$i] == "o" && $rest > $C){
        $work2[$i] = $c--;
        $rest = 0;
    }else{
        $work2[$i] = 0;
    }
    $rest++;
}
for($i = 0; $i < $N; $i++){
    if($work[$i] > 0 && $work[$i] == $work2[$i])echo $i+1,"\n";
}


Measured memory_bytes: 38004
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <set>
#include <map>
using namespace std;
typedef long long ll;

int N, K;

int main(int argc, char const *argv[]) {
	cin >> N >> K;
	int a;
	map<int, int> mp;
	vector<int> v;
	for (int i = 0; i < 10; i++) mp[i] = 1;
	for (int i = 0; i < K; i++) {
		cin >> a;
		mp[a]--;
	}
	for (int i = 0; i < 10; i++) {
		if (!mp[i]) v.push_back(i); 
	}
	int size = to_string(N).size();
	string sx;
	for (int x = N; x < 10 * N; x++) {
		sx = to_string(x);
		bool flag = false;
		for (int i = 0; i < sx.size(); i++) {
			for (int j = 0; j < v.size(); j++)
				if (sx[i]-'0' == v[j]) flag = true;
		}
		if (!flag) {
			cout << x << endl;
			return 0;
		}

	}
	// sort(v.begin(), v.end());
	// string s = to_string(N);
	// vector<int> res;
	// string t = "";

	// for (int i = 0; i < s.size(); i++) t += to_string(v[v.size()-1]);
	// if (atoi(t.c_str()) < N) {
	// 	t = "";
	// 	for (int i = 0; i < s.size()+1; i++) t += to_string(v[0]);
	// 	cout << t << endl;
	// 	return 0;
	// }
	// t = "";
	// for (int i1 = 0; i1 < v.size(); i1++) {
	// 	t += to_string(v[i1]);
	// 	if (s.size() == 1 && atoi(t.c_str()) >= N) {
	// 		cout << t << endl;
	// 		return 0;
	// 	}
	// 	else {
	// 		for (int i2 = 0; i2 < v.size(); i2++) {
	// 			t += to_string(v[i2]);
	// 			if (s.size() == 2 && atoi(t.c_str()) >= N) {
	// 				cout << t << endl;
	// 				return 0;
	// 			}
	// 			else {
	// 				for (int i3 = 0; i3 < v.size(); i3++) {
	// 					t += to_string(v[i3]);
	// 					if (s.size() == 3 && atoi(t.c_str()) >= N) {
	// 						cout << t << endl;
	// 						return 0;
	// 					}
	// 					else {
	// 						for (int i4 = 0; i4 < v.size(); i4++) {
	// 							t += to_string(v[i4]);
	// 							if (s.size() == 4 && atoi(t.c_str()) >= N) {
	// 								cout << t << endl;
	// 								return 0;
	// 							}
	// 							t.pop_back();
	// 						}
	// 						t.pop_back();
	// 					}
	// 				}
	// 				t.pop_back();
	// 			}
	// 		}
	// 		t.pop_back();
	// 	}
	// }
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>


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

	int64_t s_b = 1;
	int64_t s_m = 0;

	int64_t can_change_a = a - s_b;

	int64_t tataku_max = k + s_b;
	int64_t nokori = k - can_change_a;
	int64_t risou = 0;
	if (nokori / 2 >= 1)
	{
		risou = b + ((nokori - 2) / 2 * (b - a)) + nokori % 2;
	}

	std::cout << (risou > tataku_max ? risou : tataku_max) << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>
#include <assert.h>


using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;


int main() {
	int H, W; cin >> H >> W;
	vector<vector<char>>A(H, vector<char>(W));
	map<char, int>cnt;
	for (int i = 0; i < H; i++)
	{
		for (int j = 0; j < W; j++)
		{
			cin >> A[i][j];
			cnt[A[i][j]]++;
		}
	}

	bool flg = false;
	int odd = 0, div2=0;
	for (auto a : cnt) {
		int c = a.second;
		if (H % 2 == 0 && W % 2 == 0) {
			if (c % 4) {
				puts("No");
				return 0;
			}
		}
		else if (H % 2 && W % 2) {
			if (!flg&&c % 2) {
				flg = true;
				odd = c;
			}
			else if (flg&&c % 2) {
				puts("No");
				return 0;
			}
			else {
				if (c % 4)div2 += c%4;
				if (div2 > (H + W - 1) - (odd-1)%4) {
					puts("No");
					return 0;
				}
			}
		}
		else {
			if (c % 2) {
				puts("No");
				return 0;
			}
			else  if (c % 4) {
				div2 += c%4;
				if (div2 > ((H % 2) ? W : H)) {
					puts("No");
					return 0;
				}
			}
		}
	}

	puts("Yes");

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
int main() {
	int n, E, T;
	scanf("%d%d%d", &n, &E, &T);
	vector<int> X(n + 1);
	vector<ll> dp(n + 1);
	for (int i = 1; i <= n; ++i) scanf("%d", &X[i]);
	int j = 0;
	ll minv = 1LL << 60;
	for (int i = 1; i <= n; ++i) {
		while (2 * X[j + 1] < 2 * X[i] - T) {
			minv = min(minv, dp[j] - 2 * X[j + 1]);
			++j;
		}
		assert(j < i);
		assert(X[i] - X[j + 1] <= T);
		dp[i] = min(minv + 2 * X[i], dp[j] + T);
	}
	ll ans = dp[n] + E;
	printf("%lld\n", ans);
}


Measured memory_bytes: 1408
N, M = map(int, input().split())

S = [[] for i in range(N)]

n = []

flag = True

#print(S)

for _ in range(M):
    s, c = map(int, input().split())
    if c not in S[s - 1]:
        S[s-1].append(c)

#print(S)
#print(n)

# 0かどうかをチェック
#print(int("".join(S)))
if N != 1:
    if S[0] and sum(S[0]) == 0:
        #print("Err!")
        flag = False

ans = ""

for i in range(len(S)):
    # エラー回避済み
    if N!= 1 and i == 0:
        if S[i]:
            if len(S[i]) != 1:
                flag = False
                #print("Err")
            else:
                if S[i] == 0:
                    ans += "1"
                else:
                    ans += (str(S[i][0]))
        else:
            ans += "1"
    else:
        if S[i]:
            if len(S[i]) != 1:
                flag = False
                #print("Err")
            else:
                if S[i] == 0:
                    ans += "1"
                else:
                    ans += (str(S[i][0]))
        else:
            ans += str(0)

print(ans) if flag else print(-1)

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

using namespace std;
const int maxn = 260;
typedef long long ll;

int num[maxn];

int ok(int n)
{
    int q = sqrt(n);
    int tmp = 1;
    for(int i=2; i<=n; i++)
        if(n%i == 0)
            tmp++;
    if(tmp == 8)
        return 1;
    return 0;
}
int init()
{
    num[105] = 1;
    for(int i=106; i<=250; i++)
    {

        if(ok(i) && i%2)
            num[i] = num[i-1] + 1;
        else
            num[i] = num[i-1];
    }
}
int main()
{
    std::ios::sync_with_stdio(false);
    init();
    int n;
    cin>>n;
    cout<<num[n]<<endl;

    //cout<<ok(105);
//
//    cin>>n>>m;
//    cout<<n*m - (n+m-1)<<endl;
}


Measured memory_bytes: 256
#include<bits//stdc++.h>
#define rep(i,n) for(int i = 0;i < n;i++)
#define MOD 1000000007
using namespace std;
typedef long long int ll;
int n,a,b,ans = 0;vector<ll> sz, pw;vector<vector<int>> v;
void dfs(int node, int p) {// now , before
    sz[node] = 1; int pr = pw[1];
    for (int u : v[node]) {
        if (u != p) {
            dfs(u, node); sz[node] += sz[u];
            pr = (pr - pw[n - sz[u]] + MOD) % MOD;
        }
    }
    if (node != 1) pr = (pr - pw[sz[node]] + MOD) % MOD;
    pr = (pr + (v[node].size() - 1) * pw[n] % MOD + MOD) % MOD;
    ans = (ans + pr) % MOD;
}
int main() {
    cin >> n; v.resize(n+10), sz.resize(n+10), pw.resize(n+10);
    pw[0] = 1; pw[1] = (MOD + 1) / 2;
    rep(i, n - 1) {
        pw[i + 2] = (pw[i + 1] * pw[1]) % MOD;
        cin >> a >> b;
        v[a].push_back(b);v[b].push_back(a);
    }dfs(1, 0); cout << ans << endl;
}

Measured memory_bytes: 30556
#include <stdio.h>

int main(void)
{
    int n, x, i, d = 0;
    scanf("%d %d", &n, &x);
    int l[n + 1];

    for (i = 0; i < n; i++) {
        scanf("%d", &l[i]);
    }
    l[n] = 10000;

    for (i = 0; i < n + 1; i++) {
        if (d > x) {
            break;
        } else {
            d += l[i];
        }
    }

    printf("%d\n", i);

    return 0;
}


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

#define pb push_back
#define pob pop_back
#define mp make_pair
#define f first
#define s second

typedef long long ll;
const ll INF = 1e18;
const ll mod = 1e9 + 7;

int n,k;
vector <vector<int> > adj;

void solve(){
	cin>>n>>k;
	if(k > ((n-1)*(n-2))/2) cout<<"-1\n";
	else{
		adj.resize(n+1);
		int m=n-1;
		for(int i=1;i<=n-1;i++){
			adj[i].pb(n);
		}
		int req = ((n-1)*(n-2))/2;
		for(int i=1;i<n-1;i++){
			for(int j=i+1;j<=n-1;j++){
				if(req > k){
					adj[i].pb(j);
					req--;
					m++;
				}
			}
		}
		cout<<m<<"\n";
		vector <int> :: iterator itr;
		for(int i=1;i<=n;i++){
			for(itr = adj[i].begin();itr != adj[i].end();itr++){
				cout<<i<<" "<<(*itr)<<"\n";
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(0);
  cin.tie(0);
		solve();
}


Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(int i=0;i<n;++i)
#define REPR(i,n) for(int i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define SUR 1000000007
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  int a, b;
  scanf("%d %d", &a, &b);

  char s[100][101];
  REP(i,100){
    REP(j,100){
      if(i < 50){
        s[i][j] = '.';
      }else{
        s[i][j] = '#';
      }
    }
  }

  REP(i,b - 1){
    int r = i % 50, c = (i / 50) * 2;
    if(c % 2 == 0){
      s[c][r * 2] = '#';
    }else{
      s[c][r * 2 + 1] = '#';
    }
  }

  REP(i,a - 1){
    int r = i % 50, c = (i / 50) * 2 + 51;
    if(c % 2 == 0){
      s[c][r * 2] = '.';
    }else{
      s[c][r * 2 + 1] = '.';
    }
  }

  printf("100 100\n");
  REP(i,100){
    REP(j,100){
      printf("%c", s[i][j]);
    }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        int[] inputi = new int[4];
        string[] inputs = Console.ReadLine().Split(' ');
        for (int cnt = 0; cnt < inputs.Length; cnt++)
        {
            if (cnt < inputi.Length)
            {
                if (!int.TryParse(inputs[cnt], out inputi[cnt]))
                {
                    Console.WriteLine(0);
                    return;
                }
                // 0≤A,B,C
                if (cnt < 3 && inputi[cnt] < 0)
                {
                    Console.WriteLine(0);
                    return;
                }
                // 1≤K≤A+B+C
                if (cnt == 3 && (inputi[cnt] < 1 || inputi[cnt] > inputi[0] + inputi[1] + inputi[2]) && inputi[cnt] > 2 * Math.Pow(10, 9))
                {
                    Console.WriteLine(0);
                    return;
                }
            }
            else
            {
                Console.WriteLine(0);
                return;
            }
        }

        inputi[3] = inputi[3] - inputi[0];
        if (inputi[3] <= 0)
        {
            Console.WriteLine(1 * (inputi[0] + inputi[3]));
            return;
        }
        inputi[3] = inputi[3] - inputi[1];
        if (inputi[3] <= 0)
        {
            Console.WriteLine(inputi[0]);
            return;
        }
        inputi[3] = inputi[3] - inputi[2];
        if (inputi[3] <= 0)
        {
            Console.WriteLine(inputi[0] - 1 * (inputi[2] + inputi[3]));
            return;
        }

        return;
    }
}


Measured memory_bytes: 27524
# pragma GCC optimize("O3")
# include <bits/stdc++.h>
# define maxn 200005
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
# define pb push_back
# define mp make_pair
# define int ll
using namespace std;

ll mx = 0,n,W,w[101],p[101],dp[101][1001];

int32_t main(){_
    //freopen("input","r",stdin);
	cin >> n >> W;
	for(int i = 1;i <= n;i++)
	{
		cin >> w[i] >> p[i];
	}
	for(int i = 1;i <= n;i++){
    for(int ii = n;ii >= 1;ii--)
    {
        for(int j = n*3;j >= w[i] - w[1];j--)
        {
            dp[ii][j] = max(dp[ii][j],dp[ii - 1][j - (w[i] - w[1])] + p[i]);
			if(j + (ii*w[1]) <= W) mx = max(mx,dp[ii][j]);
        }
	}
	}
	rc(mx);
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <climits>
#include <set>
#include <map>
#include <stack>
#include <iomanip>
#include <tuple>
#define ll long long
using namespace std;
/* ユークリッドの互除法 最大公約数*/
ll gcd(ll a, ll b)
{
    ll r;
    r = a % b;
    while (r != 0)
    {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

/*最小公倍数*/
ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

struct all_init
{
    all_init()
    {
        cout << fixed << setprecision(12);
    }
} All_init;

int main()
{
    ll n, x,sa1,g;
    cin >> n >> x;
    vector<ll> a(n);
    for (ll i = 0; i < n;i++){
        cin >> a[i];
    }
    g = abs(a[0] - x);
    for (ll i = 0; i < n; i++)
    {
        sa1 = abs(a[i] - x);
        g = gcd(g, sa1);
    }
    cout << g << endl;
}

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

int main() {
  int N, K, sum = 1;
  
  cin >> N >> K;
  for(int i = 0; i < N; i++) {
    if(sum * 2 < sum + K) {
      sum = sum * 2;
    }else {
      sum = sum + K;
    }
  }
  cout << sum << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define sum(a) accumulate(a.begin(),a.end(),0LL)
#define put(i) cout<<fixed<<i<<endl
using namespace std;
using ll = long long;

//pdf見て解答

int main(){
    ll n; cin >> n;
    vector<ll> a(n+2,0);
    for(long long i = 1; i < n+1; i++){
        cin >> a[i];
    }

    ll suma = 0;
    for(long long i = 0; i < n+1; i++){
        suma += abs(a[i+1] - a[i]);
    }

    for(long long i = 1; i < n+1; i++){
        ll ans = 0;
        ans = suma + abs(a[i-1] - a[i+1]) - (abs(a[i-1] - a[i]) + abs(a[i] - a[i+1]));
        put(ans);
    }

}

Measured memory_bytes: 4000
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(vector<int>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

//CODE
void solve(void)
{
  int A,B,C,X,Y;
  cin>>A>>B>>C>>X>>Y;
  int ANS = INF;
  for (int i = 0; i < 10e5 + 1; i++)
  {
    chmin(ANS,C*(i) + max(0LL,X-i/2)*A + max(0LL,Y-i/2)*B);
  }
  cout<<ANS;
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<climits>
#include<algorithm>
#include<numeric>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<cstring>
#include<random>
#include<cassert>
#define ll long long
#define int long long
#define ld long double
#define INF (ll)1e18 
const ll Mod = (ll)1e9+7;
ll CaseN=1;
const ld PI = 22/7.0;
using namespace std;

ll tst()
{
ll ans=0;

return ans;
}


void solve()
{
	ll n,d;
	cin>>n>>d;
	ll ans=0;
	for(ll i=1;i<=n;i++)
	{
	ll x,y;
	cin>>x>>y;
	if((x*x)+(y*y)<=d*d)	
		{
		ans++;	
		}
	}
	
	
	
	cout<<ans<<endl;
	
	//cout<<"Case #"<<CaseN<<": ";
		CaseN++;
		// print your ans below;
	
return ;

}


signed main() {
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	
	ll t=1;
	//cin>>t;
	while(t--)
	{
	solve();
	}
	
}


Measured memory_bytes: 3632
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define rs(a, b) ((a) >> (b))
#define ls(a, b) ((a) << (b))
#define gcd __gcd
#define lcm(a, b) ((a * b) / gcd(a, b))
#define pq priority_queue
#define um unordered_map
#define us unordered_set
#define lb lower_bound
#define ub upper_bound
#define F first
#define B begin()
#define E end()
#define ln length()
#define sz size()
#define S second
#define em empty()
#define nani(x) cerr << #x << " is " << x << endl;
#define ch(x) (x - 'a' + 1)
#define mp make_pair
#define pb push_back
#define loop(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define scan(x, n) loop(i, 0, n) cin >> x[i];
#define adde(g, u, v) g[u].pb(v), g[v].pb(u);
#define addew(g, u, v, w) g[u].pb({ v, w }), g[v].pb({ u, w });
#define print(x, n) loop(i, 0, n) cout << x[i] << " ";
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 10000000000
#define mod 1000000007

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef pair<long, long> pll;
typedef vector<ii> vii;
typedef vector<pll> vll;
typedef um<int, int> umii;
typedef um<char, int> umci;
typedef map<char, int> mci;
typedef map<int, int> mii;

int main()
{
    fast;
    //freopen("input.txt", "r", stdin);
    int r;
    cin >> r;
    cout << 3 * r * r;
    return 0;
}


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

#ifndef ONLINE_JUDGE
	#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
	#define W(x, y)
#endif

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<pii>
#define vl vector<ll>
#define vll vector<pll>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pi acosl(-1)
#define ld long double
#define prime (1000000000 + 7)
#define INF 1000000000

using namespace std;


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

    ll n, k;
    ld sum = 0, res = 0;
    cin >> n >> k;
    vector<ld> vet(n);
    for(int i = 0; i < n; ++i){
        ll p;
        cin >> p;
        vet[i] = (p + 1) / 2.0l;
    }
    for(int i = 0; i < n; ++i){
        sum += vet[i];
        if(i >= k){
            sum -= vet[i-k];
        }
        res = max(res, sum);
    }
    cout << setprecision(10) << fixed << res << endl;
   
    return 0;
}


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

using namespace std;

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

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

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

  string s;
  cin >> s;

  s[3] = '8';
  cout << s << "\n";

  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main() {
	double r;

	cin >> r;
	cout << fixed;
	cout << setprecision(6) << M_PI * r * r <<" "<< 2 * M_PI * r << endl;
	return 0;
}


Measured memory_bytes: 3236
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char s[105];
bool cmp = true;
int len;
int main(){
	scanf("%s", s);
	len = strlen(s);
	for(int i = 0; i < len; i++){
		if(i % 2 != 0 && s[i] == 'R') {
			cmp = false;
		}
		if(i % 2 == 0 && s[i] == 'L'){
			cmp = false;
		}
	}
	if(cmp == true) puts("Yes");
	else puts("No");
}

Measured memory_bytes: 256
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define SANKOU(n,a,b) cout << ((n) ? (a) : (b) ) << endl;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd

#define CIN(x) int x;cin>>x;
#define CIN2(x,y) int x,y;cin>>x>>y;
#define CIN3(x,y,z) int x,y,z;cin>>x>>y>>z;
#define SCIN(x) string x;cin>>x;
#define SCIN2(x,y) string x,y;cin>>x>>y;
#define COUT(x) cout<<(x)<<endl;
#define SCOUT(x) cout<<(x)<<" ";
#define ENDL cout<<endl;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i];
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())


#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){
    CIN(n);
    vector<tuple<int,int,int>> tup;
    tup.pb(make_tuple(0,0,0));
    REP(i,n){CIN3(a,b,c);tup.pb(make_tuple(a,b,c));}
    sort(ALL(tup));
    bool flag=true;
    FOR(i,1,n+1){
        if((abs(get<1>(tup[i])-get<1>(tup[i-1]))+abs(get<2>(tup[i-1])-get<2>(tup[i])))%2
                !=(get<0>(tup[i])-get<0>(tup[i-1]))%2
                || get<0>(tup[i])-get<0>(tup[i-1]) <
                abs(get<1>(tup[i])-get<1>(tup[i-1]))+abs(get<2>(tup[i-1])-get<2>(tup[i]))

                ){

            flag=false;break;
        }

    }
    Yes(flag);
    

    return 0;
}


Measured memory_bytes: 1912
import math
import numpy as np
N = int(input())
ARR = list(map(int,input().split()))

def calculate(n,arr):

    maxValue = max(arr)

    if maxValue == 0:
        maxNum = 1
    else:
        maxNum = math.ceil(math.log(maxValue,2))

    arr = np.array(arr)

    oneArray =  [0]*(maxNum+1)
    zeroArray = [0]*(maxNum+1)

    for i in range(maxNum+1):
        s = (arr >> i) & 1

        a = np.count_nonzero(s)

        oneArray[i] = a
        zeroArray[i] = n - a


    finalResult = 0
    for  i in range(maxNum + 1):
        finalResult += 2**i * oneArray[i] * zeroArray[i]

    print(finalResult % (10**9 + 7))





calculate(N, ARR)

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

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

    ll c = A + B;
    ll ans = A * (N / c);
    ans += min(A, N % c);
    
    cout << ans << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var x int
	fmt.Scan(&x)

	if x <= 6 {
		fmt.Println(1)
	} else {
		ans := (x / 11) * 2
		if x%11 > 6 {
			ans += 2
		} else if x%11 > 0 {
			ans += 1
		}
		fmt.Println(ans)
	}
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
double pi = 3.141592653589793;

int main(){
  int a, b;
  cin >> a >> b;
  
  cout << a*b << endl;
}

Measured memory_bytes: 3624
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc068/tasks/abc068_b
import math

def fact(N):
    ans = {}
    for i in range(2, math.ceil(math.sqrt(N))+1):
        if N % i != 0:
            continue
        ex = 0

        while N % i == 0:
            ex += 1
            N /= i
        ans[i] = ex

    if N != 1:
        ans[int(N)] = 1
    return ans

N = int(input())
max_x = 0
max_n = 0

if N == 1:
    print(1)
    exit()

for i in range(N+1):
    num = fact(i)
    num = num.get(2, 0)
    if num > max_n:
        max_x = i
        max_n = num

print(max_x)


Measured memory_bytes: 9188
#include <stdio.h>

int main(){
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    long long produtoAC = a *c, produtoAD = a*d, produtoBC = b*c, produtoBD = b*d;
    if(produtoAC > produtoAD && produtoAC > produtoBC && produtoAC > produtoBD){
         printf("%lld", produtoAC);
    }else if(produtoAD > produtoAC && produtoAD > produtoBC && produtoAD > produtoBD){
        printf("%lld", produtoAD);
    }else if(produtoBC > produtoAC && produtoBC > produtoAD && produtoBC > produtoBD){
        printf("%lld", produtoBC);
    }else{
        printf("%lld", produtoBD);
    } 
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S, T;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

int main() {
    cin>>N;
    ll ans = 1, temp = 0;
    vec dp(N), sum(N);
    rep(i,N){
        if(i < 3){
            dp[i] = 1;
            sum[i] = i + 1;
        }else{
            (temp += sum[i-3])%=MOD;
            dp[i] = (1 + temp)%MOD;
            sum[i] = (sum[i-1] + dp[i])%MOD;
        }
        (ans += dp[i] * ((i == N - 1 ? 1 : N) * (N - 1) % MOD))%=MOD;
        //cout<<i<<' '<<ans<<endl;
    }
    /*rep(i,N) cout<<dp[i]<<' ';
    cout<<endl;*/
    //(ans += ((MOD + sum[N-1] * 2 - dp[N - 1])%MOD) * (N - 1))%=MOD;
    cout<<ans<<endl;
}

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

int main(){
    int k,n;
    scanf("%d %d",&k,&n);
    vector<int> a(n);
    vector<int> b(n);
    for(int i=0;i<n;i++){
        scanf("%d", &a[i]);
    }
    for(int i=0;i<n-1;i++){
        b[i] = a[i+1] - a[i];
    }
    b[n-1] = (a[0] + k) - a[n-1];
    int max = *std::max_element(b.begin(), b.end());
    long long int ans = accumulate(b.begin(), b.end(), 0) - max;

    printf("%lld\n",ans);
    return 0;
}

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

using namespace std;
int A,B;
int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>A>>B;

if(A==B){
  cout<<"Draw"<<endl; return 0;
}
if(A==1) {
  cout<<"Alice"<<endl; return 0;
}
if(B==1){
  cout<<"Bob"<<endl; return 0;
} 
if(A>B) cout<<"Alice"<<endl;
if(A<B) cout<<"Bob"<<endl;

}



Measured memory_bytes: 256