akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)

using namespace std;
const int N=200005,INF=2000000000;
int n,a[N],b[N],R_mn,R_mx,B_mn,B_mx;
typedef long long LL;

int getint()
{
	char ch;
	while(!isdigit(ch=getchar()));
	int x=ch-48;
	while(isdigit(ch=getchar())) x=x*10+ch-48;
	return x;
}

void ck(int &x,int &y,int c)
{
	x=min(x,c);
	y=max(y,c);
}

LL solve1()
{
	R_mn=INF,R_mx=0;
	B_mn=INF,B_mx=0;
	rep(i,1,n) ck(R_mn,R_mx,min(a[i],b[i])),ck(B_mn,B_mx,max(a[i],b[i]));
	return (LL)(R_mx-R_mn)*(B_mx-B_mn);
}

LL solve2()
{
	R_mn=INF,R_mx=0;
	B_mn=INF,B_mx=0;
	rep(i,1,n) R_mn=min(R_mn,min(a[i],b[i])),R_mx=max(R_mx,max(a[i],b[i]));
	rep(i,1,n)
		B_mn=min(B_mn,max(a[i],b[i]));
	rep(i,1,n)
		if(min(a[i],b[i])>=B_mn) B_mx=max(B_mx,min(a[i],b[i]));
		else B_mx=max(B_mx,max(a[i],b[i]));
	return (LL)(R_mx-R_mn)*(B_mx-B_mn);
}

LL solve3()
{
	R_mn=INF,R_mx=0;
	B_mn=INF,B_mx=0;
	rep(i,1,n) R_mn=min(R_mn,min(a[i],b[i])),R_mx=max(R_mx,max(a[i],b[i]));
	rep(i,1,n)
	{
		if(a[i]==R_mn || a[i]==R_mx) ck(B_mn,B_mx,b[i]);
		else if(b[i]==R_mn || b[i]==R_mx) ck(B_mn,B_mx,a[i]);
	}
	rep(i,1,n)
	{
		if(B_mn<=a[i] && a[i]<=B_mx) continue;
		if(B_mn<=b[i] && b[i]<=B_mx) continue;
		if(min(abs(a[i]-B_mn),abs(a[i]-B_mx))<min(abs(b[i]-B_mn),abs(b[i]-B_mx)))
			ck(B_mn,B_mx,a[i]);
		else ck(B_mn,B_mx,b[i]);
	}
	return (LL)(R_mx-R_mn)*(B_mx-B_mn);
}

int main()
{
	n=getint();
	rep(i,1,n) a[i]=getint(),b[i]=getint();
	printf("%lld\n",min(min(solve1(),solve2()),solve3()));
	return 0;
}

Measured memory_bytes: 1664
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var dic = new Dictionary<string, int>();

            for (int i = 0; i < N; i++)
            {
                var key = Console.ReadLine();
                if (!dic.ContainsKey(key))
                    dic[key] = 0;
                dic[key]++;
            }

            var max = dic.Max(_ => _.Value);
            var list = dic.Where(_ => _.Value == max)
                .Select(_ => _.Key);

            foreach (var item in list.OrderBy(_ => _, StringComparer.OrdinalIgnoreCase))
            {
                Console.WriteLine(item);
            }
        }
    }
}


Measured memory_bytes: 42608
fn dfs(u: usize, p: usize, depth: &mut Vec<usize>, parent: &mut Vec<usize>, next: &Vec<Vec<usize>>) {
    for &v in &next[u] {
        if v != p {
            depth[v] = depth[u] + 1;
            parent[v] = u;
            dfs(v, u, depth, parent, next);
        }
    }
}
fn cnt(u: usize, p: usize, next: &Vec<Vec<usize>>) -> usize {
    let mut res = 1;
    for &v in &next[u] {
        if v != p {
            res += cnt(v, u, next);
        }
    }
    res
}
fn main() {
    let n: usize = readln();
    let ps: Vec<(usize, usize)> = readlns(n-1);
    let mut next: Vec<Vec<usize>> = vec![vec![]; n];
    for (a, b) in ps {
        next[a-1].push(b-1);
        next[b-1].push(a-1);
    }
    let mut parent: Vec<usize> = vec![0; n];
    let mut depth: Vec<usize> = vec![0; n];
    parent[0] = 0;
    depth[0] = 0;
    dfs(0, 0, &mut depth, &mut parent, &next);
    let c = (depth[n-1] - 1) / 2;
    let mut root = n-1;
    for i in 0..c {
        root = parent[root];
    }
    let b = cnt(root, parent[root], &next);
    let a = n - b;
    println!("{}", if a <= b { "Snuke" } else { "Fennec" });
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashSet;

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n { vs.push(readln()); }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(String, bool, f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64);
impl<T> FromLn for Vec<T> where T: FromLn {
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);

Measured memory_bytes: 18684
#define _GLIBCXX_DEBUG
// header {{{
#include <bits/stdc++.h>
using namespace std;
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y
#define ASSERT(expr...) assert((expr))
using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using f80 = __float80;
// }}}
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
// util {{{
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}
// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

//--------------------------------------------------------------------

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

    REP(i,s.size()){
        if( i % 2 != 0){
            if(s.at(i) == 'L' || s.at(i) == 'U' || s.at(i) == 'D'){
                continue;
            } else {
                cout<<"No"<<endl;
                return 0;
            }
        } else {
            if(s.at(i) == 'R' || s.at(i) == 'U' || s.at(i) == 'D'){
                continue;
            } else {
                cout<<"No"<<endl;
                return 0;
            }
        }
    }

    cout<<"Yes"<<endl;

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

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

