akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<long long>> xyz(N, vector<long long>(3));
    for(int i = 0; i < N; i++) cin >> xyz.at(i).at(0) >> xyz.at(i).at(1) >> xyz.at(i).at(2);
    
    long long ans = 0;
    for(int bit = 0; bit < (1<<3); bit++) {
        vector<long long> sums(N);
        vector<int> d(3, 1);
        for(int i = 0; i < 3; i++) {
            if(bit & (1<<i)) d.at(i) *= (-1);
        }
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < 3; j++) {
                sums.at(i) += xyz.at(i).at(j)*d.at(j);
            }
        }
        sort(sums.begin(), sums.end());
        reverse(sums.begin(), sums.end());
        long long tmp = 0;
        for(int i = 0; i < M; i++) {
            tmp += sums.at(i);
        }
        ans = max(ans, tmp);
    }
    
    cout << ans << endl;
    
}


Measured memory_bytes: 256
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
#include <bitset>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    if(s=="BBB"||s=="AAA"){
        cout<<"No"<<endl;
    }else{
        cout<<"Yes"<<endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int day = sc.nextInt();

        if (day == 25) System.out.println("Christmas");
        else if (day == 24) System.out.println("Christmas Eve");
        else if (day == 23) System.out.println("Christmas Eve Eve");
        else if (day == 22) System.out.println("Christmas Eve Eve Eve");
    }
}

Measured memory_bytes: 26960
import sys
import numpy as np

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
MOD = 10 ** 9 + 7
S1 = rs()
S2 = rs()
color = [None] * N

answer = 1
pattern = 0 #１つ前の列の色の種類

for i in range(N):
    if color[i] != None:
        continue
    if S1[i] == S2[i]:
        answer *= 3 - pattern
        pattern = 1
    else:
        answer *= [6, 2, 3][pattern]
        color[i+1] = 1
        pattern = 2

print(answer%MOD)
#08

Measured memory_bytes: 12508
use proconio::input;

fn main() {
  let mut _n : i128 ;
  let mut _r : i128 ;


   input! {
    n : i128 ,
    r : i128 ,

 }

 let t = 100 * (10-n) ;
 let tt = r + t ;
 if n < 10 {
  println!("{}",tt);
 }else {
   println!("{}",r);
 }



}


Measured memory_bytes: 2072
#include<cstdio>
using namespace std;
int main()
{
    int n;
    int k;
    int ans=0;
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++)
    {
    	int x;
		scanf("%d",&x);
		if(x>=k) ans++;
	}
	printf("%d",ans);
	return 0;
} 

Measured memory_bytes: 128
// #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <stack>
#include <numeric>
// #include <windows.h>
using namespace std;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = V<VV<T>>;
template<class T1, class T2> using P = pair<T1, T2>;
using I = int;
using D = double;
using B = bool;
using C = char;
using S = string;
using LL = long long;
using LD = long double;
using ULL = unsigned long long;
using PII = P<I, I>;
using VPII = V<PII>;
using PLL = P<LL, LL>;
using VPLL = V<PLL>;
using VI = V<I>;
using VVI = VV<I>;
using VLL = V<LL>;
using VVLL = VV<LL>;
using VC = V<C>;
using VVC = VV<C>;
using VS = V<S>;
using VVS = VV<S>;
using VB = V<B>;
using VVB = VV<B>;
#define REP(type, i, n) for (type i = 0; i < (type)(n); ++i)
#define REP2(type, i, m, n) for (type i = (m); i < (type)(n); ++i)
#define REPR(type, i, n) for (type i = (n)-1; i >= 0; --i)
#define REPR2(type, i, m, n) for (type i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a, type) sort(ALL(a), greater<type>())
#define SORTF(a, comp) sort(ALL(a), comp)
#define REVERSE(a) reverse(ALL(a))
#define SIZE(a, type) ((type)(a).size())
#define bit_search(bit, n) REP(LL, bit, 1LL<<(n))
#define bit_check(bit, i) ((bit>>(i)) & 1)
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) (lower_bound(ALL(a), (x)) - a.begin())
#define bisect_right(a, x) (upper_bound(ALL(a), (x)) - a.begin())
#define INPUT(a) REPx(&x, a) cin >> x;
#define INPUT2(a) REPx(&x, a) INPUT(x);
#define INPUTP(a) REPx(&x, a) cin >> x.first >> x.second;
#define ENDL cout << endl;

const int INF = 2e9;
// const LL INF = 9e18;
const LL MOD = 1e9+7;

