akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll N, D; cin >> N >> D;
  ll X[N], Y[N]; rep(i,N) cin >> X[i] >> Y[i];
  ll result = 0; rep(i,N) result += X[i]*X[i]+Y[i]*Y[i]<=D*D;
  cout << result << endl;
  return 0;
}

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

//define gcd and lcm (using 64bit)
ll gcd(ll a,ll b){
    if (a < b) {
        //^はxor(bitwise operator)。以下三行でswap(a,b)を行っている。
        a ^= b;
        b ^= a;
        a ^= b;
    }
    //only when b==0,this program finds that b means false and returns a.
    return b ? gcd(b, a % b) : a;
}

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


int main(){
    int r;
    cin>>r;
    cout<<pow(r,2)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define clr(a,x) memset(a,x,sizeof(a))
#define rr(v) for(auto &val:v)
#define print(v) for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define ln length()
#define sz size()
#define mod 1000000007
#define elif else if
int32_t main(){
   int n; cin>>n;
   vector<int> v;
   rep(i,0,n){
       int t; cin>>t;
       v.pub(t);
   }
   int ans=n*(n-1)*(n-2)/6;
   ans=0;
   sort(all(v));
   set<pair<pi,int>> s;
   rep(i,0,n){
       rep(j,0,n){
        if(j==i)continue;
           rep(k,0,n){
               if(k==i or k==j)continue;
            if(v[i]+v[j]>v[k] and v[j]+v[k]>v[i] and v[i]+v[k]>v[j] and s.find({{i,j},k})==s.end() and v[i]!=v[j] and v[i]!=v[k] and v[j]!=v[k]){
                ans++;
                //cout<<i<<" "<<j<<" "<<k<<"\n";
                s.insert({{i,j},k});
                s.insert({{j,i},k});
                s.insert({{i,k},j});
                s.insert({{k,i},j});
                s.insert({{j,k},i});
                s.insert({{k,j},i});
            }
           }
       }
   }
   cout<<ans<<"\n";
   return 0;
}
/*
Edge cases? n=1? a[i]<=0?
long vs int? 1LL? 64bits?
Re-read question. Is it as easy as it seems?
KEEP CORRECTING AND SUBMITTING!
*/


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

using namespace std;
typedef long long ll;
int n;
ll a[1000005];
ll Abs(ll x){
	return x > 0 ? x : -x;
}
ll check(ll x){
	ll ret = 0;
	for(int i = 1; i <= n; i ++){
		ret = ret + Abs(a[i] - x - i);
	}
	return ret;
}
int main(){
	scanf("%d", &n);
	for(int i = 1; i <= n; i ++){
		scanf("%lld", &a[i]);
	}
	ll ans = 1e18;
	ll L = -1e9, R = 1e9;
	while(R - L >= 3){
		ll m1 = (L + L + R) / 3;
		ll m2 = (R + L + R) / 3;
		if(check(m1) < check(m2)){
			R = m2;
		} else L = m1;
	}
	for(ll i = L; i <= R; i ++){
		ans = min(ans, check(i));
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pli pair<ll, int>
#define pb push_back

#define mp make_pair
#define all(a) (a).begin(),(a).end()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

ll gcd(ll a, ll b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}

const ll INF = 1LL << 60;

const int dh[4] = {1,0,-1,0};
const int dw[4] = {0,1,0,-1};

struct Edge{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w){}
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, int>;



vi MP(string s){
  vi A(s.size()+1);
  A[0] = -1;
  int j = -1;
  rep(i,s.size()) {
    while(j >= 0 && s[i] != s[j]) j = A[j];
    j++;
    A[i+1] = j;
  }
  return A;
}

vi Manacher(string s){
  vi R(s.size());
  int i = 0, j = 0;
  while(i < s.size()){
    while(i-j >= 0 && i+j < s.size() && s[i-j] == s[i+j]) ++j;
    R[i] = j;
    int k = 1;
    while(i-k >= 0 && i+k < s.size() && k+R[i-k] < j) R[i+k] = R[i-k], k++;
    i += k; j -= k;
  }
  return R;
}

vi Z_algorithm(string &s){
  vi Z(s.size());
  Z[0] = s.size();
  int i = 1, j = 0;
  while(i < s.size()){
    while(i+j < s.size() && s[j] == s[i+j]) j++;
    Z[i] = j;
    if(j == 0){++i; continue;}
    int k = 1;
    while(i+k < s.size() && k+Z[k] < j) Z[i+k] = Z[k], ++k;
    i += k; j -= k;
  }
  return Z;
}

const int MAX = 1e6+1;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(ll n, ll k){
  if(n >= MAX){
    ll tmp = 1;
    rep(i,k){
      tmp *= (n-i);
      tmp %= MOD;
    }
    return tmp*finv[k]%MOD;
  }

  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll POW(ll x, ll n){
  ll ret = 1;
  if(n < 0){// n < 0 にも対応
    n *= -1;
    x = inv[x];
  }
  while(0 < n){
    if(n%2 == 0){
      x = x*x%MOD;
      n /= 2;
    }
    else{
      ret = ret*x%MOD;
      n--;
    }
  }
  return ret;
}

int main(){
  int A,B,m; cin >> A >> B >> m;
  vi a(A);
  rep(i, A) cin >> a[i];
  vi b(B);
  rep(i, B) cin >> b[i];
  int ans = 1e9;
  rep(i,m) {
    int x,y,c; cin >> x >> y >> c;
    x--; y--;
    chmin(ans, a[x]+b[y]-c);
  }
  sort(all(a));
  sort(all(b));
  chmin(ans,a[0]+b[0]);

  cout << ans << endl;

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

int main() {
    ll n;
    cin>>n;

    cout<<(n-1)*n/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#define endl "\n"
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    int i;
    int l, r;

    vector <int> v(n + 5, 0);
    for(i = 0; i < m; i ++)
    {
    	cin >> l >> r;
    	v[l] ++;
    	v[r + 1] --;
    }

    int count = 0;
    for(i = 1; i <= n; i ++)
    {
    	v[i] += v[i - 1];
    	if(v[i] == m)
    		count ++;
    }
    cout << count << endl;
}

Measured memory_bytes: 640
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::mem::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::HashMap;
#[allow(unused_imports)]
use std::collections::VecDeque;
#[allow(unused_imports)]
use std::usize;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    line.trim().to_string().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_cols<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();

    line.trim()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn main() {
    let n = read::<u64>();
    let chars = read_cols::<String>();

    let has_yellow = chars.iter().any(|c| c == "Y");

    if has_yellow {
        println!("Four");
    } else {
        println!("Three");
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <stdio.h>
#include <stack>
#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
#include <fstream>
#include <functional>
#include <list>
#include <iomanip>
#include <cctype>
#include <math.h>

#define rep(i,first,end) for(int i = first; i < end; i++)

using namespace std;


int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    string b;
    cin >> b;
    
    if (b =="A"){
        cout << 'T' << endl;
    }
    else if (b == "T"){
        cout << 'A' << endl;
    }
    else if (b == "C"){
        cout << 'G' << endl;
    }
    else {
        cout << 'C' << endl;
    }
    

}
    




Measured memory_bytes: 256
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { reader: s.lock() };
    let n: usize = sc.read();
    let mut num = vec![0; n + 1];
    let mut p = vec![0; n + 1];
    num[0] = 1;
    p[0] = 1;
    for i in 0..n {
        num[i + 1] = 3 + 2 * num[i];
        p[i + 1] = 1 + 2 * p[i];
    }

    let x: usize = sc.read();

    println!("{}", eat(n, x, &num, &p));
}

fn eat(level: usize, mut x: usize, num: &Vec<usize>, p: &Vec<usize>) -> usize {
    if x == 0 {
        0
    } else if level == 0 {
        match x {
            0 => 0,
            1 => 1,
            _ => unreachable!(),
        }
    } else {
        assert!(x > 0);
        if x >= num[level] - 1 {
            return p[level];
        }
        let mut ans = 0;
        let next = num[level - 1];
        x -= 1;
        if x < next {
            return eat(level - 1, x, num, p);
        }
        x -= next;
        ans += p[level - 1];
        if x == 0 {
            return ans;
        }
        x -= 1;
        ans += 1;
        if x < next {
            return eat(level - 1, x, num, p) + ans;
        }
        unreachable!()
    }
}

pub struct Scanner<R> {
    reader: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
s= list(input())
n= len(s)

children=[0]*n

cnt=0
for i in range(n-1):
    if s[i]=='R':
        cnt+=1

        if s[i+1]=='L':
            children[i]+=(cnt+1)//2
            children[i+1]+=cnt//2

    else:
        cnt=0


cnt=0
for i in range(n-1,0,-1):
    if s[i]=='L':
        cnt+=1

        if s[i-1]=='R':
            children[i]+=(cnt+1)//2
            children[i-1]+=cnt//2

    else:
        cnt=0

print(*children)

Measured memory_bytes: 7096
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)
#define FOR(i, m, n) for(int i = (m); i < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << x << endl;

using namespace std;
typedef long long ll;

signed main() {
  int n;
  cin >> n;
  int n_max = 100;
  int fn[60000] = {};

  for(int x = 1; x <= n_max; x++) {
    for(int y = 1; y <= n_max; y++) {
      for(int z = 1; z <= n_max; z++) {
        int tmp = x * x + y * y + z * z + x * y + y * z + z * x;
        fn[tmp]++;
      }
    }
  }

  REP(i, n) { cout << fn[i + 1] << endl; }

  return 0;
}


Measured memory_bytes: 3864
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  n <- readLn
  as <- map readInt . BS.words <$> BS.getLine
  print $ solve n as

solve :: Int -> [Int] -> Int
solve _ = sum . map (subtract 1)

readInt :: BS.ByteString -> Int
readInt = fst . fromJust . BS.readInt


Measured memory_bytes: 1020
n = int(input())
a_list = list(map(int, input().split()))

total = 0
count = 0
pos_or_neg = True  # True = +, False = -

for a in a_list:
    total += a
    if pos_or_neg:
        if total <= 0:
            count += -total + 1
            total += -total + 1
        pos_or_neg = False

    else:
        if total >= 0:
            count += total + 1
            total -= total + 1
        pos_or_neg = True

first_count = count
count = 0
total = 0
pos_or_neg = False

for a in a_list:
    total += a
    if pos_or_neg:
        if total <= 0:
            count += -total + 1
            total += -total + 1
        pos_or_neg = False

    else:
        if total >= 0:
            count += total + 1
            total -= total + 1
        pos_or_neg = True

print(min(count, first_count))

Measured memory_bytes: 14468
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll read(){
	ll a=0,b=getchar(),c=1;
	while(!isdigit(b))c=b=='-'?-1:1,b=getchar();
	while(isdigit(b))a=a*10+b-'0',b=getchar();
	return a*c;
}
const int N=3e5+5;
struct node{
    int to,x,w;
};
struct no{
    int x,w,y,id;
};
vector<no> e[N];
vector<node> g[N];
int n,q,ans[N],c[N],h[N],d[N],ab[N],b[N],a[N],f[N][20];
void dfs(int x,int y,int z,int &k){
    b[x]=k,ab[k]=x;
    d[k++]=z;
    for(int i=0;i<g[x].size();i++){
        node &t=g[x][i];
        if(t.to==y)continue;
        a[t.to]=a[x]+t.w;
        dfs(t.to,x,z+1,k);
        ab[k]=x,d[k++]=z;
    }
}
void gg(int n){
    for(int i=1;i<=n;i++)
		f[i][0]=i;
    for(int j=1;(1<<j)<=n;j++)
        for(int i=1;i+(1<<j)-1<=n;i++)
            if(d[f[i][j-1]]<d[f[i+(1<<(j-1))][j-1]])
                f[i][j]=f[i][j-1];
            else f[i][j]=f[i+(1<<(j-1))][j-1];
}
int jj(int l,int r){
    int x=0;
    while((1<<(x+1))<=r-l+1)x++;
    if(d[f[l][x]]<d[f[r-(1<<x)+1][x]])
        return f[l][x];
    else return f[r-(1<<x)+1][x];
}
void dfs(int u,int y){
	for(int i=0;i<e[u].size();i++){
		no qu=e[u][i];
        ans[qu.id]+=(a[u]+c[qu.x]*qu.w-h[qu.x])*qu.y;
    }
	for(int i=0;i<g[u].size();i++){
		node p=g[u][i];
        int to=p.to;
        if(to==y)continue;
        c[p.x]++,h[p.x]+=p.w;
        dfs(to,u);
        c[p.x]--,h[p.x]-=p.w;
    }
}
int main(){
	n=read(),q=read();
    for(int i=1;i<n;i++){
        int u=read(),v=read(),c=read(),w=read();
        g[u].push_back(node{v,c,w});
        g[v].push_back(node{u,c,w});
    }
    int k=1;
    dfs(1,-1,0,k);
    gg(2*n-1);
    for(int i=1;i<=q;i++){
        int x=read(),y=read(),u=read(),v=read();
        int fa=ab[jj(min(b[u],b[v]),max(b[u],b[v]))];
        e[u].push_back(no{x,y,1,i});
        e[v].push_back(no{x,y,1,i});
        e[fa].push_back(no{x,y,-2,i});
    }
    dfs(1,-1);
    for(int i=1;i<=q;i++)
        printf("%d\n",ans[i]);
	return 0;
}

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

#define Fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define FO freopen("in.txt", "r", stdin)
#define FC freopen("out.txt", "w", stdout)
#define aise cout<<"aise"<<endl
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define ll long long
#define all(x) x.begin(), x.end()
#define mset(v, a) memset(v, a, sizeof(v))
#define pll pair< ll, ll >
#define pdd pair< double, double >
#define ff first
#define ss second
#define pi acos(-1.0)
#define mxN 2010
#define inf 1e14
#define MOD 1000000007

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

ll lcm(ll x, ll y)
{

    return (x/__gcd(x,y)*y);
}

int main()
{
    string ss;
    cin >> ss;
    cout << ss[0] << ss.size()-2 << ss[ss.size()-1];
}


Measured memory_bytes: 256
import sys

def main():

    input = sys.stdin.readline

    N = int(input())
    A = sorted(list(map(int,input().split())))[::-1]

    ans = A[0]

    count = 2

    if count >= N:
        print(ans)
        return


    for i in range(1,N):
        count += 1
        ans += A[i]

        if count >= N:
            break

        count += 1
        ans += A[i]

        if count >= N:
            break

    print(ans)

if __name__ == "__main__":
    main()

Measured memory_bytes: 31420
#include <bits/stdc++.h>
using namespace std;
#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 all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
using ll = long long;

int main() {
  ll n;
  cin >> n;
  n--;
  string ans = "";
  do {
	  ans = (char) ('a' + n % 26) + ans;
	  n  /= 26;
	  n--;
	} while (n >= 0);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3632
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
    vector<int>ara;
    int n,k,sum=0,m,i,value;
    while(scanf("%d%d",&n,&k)==2)
    {
        value=n;
        while(n--)
        {
            scanf("%d",&m);
            ara.push_back(m);
        }
        sort(ara.begin(),ara.end());
        for(i=value-k;i<ara.size();i++)sum=sum+ara[i];
        printf("%d\n",sum);
        sum=0;
        ara.clear();
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    double t=100;
    int sum=0;
    long k=sc.nextLong();
    while(t<k){
      t= t+Math.floor(t*0.01);
      sum++;
    }
    System.out.println(sum);
  }
}


Measured memory_bytes: 35744
<?php
$K = intval(fgets(STDIN));
$sum = 0;
for($i = 1; $i <= $K; $i++)
for($j = 1; $j <= $K; $j++)
$memo[$i][$j] = $memo[$j][$i] = (int)gmp_gcd($i, $j);

for($i = 1; $i <= $K; $i++)
for($j = 1; $j <= $K; $j++)
for($k = 1; $k <= $K; $k++)
    $sum+=$memo[$memo[$i][$j]][$k];

echo $sum;

Measured memory_bytes: 18840
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n,m,sum = 0; cin>>n>>m;
	vector<int> num(n);
	for(int i=0;i<n;i++){
		 cin>>num[i];
		 sum += num[i];
	}
	sort(num.begin(),num.end(),greater<int>());
	bool isSelect = true;
	sum = (sum/(4*m)) + (sum%(4*m)?1:0);
	for(int i=0;i<m;i++){
		if(num[i] < sum){
			isSelect = false; break;
		}	
	}
	cout<<(isSelect ? "Yes" : "No");
}


Measured memory_bytes: 256
N,C,K = map(int,input().split(" "))
T = [0]*N
for i in range(N):
    T[i] = int(input())

T = sorted(T)

bus_time = T[0]
bus_people = 1
c = 1
for i in range(1,N):
    bus_people += 1
    if T[i] > bus_time + K or bus_people > C:
        bus_time = T[i]
        bus_people = 1
        c += 1

print(c)

Measured memory_bytes: 8240
#include<bits/stdc++.h>
#define int long long
#define mod 1e18+10
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
int32_t main() {
	int k,i,j,l;
	cin>>k;
	int ans=0;
	for(i=1;i<=k;i++)
	for(j=1;j<=k;j++)
	for(l=1;l<=k;l++)
	{
		int gc=__gcd(i,j);
		ans+=__gcd(gc,l);
		
	}
	cout<<ans;
	
	
}


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


Measured memory_bytes: 2064
#include <bits/stdc++.h>
using namespace std;
 
struct edge {int /*from,*/to,cost;};
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<long long int> VL;
typedef vector<edge> VE;
//static const int INF = 2147483647;
static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const long long INF = 9223372000000000000/2145;
//static const int INF = 1000010000;
static const int NIL = -1;
static const int MOD = 1000000007;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define np next_permutation
#define pq priority_queue
#define itn int
#define scnaf scanf
#define reutnr return
#define scamf scanf
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define int ll

int f[114][10];
int p[114][11];
int n;

int calc(int m){
    int ret = 0;
    for(int j=0;j<n;j++){
        int a = 0;
        for(int i=0;i<10;i++){
            if((m>>(9-i))&1){
                if(f[j][i]){
                    a++;
                }
            }
        }
        ret += p[j][a];
    }
    return ret;
}

signed main(){
    scanf("%lld",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<10;j++){
            int tmp;
            scanf("%lld",&tmp);
            f[i][j] = tmp;
        }
    }

    for(int i=0;i<n;i++){
        for(int j=0;j<11;j++){
            int tmp;
            scanf("%lld",&tmp);
            p[i][j] = tmp;
        }
    }

    int ans=-INF;
    for(int i=1;i<(1<<10);i++){
        ans = max(ans,calc(i));
    }

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

Measured memory_bytes: 256
package main

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

type light struct {
	k  int
	sl []int
	p  int
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	sc.Scan()
	m, _ := strconv.Atoi(sc.Text())

	lst := make([]light, m)
	for i := 0; i < m; i++ {
		sc.Scan()
		k, _ := strconv.Atoi(sc.Text())
		li := light{k, make([]int, k), i}
		for j := 0; j < k; j++ {
			sc.Scan()
			s, _ := strconv.Atoi(sc.Text())
			li.sl[j] = s
		}
		lst[i] = li
	}
	for i := 0; i < m; i++ {
		sc.Scan()
		p, _ := strconv.Atoi(sc.Text())
		lst[i].p = p
	}

	ans := 0
	for i := 0; i < pow(2, n); i++ {
		l := getl(i, n)
		for j, li := range lst {
			c := 0
			for _, s := range li.sl {
				for _, m := range l {
					if m == s {
						c++
					}
				}
			}
			if c%2 != li.p {
				break
			}
			if j == len(lst)-1 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}

func getl(x, y int) []int {
	r := []int{}
	for i := 0; i < y; i++ {
		if x%2 == 1 {
			r = append(r, i+1)
		}
		x >>= 1
	}
	return r
}

func pow(x, n int) int {
	ans := 1
	for i := 0; i < n; i++ {
		ans *= x
	}
	return ans
}


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

int kai(int n){
  if(n==0) return 1;
  return n*kai(n-1);
}

int main() {
  cout<<fixed<<setprecision(8);
  int n;
  cin>>n;
  double ans=0.0;
  vector<vector<int>> a(n,vector<int>(2,0));
  rep(i,n) cin>>a.at(i).at(0)>>a.at(i).at(1);
  rep(i,n){
    rep(j,n){
      ans+=sqrt((a.at(i).at(0)-a.at(j).at(0))*(a.at(i).at(0)-a.at(j).at(0))+
           (a.at(i).at(1)-a.at(j).at(1))*(a.at(i).at(1)-a.at(j).at(1)));
    }
  }
  cout<<ans/n<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int n,m;
	cin >> n >> m;
	vector<int> head(m);
	vector<bool> used(n,false);

	for(int i=0;i<m;i++)
		cin >> head[i];

	for(int i=m-1;i>=0;i--)
		if(used[head[i]-1]!=true)
		{
			cout << head[i] << endl;
			used[head[i]-1]=true;
		}
	for(int i=1;i<=n;i++)
	{
		if(used[i-1]!=true)
			cout << i << endl;
	}

	




}



Measured memory_bytes: 3280
#include<iostream>
#include<math.h>
#include<cstring>
#include<set>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#include<string>
#include<bitset>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
typedef long long ll;
using namespace std;
const int N = 1e5;
const int INF = 1e9;
ll MOD = 998244353;
struct point
{
    int x , y , num;
};
map<int , int > m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n , k;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        int a = 0;
        cin >> a;
        m[a]++;
    }
    cin >> k;
    for (int i = 0; i < k; i++)
    {
        int t;
        cin >> t;
        if (!m[t])
        {
            cout << "NO" << "\n";
            return 0;
        }
        m[t]--;
    }
    cout << "YES" << "\n";
    return 0;
}


Measured memory_bytes: 9600
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n,a,b = i_map()
    s = pow(2,n,MOD) - 1

    def fur(n,r):
        p,q = 1, 1
        for i in range(r):
            p = p*(n-i)%MOD
            q = q*(i+1)%MOD
        return (p * pow(q,MOD-2,MOD)) % MOD

    print((s - fur(n,a) - fur(n,b)) % MOD)



if __name__=="__main__":
    main()


Measured memory_bytes: 9484
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <deque>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <random>
#include <fstream>
#include <sstream>
#include <time.h>
#include <tuple>
// #define int long long
#define debug(x) cerr << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MOD = 1e9+7;
const ll LINF = 1e18;
const double EPS = 1e-9;


const int INF = 1001001001;

vector<int> to[2510];
vector<int> ot[2510];
bool reachableFrom1[2510];
bool reachableToN[2510];
bool ok[2510];

void dfs(int v) {
  if (reachableFrom1[v]) return;
  reachableFrom1[v] = true;
  for(int x : to[v]) {
    dfs(x);
  }
}

void rdfs(int v) {
  if (reachableToN[v]) return;
  reachableToN[v] = true;
  for(int x : ot[v]) {
    rdfs(x);
  }
}

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

  int n,m,p;
  cin>>n>>m>>p;
  vector<tuple<int, int, int>> edges;
  rep(i,m) {
    int a,b,c;
    cin>>a>>b>>c;
    a--;b--;
    c -= p;
    c = -c;
    edges.emplace_back(a,b,c);
    to[a].push_back(b);
    ot[b].push_back(a);
  }
  dfs(0);
  rdfs(n-1);
  rep(i,n) ok[i] = reachableFrom1[i] && reachableToN[i];


  vector<int> d(n,INF);
  d[0] = 0;
  bool upd = true;
  int step = 0;
  while(upd) {
    upd = false;
    rep(i,m) {
      int a,b,c;
      tie(a,b,c) = edges[i];
      if (!ok[a]) continue;
      if (!ok[b]) continue;
      int newd = d[a] + c;
      if (newd < d[b]) {
        upd = true;
        d[b] = newd;
      }
    }
    step++;
    if(step > n) {
      puts("-1");
      return 0;
    }
  }
  int ans = max(0, -d[n-1]);
  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 768
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<algorithm>
#include<functional>
#define ll long long
#define inf  999999999
#define pa pair<int,int>
#define int long long

using namespace std;


struct seg_addsum_getsum{
	//       1
	//   2        3
	// 4   5   6    7
	
	
	private:
	public:
	
	// (1<<15)=32768
	// 1<<16 = 65536
	// 1<<17 = 131072
	// 1<<18 = 262144
	
	int cor=(1<<17);
	
	vector<int> vec;
	vector<int> lazy;
	void shoki1(){
		vec.resize(2*cor+3, 0);
		lazy.resize(2*cor+3, 0);
	}
	void shoki2(){
			for(int i=cor-1;i>0;i--) vec[i]=vec[2*i]+vec[2*i+1];
	}
		
	void chien(int k,int l,int r){
		if(lazy[k]==0) return;
		if(l+1<r){
			lazy[k*2]+=lazy[k]/2;
			lazy[k*2+1]+=lazy[k]/2;
		}
		vec[k]+=lazy[k];
		lazy[k]=0;
	}
	
	void rangeadd(int a,int b,int w, int k=1,int l=0,int r=-3){
		//[a,b)に w加算
		if(r<0) r=cor;
		chien(k,l,r);
		if(a<=l && r<=b){
			lazy[k]+=w*(r-l);
			
			chien(k,l,r);
			return ;
		}
		if(r<=a || b<=l){
			return ;
		}
		
		rangeadd(a,b,w,k*2,l,(l+r)/2);
		rangeadd(a,b,w,k*2+1,(l+r)/2,r);
		vec[k]=vec[2*k]+vec[2*k+1];
		return ;
	}
	
	// [a,b)
	// k-th node
	// k no kukanha [l,r)
	int getsum(int a,int b,int k=1,int l=0,int  r=-3){
		if(r<0) r=cor;
		chien(k,l,r);
		if(a<=l && r<=b){
			return vec[k];
		}
		if(r<=a || b<=l){
			return 0;
		}
		return getsum(a,b,k*2,l,(l+r)/2)+getsum(a,b,k*2+1,(l+r)/2,r);
		
	}
	
	void pre(){
		for(int i=1;i<2*cor;i++){
			cout<<vec[i]<<"/"<<lazy[i]<<" ";
			if(((i+1)&(-(i+1)))==i+1) cout<<endl;
		}
	}
	
};


signed main(){
seg_addsum_getsum SE;
	
	SE.shoki1();
//	for(int i=0;i<SE.cor;i++){
//		SE.vec[i+SE.cor]=i;
//	}
	SE.shoki2();
	
	
	int n,q;
	cin>>n>>q;
	
	for(int i=0;i<q;i++){
	int d,a,b,c;
		cin>>a;
		
		if(a==0){
			cin>>b>>c>>d;
			
			SE.rangeadd(b,c+1,d);
		}
		else{
			cin>>b;
			
			cout<<SE.getsum(b,b+1)<<endl;
		}
	}
	return 0;
}





Measured memory_bytes: 7024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define MOD 100000000
using pi = pair<int, int>;
int main()
{
    string  s1, s2;
    cin >> s1 >> s2;
    int mx = 0, n = s1.size(), m = s2.size();
    for(int i = 0; i <= n - m; i++)
    {
        int k = 0;
        for(int j = 0; j < m ; j++)
        {
            if(s1[j+i] == s2[j])
                k++;
        }
        mx = max(k, mx);
    }
    cout << s2.size() - mx << endl;

}


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

int main(){
    int h,w,fl=0;
    cin >> h >> w;
    vector<vector<char>> haha(h,vector<char>(w));
    for(int i=0;i<h;i++){
        for(int ii=0;ii<w;ii++){
            cin >> haha.at(i).at(ii);
            if(haha.at(i).at(ii)!='.'){
                fl=1;
            }
        }
        if(fl == 0){
            i--;
            h--;
        }
        fl=0;
    }
    for(int i=0;i<w;i++){
        for(int ii=0;ii<h;ii++){
            if(haha.at(ii).at(i)!='.'){
                fl=1;
            }
        }
        if(fl == 0){
            for(int m=i;m<w-1;m++){
                for(int ii=0;ii<h;ii++){
                    haha.at(ii).at(m) = haha.at(ii).at(m+1);
                }
            }
            w--;
            i--;
        }
        fl=0;
    }
    for(int i=0;i<h;i++){
        for(int ii=0;ii<w;ii++){
            cout << haha.at(i).at(ii);
        }
        cout << endl;
    }


    
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
//using
using intl = long long;
using itnl = long long;//typo用
using uintl = unsigned long long;
using itn = int;//typo用
using ld = long double;
using namespace std;

//関数マクロ
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n) - 1; i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(i, a, b) for(intl i = (intl)(a) - 1; i >= (intl)(b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define debug(x) cout << #x << ":" << x << endl

//定数マクロ
#define pb push_back
#define mp make_pair
#define pii pair<intl,intl>

//定数
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld EPS = 1.0e-14;//-9
const ld PI = acos(-1);

//テンプレート関数
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; }
//intl gcd(intl a, intl b){ if(!b)return a; return gcd(b, a % b); } //c++17からある
//intl lcm(intl a,intl b){ return a / gcd(a, b) * b; } //c++17からある

//自作テンプレート関数
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}//Yes,Noの出力を楽にするよう
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}//上の関数のYes,Noを任意の文字列でできるようにしたもの
intl fact(intl k){ intl a = 1; for(int i = 2; i <= k; i++){ a *= i; } return a; }//k!を求める関数,O(N)
intl digit10(intl a){ intl b = 0; do{ a /= 10; b++; }while(a); return b; }//aを10進数で表したときの桁数を求める関数,O(logN)




signed main(){
    cout << fixed << setprecision(10);
    intl n;
    cin >> n;
    n /= 200;
    cout << 10 - n << endl;
    return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#define vi vector<int>
template <class t, class u>
bool chmax(t &a, u b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class t, class u>
bool chmin(t &a, u b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

int main()
{
    int n;
    cin >> n;
    map<int, int> m;
    rep(i, n)
    {
        int a;
        cin >> a;
        m[a]++;
    }
    if (m.size() > 2)
    {
        cout << "No" << endl;
        return 0;
    }
    if (m.size() == 1)
    {
        int a = m.begin()->first;
        if (a == n - 1 || a <= n / 2)
        {
            cout << "Yes" << endl;
            return 0;
        }
        else
        {
            cout << "No" << endl;
            return 0;
        }
    }
    else
    {
        int a = m.begin()->first;
        auto it = m.begin();
        it++;
        int b = it->first;
        if (b != a + 1)
        {
            cout << "No" << endl;
            return 0;
        }
        else
        {
            if (m[a] > a)
            {
                cout << "No" << endl;
                return 0;
            }
            else if (m[b] < (b - m[a]) * 2)
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

typedef long long ll;

using tpl = tuple<ll, ll, ll>;
typedef pair<ll,ll> pii;

void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}

using namespace std;
class UnionFindTree{
private:
  // indexの数の親ノード(ある集合の親を見つけたいときはここを直接参照せず、findを使う)
  vector<int> par;
  // indexを根とする木のランク
  vector<int> rank;
  // 集合のサイズ
  vector<ll> cnts;
  // 木の最大値
  int treeSize;
public:
  void init(int sz, int *ary){
    par.clear(),rank.clear(),cnts.clear();
    treeSize=sz;
    for(int i = 0; i < sz; i++){
      par.push_back(i);
      rank.push_back(0);
      cnts.push_back(ary[i]);
    }
  }
  // 与えられた数が格納されている木のルートを探索
  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;
      cnts[y]+=cnts[x];
    }
    else{
      par[y] = x;
      cnts[x]+=cnts[y];
      if(rank[y] == rank[x])rank[x]++;
    }
  }
  // xの属する集合のサイズ
  ll getCnt(int x){
    return cnts[find(x)];
  }
  bool same(int x,int y){
    return find(x) == find(y);
  }
    
};


int N, M;
int X[100010];
int A[100010];
int B[100010];
int Y[100010];
tpl es[100010];
UnionFindTree uft;
bool is_cand[100010];
bool used_e[100010];
bool used_n[100010];
vector<pii> G[100010];

void rec(int pos, int y){
    used_n[pos] = true;
    for(pii p : G[pos]){
        int npos = p.first;
        int eid = p.second;
        if(get<0>(es[eid]) > y){
            continue;
        }
        used_e[eid] = true;
        if(!used_n[npos]){
            rec(npos, y);
        }
    }
}

int main(){
    fastStream();
    cin >> N >> M;
    for(int i = 0; i < N; i++) cin >> X[i];

    vector<pii> sorted;
    vector<pii> rsorted;

    for(int i = 0; i < M; i++){
        cin >> A[i] >> B[i] >> Y[i]; A[i]--; B[i]--;
        es[i] = tpl(Y[i], A[i], B[i]);
        sorted.push_back(pii(Y[i], i));
        rsorted.push_back(pii(Y[i], i));
        G[A[i]].push_back(pii(B[i], i));
        G[B[i]].push_back(pii(A[i], i));
    }

    uft.init(N, X);

    sort(sorted.begin(), sorted.end());
    sort(rsorted.begin(), rsorted.end(), greater<pii>());

    for(int i = 0; i < M; i++){
        auto t = sorted[i];
        int y = get<0>(t);
        int eid = get<1>(t);
        int a = get<1>(es[eid]);
        int b = get<2>(es[eid]);
        uft.unite(a, b);
        if(y <= uft.getCnt(a)){
            is_cand[eid] = true;
        }
    }

    for(int i = 0; i < M; i++){
        auto t = rsorted[i];
        int y = get<0>(t);
        int eid = get<1>(t);
        if(is_cand[eid]){
            int a = get<1>(es[eid]);
            int b = get<2>(es[eid]);
            // 小さい順番にdfsしていく
            if(used_e[eid]) continue;
            if(!used_n[a]) rec(a, y);
            if(!used_n[b]) rec(b, y);
        }
    }
    
    
    int ans = 0;
    for(int i = 0; i < M; i++){
        if(!used_e[i]) ans++;
    }

    cout << ans << endl;
    

    return 0;
}


Measured memory_bytes: 22496
import java.util.Scanner;

class Main{
	public static void main(String[] args){
    	int r,c;
    	int total= 0;
    	Scanner sc = new Scanner(System.in);
    	r = sc.nextInt();
        c = sc.nextInt();
        int [][] a = new int [r+1][c+1];

    	for(int i = 0; i < r; i++){
			for(int j = 0; j < c+1; j++){
				if(j != c){
					a[i][j] = sc.nextInt();
					a[r][j] += a[i][j];
	    			System.out.print(a[i][j]+" ");
	    			total += a[i][j];
				}
				else{
					a[i][j] = total;
					System.out.println(a[i][j]);
					a[r][j] += a[i][j];
				}
			}
			total = 0;
    	}
    	sc.close();

    	for(int i = 0; i < c+1; i++){
    		if(i != c){
    			System.out.print(a[r][i]+" ");
    		}
    		else{
    			System.out.println(a[r][i]);
    		}
    	}
    }
}

Measured memory_bytes: 40644
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define ll long long
#define ins insert
#define vi vector<int>
#define vl vector<ll>
#define lu unsigned long long
#define ff first
#define ss second
#define mod 1000000007

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

   double q=((double)d/(double)s);
   if(q<=t)
    cout<<"Yes\n";
   else
    cout<<"No\n";
}


Measured memory_bytes: 3572
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 min = Math.min(a,b);
		int max = Math.max(a,b);
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < max;i++){
			sb.append(String.valueOf(min));
		}
		System.out.println(sb.toString());
	}
}

Measured memory_bytes: 19796
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	int sum=0;
	int ans;
	sum+=1900*m+(n-m)*100;
	for(int i=0;i<m;i++)
	    sum*=2;
	printf("%d\n",sum);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f;
	scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
	if(1*a+5*b+10*c+50*d+100*e+500*f>=1000){
	printf("%d\n",1);
	}
	else{
	printf("%d\n",0);
	}
	return 0;
}
	


Measured memory_bytes: 2044
#include<cstdio>
#include<iostream>
int x,ans=0;
int main(){
    int n;
    std::cin>>n;
    for(int i=1;i<=n;i++){
        std::cin>>x;
        ans+=x;
    }
    std::cout<<ans-n<<std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  bool ans = false;
  for (int i = 0; i < S.size(); i++){
    if(i % 2 == 0){
      if(S.at(i) == 'L'){
        ans = true;
      }
    }
    else {
      if(S.at(i) == 'R'){
        ans = true;
      }
    }
  }
    if (ans) cout << "No" << endl;
    else cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];

    sort(s[i].begin(), s[i].end());
  }

  unordered_map<string, int> temp;

  ll ans = 0;
  for (int i = 0; i < n; i++) {
    temp[s[i]]++;
    if (temp[s[i]] != 1) ans += (temp[s[i]] - 1);
  }
  cout << ans << endl;
}