#define MAX 10000

using namespace std;

class DisjointSet {
public:
	vector<int> rank, p;

	DisjointSet() {}
	DisjointSet(int size) {
		rank.resize(size, 0);
		p.resize(size, 0);
		for (int i = 0; i < size; i++)makeSet(i);
	}

	void makeSet(int x) {
		p[x] = x;
		rank[x] = 0;
	}

	bool same(int x, int y) {
		return findSet(x) == findSet(y);
	}

	void unite(int x, int y) {
		link(findSet(x), findSet(y));
	}

	void link(int x, int y) {
		if (rank[x] > rank[y]) {
			p[y] = x;
		} else {
			p[x] = y;
			if (rank[x] == rank[y]) {
				rank[y]++;
			}
		}
	}

	int findSet(int x) {
		if (x != p[x]) {
			p[x] = findSet(p[x]);
		}
		return p[x];
	}
};

int main() {
	int n, a, b, q;
	int t;

	cin >>  n >> q;
	DisjointSet ds = DisjointSet(n);

	for (int i = 0; i < q; i++) {
		cin >> t >> a >> b;
		if (t == 0)ds.unite(a, b);
		else {
			if (ds.same(a, b))cout << 1 << endl;
			else cout << 0 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3180
package main

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

var sc *bufio.Scanner

const BufferSize = 1024

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

var production bool

func debugf(format string, v ...interface{}) {
	if !production {
		fmt.Printf(format, v...)
	}
}

func answer(reader io.Reader, writer io.Writer) {
	sc = bufio.NewScanner(reader)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, 1e+6)
	sc.Split(bufio.ScanWords)
	n := nextInt()
	a := make([]int, n)
	b := make([]int, n)

	for i := range a {
		a[i] = nextInt()
	}
	debugf("a: %v\n", a)
	ans := 0
	for i := n; i > 0; i-- {
		b[i-1] = a[i-1]
		for j := i+i; j <= n; j += i {
			b[i-1] += b[j-1]
			b[i-1] %= 2
		}
		if b[i-1] == 1 {
			ans++
		}
		debugf("b: %v\n", b)
	}

	_, _ = fmt.Fprintf(writer, "%d", ans)
	if ans > 0 {
		_, _ = fmt.Fprint(writer, "\n")
		first := true
		for i := range a {
			if b[i] > 0 {
				if first == true {
					first = false
				} else {
					_, _ = fmt.Fprint(writer, " ")
				}
				_, _ = fmt.Fprintf(writer, "%d", i+1)
			}
		}
	}

}

func main() {
	production = true
	answer(os.Stdin, os.Stdout)
}


Measured memory_bytes: 8320
#include <bits/stdc++.h>
using namespace std;
int n, k, a[100005], pos;
int main()
{
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", a + i);
		if (a[i] == 1) pos = i;
	}
	printf("%d\n", (n - 2) / (k - 1) + 1);
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };

struct MyStruct
{
	int list[13];
};



signed main() {
	int i, j, k, n, m, sum = 0, cnt = 0;
	string s, s1, s2;
	bool flag = false;
	vector<vector<int>>list(1005, vector<int>(1005, 0));
	vector<vector<int>>list2(1005, vector<int>(1005, 0));
	vector<vector<int>>list3(1005, vector<int>(1005, 0));
	vector<int>list4(10005, 0);
	double x1, y1, x2, y2;
	

	cin >> x1 >> y1 >> x2 >> y2;


	cout <<fixed << sqrt(abs(x1-x2)*abs(x1-x2) + abs(y1-y2) * abs(y1-y2)) << endl;






	getchar();
	getchar();
	return 0;
}


Measured memory_bytes: 14608
#include <iostream>
#include<string>
#include<time.h>
#include<math.h>
#include<stdlib.h>
#include<map>
using namespace std;

int main() {
	int X, Y;
	cin >> X >> Y;
	int i;
	int turu, kame;
	int C = 0;
	for (i = 0; i <= X; i++) {
		turu = i;
		kame = X - i;
		if (Y == (turu * 2) + (kame * 4)) {
			cout << "Yes" << endl;
			break;
		}
		else C++;
	}
	if (C == X + 1) {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;

struct edge {
	int from, to, cost, enemy;
	edge ( int f, int t, int c, int e ) : from(f), to(t), cost(c), enemy(e) {}
	bool operator < (const edge &e ) const {
		return cost < e.cost;
	}
};

typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<edge> VE;
typedef vector<VE> VVE;

const int INF = 1 << 29;

int solve ( int N, int M, int L )
{
	VVE E(N);
	for (int i = 0; i < M; ++i) {
		int a, b, d, e;
		cin >> a >> b >> d >> e;
		E[a-1].push_back(edge(a-1, b-1, d, e));
		E[b-1].push_back(edge(b-1, a-1, d, e));
	}
	VVI mincost(N, VI(L+1, INF));
	priority_queue<PP, vector<PP>, greater<PP> > que;
	que.push(PP(0, P(0, L)));
	mincost[0][L] = 0;
	while (!que.empty()) {
		PP pp = que.top(); que.pop();
		int v = pp.second.first, l = pp.second.second;
		if (mincost[v][l] < pp.first) { continue; }
		for (int i = 0, I = E[v].size(); i < I; ++i) {
			edge e = E[v][i];
			int c = l - e.cost;
			if (0 <= c && mincost[e.to][c] > pp.first) {
				mincost[e.to][c] = pp.first;
				que.push(PP(mincost[e.to][c], P(e.to, c)));
			}
			if (mincost[e.to][l] > pp.first + e.enemy) {
				mincost[e.to][l] = pp.first + e.enemy;
				que.push(PP(mincost[e.to][l], P(e.to, l)));
			}
		}
	}
	int res = INF;
	for (int i = 0; i <= L; ++i) {
		res = min(res, mincost[N-1][i]);
	}
	return res;
}

int main ( void )
{
	int n, m, l;
	while (cin >> n >> m >> l, n|m|l) {
		cout << solve(n, m, l) << endl;
	}
	return 0;
}

Measured memory_bytes: 2016
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans = 0;
		if(a >= 13){
			ans = b;
		} else if(a >= 6){
			ans = b/2;
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}
}

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

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

    //文字a をb 回連携した文字列
    string A;

    //文字b をa 回連携した文字列
    string B;

    for(int i=0; i < (b-'0'); ++i){
        A += a;
    }

   for(int j=0; j < (a-'0'); ++j){
        B += b;
    }

    if(A < B) cout << A << endl;
    else cout << B << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
    int main()
    {
        int N;
        scanf("%d", &N);
        
        int i,mi,ma;
        int bint[N];
        for(i=0;i<N;i++){
         scanf("%d", &bint[i]); 
        }                   
             ma=bint[0];
             mi=bint[0];    
        for(i=0;i<N;i++){
           if(bint[i]<mi){
           mi =bint[i];
           }
        }   
        for(i=0;i<N;i++){
           if(bint[i]>ma){
           ma =bint[i];
           }
        }   

        printf("%d",ma-mi);
        return 0;
    }

Measured memory_bytes: 128
import bisect
n, m = map(int, input().split())

prefs_list = []
prefs_dict = {}
for i in range(m):
  p, y = map(int, input().split())
  prefs_list.append([p,y])
  if p in prefs_dict:
    prefs_dict[p].append(y)
  else:
    prefs_dict[p] = [y]

for key in prefs_dict:
  prefs_dict[key].sort()



for pref in prefs_list:
  print(str(pref[0]).zfill(6) + str(bisect.bisect_left(prefs_dict[pref[0]], pref[1])+1).zfill(6))


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

#define rep(i,n) for(int i = 0; i<n; ++i)
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
typedef long long ll;

int main(){
    int n; cin >> n;
    if(n%10==9)cout << "Yes" << endl; 
    else if((n/10)%9 == 0)cout << "Yes" << endl;
    else cout << "No" <<endl;
    return 0;
}


Measured memory_bytes: 256
use std::io;

fn main() {
    let mut buf: String = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let mut iter = buf.trim().split_whitespace();
    let a = iter.next().unwrap().parse::<i64>().unwrap();
    let b = iter.next().unwrap().parse::<i64>().unwrap();
    let mut ans = 0;
    for i in a..b+1 {
        let mut i_as_str = format!("{}", i);
        unsafe {
            i_as_str.as_mut_vec().reverse();
            if format!("{}", i) == i_as_str.to_string() {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		int l = sc.nextInt();
		
		int[][] A = new int[n][m];
		int[][] B = new int[m][l];
		long[][] c = new long[n][l];
		int i, j, k;
		for (i = 0; i < n ; i++) {
			for (j = 0; j < m; j++) {
				A[i][j] = sc.nextInt();
			}
		}
		
		for (i = 0; i < m; i++) {
			for (j = 0; j < l; j++) {
				B[i][j] = sc.nextInt();    
			}
		}
		for (i = 0; i < n; i++) {
			for (j = 0; j < l; j++) {
				for (k = 0; k < m; k++) {
					c[i][j] += A[i][k] * B[k][j];
				}
			}
		}
		
		for (i = 0; i < n; i++) {
			for (j = 0; j < l; j++) {
				if (j != l - 1) {
					System.out.printf("%d ", c[i][j]);
				}
				else {
					System.out.printf("%d\n", c[i][j]);
				}
			}
		}
	}
}


Measured memory_bytes: 63028
#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;
  int k;
  cin >> s >> k;

  vector<string> vec;
  int len = s.length();
  for (int l = 0; l < len; ++l) {
    for (int r = l + 1; r <= len && r - l <= 5; ++r) {
      vec.push_back(s.substr(l, r - l));
    }
  }

  sort(all(vec));
  vec.erase(unique(all(vec)), vec.end());

  k--;
  cout << vec[k] << "\n";

  return 0;
}

Measured memory_bytes: 1660
#include<iostream>
using namespace std;
int main(){
	int a[105] = {},b,c=0;
	while(cin>>b){
		a[b]++;
	}
	for (int i = 0; i < 101; i++){
		if (c < a[i]){
			c = a[i];
		}
	}
	for (int i = 0; i < 101; i++){
		if (a[i] == c)cout << i << endl;
	}
	return 0;
}


Measured memory_bytes: 3108
#include <iostream>
using namespace std;
int main()
{ int a,b;
cin>>a>>b;
if(b<=a){
for(int i=0;i<a;i++){
    cout<<b;
}}
else{
    for(int i=0;i<b;i++){
        cout<<a;
    }
}
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<math.h>
#include<bitset>
#include <numeric>
using namespace std;
using ll=long long;
using ld=long double;
using pint=pair<int,int>;
using pll=pair<ll,ll>;
#define LONG_INF 9223372036854775807
#define INF 1000000000LL
#define EPS 1e-10
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define dump(a) rep(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define all(v) v.begin(),v.end()
#define pb push_back


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

    int A, B;
    cin >> A >> B;
    cout << A*B << endl;    

    return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>
int main(void){
    int H, W, i, j;
    for (;;){
        scanf("%d",&H);
        scanf("%d",&W);
        if (H==0 && W==0)break;
        else{
            for ( i = 0; i < H; i++ ){
                for ( j = 0; j < W; j++ ){
                printf("#");
                }
            printf("\n");
            }
        }
        printf("\n");
    }
    return 0;
    
}



Measured memory_bytes: 2044
-- https://github.com/minoki/my-atcoder-solutions
import Data.Char (isSpace)
import Data.List (unfoldr, sort)
import qualified Data.ByteString.Char8 as BS

main = do
  n <- readLn
  xs <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  let result = map snd $ sort $ zip xs [1..n]
  putStrLn $ unwords $ map show result


Measured memory_bytes: 28284
alpha = ['a','b','c','d','e','f','g','h','i','j']
N=int(input())
res=['a']
if N >1:
    for i in range(N-1):
        length=len(res)
        new = []
        for x in range(length):
            kind = len(set(res[x]))
            for y in range(kind+1):
                new.append(str(res[x]+alpha[y]))
        res=new
for i in range(len(res)):
    print(res[i])

Measured memory_bytes: 56540
<?php
[$N, $A, $B, $C] = ints();
for($i = 0; $i < $N; $i++){
    $S[] = str();
}
$path = [];
dfs(0, $path, $A, $B, $C);
echo "No\n";
function dfs($d, &$path, $A, $B, $C){
    global $S, $N;
    if($d == $N){
        echo "Yes\n";
        echo implode("\n", $path);
        exit;
    }
    $s = $S[$d];
    for($i = 0; $i < 2; $i++){
        if(${$s[$i]}>0){
            $path[] = $s[1-$i];
            ${$s[$i]}--;
            ${$s[1-$i]}++;
            dfs($d+1, $path, $A, $B, $C);
            ${$s[$i]}++;
            ${$s[1-$i]}--;
            array_pop($path);
        }
    }
}

function str(){return trim(fgets(STDIN));}
function ints(){return array_map('intval',explode(' ',trim(fgets(STDIN))));}
function int(){return intval(trim(fgets(STDIN)));}
function chmax(&$a,$b){if($a<$b){$a=$b;return 1;}return 0;}
function chmin(&$a,$b){if($a>$b){$a=$b;return 1;}return 0;}
function popcount($x){$c=0;while($x){$x&=$x-1;++$c;}return$c;}
function o(...$val){
    if(count($val)==1)$val=array_shift($val);
    echo debug_backtrace()[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0)echo "empty array";
        elseif(!is_array(current($val)))echo "array: ",implode(" ", addIndex($val)),"\n";
        else{
            echo "array:array\n";
            if(isCleanArray($val))foreach($val as $row)echo implode(" ", addIndex($row)),"\n";
            else foreach($val as $i => $row)echo "[".$i."] ".implode(" ", addIndex($row)),"\n";
        }
    }else echo $val."\n";
}
function addIndex($val){if(!isCleanArray($val)){$val = array_map(function($k, $v){return $k.":".$v;}, array_keys($val), $val);}return $val;}
function isCleanArray($array){$clean=true;$i = 0;foreach($array as $k=>$v){if($k != $i++)$clean = false;}return $clean;}
// 座圧対象の配列 -> [圧縮された配列,復元用のMap,圧縮用のMap]
function atsu($array){$a = array_flip($array);$fuku=array_flip($a);sort($fuku);$atsu = array_flip($fuku);foreach($array as $i=>$val)$array[$i]=$atsu[$val];return [$array, $fuku, $atsu];}
function gcdAll($array){$gcd=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$gcd=gcd($gcd,$array[$i]);}return $gcd;}
function gcd($m, $n){if(!$n)return $m;return gcd($n, $m % $n);}
function lcmAll($array){$lcm=$array[0];for($i=1,$I=count($array);$i<$I;++$i){$lcm=lcm($lcm,$array[$i]);}return $lcm;}
function lcm($a, $b) {return $a / gcd($a, $b) * $b;}


function loadTree($N = false){
  if($N === false)$N = $GLOBALS['N'];
  return loadGraph($N, $N-1);
}
function loadGraph($N = false, $M = false, $both = true){
  if($N === false)$N = $GLOBALS['N'];
  if($M === false)$M = $GLOBALS['M'];
  $G = array_fill(1, $N, []);
  for($i = 0; $i < $M; $i++){
    $values = ints();
    if(count($values) == 2){
      list($a, $b) = $values;
      $G[$a][] = $b;
      if($both)$G[$b][] = $a;
    }else{
      list($a, $b, $d) = $values;
      $G[$a][] = [$b, $d];
      if($both)$G[$b][] = [$a, $d];
    }
  }
  return $G;
}


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

typedef long long ll;
static const ll INF = 1ll<<60;
static const int MOD = 1e9+7;

int main(){
    ll N,M,K;
    cin>>N>>M>>K;
    vector<ll> A(N),B(M);
    vector<ll> asum(N+1,0),bsum(M,0);
    for(int i=0; i<N; i++) cin>>A[i];
    for(int i=0; i<M; i++) cin>>B[i];
    bsum[0] = B[0];

    for(int i=1; i<=N; i++) asum[i] = A[i-1] + asum[i-1];
    for(int i=1; i<M; i++) bsum[i] = B[i] + bsum[i-1];

    ll ans = 0;

    for(ll a=0; a<=N; a++){
        ll cur = 0;
        cur = asum[a];
        if(cur > K) break;
        ll lim = K - asum[a];
        auto itr = upper_bound(bsum.begin(),bsum.end(),lim);
        ll b = itr - bsum.begin();
    
        ans = max(ans,b+a);
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 9548
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

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

        if(a <= b) {
                for(int i = 0; i < b; i++) {
                        cout << a;
                }
        } else {
                for(int i = 0; i < a; i++) {
                        cout << b;
                }
        }
        cout << endl;
        return 0;
}

Measured memory_bytes: 256
<?php
	fscanf(STDIN, "%d", $r);

	// 半径rの円の面積 ÷ 半径1の円の面積
	// ($r * $r * π) / (1 * 1 * π) 
	// 	= $r * $r * π / π
	// 	= $r * $r
	echo($r**2);
?>


Measured memory_bytes: 4856
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> llP;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}

ll big = 1e16;

bool isbig(ll k, ll d){
    if (big/k < d){
        return true;
    } else {
        return false;
    }

}

int main()
{
    ll x, k, d;
    cin >> x >> k >> d;

    ll ans = 0;
    if (isbig(k,d) || abs(x) <= k*d) {
        if ((abs(x)/d - k)%2 == 0){
            //近づく
            ans = abs(x)%d;
        } else {
            //追い越す
            ans = abs((abs(x)%d)-d);
        }
    } else {
        ans = abs(x) - k*d;
    }

    cout << ans << endl;


}



Measured memory_bytes: 3548
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};
int dx9[9]={0,1,0,-1,1,-1,1,0,-1};
int dy9[9]={0,1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;
// << fixed << setprecision
// --------------------------------------
int n, m;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n >> m;
  vector<int> a(m);
  vector<int> t[m];

  REP(i, m) {
    int b;
    cin >> a[i] >> b;
    REP(j, b) {
      int c;
      cin >> c;
      c--;
      t[i].push_back(c);
    }
  }

  int dp[10000];
  REP(i, 10000) dp[i] = INF;
  dp[0] = 0;

  REP(i, m) {
    int h = 0;
    for(int u : t[i]) h |= (1 << u);
    REP(j, 1 << n) {
      int now = j | h;
      dp[now] = min(dp[now], dp[j] + a[i]);
    }
  }

  cout << (dp[(1 << n) - 1] == INF ? -1 : dp[(1 << n) - 1]) << endl;
}


Measured memory_bytes: 3724
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long long
using namespace std;
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
signed main() {
 	int N;
 	cin >> N;
 	int answer = 100;
 	for(int i = 1;i * i <= N;i++) {
 		if(N % i == 0) {
 			int A = N / i;
 			int count=0;
              count=kt(A);
 			
 			answer = min(answer,count);
 		}
 	}
 	cout << answer << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111

	class unionfind {
	vector<int> par, rank;
 
public:
	void init(int n) {
		par.resize(n);
		rank.resize(n);
 
		for (int i = 0; i < n; i++) {
			par[i] = i;
			rank[i] = 0;
		}
	}
 
	int find(int x) {
		if (par[x] == x) return x;
		else return par[x] = find(par[x]);
	}
 
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) return ;
 
		if (rank[x] < rank[y]) par[x] = y;
		else {
			par[y] = x;
			if (rank[x] == rank[y]) ++rank[x];
		}
	}


	bool same(int x, int y) { return (find(x) == find(y)); }
} uf;


	void solve(){

		ini(n);
		ini(n1);
		uf.init(n+n1);
		FOR(i,0,n){
			ini(x);
			while(x--){
				ini(l);
				l--;
				uf.unite(i,n+l);
			}
		}
		
		set<int> set1;
		FOR(i,0,n){
			set1.insert(uf.find(i));
		}
		if(set1.size() == 1)out("YES");
		else{
			out("NO");
		}







	}	























int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}