template<class T> using PRIORITY_QUEUE = priority_queue< T, V<T>, greater<T> >;
template<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true;} return false;}
template<class T> inline void debug1(V<T> A){REP(int, i, SIZE(A, int)){if (A[i] == INF) cout << "I ";else cout << A[i] << " ";}ENDL}
template<class T> inline void debug2(VV<T> A){REP(int, i, SIZE(A, int)){REP(int, j, SIZE(A[i], int)){if (A[i][j] == INF) cout << "I "; else cout << A[i][j] << " ";}ENDL}}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  LL n, c, k;
  cin >> n >> c >> k;
  VLL T(n);
  INPUT(T);
  SORT(T);
  int idx = 0, ans = 0;
  while(idx < n)
  {
    ++ans;
    int ct = 1;
    int r = T[idx] + k;
    while(ct < c)
    {
      if (T[idx+ct] <= r && r <= T[idx+ct]+k) ++ct;
      else break;
    }
    idx += ct;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3988
#include <stdio.h>

// 入力受付用の変数
#define BUF 200002
char str[BUF];

// 入力された値
#define LIM_A 100001
int N;
int A[LIM_A];

void receive_input() {
	fgets(str, sizeof(str), stdin);
	sscanf(str, "%d", &N);

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

void solve() {
	double sum = 0;
	for (size_t i = 0; i < N; i++) {
		sum += 1 / (double)A[i];
	}

	printf("%f\n", 1 / sum);
}

int main(void) {
	receive_input();

	solve();

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>

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

int main(){
  int k;
  cin >> k;
  cout << (k/2)*(k-k/2) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second

int main(void) {
	ll w,h,x,y; cin >> w >> h >> x >> y;
	double s = (w*h)/2.0;
	int ans;
	if(x*2==w&&y*2==h) ans = 1;
	else ans = 0;
	cout16 << s;
	cout << " " << ans << endl;
}




Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item = U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}

fn binary_search<F>(mut ok: i64, mut ng: i64, pred: F) -> i64
where
    F: Fn(usize) -> bool
{
    while (ok - ng).abs() > 1 {
        let mid = (ok + ng) / 2;
        if pred(mid as usize) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    ok
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: i64 = sc.get();
    let K: i64 = sc.get();
    let mut ans = 0;
    for b in 1..N+1 {
        let per_one = max(b - K, 0);
        let times = (N+1) / b;
        let rem = max((N+1) % b - K, 0);
        ans += per_one * times + rem;
        if K == 0 {
            ans -= 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
l = int(input()) # 冬休みの日数
a = int(input()) # 国語ページ数
b = int(input()) # 算数ページ数
c = int(input()) # 国語消化
d = int(input()) # 算数消化

import math

print(l - max(math.ceil(a/c), math.ceil(b/d)))


Measured memory_bytes: 5656
import java.util.Scanner;

class Main
{
	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNextDouble())
		{
			double w = sc.nextDouble();
			if (w <= 48.0)
			{
				System.out.println("light fly");
			}
			else if (w <= 51.0)
			{
				System.out.println("fly");
			}
			else if (w <= 54.0)
			{
				System.out.println("bantam");
			}
			else if (w <= 57.0)
			{
				System.out.println("feather");
			}
			else if (w <= 60.0)
			{
				System.out.println("light");
			}
			else if (w <= 64.0)
			{
				System.out.println("light welter");
			}
			else if (w <= 69.0)
			{
				System.out.println("welter");
			}
			else if (w <= 75.0)
			{
				System.out.println("light middle");
			}
			else if (w <= 81.0)
			{
				System.out.println("middle");
			}
			else if (w <= 91.0)
			{
				System.out.println("light heavy");
			}
			else
			{
				System.out.println("heavy");
			}
		}
	}
}

Measured memory_bytes: 12000
package main

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

const Mod = int(1e9) + 7

func main() {
	N := ReadInt()
	As := ReadInts(N)
	ans := 0
	for i := uint(0); i < 60; i++ {
		cnt := 0
		for j := 0; j < N; j++ {
			if (As[j]>>i)&1 == 1 {
				cnt++
			}
		}
		v := cnt * (N - cnt) % Mod
		for j := 0; j < int(i); j++ {
			v = v * 2 % Mod
		}
		ans = (ans + v) % Mod
	}
	fmt.Println(ans)
}

func ReadInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = ReadInt()
	}
	return ret
}

var sc = bufio.NewScanner(os.Stdin)

func init()        { sc.Buffer(make([]byte, 256), 1e9); sc.Split(bufio.ScanWords) }
func Read() string { sc.Scan(); return sc.Text() }

func ReadInt() int {
	v, e := strconv.Atoi(Read())
	if e != nil {
		panic(e.Error())
	}
	return v
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
#define MAXN 100000+5
using namespace std;
typedef long long LL;
LL n,a[MAXN],L,t,lgn;
LL ne[MAXN];
LL f[MAXN][21];
LL divide(LL d)
{
	LL l=1,r=n;
	while(l<=r)
	{
		LL mid=(l+r)>>1;
		if(a[mid]>d) r=mid-1;
		if(a[mid]<=d) l=mid+1;
	}
	return r;
}
int main()
{
	scanf("%lld",&n);
	lgn=log2(n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
	}
	scanf("%lld%lld",&L,&t);
	for(int i=1;i<=n;i++)
	{
		LL x=divide(a[i]+L);
	    f[i][0]=x;
	}
	for(int j=1;j<=lgn;j++)
	{
		for(int i=1;i<=n;i++)
		{
			f[i][j]=f[f[i][j-1]][j-1];
		}
	}
	for(int i=1;i<=t;i++)
	{
		LL times=0;
		LL u,v;
		scanf("%lld%lld",&u,&v);
		if(u>v) swap(u,v);
		for(int j=lgn;j>=0;j--)
		{
			if(f[u][j]<v)
			{
				u=f[u][j];
				times+=pow(2,j);
			}
		}
		times++;
		printf("%lld\n",times);
	}
	return 0;
}


Measured memory_bytes: 18048
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e3+9;
const double ep=1e-7;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
const double pi=acos(-1);
#define debug1 puts("?");
#define debug(x) cout<<"##"<<(x)<<endl;
#define mk make_pair
#define PII pair<int,int>
#define PIII pair<PII,int>
#define PIL pair<int,ll>
#define PLL pair<ll,ll>
#define eb emplace_back
#define fi first
#define se second
#define rep(i,a,b) for(register int i=(a);i<=(b);++i)
#define sd(x) scanf("%d",&(x))
#define slld(x) scanf("%lld",&(x))
#define sdd(x,y) scanf("%d%d",&(x),&(y))
#define sc(s) scanf("%s",(s))
#define pd(x) printf("%d\n",(x))
#define plld(x) printf("%lld\n",(x))
#define pdk(x) printf("%d ",(x))
typedef long long ll;
char s[maxn],t[maxn];
vector<int>vec[30];
vector<int>::iterator it;
int res;
void solve()
{
	scanf("%s%s",s+1,t+1);
	int lens=strlen(s+1);
	int lent=strlen(t+1);
	res=lent;
	for(int i=1;i<=lens-lent+1;i++)
	{
		int sum=0;
		for(int j=1;j<=lent;j++)
		{
			if(s[i+j-1]!=t[j])sum++;
		}
		res=min(res,sum);
	}
	pd(res);
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int T=1;
//	sd(T);
	while(T--)solve();
} 

Measured memory_bytes: 3824
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,a[1000001];
int main()
{
	scanf("%d",&n);
    for(int i=1;i<=n;i++)
    	scanf("%d",&a[i]);
    sort(a+1,a+n+1,greater<int>());
    for(int i=1;i<=n;i++)
        if(i+1>a[i+1]&&a[i]>=i)
		{
            int j=0;
            while(a[j+i+1]==i) j++;
            if((a[i]-i)%2==0&&j%2==0) printf("Second");
            else printf("First");   
    		return 0;
        }
    return 0;
}

Measured memory_bytes: 640
#pragma region

#ifdef LOCAL
#define debug cout
#else
#define debug \
    if (0) cout
#endif

#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using ll = long long;

template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    os << "[ ";
    for (auto e : v) os << e << " ";
    return os << "]";
}

template <typename T, typename V>
ostream& operator<<(ostream& os, set<T, V> v) {
    os << "{ ";
    for (auto e : v) os << e << " ";
    return os << "}";
}

template <typename T, typename V, typename S>
ostream& operator<<(ostream& os, map<T, V, S> v) {
    os << "{ ";
    for (auto e : v) os << e << " ";
    return os << "}";
}

template <typename T, typename V>
ostream& operator<<(ostream& os, pair<T, V> x) {
    return os << "( " << x.first << ", " << x.second << " )";
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    for (auto& e : v) is >> e;
    return is;
}

template <typename T, typename V>
istream& operator>>(istream& is, pair<T, V>& x) {
    return is >> x.first >> x.second;
}

void solve();

int main() {
#ifdef LOCAL
    freopen("data.txt", "r", stdin);
#else
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif
    solve();
}

#pragma endregion

const ll MOD = 1e9 + 7;

vector<vector<int>> mult(const vector<vector<int>>& a, const vector<vector<int>>& b) {
    auto res = vector<vector<int>>(a.size(), vector<int>(b[0].size()));
    for (int i = 0; i < res.size(); ++i) {
        for (int j = 0; j < res[i].size(); ++j) {
            for (int k = 0; k < a[i].size(); ++k) {
                res[i][j] = (1LL * res[i][j] + 1LL * a[i][k] * b[k][j]) % MOD;
            }
        }
    }
    return res;
}

void solve() {
    int n;
    ll k;
    cin >> n >> k;
    vector<vector<int>> a(n, vector<int>(n)), res(n, vector<int>(n));
    cin >> a;
    for (int i = 0; i < n; ++i) res[i][i] = 1;
    while (k) {
        if (k & 1LL == 1LL) {
            res = mult(res, a);
        }
        a = mult(a, a);
        k /= 2;
    }
    ll ans = 0;
    for (int i = 0; i < res.size(); ++i) {
        for (int j = 0; j < res[i].size(); ++j) {
            ans += res[i][j];
            ans %= MOD;
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod 1000000007
#define endl "\n"
 
 
int pow1(int n, int p)
{
	if(p==0)	return 1;
	int x=pow1(n, p/2);
	x=(x*x)%mod;
	if(p%2==0)
		return x;
	else
		return (x*n)%mod;
}
 
int32_t main()
{
	fast;

	int a, b;
	cin>>a>>b;
	if(a<b)
	{
		for(int i=0;i<b;i++)
			cout<<a;
	}
	else if(b>a)
	{
		for(int i=0;i<a;i++)
			cout<<b;
	}
	else
	{
		for(int i=0;i<a;i++)
			cout<<b;
	}

	return 0;
}

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

    using namespace std;
    typedef long long ll;
    typedef unsigned long long ull;
    # define M_PI  3.14159265358979323846

    void solve(){
        int n;
        cin>>n;
        for(int i=1000;i<=10000;i+=1000){
            if(i>=n){
                cout<<(i-n);
                return;
            }
        }
    }
    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cout<<fixed;
        cout<<setprecision(10);
        int t=1;
//        cin>>t;
        for(int i=1;i<=t;i++){
            solve();
        }
        return 0;
    }


Measured memory_bytes: 3616
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

int main(){

    ll N;
    cin >> N;
    for(ll i = 1; i <= N; i++){
        if(i * 108 / 100 == N){
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;

    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,d;
  	cin>>n>>d;
  	vector<vector<int>>vec(n,vector<int>(d));
  	for(int i=0;i<n;i++){
    	for(int j=0;j<d;j++){
        	cin>>vec[i][j];
        }
    }
  	vector<int>vec2(0);
  	int l=0;
  for(int k=0;k<n;k++){
  	for(int i=k+1;i<n;i++){
       	l=0;
    	for(int j=0;j<d;j++){
        	l=l+(vec[k][j]-vec[i][j])*(vec[k][j]-vec[i][j]);
        }
      vec2.push_back(l);//一番最初は0である。
    }
  }
  
  
  int count=0;
 	for(int i=0;i<vec2.size();i++){
      for(int j=1;j<=1000;j++){
    	if(vec2.at(i)==j*j){
        	count++;
        }
      }
    }
  	cout<<count<<endl;
}

Measured memory_bytes: 256
ANS=[]
N,K=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
for i in range(N-K+1):
    a=x[i]
    b=x[i+K-1]
    A=abs(a)+abs(a-b)
    B=abs(b)+abs(b-a)
    c=min(A,B)
    ANS.append(c)
print(min(ANS))

Measured memory_bytes: 14252
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n;
  cin>>n;
  vector<string> v(n);
  rep(i,n){
    cin>>v[i];
  }

  set<string> s;
  s.insert(v[0]);
  FOR(i,1,n){
    if(s.find(v[i])!=s.end()){
      Yes(false);
      return 0;
    }
    if(v[i-1][v[i-1].size()-1]!=v[i][0]){
      Yes(false);
      return 0;
    }
    s.insert(v[i]);
  }

  Yes(true);




}

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

int main(void){
    int N; cin >> N;
    string S=to_string(N);
    int sn=0;

    for(int i=0; i<S.size(); i++){
        sn+=stoi(S.substr(i,1));
    }

    if(N%sn==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

using namespace std;

int main() {
  string s;
  cin >> s;
  int len = (int)s.size();
  
  int res = 0;
  for (int i=1; i<len; ++i) {
    if (s.at(i) != s.at(i-1)) ++res;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {
    //-------------------------------------------------------------//
    public static final void main(String[] args) {
        new Main().solve();
    }
    //-------------------------------------------------------------//
    private final Scanner sc = new Scanner(System.in);

    void solve() {
        char[] S = sc.next().toCharArray();
        HashSet<Character> set = new HashSet<>();
        for (char c : S) {
            if (set.contains(c)) {
                System.out.println("no");
                return;
            }
            else {
                set.add(c);
            }
        }
        System.out.println("yes");
    }
}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define tc int t; cin>>t; while(t--)
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define mod 1000000007
#define pb push_back
#define vi vector<int>
#define vc vector<char>
#define eb emplace_back
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define fo(i,x,n) for(int i=x;i<n;i++)
#define csb(x) __builtin_popcount(x)
#define tz(x) __builtin_ctz(x)
#define lsbp(x) __builtin_ffs(x)
#define msbp(x) __lg(x)
#define btoi(str,i) stoi(str,0,i)
#define ff first
#define ss second
const int inf=0x3f3f3f3f3f3f3f3f;

void zz(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}

int32_t main(){
zz();
int n;cin>>n;
vi v(n);for(int i=1;i<n;i++)cin>>v[i];
vi cnt(n+1,0);
// map<int,int>mp;
for(int i=1;i<n;i++){
	cnt[v[i]]+=1;
}
for(int i=1;i<=n;i++)cout<<cnt[i]<<endl;

}

Measured memory_bytes: 6352
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


int main(){
  int N;
  cin >> N;
  int a[N];
  int sum = 0;
  rep(i, N){
    cin >> a[i];
    sum += a[i];
  }
  sort(a, a+N);
  if(sum%10) cout << sum << endl;
  else{
    bool ALL = true;
    rep(i, N){
      if(a[i]%10){
        sum -= a[i]; ALL = false; break;
      }
    }
  if(ALL) cout << 0 << endl;
  else cout << sum << endl;
  }
}

Measured memory_bytes: 256
use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let x: u64 = buf.trim_end().chars().map(|c| (c as u8 - b'0') as u64).sum();
    if x % 9 == 0 {
        println!("Yes");
    } else {
        println!("No");
    }
}

Measured memory_bytes: 2264
import itertools
import copy
n, m = map(int, input().split())
graph = [[] * n for i in range(n)]
for _ in range(m):
    num_from, num_to = map(int, input().split())
    graph[num_from - 1].append(num_to - 1)
    graph[num_to - 1].append(num_from - 1)

count = 0
node_list = [i + 1 for i in range(n - 1)]
for pattern in itertools.permutations(node_list):
    pattern_list = list(pattern)
    pattern_list.insert(0, 0)
    can_arrive = False
    for i in range(n):
        if i == n - 1:
            can_arrive = True
            break
        if pattern_list[i + 1] not in graph[pattern_list[i]]:
            can_arrive = False
            break
    if can_arrive:
        count += 1

print(count)

Measured memory_bytes: 3436
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int D 	  = Integer.parseInt(scanner.nextLine());
		int ans   = 0;
		int point = 0;

		String[] clist = scanner.nextLine().split(" ");
		int[] clis = new int[26];
		int[] list = new int[26 * D];

		for(int i = 0; i < 26 ; i++)clis[i] = Integer.parseInt(clist[i]);

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

			String[] slist = scanner.nextLine().split(" ");
			int count = i * 26;

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

				list[count] = Integer.parseInt(slist[j]);
				count++;

			}
		}//1373

		int[] day = new int[26];
		for(int i = 0; i < 26; i++) day[i] = 0;

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

			int t = Integer.parseInt(scanner.nextLine()) - 1;
			point = i * 26 + t;

			ans += list[point];
			day[t] = i + 1;
			for(int j = 0; j < 26; j++) {

				ans -= clis[j] * (i + 1 - day[j]);

			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 39416
#include<bits/stdc++.h>
using namespace std;
#define intt long long int
#define intu unsigned long long int
#define vi vector<int>
#define ii pair<int,int>
#define pb push_back
//#define mp make_pair
#define ff first
#define ss second
#define fast_io ios::sync_with_stdio(0);cin.tie(NULL);std::cout.tie(NULL);
# define PI           3.14159265358979323846 
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
int mod = 1000000007;
int gcd(int a, int b) {return b ? gcd(b, a % b) : a;}
int lcm(int a, int b) {return a * b / gcd(a, b); }
intt bpow(intt a,intt b) 
{
  intt res = 1;
  while (b > 0) {
    if (b & 1)res = ((res%mod) * (a%mod))%mod;
      a = ((a%mod) * (a%mod))%mod;
      b >>= 1;
  }
  return res;
}
intt fact(intt n) { 
   if ((n==0)||(n==1))
      return 1; 
   else
      return n*fact(n-1);
}
void go()
{
#ifndef ONLINE_JUDGE
  freopen("inn.txt","r",stdin);
  freopen("ouut.txt","w",stdout);
  #endif
}
///////////U L R D
int dx[4]={0,-1,1,0};
int dy[4]={1,0,0,-1};


int main() 
{ 
    fast_io
    go();
   intt n,m;cin>>n>>m;
   cout << n*(n-1)/2+m*(m-1)/2 <<"\n";
}

/*!
    You are under no obligation to be the same person you were a minute ago,
    You have the right to grow !
*/




















Measured memory_bytes: 3664
#include<cstdio>
const int MaxN=1510,inf=1<<23;
int N;
char A[2][MaxN][MaxN];
int dep[MaxN][MaxN],left[MaxN][MaxN],right[MaxN][MaxN],
	cnt_l[MaxN][MaxN],cnt_r[MaxN][MaxN],tmp[MaxN],low[MaxN][MaxN],rea[MaxN],Q[MaxN],Qm[MaxN];
void swp(int&a,int&b){int t=a;a=b;b=t;}
int min(int a,int b){return a<b?a:b;}
int max(int a,int b){return a>b?a:b;}
int reach(int i,int j,int d){
	int l=low[i][j];
	if(l>=d)return 0;
	return cnt_l[d][i+1]-cnt_l[l][i+1]-cnt_r[d][j]+cnt_r[l][j];
}
long long dc(int ty,int u,int d,int l,int r){
	if(r-l>d-u)ty^=1,swp(u,l),swp(d,r);
	if(d-u==1)return 0;
	int mid=u+d>>1;
	for(int i=mid;i<=d;i++)
		for(int j=l;j<=r;j++)cnt_l[i][j]=cnt_r[i][j]=0;
	for(int i=u;i<mid;i++)
		for(int j=l;j<r;j++)dep[i][j]=A[ty][i][j]?min(i,min(i>u?dep[i-1][j]:inf,j>l?dep[i][j-1]:inf)):inf;
	for(int i=d;i-->mid;)
		for(int j=r;j-->l;)dep[i][j]=A[ty][i][j]?max(i,max(i+1<d?dep[i+1][j]:-inf,j+1<r?dep[i][j+1]:-inf)):-inf;
	for(int i=mid;i-->u;)
		for(int j=r;j-->l;){
			left[i][j]=A[ty][i][j]?min(i==mid-1?j:inf,min(i+1<mid?left[i+1][j]:inf,j+1<r?left[i][j+1]:inf)):inf;
			right[i][j]=A[ty][i][j]?max(i==mid-1?j:-inf,max(i+1<mid?right[i+1][j]:-inf,j+1<r?right[i][j+1]:-inf)):-inf;
		}
	for(int i=l;i<r;i++)tmp[i]=i;
	for(int i=mid;i<d;i++){
		int p=l,q=l-1;
		for(int j=l;j<r;j++){
			left[i][j]=A[ty][i][j]?min(i==mid?j:inf,min(i>mid?left[i-1][j]:inf,j>l?left[i][j-1]:inf)):inf;
			right[i][j]=A[ty][i][j]?max(i==mid?j:-inf,max(i>mid?right[i-1][j]:-inf,j>l?right[i][j-1]:-inf)):-inf;
			if(left[i][j]<=right[i][j]){
				cnt_l[i+1][left[i][j]+1]+=A[ty][i][j];cnt_r[i+1][right[i][j]+1]+=A[ty][i][j];
				for(;p<=q&&p<left[i][j];p++)
					for(;tmp[p]<=q;tmp[p]++)low[p][tmp[p]]=i<=dep[mid][p]&&i<=dep[mid][tmp[p]]?i:inf;
				p=left[i][j];q=right[i][j];
			}
		}
		for(;p<=q;p++)
			for(;tmp[p]<=q;tmp[p]++)low[p][tmp[p]]=i<=dep[mid][p]&&i<=dep[mid][tmp[p]]?i:inf;
	}
	for(int i=l;i<r;i++)
		for(int j=tmp[i];j<r;j++)low[i][j]=inf;
	for(int i=mid;i<d;i++)
		for(int j=l;j<r;j++){
			cnt_l[i+1][j+1]+=cnt_l[i+1][j]+cnt_l[i][j+1]-cnt_l[i][j];
			cnt_r[i+1][j+1]+=cnt_r[i+1][j]+cnt_r[i][j+1]-cnt_r[i][j];
		}
	long long s=0;
	for(int x=u;x<mid;x++){
		int*h=Q+1,*t=Q,*hm=Qm+1,*tm=Qm,pos=l,sum=0;
		for(int y=l;y<r;y++)if(left[x][y]<=right[x][y]){
			for(;pos<=right[x][y];pos++)if(A[ty][mid][pos]&&dep[mid-1][pos]<=x){
				rea[pos]=reach(pos,pos,dep[mid][pos]+1);
				sum+=rea[pos];
				*++t=pos;
				for(int la=mid;hm<=tm;tm--){
					int v=reach(*tm,pos,min(dep[mid][*tm],dep[mid][pos])+1)-reach(*tm,pos,la);
					rea[*tm]-=v;sum-=v;
					if(dep[mid][*tm]<=dep[mid][pos])la=dep[mid][*tm]+1;
					else break;
				}
				*++tm=pos;
			}
			for(;h<=t&&*h<left[x][y];h++)sum-=rea[*h];
			for(;hm<=tm&&*hm<left[x][y];hm++);
			s+=A[ty][x][y]*sum;
		}
	}
	return s+dc(ty,u,mid,l,r)+dc(ty,mid,d,l,r);
}
int main(){
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%s",A[0][i]);
		for(int j=0;j<N;j++)A[1][j][i]=A[0][i][j]=A[0][i][j]=='#'?0:A[0][i][j]-'0';
	}
	printf("%lld\n",dc(0,0,N,0,N));
}

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

int main() {
    int N; cin >> N;
    vector<int> A(N), B(N), C(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    for (int i = 0; i < N; i++) cin >> B[i];
    for (int i = 0; i < N; i++) cin >> C[i];
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());

    vector<long long> bccount(N, 0);
    for (int i = 0; i < N; i++) {
        auto iter = upper_bound(C.begin(), C.end(), B[i]);
        bccount[i] = distance(iter, C.end());
    }
    for (int i = N - 1; i > 0; i--) {
        bccount[i-1] += bccount[i];
    }

    long long ans = 0;
    for (int i = 0; i < N; i++) {
        auto iter = upper_bound(B.begin(), B.end(), A[i]);
        if (iter == B.end()) break;
        ans += bccount[distance(B.begin(), iter)];
    }
    cout << ans << endl;
}

Measured memory_bytes: 5344
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#define mem(a,b) memset(a,b,sizeof (a))
#define endl '\n'
#define pb push_back
typedef long long ll;
const int maxn=200010;
const int inf=1e9;
const ll mod=998244353;
const double pi=3.14159265358979;
const double ep=0.0;
using namespace std;
double q[111000];
int main()
{
    string s;
    int q,f=1;
    cin>>s>>q;
    deque<char>de;
    for (int i=0;i<s.size();i++)
        de.push_back(s[i]);
    while (q--)
    {
        int x;
        cin>>x;
        if (x==1)
            f=(f+1)%2;
        else
        {
            int t;
            char c;
            cin>>t>>c;
            if (t==1)
            {
                if (f==1)
                    de.push_front(c);
                else
                    de.push_back(c);
            }
            else
            {
                if (f==1)
                    de.push_back(c);
                else
                    de.push_front(c);
            }

        }
    }
    if (f==1)
        while (!de.empty())
        {
            cout<<de.front();
            de.pop_front();
        }
    else
        while (!de.empty())
        {
            cout<<de.back();
            de.pop_back();
        }
    return 0;
}


Measured memory_bytes: 960
#include <algorithm>
#include <deque>
#include <iostream>
#include <vector>

#define FOR(i, b, e) for(int i=(b);i<(e);i++)
#define REP(i, n) FOR(i,0,n)

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

string S, T, U;
int A, B;

int main() {
    cin >> S >> T;
    cin >> A >> B;
    cin >> U;
    if (U == S)
        A--;
    else
        B--;
    cout << A << ' ' << B << endl;
    return 0;
}


Measured memory_bytes: 256
S = input()
T = input()

for i in range(len(S)-len(T),-1,-1):
  flag = True
  for j in range(len(T)):
    if S[i+j] != '?' and S[i+j] != T[j]:
      flag = False
  if flag:
    S = S[:i]+T+S[i+len(T):]
    S = S.replace('?','a')
    print(S)
    exit()

print('UNRESTORABLE')

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    rep (i, 12) {
        char c;
        cin >> c;
        cout << c;
        if (i == 3) cout << " "; 
    }
    cout << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>
#include <cassert>
#include <bitset>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define EL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

bool is_palindrome(std::string s) {
	int n=s.size();
	for(int i=0;i<n;i++) {
		if(s[i]!=s[n-i-1]) return false;
	}
	return true;
}

signed main() {
	std::string s;
	std::cin >> s;
	int n=s.size();
	std::string t,r;
	t=s.substr(0,(n-1)/2);
	r=s.substr((n+3)/2-1,n-(n+3)/2+1);
	debug(s,t,r);
	if(is_palindrome(s) && is_palindrome(t) && is_palindrome(r)) {
		print("Yes");
	} else print("No");

	return 0;
}


Measured memory_bytes: 256
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}
///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }
    
    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let nd = readInts()
    let n = nd[0]
    let d = Double(nd[1])
    var ans = 0
    for _ in 0..<n {
        let aryX = readDoubles()
        if sqrt(pow(aryX[0], 2.0) + pow(aryX[1], 2.0)) <= d {
            ans += 1
        }
    }
    
    print(ans)
    
}
main()


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

int sum10(int N){
  if(N==0)return 0;
  else return sum10(N/10)+N%10;
}
int main(){
  int A,B,N;
  cin >> N >> A >> B ;
  int sum=0;
  for(int i=1;i<=N;i++){
    if(sum10(i)>=A && sum10(i)<=B)sum+=i;
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_map>
#include <queue>
#define MOD 1000000007

using namespace std;

int main() {
    long long N,M;
    cin>>N>>M;
    if(N==1){
        cout<<M;
        return 0;
    }
    long long ans = -1;
    for(long long i=M/N;i>=1;i--){
        if(M%i==0&&(M/i)>=N){
            ans=i;
            break;
        }
    }
    cout<<ans;
    
    return 0;
}

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

namespace AOJ_Vol01_130
{
    class Program
    {
        static void Main(string[] args)
        {
            // ?????°??\??????????????????
            int n = int.Parse(Console.ReadLine());


            // ??\???????????????????????????
            for(int i = 0; i < n; ++i)
            {
                string sInput = Console.ReadLine();
                string train = "";  // ????????????????´???¨
                train += sInput[0]; // ?????????????????????????????????????´???????????????????????????????????????£??\

                int index = 0;

                // ??????????§£???
                for(int j = 0; j < sInput.Length; ++j)
                {
                    // ????????\????????´???
                    if (sInput[j] == '<')
                    {
                        if (train.IndexOf(sInput[j + 2]) == -1)
                        {
                            train = sInput[j + 2] + train;
                        }
                    }
                    // ???????????£????????????
                    else if (sInput[j] == '>')
                    {
                        if (train.IndexOf(sInput[j + 1]) == -1)
                        {
                            train += sInput[j + 1];
                        }
                    }
                    // ?????????????????????
                    else
                    {
                        index++;
                    }
                }

                // ?????????????????????
                Console.WriteLine(train);
            }
        }
    }
}

Measured memory_bytes: 8824
import sys
input = sys.stdin.readline
n,w=map(int,input().split())
w_sub,v_sub=map(int,input().split())
w0=w_sub
inf=1000000001
x=[[inf,v_sub],[inf],[inf],[inf]]
for i in range(n-1):
    w_sub,v_sub=map(int,input().split())
    z=w_sub-w0
    x[z].append(v_sub)
for i in range(4):
    x[i].sort(key=lambda x:-x)
    x[i][0]=0
    l_sub=len(x[i])
    for j in range(1,l_sub):
        x[i][j]+=x[i][j-1]

ma=0
l3=len(x[3])
l2=len(x[2])
l1=len(x[1])
l0=len(x[0])
for i in range(l3):
    for j in range(l2):
        d=w-i*(w0+3)-j*(w0+2)
        if d>=0:
            for k in range(l1):
                d=w-i*(w0+3)-j*(w0+2)-k*(w0+1)
                if d>=0:
                    ma=max(ma,x[3][i]+x[2][j]+x[1][k]+x[0][min(d//w0,l0-1)])
                else:
                    break
        else:
            break

print(ma)


Measured memory_bytes: 3064
import sys

def input():
    return sys.stdin.readline()[:-1]


n, k = map(int, input().split())
a_li = list(map(int, input().split()))

if k>=42:
    print(*[n]*n)
    exit()

for i in range(k):
    b = [0] * n
    for j in range(n):
        l = max(0, j-a_li[j])
        r = min(n-1, j+a_li[j])
        b[l] += 1
        if (r+1<n):
            b[r+1] -= 1
    for j in range(n-1):
        b[j+1] += b[j]
    a_li = b
print(*a_li)

Measured memory_bytes: 148096
N, total = map(int, input().split())
li = list(map(int, input().split()))

ans = 0
for i in range(N-1):
    wa = li[i] + li[i+1]
    if wa > total:
        if li[i+1] > wa - total:
            li[i+1] -= (wa - total)
        else:
            li[i] -= ((wa - total) - li[i+1])
            li[i+1] = 0
        ans += wa - total
print(ans)

Measured memory_bytes: 14052
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define REV(i, a) for (int i = (a); i >= 0; --i)
#define CLR(a) memset((a), 0, sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (3e15)

using namespace std;

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

    vector<string> vs;
    REP(i, S.size()) {
        FOR(j, i + 1, i + 10) { vs.push_back(S.substr(i, j - i)); }
    }
    sort(vs.begin(), vs.end());
    vs.erase(unique(vs.begin(), vs.end()), vs.end());
    // REP(i, vs.size()) { DUMP(vs[i]); }
    cout << vs[K - 1] << endl;

    return 0;
}


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

int main(void){
  int H, W, i, j;
  cin >> H >> W;
  char picture[H+2][W+2] = {};
  for(i = 0; i < H+2; i++){
    for(j = 0; j < W+2; j++){
      picture[i][j] = '#';
    }
  }
  for(i = 0; i < H; i++){
    for(j = 0; j < W; j++){
      cin >> picture[i+1][j+1];
    }
  }

  for(i = 0; i < H+2; i++){
    for(j = 0; j < W+2; j++){
      cout << picture[i][j];
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    in h,w;
    cin>>h>>w;
    in x;
    if(h==1ll || w==1ll){
        cout<<1<<endl;
        return 0;
    } 
    if(h%2ll==0ll) x=h/2ll;
    else x=(h+1ll)/2ll;
    in y;
    if(w%2ll==0ll) y=w/2ll;
    else y=(w+1ll)/2ll;
    in ans=x*y+(h-x)*(w-y);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#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(){
	int N,l,ans;
	cin >> N;
	vector<int> h(N);

	for (int i = 0;i < N;i++){
		cin >>  l;
		h[i] = l;
	}
	ans = h[0];
	for (int i = 1;i < N;i++){
		if (h[i-1] < h[i]){
			ans += h[i] -h[i-1];
		}
	}
	cout << ans << endl;
	return 0;
}

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

class Dice{
public:
    
    int number[6];   
    int work[6];

    void setLabel(int index,int num){
        number[index] = num; 
    };

    void roll(char tokn){
        for(int i=0;i<6;i++) work[i] = number[i];
        switch(tokn){
            case 'E':
                setNumber(work[3],work[1],work[0],work[5],work[4],work[2]);
                break;      
            case 'S':
                setNumber(work[4],work[0],work[2],work[3],work[5],work[1]);
                break;       
            case 'N':
                setNumber(work[1],work[5],work[2],work[3],work[0],work[4]);
                break;         
            case 'W':
                setNumber(work[2],work[1],work[5],work[0],work[4],work[3]);
                break;
        }
    }
private:
    void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
        number[0] = n0;
        number[1] = n1;
        number[2] = n2;
        number[3] = n3;
        number[4] = n4;
        number[5] = n5;
    }
};

bool compareDice(Dice a,Dice b){
    string tokn ="NNNNWNNNWNNNENNNENNNWNNN";
    for(int i=0;i<tokn.length();i++){
        a.roll(tokn[i]);
        for(int k=0;k<6;k++){
            if(a.number[k] != b.number[k]) break;
            if(k+1 == 6){
                return true;
            }
        }
    }
    return false;
}

int main() {
    Dice dice[100];
    int label,n;
    cin >> n;
    //cout <<dice.size();
    for(int i=0;i<n;i++){ 
        for(int k=0;k<6;k++) {
            cin >> label;
            dice[i].setLabel(k,label);
        }
    }
    
    for(int i=0;i<n-1;i++){
        for(int k=i+1;k<n;k++){
            if(compareDice(dice[i],dice[k])){
                cout << "No" << endl;
                return 0;
            }
        }
    }
   
    cout << "Yes" << endl;
    return 0;
}



Measured memory_bytes: 3216