Measured memory_bytes: 13284
i = false

while true
  cost = gets.to_i/10 #????°????0????¬±??¶??????
  break if cost==0

  puts "" if i
  i = true
  
  m1,m5,m10,m50 = gets.split(" ").map{|s| s.to_i}

  n = m1+5*m5+10*m10+50*m50

  for i in 0..m1
    for j in 0..m5
      for k in 0..m10
        for l in 0..m50
          change = i + j*5 + k*10 + l*50 - cost
          if change >= 0
            mm1 = m1-i+change%5
            mm5 = m5-j+(change%10)/5
            mm10 = m10-k+(change%50)/10
            mm50 = m50-l+(change/50)

            nn = mm1+mm5+mm10+mm50
            a1,a5,a10,a50,n = i,j,k,l,nn if n>nn

          end
        end
      end
    end
  end

  puts "10 #{a1}" if a1!=0
  puts "50 #{a5}" if a5!=0
  puts "100 #{a10}" if a10!=0
  puts "500 #{a50}" if a50!=0
end

Measured memory_bytes: 8720
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int N,M,Q; cin>>N>>M>>Q;
	queue<vector<int>> q;
	for (int i=1; i<=M; i++)
		q.push({i});
	for (int i=0; i<N-1; i++) {
		int sz=q.size();
		for (int i=0; i<sz; i++) {
			auto cur=q.front(); q.pop();
			for (int j=cur.back(); j<=M; j++) {
				cur.push_back(j);
				q.push(cur);
				cur.pop_back();
			}
		}
	}
	vector<int> a(Q), b(Q), c(Q), d(Q);
	for (int i=0; i<Q; i++)
		cin>>a[i]>>b[i]>>c[i]>>d[i], a[i]--, b[i]--;
	int ret=0;
	while(!q.empty()) {
		auto cur=q.front(); q.pop();
		int val=0;
		for (int i=0; i<Q; i++)
			if(cur[b[i]]-cur[a[i]]==c[i])
				val+=d[i];
		ret=max(ret,val);
	}
	cout<<ret<<"\n";
	return 0;
}