Measured memory_bytes: 3328
# https://atcoder.jp/contests/abc097/tasks/arc097_a


# 辞書順に置いては文字の先頭が重要。
# 一文字目が速いやつから注目していく。
# 一文字目が同じだったらさらにその次の文字を注目する。

# atcoderandatcodeer
# a      a  a       # 1種
# at     an at      # 1種 #tは以下のすべてよりも辞書順があと
#        and        # 1種
#        anda       # 1種
#        andat      #

S = input()
K = int(input())

# 一番速い文字を検索してからそこからK文字見るのが一番早そう。
# ただし、K文字ない場合は辻褄合わせが必要
# てか計算量的に、こんなことしなくてもK文字目まで全列挙すればよくね？

# mi = min(S)
candi = []
for s in range(len(S)):
    for add in range(1, K + 1):
        candi.append(S[s:s + add])

candi = list(set(candi))
candi.sort()
print(candi[K - 1])


Measured memory_bytes: 40560
#include<bits/stdc++.h>
using namespace std;
map<char,int> mp;
int main()
{
	string s;
	cin>>s;
	for(int i=0;i<4;i++)
	{
		mp[s[i]]++;
	}
	int cnt=0;
	for(char a='A';a<='Z';a++)
	{
		if(mp[a]==2)
		  cnt++;
	}
	if(cnt==2)
	  cout<<"Yes";
	else
	  cout<<"No";
	return 0;
}

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