Measured memory_bytes: 10260
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define rep(i, l, r) for(int i = (l); i <= (r); i++)
#define per(i, r, l) for(int i = (r); i >= (l); i--)
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> os;

int n;
int main(){
  scanf("%d", &n);
  vector <int> v(n);
  rep(i, 0, n - 1) scanf("%d", &v[i]);
  rep(i, 1, n - 1)  {
    if(v[i] > v[i - 1]) v[i]--;
  }
  vector <int> t = v;
  sort(t.begin(), t.end());
  puts(t == v ? "Yes" : "No");
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

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



Measured memory_bytes: 3012
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
using ll=long long;
using namespace std;
const auto mod=1e9+7;

template <typename T>
using GPQ=priority_queue<T,vector<T>,greater<T>>;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  
  int a,b,p=1,ans=0; cin >> a >> b;
  while(p<b){
  	p--;
  	p+=a;
  	++ans;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
main = do
  s <- getLine
  putStrLn $ solve2 s
solve2 = solve2' ['a' .. 'z']
solve2' [] _ = "None"
solve2' (x : xs) [] = [x]
solve2' (x : xs) ys = let ys' = filter (/= x) ys in if length ys == length ys' then [x] else solve2' xs ys'

Measured memory_bytes: 8572
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define mod ((int)1e9+7)
#define lim 1000000000000000007
#define lim1 18446744073709551615  //Unsigned
#define sq(a) ((a)*(a))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mms(v,i) memset(v,i,sizeof(v))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define REPN(i,a,b) for (int i = a; i >= b; i--)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pi;
typedef pair<ll,ll> PL;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<int,pair<int,int> > pii;
typedef pair<double,double> pdd;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
ll power(ll a,ll b) {
   ll res=1;
   while(b){
      if(b%2==1) res=(res*a)%mod;
      a=(a*a)%mod;
      b>>=1;
   }
   return res;
}
ll gcdll(ll a,ll b) {
    if (b==0) return a;
    return gcdll(b,a%b);
}
int gcd(int a,int b) {
    if (b==0) return a;
    return gcd(b,a%b);
}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

const int N = (int)1e5+5;
const int M = (int)3e3+5;
const int Q = 301;
const int logN = 19;

void solve() {
    int n,w,x,y;
    cin>>n>>w;
    vector<vector<int>> dp(n+1,vector<int>(N,w+1));
    dp[0][0] = 0;
    REP(i,1,n) {
        cin>>x>>y;
        REP(j,0,N-1) {
            dp[i][j] = dp[i-1][j];
            if(j>=y) dp[i][j] = min(dp[i][j],x+dp[i-1][j-y]);
        }
    }
    int ans = 0;
    REP(j,1,N-1) {
        if(dp[n][j]<=w) ans = j;
    }
    cout<<ans;
}
int main() {
    //freopen("output.txt","r",stdin);
    //freopen("output.txt","w",stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int T=1;
    //cin>>T;
    REP(TC,1,T) {
        //cout<<"Case #"<<TC<<": ";
        solve();
        cout<<"\n";
    }
}


Measured memory_bytes: 40192
use std::io::*;
use std::str::FromStr;

fn main() {
    let stdin = stdin();
    let mut stdinlock = stdin.lock();
    let mut str1 = String::new();
    stdinlock.read_line(&mut str1).unwrap();
    let mut it1 = str1.trim().split_whitespace().map(|x| u32::from_str(x).unwrap());
    let n = it1.next().unwrap();
    let a = it1.next().unwrap();
    let b = it1.next().unwrap();
    if n * a <= b {
        println!("{}", n * a);
    } else {
        println!("{}", b);
    }
}


Measured memory_bytes: 4352