using i64 = int64_t;

int main(){
    int Q;
    cin >> Q;
    i64 mid = 0, left_sum = 0, right_sum = 0, b_sum = 0;
    priority_queue<i64> left;
    priority_queue<i64, vector<i64>, greater<i64>> right;
    i64 q, a, b;
    cin >> q >> a >> b;
    b_sum += b;
    mid = a;
    bool flag = true;
    for(int i=1;i<Q;++i){
        cin >> q;
        if(q == 1){
            flag = !flag;
            cin >> a >> b;
            b_sum += b;
            if(a >= mid){
                right.push(a);
                right_sum += a;
                if(flag){
                    left.push(mid); left_sum += mid;
                    mid = right.top(); right.pop();
                    right_sum -= mid;
                }
            }else{
                left.push(a);
                left_sum += a;
                if(!flag){
                    right.push(mid); right_sum += mid;
                    mid = left.top(); left.pop();
                    left_sum -= mid;
                }
            }
        }else{
            if(flag){
                cout << mid << " " << -left_sum + right_sum + b_sum << endl;
            }else{
                i64 mid2 = right.top();
                cout << mid << " " << -left_sum + (right_sum-mid2) + (mid2 - mid) + b_sum << endl;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3828
#!/usr/bin/env python3

import sys
import pprint

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)


def main():
	log = Logger(0)
	day_length = int(sys.stdin.readline())
	down_happy = list(map(int, sys.stdin.readline().split()))
	daily_happy = [[] for i in range(day_length)]
	contests_kind = 26
	contests = []
	for i in range(day_length):
		si = list(map(int, sys.stdin.readline().split()))
		for j in range(contests_kind):
			daily_happy[i].append(si[j])
	for i in range(day_length):
		contests.append(int(sys.stdin.readline())-1)
	log.print(day_length, down_happy, daily_happy)
	happy = 0
	last_contest_days = [0]*contests_kind
	for day in range(day_length):
		contest = contests[day]
		happy += daily_happy[day][contest]
		last_contest_days[contest] = day + 1
		for i in range(contests_kind):
			happy -= down_happy[i] * (day + 1 - last_contest_days[i])
		print(happy)





main()

Measured memory_bytes: 70300
#define _CRT_SECURE_NO_WARNINGS

#define N (1<<4)
#define MODULO (1000000007)
#define HA1 (2420609)
#define HA2 (19260817)

#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <complex>
using namespace std;

namespace MRAND
{
	class MRNDS
	{
	public:
		int ngf;
		unsigned int lgf;
		MRNDS()
		{
			ngf = HA1*HA2;
			lgf = HA1 - HA2*ngf;
		}
		MRNDS(long long rgf)
		{
			lgf = rgf&((1LL << 32) - 1LL);
			ngf = (rgf >> 31);
			ngf += 2LL * lgf;
			ngf *= HA2;
			lgf += HA1;
		}
		MRNDS operator* (const MRNDS &mrs)const
		{
			MRNDS Res;
			Res.ngf += ngf*mrs.lgf;
			Res.ngf -= mrs.ngf*lgf;
			Res.ngf *= HA1;
			Res.lgf *= HA2;
			return Res;
		}
	}curl, curr;
	inline void InitRand(MRNDS &Lmrs, MRNDS &Rmrs)
	{
		curl = Lmrs;
		curr = Rmrs;
		curl = curl*curr;
		curl.ngf += HA2;
	}
	inline int GetRand()
	{
		curl = curl*curr;
		return (curl.lgf*HA1 - curr.ngf*HA2);
	}
}

char s[N];
int n, t;
bool dis[N];
int nxt[N];

int main()
{
	scanf("%s %d", s, &n);
	t = strlen(s);
	for (int i = 0;i < n;i++)
	{
		int tmp;
		scanf("%d", &tmp);
		dis[tmp] = true;
	}
	int lst = 0;
	for (int i = 0;i <= 9;i++)
	{
		if (lst < i)
		{
			lst = i;
		}
		while (dis[lst])
		{
			lst++;
		}
		nxt[i] = lst;
	}
	nxt[10] = 10;
	int tt = 0;
	while (tt < t)
	{
		if (dis[s[tt] - '0'])
		{
			break;
		}
		tt++;
	}
	while (tt < t&&tt > 0)
	{
		if (nxt[s[tt] - '0' + 1] != 10)
		{
			tt++;
			break;
		}
		tt--;
	}
	if (tt)
	{
		if (tt < t)
		{
			s[tt] = nxt[s[tt] - '0' + 1] + '0';
			for (int i = tt + 1;i < t;i++)
			{
				s[i] = nxt[0] + '0';
			}
			printf("%s\n", s);
		}
		else
		{
			printf("%s\n", s);
		}
	}
	else
	{
		if (nxt[s[tt] - '0' + 1] == 10)
		{
			printf("%d", nxt[1]);
			for (int i = 0;i < t;i++)
			{
				printf("%d", nxt[0]);
			}
			printf("\n");
		}
		else
		{
			s[tt] = nxt[s[tt] - '0' + 1] + '0';
			for (int i = tt + 1;i < t;i++)
			{
				s[i] = nxt[0] + '0';
			}
			printf("%s\n", s);
		}
	}
	//system("pause");
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
#include <stack>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

const long long MOD = 1000000007;

int main(){
  string s;
  cin>>s;
  vector<int> v(3, 0);
  rep(i,s.size()) {
    v[s[i]-'a']++;
  }
  sort(v.begin(), v.end());
  if(v[2]-v[0]>=2)
    std::cout << "NO" << std::endl;
  else
    std::cout << "YES" << std::endl;

  return 0;
}


Measured memory_bytes: 512
//#include <bits/stdc++.h>
//#include <algorithm>
//#include <cstdio>
//#include <functional>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
//#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <string>
//#include <time.h>
//#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
//#include <string.h>
#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define LL long long
#define pii pair<int,int>
#define pb push_back
using namespace std;
const LL MOD=1e9+7;
int main()
{
	int n,f=0;
	char s[300010];
	cin>>n;
	rep(i,n)
	{
		cin>>s[i];
		if(i>0&&s[i]=='E') f++;
	}
	int mn=f;
	for(int i=1;i<n;i++)
	{
		if(s[i]=='E') f--;
		if(s[i-1]=='W') f++;
		mn=min(f,mn);
	}
	cout<<mn;
    rt0;
}

Measured memory_bytes: 512
#include <stdio.h>
int main()
{
    
    int a,b;
	scanf("%d%d",&a,&b);
	if(a!=1&&b!=1)
	{
		printf("1");
	}
	if(a!=2&&b!=2)
	{
		printf("2");
	} 
	if(a!=3&&b!=3)
	{
		printf("3");
	 } 
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
  unsigned short *A, *B;
  int C[VMAX+1];
  int n, i, j;

  scanf("%d", &n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  /* your code */
  for(i=0; i<=VMAX; i++)
    C[i] = 0;

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

  for(i=1; i<=VMAX; i++)
    C[i] += C[i-1];

  for(j=1; j<=n; j++){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

  for(i=1; i<n; i++)
    printf("%d ",B[i]);

  printf("%d\n",B[n]);

  return 0;
}


Measured memory_bytes: 9572
import std.stdio;
import std.functional;

alias memoize!(c) cm;
ulong c(ulong n, ulong k){
	if(k==0 || n==k) return 1;
	return cm(n-1, k) + cm(n-1, k-1);
}

int main(){
	auto s = readln;
	ulong[char] maji;
	foreach(i; 0..s.length-1){
		maji[s[i]]++;
	}
	bool shinu = false;
	foreach(i; maji){
		if(i%2){
			if(shinu){
				0.writeln;
				return 0;
			}
			shinu = true;
		}
	}
	ulong[char] anman;
	ulong total, kazoeruyatu = 1;
	foreach(i,j; maji) total += (anman[i] = j%2 ? (j-1)/2 : j/2);
	foreach(i; anman){
		kazoeruyatu *= cm(total, i);
		total -= i;
	}
	kazoeruyatu.writeln;
	return 0;
}

Measured memory_bytes: 2516
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++){
    ans = ans +  int(s.at(i))-48;
  }
  if (ans%9==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}



Measured memory_bytes: 3752
'use strict'
function main(input) {
    const tmp = input.split('\n');
    const N = parseInt(tmp[0], 10);
    const d = tmp[1].split(" ").map((elem) => parseInt(elem, 10));

    d.sort((d1, d2) => d1 - d2);

    const ctrLeftInd = N / 2 - 1;
    const ctrRightInd = ctrLeftInd + 1;
    console.log(d[ctrRightInd] - d[ctrLeftInd]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 28220
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <array>

using namespace std;

#define forange(counter, end) forstep(counter, 0, end)
#define forstep(counter, begin, end) forstep_type(size_t, counter, begin, end)
#define forange_type(type, counter, end) forstep_type(type, counter, 0, end)
#define forstep_type(type, counter, begin, end) for (type counter = begin, forstep_type_end_##counter = end; counter < forstep_type_end_##counter; counter++)

const int D = 365;
const int C = 26;

int main() {

	int d;
	cin >> d;

	array<int, C> contest;

	for (auto& c : contest)
	{
		cin >> c;
	}

	array<array<int, C>, D> satisfaction;

	forange(d, D)
	{
		forange(s, C)
		{
			cin >> satisfaction[d][s];
		}
	}

	forange(i, D)
	{
		cout << (rand() % C) + 1 << endl;
	}

	return 0;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#ifdef DBP
#define deb(...) fprintf(stderr,__VA_ARGS__)
#else
#define deb(...) 0
#endif
#define fst first
#define snd second
#define fore(x,a,b) for(int x=(a), qwerty=(b); x<qwerty; x++)
#define pb push_back
#define mset(a,v) memset((a),(v),sizeof(a))
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) int((a).size())
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;

ll n,demetrio,dp[105][100015],w[105],v[105];
ll INF=1e18;

ll solve(ll i,ll j) {
	if(i<0) {
		if(j)return INF;
		return 0;
	}
	if(dp[i][j]!=-1)return dp[i][j];
	ll res=solve(i-1,j);
	if(v[i]<=j)res=min(res,w[i]+solve(i-1,j-v[i]));
	//if(i<=100 && j<=100)cout<<i<<" "<<j<<" "<<res<<endl;
	dp[i][j]=res;
	return res;
}
// minimo peso para llegar a valor j
int main(){FIN;
	cin>>n>>demetrio;
	fore(i,0,n)cin>>w[i]>>v[i];
	mset(dp,-1);
	int res=0;
	fore(i,0,1e5+1) {
		if(solve(n-1,i)<=demetrio)res=max(res,i);	
	}
	cout<<res<<endl;
}

Measured memory_bytes: 82304
#include <iostream>
#include <vector>
#include <string>

using namespace std;

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

    int ans = 0;
    for(int i=0; i<S.size(); ++i){
        if(S[i] != T[i]) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3916
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split()))for _ in range(N)]
ans = 0

for Ai in A:
    ansi = C
    for i, a in enumerate(Ai):
        ansi += a * B[i]
    if ansi > 0:
        ans += 1
print(ans)



Measured memory_bytes: 3060
#include <stdio.h>

int main(void)
{
	int a, b, c;
	int i;
	int n = 0;
	
	scanf("%d %d %d", &a, &b, &c);
	
	for (i = a; i <= b; i++){
		if (c % i == 0) {
			n++;
		}
	}
	
	printf("%d\n", n);
	
	return (0);
}

Measured memory_bytes: 596
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[][] input = new int[M][2];
		for (int i = 0; i < M; i++) {
			input[i][0] = sc.nextInt();
			String tmp = sc.next();
			if (tmp.equals("AC")) {
				input[i][1] = 1;
			} else {
				input[i][1] = 0;
			}
		}
		int resCorr = 0;
		int pena = 0;
		int[][] qa = new int[N][2];
		for (int i = 0; i < M; i++) {
			if (qa[input[i][0]-1][1] == 1) {
				continue;
			}
			if (input[i][1] == 0) {
				qa[input[i][0]-1][0]++;
			} else {
				resCorr++;
				pena += qa[input[i][0]-1][0];
				qa[input[i][0]-1][1] = 1;
			}
		}
		System.out.print(resCorr + " " + pena);
	}
}

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

int main() {
	int a,h,m,s;
	cin >> a;
	h = a / 3600;
	m = a % 3600 / 60;
	s = a % 3600 % 60 ;
	cout << h << ":" <<  m << ":" << s << endl;
	return 0;
}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
LL group[100005];
int main(void)
{
    int k;
    scanf("%d",&k);
    for(int i = 0; i < k; i++)
        scanf("%lld",&group[i]);
    if(group[k-1]!=2)printf("-1\n");
    else
    {
        LL l = -1,r = -1;
        LL ll = 2,rr = 1e18;
        while(ll <= rr)
        {

            LL mid = (ll+rr)/2LL;
            LL cp = mid;
            for(int i = 0; i < k; i++)
            {
                LL s = cp%group[i];
                cp -= s;
            }
            if(cp/2LL == 1)
            {
                r = mid;
                ll = mid + 1;
            }
            else if(cp/2LL < 1)
            {
                ll = mid + 1;
            }
            else rr = mid - 1;
        }
        ll = 2,rr = r;
        //cout<<r<<endl;
        while(ll <= rr)
        {
            //cout<<"1"<<endl;
            LL mid = (ll+rr)/2LL;
            LL cp = mid;
            for(int i = 0; i < k; i++)
            {
                LL s = cp%group[i];
                cp -= s;
            }
            if(cp/2LL == 1)
            {
                l = mid;
                rr = mid - 1;
            }
            else if(cp/2LL < 1)
            {
                ll = mid + 1;
            }
            else rr = mid - 1;
        }
        if(l==-1||r == -1)
            printf("-1\n");
        else printf("%lld %lld\n",l,r);
    }
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  double ans = 0.0;
  if (n == 1) ans = 1;
  else if (n % 2 == 0) ans = (double)5/10;
  else {
    ans = (double)((n+1)/2) / n;
  }
  printf("%.10f\n", ans);
  return 0;
}

Measured memory_bytes: 3748
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3e5+5;
long long arr[MAXN];
long long pref[MAXN];
long long pref2[MAXN];
long long ans;
long long res= 1e18;
int main(){
    long long n,m;
    cin>>n>>m;
    for(long long i=1;i<=n;i++){
        cin>>arr[i];
    }
    for(long long i=1;i<n;i++){
        long long x = arr[i];
        long long y = arr[i+1];
        if(y<x){
            y+=m;
            if(y-x==1){
                ans++;
                continue;
            }
        }
            pref[x+2]++;
            pref[y+1]--;
            pref2[y+1]+=y-x-1;
            pref[m+x+2]++;
            pref[m+y+1]--;
            pref2[m+y+1]+=y-x-1;
        ans+=(y-x);


    }
    for(long long i=1;i<=3*m;i++){
        pref[i] += pref[i-1];
        pref2[i] += pref2[i-1];
        pref2[i]-=pref[i];
        res = min(res,ans+pref2[i]);
    }
    cout<<res<<endl;
}


Measured memory_bytes: 6400
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        String ans = "";
        long d = c - a - b;
        if (4 * a * b < d * d && d > 0)
            ans = "Yes";
        else {
            ans = "No";
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 22996
s = input()


def get_z_idx(s):
    l = len(s) - 1
    for i in range(l, -1, -1):
        if s[i] == 'Z':
            z_idx = i
            break
    return z_idx


def main(s):
    a_idx = s.index('A')
    z_idx = get_z_idx(s)
    _s = s[a_idx:z_idx + 1]
    return len(_s)


print(main(s))

Measured memory_bytes: 3516