akhauriyash/Code-Regression huggingface dataset:
import unittest
import sys

def count_odds_of_odd(n):
	#print n
	if n == 1:
		return float(1)
	else:
		odd_count = (n / 2) + (n % 2)
		#print odd_count
		odds_of_odd = float(odd_count) / float(n)
		return odds_of_odd

def read_input():
	#Read the input N
	n = int(sys.stdin.readline())
	return count_odds_of_odd(n)

class testMyCode(unittest.TestCase):
	def test_1(self):
		res = count_odds_of_odd(1)
		self.assertEqual(res, 1)
		res = count_odds_of_odd(4)
		self.assertEqual(res, 0.5)
		res = count_odds_of_odd(5)
		self.assertEqual(res, 0.6)

if __name__ == '__main__':
	res = read_input()
	print res
	#unittest.main()

Measured memory_bytes: 3716
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5+7;
const ll mod = 1e9+7;
const int sz = 62;
#define afdafafafdafaf y1;
int n,m;
int ar[maxn];
int mx[maxn << 2];
int mn[maxn << 2];
void build(int l,int r,int o){
    if(l==r){
        mx[o] = ar[l];
        mn[o] = ar[l];
    }
    else{
        int mid = l+r >> 1;
        build(l, mid, o<<1);
        build(mid+1, r, o<<1|1);
        mx[o] = max(mx[o<<1], mx[o<<1|1]);
        mn[o] = min(mn[o<<1], mn[o<<1|1]);
    }
}
int x, y, max_que, min_que;
int que(int l, int r, int o){
    if(l>=x && r<=y){
        max_que = max(max_que, mx[o]);
        min_que = min(min_que, mn[o]);
    }
    else{
        int mid = l+r >> 1;
        if(x<=mid)que(l, mid, o<<1);
        if(y>mid)que(mid+1, r, o<<1|1);
    }
}
int be, en;
void check(){
    while(be<en){
        x = be;
        y = en;
        max_que = -1;
        min_que = n;
        que(1, n, 1);
        if(min_que != ar[be] && max_que != ar[en]){
            break;
        }
        if(min_que == ar[be]){
            be++;
        }
        if(be < en && max_que == ar[en]){
            en--;
        }
    }
    if(be == en){
        be = en = -1;
    }
}

int main()
{
    scanf("%d%d", &n, &m);
    for(int i=1;i<=n;i++)scanf("%d", ar+i);
    build(1, n, 1);
    set<pair<int,int>> s;
    be = 1;
    en = m;
    check();
    s.insert(make_pair(be, en));
    //cout<<"be = " << be << " " << en << '\n';
    for(int i=2;i<=n-m+1;i++){
        int new_en = i+m-1;
        if(be == i-1){
            be = i;
            check();
        }
        if(be == -1){
            int k = upper_bound(ar+i, ar+new_en, ar[new_en]) - ar;
            if(k == new_en);
            else{
                be = k;
                en = new_en;
            }
        }
        else{
            x = i;
            y = new_en - 1;
            max_que = -1;
            min_que = n;
            que(1, n, 1);
            if(max_que < ar[new_en]);
            else{
                assert(i<=be);
                int k = upper_bound(ar+i, ar+be, ar[new_en]) - ar;
                assert(k<=be);
                be = k;
                en = new_en;
            }
        }
        s.insert(make_pair(be, en));
        //cout<<i<< " " << be<<" "<<en<<"\n";
    }
    printf("%d\n", s.size());

    return 0;
}


Measured memory_bytes: 16512
rooms = Hash.new(0)

def report(rooms)
  (1..4).each do |b|
    (1..3).each do |f|
      nums = (1..10).map do |r|
        rooms["#{b}#{f}#{r}"]
      end
      print "\s"
      puts nums.join("\s")
    end
    puts "#" * 20 unless b == 4
  end
end

_ = gets
ARGF.each_line do |line|
  b, f, r, v = line.split.map(&:to_i)
  rooms["#{b}#{f}#{r}"] += v
end

report(rooms)

Measured memory_bytes: 6104
#include <iostream>
#include <vector>
#include <ios>
#include <limits.h>
using namespace std;
int g_minCand = 0;

int GetMax(int a, int b) { return (a > b ? a : b); }

int partition(const vector<int>& vN, int m, int i, int p, int k)
{
	if (p == k - 1){
		int a = 0;
		for (int j = i; j < vN.size(); ++j)
			a += vN[j];		
		return GetMax(m, a);
	}

	int q, a = 0;
	for (q = i; q <= vN.size() - k + p + 1; ++q){
		if (a + vN[q] > g_minCand)
			break;
		a += vN[q];
	}

	int r = GetMax(m, a);
	return partition(vN, r, q, p + 1, k);
}

int main()
{
	ios::sync_with_stdio(false);
	int n, k, i;
	cin >> n >> k;
	vector<int> vN(n, 0);
	int s = 0;
	int maxV = INT_MIN;
	for (i = 0; i < n; ++i){
		cin >> vN[i];
		s += vN[i];
		if (vN[i] > maxV)
			maxV = vN[i];
	}
	g_minCand = ((double)s / (double)k + 0.9999);
	g_minCand = GetMax(g_minCand, maxV);

	while (g_minCand != partition(vN, 0, 0, 0, k))
		++g_minCand;

	cout << g_minCand << "\n";

	return 0;
}

Measured memory_bytes: 1532
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class ABC148D
    {
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }
        static public void Solve()
        {
            var N = NN;
            var aList = NNList(N);
            var cnt = 0L;
            var before = 0L;
            foreach (var item in aList)
            {
                if (item == before + 1)
                {
                    ++before;
                }
                else
                {
                    ++cnt;
                }
            }
            Console.WriteLine(cnt == N ? -1 : cnt);
        }
        static class Console_
        {
            static Queue<string> param = new Queue<string>();
            public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }
        static long NN => long.Parse(Console_.NextString());
        static double ND => double.Parse(Console_.NextString());
        static string NS => Console_.NextString();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static IEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => x.OrderBy(_ => xorshift);
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
}


Measured memory_bytes: 42692
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
struct X{
	int id;
	LL P;
	LL Y;
};
bool Comp(X&l,X&r){
	if (l.P<r.P){
		return true;
	}else if (l.P==r.P){
		return l.Y<r.Y;
	}
	return false;
}
bool Comp1(X&l,X&r){
	return l.id<r.id;
}
int main(int argc, char* argv[])
{
	int N,M,i;
	cin>>N>>M;
	vector<X> ID(M);
	for (i=0;i<M;i++){
		cin>>ID[i].P>>ID[i].Y;
		ID[i].id=i+1;
	}
	sort(ID.begin(),ID.end(),Comp);
	LL p1=ID[0].P;
	int num=1;
	for (i=0;i<M;i++){
		if (p1==ID[i].P){
		}else{
			p1=ID[i].P;
			num=1;
		}
		ID[i].Y=num;
		num++;
	}
	sort(ID.begin(),ID.end(),Comp1);
	for (i=0;i<M;i++){
		printf("%06lld%06lld\n",ID[i].P,ID[i].Y);
	}
	return 0;
}

Measured memory_bytes: 3840
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>

using namespace std;

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

#define PI 3.1415926535897932384626433832795


template<typename X>bool max_u(X&m, X v)
{
	if(m<v)
	{
		m=v;
		return true;
	}
	return false;
}


template<typename X>bool min_u(X&m, X v)
{
	if(m>v)
	{
		m=v;
		return true;
	}
	return false;
}


template<typename X>
void kmp_ready(vi&t, const X*k, int kl)
{
	t.resize(kl);
	int j=0;
	t[0]=0;
	for(int i=1;i<kl;i++)
	{
		t[i]=j;
		if(k[i]==k[j]) j++;
		else j=0;
	}
}


template<typename X>
int kmp_common(const X *s, int sl, const X *k, int kl, const vi&t)
{
	int i=0;
	int j=0;
	for(;i<sl;)
	{
		if(s[i]==k[j])
		{
			i++;
			j++;
			if(j>=kl) return i-j;
		}
		else if(j==0)
		{
			i++;
		}
		else
		{
			j=t[j];
		}
	}
	return -1;
}


template<typename X>
vi kmp_r(const X *s, int sl, const X *k, int kl, int lim=0)
{
	vi ret;

	if(kl<=0) return ret;
	if(sl<=0) return ret;

	vi t;
	kmp_ready(t, k, kl);

	int i=0;
	int j=0;
	for(;i<sl;)
	{
		if(s[i]==k[j])
		{
			i++;
			j++;
			if(j>=kl)
			{
				ret.push_back(i-j);
				i--;
				j=t[j-1];
			}
		}
		else if(j==0)
		{
			i++;
		}
		else
		{
			j=t[j];
		}
	}
	return ret;
}


template<typename X>
int kmp(const X *s, int sl, const X *k, int kl)
{
	if(kl<=0) return 0;
	if(sl<=0) return -1;

	vi t;
	kmp_ready(t, k, kl);

	return kmp_common(s, sl, k, kl, t);
}


int msb(unsigned long long v)
{
	int ret=0;

	if(v & 0xFFFFFFFF00000000LL) ret+=32,v>>=32;
	if(v & 0xFFFF0000) ret+=16,v>>=16;
	if(v & 0xFF00) ret+=8,v>>=8;
	if(v & 0xF0) ret+=4,v>>=4;
	if(v & 0xC) ret+=2,v>>=2;
	if(v & 0x2) ret+=1;
	return ret;
}


int lsb(unsigned long long v)
{
	int ret=0;

	if(!v) return 0;

	if(!(v & 0xFFFFFFFF)) ret+=32,v>>=32;
	if(!(v & 0xFFFF)) ret+=16,v>>=16;
	if(!(v & 0xFF)) ret+=8,v>>=8;
	if(!(v & 0xF)) ret+=4,v>>=4;
	if(!(v & 0x3)) ret+=2,v>>=2;
	if(!(v & 0x1)) ret+=1;
	return ret;
}


int bit_count(unsigned long long v)
{
	int ret=0;

	while(v)
	{
		ret++;
		v&=v-1;
	}
	return ret;
}


int main(void)
{
	int n;
	while(scanf("%d", &n)==1)
	{
		vi a(n), b(n);

		for(auto&m:a) scanf("%d", &m);
		for(auto&m:b) scanf("%d", &m);

		vi ad2(n*2-1), bd(n);

		for(int i=0;i<n*2-1;i++)
		{
			ad2[i]=a[i%n]^a[(i+1)%n];
		}
		for(int i=0;i<n;i++)
		{
			bd[i]=b[i%n]^b[(i+1)%n];
		}
/*
printf("< n=%d >\n", n);
printf("ad ="); for(auto m:ad)  printf("%d ", m); printf("\n");
printf("bd2="); for(auto m:bd2) printf("%d ", m); printf("\n");
*/
		vi p=kmp_r(&ad2[0], ad2.size(), &bd[0], bd.size());
		for(auto m:p)
		{
			printf("%d %d\n", m, b[0]^a[m]);
		}
	}
	return 0;
}


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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	long long h;
	cin >> h;
	int dig=0;
	while(h>0){
		h/=2;
		dig++;
	}
	long long ans= (long long)pow(2,dig) - 1;
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x[4],i,j=0;
  for(i=0;i<4;i++){
    cin >> x[i];
  }
  int n = sizeof(x)/sizeof(x[0]); 
  sort(x,x+n);
  if(x[0]==1){
    if(x[1]==4){
      if(x[2]==7){
        if(x[3]==9){
            cout << "YES";
            return 0;
          }else{
            cout << "NO";
            return 0;
          }
          cout << "NO";
          return 0;
        }
        cout << "NO";
        return 0;
      }
      cout << "NO";
      return 0;
    }
    cout << "NO";
  return 0;
}


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

int main(){
	string w,t;
	cin >> w;
	int count = 0;
	transform(w.begin(),w.end(),w.begin(),::tolower);
	while(cin >> t){
		transform(t.begin(),t.end(),t.begin(),::tolower);
		if( t == "END_OF_TEXT" ) break;
		if( t == w ) count++;
	}
	cout << count << endl;
}

Measured memory_bytes: 3192
#include<bits/stdc++.h>
#define ll long long
#define dl double
#define mp make_pair
#define pb push_back
using namespace std;

//***********************************************************************

// hash struct for unordered_map
struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
};

int MAXNUM = 5e3+5;
vector <int>vis(MAXNUM);
vector<int> pr;
void sieve() {
	pr.push_back(2);
	for(ll i=3;i<MAXNUM;i+=2) if(!vis[i]) {
		pr.push_back(i);
		for(ll j=i*i;j<MAXNUM;j+=2*i) vis[j]=true;
	}
}
//************************************************************************
ll mod=1000000007;
void solve()
{
    ll n;
    cin >> n;
    cout << (1000-n%1000)%1000 << endl;
}


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

	return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MX=3*1e5+100;
const long long INF = 1e18;
ll N, M, k;
ll arr[MX];
int main()
{
    ll R ,G;
    cin>>R>>G;
    cout<<2LL*G-R;
}


Measured memory_bytes: 256
{
  const Main = input => {
    const [n, k] = input.trim().split(" ").map(v => parseInt(v))

    let count = k
    for (let i = 0; i < n; i++) {
      if (i !== 0) count *= k - 1
    }

    console.log(count)
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


Measured memory_bytes: 29652
iList = [int(input()) for i in range(5)]
count = 0
maxAmari = 0
for i in iList :
    if i%10 == 0 :
        count += i
    else :
        count += i + (10 - i%10)
        if (10 - i%10) > maxAmari :
            maxAmari = (10 - i%10)
print(count - maxAmari)

Measured memory_bytes: 3060
a,b=map(int,input().split())
s=input()
p=["0","1","2","3","4","5","6","7","8","9"]
c=0
for i in range(a+b+1):
    if i!=a:
        if s[i] not in p:
            c=1
    else:
        if s[i]!="-":
            c=1
print("Yes"if c!=1else"No")

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

int main() {
	// your code goes here
	int n,m,k,i,j;
	bool ans=false;
	cin >> n >> m >> k;
	for(i=0;i<=n;i++){
		for(j=0;j<=m;j++){
			int memo=0;
			memo=m*i;
			memo=memo-j*i+j*(n-i);
			if(memo==k) ans=true;
		}
	}
	if(ans) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> v(n);
  for(int i=0;i<n;++i) cin >> v[i];
  sort(v.rbegin(),v.rend());
  auto max_sum=0;
  for(int i=0;i<k;++i) max_sum+=v[i];
  cout << max_sum << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
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; }
const ll INF=1LL<<60;
const int inf=1<<30;
const int mod=1e9+7;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,c;cin >> n >> c;
    vector<ll> x(n),v(n),l(n+1),r(n+1),l2(n+1),r2(n+1),sl(n+1),sr(n+1);
    for(int i=0;i<n;i++){
        cin >> x[i] >> v[i];
    }
    for(int i=0;i<n;i++){
        sl[i+1]=sl[i]+v[i];
    }
    for(int i=n-1;i>=0;i--){
        sr[i]=sr[i+1]+v[i];
    }
    for(int i=1;i<=n;i++){
        l[i]=max(l[i-1],sl[i]-x[i-1]);
        l2[i]=max(l2[i-1],sl[i]-2*x[i-1]);
    }
    for(int i=n-1;i>=0;i--){
        r[i]=max(r[i+1],sr[i]-(c-x[i]));
        r2[i]=max(r2[i+1],sr[i]-2*(c-x[i]));
    }
    ll ans=0;
    for(int i=0;i<=n;i++){
        chmax(ans,max(l[i]+r2[i],l2[i]+r[i]));
    }
    cout << ans << endl;
}

Measured memory_bytes: 6528
n, x = gets.strip.split.map(&:to_i)

@burger = [1]
@meat = [1]

(1..n).each do |i|
  @burger[i] = @burger[i-1]*2+3
  @meat[i] = @meat[i-1]*2+1
end

def counter(l, x)
  return 0 if x.zero?
  return 1 if l.zero?

  if x >= @burger[l-1]+2
    return @meat[l-1]+1 + counter(l-1, x-(@burger[l-1]+2))
  else
    return counter(l-1, x-1)
  end
end

p counter(n, x)


Measured memory_bytes: 1788
import bisect
import math
import sys
from collections import Counter, defaultdict, deque
from copy import copy, deepcopy
from heapq import heapify, heappop, heappush
from itertools import combinations, permutations
from queue import Queue

read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines 

def SI():
    return int(readline())
def MI():
    return map(int, readline().split())
def MLI():
    return map(int, open(0).read().split())

inf = float("inf")


class Dictionary:
    def __init__(self):
        self.dict = defaultdict(lambda:False)
    
    def insert(self, x):
        self.dict[x] = True
        
    def find(self, x):
        if self.dict[x]:
            print("yes")
        else:
            print("no")
            
            
def main():
    Dict = Dictionary()
    
    n = int(input())
    for i in range(n):
        op, key = input().split()
        if op == "find":
            Dict.find(key)
        else:
            Dict.insert(key)

if __name__ == "__main__":
    main() 


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

using namespace std;

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

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int main() {
    int h,w;
    while(cin>>h>>w){
        char data[100][100]={};
        rep(i,h) rep(j,w) cin>>data[i][j];
        
        int dp[100][100]={};
        rep(i,100) rep(j,100) dp[i][j]=99999999;
        dp[0][0]=0;
        rep(i,h){
            rep(j,w){
                dp[i+1][j]=min(dp[i][j]+data[i+1][j]-'0',dp[i+1][j]);
                dp[i][j+1]=min(dp[i][j]+data[i][j+1]-'0',dp[i][j+1]);
            }
        }
        cout<<dp[h-1][w-1]<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 1216
#include <iostream>
#include <cmath>

using namespace std;

int main() {
    unsigned long long n, i;
    cin >> n;
    unsigned long long divOne = 1, divTwo = n;
    for (i = floor(sqrt(n)); i > 0; i--) {
        if (n % i == 0) {
            divOne = i;
            divTwo = n / divOne;
            break;
        }
    }
    cout << (divOne - 1) + (divTwo - 1);
}

Measured memory_bytes: 256
#include<string>
#include<vector>
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

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



int main(){

    vector<int>s;
	int n;
	while(cin >> n){

	s.push_back(0);
	s.push_back(2);

	REP(i,2,n)
	s.push_back(s[i-1]+i);

	cout << s.back() << endl;

    s.clear();

	}

	return 0;
}

Measured memory_bytes: 1320
#include<iostream>
using namespace std;
int main()
{  int a,b;
 cin>>a>>b;
 if(a==0)
 {  if(b!=100)
     cout<<b;
   else
      cout<<101;
 }
else if(a==1)
{  if(b!=100)
    cout<<b*100;
  else
     cout<<101*100;
}   
else
{ if(b!=100)
    cout<<b*100*100;
  else
      cout<<101*100*100;
}  
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    int n; cin >> n;
    ll s; cin >> s;
    ll a[n];
    rep(i,n)cin >> a[i];

    int ans[n];
    ll tmp = 0;
    int j = 0;
    rep(i,n){
        tmp += a[i];
        if(tmp < s){
            ans[i] = 0;
        }else{
            while(tmp - a[j] >= s){
                tmp -= a[j];
                j++;
            }
            ans[i] = i - j + 1;
        }
    }

    int res = 1001001001;
    rep(i,n){
        if(ans[i] == 0)continue;
        res = min(res, ans[i]);
    }
    if(res == 1001001001)res = 0;
    cout << res << endl;
    return 0;
}
 
 



Measured memory_bytes: 4292
//       Author: Mostafa Mounir Shehab
 
#include <bits/stdc++.h>
using namespace std;
 
#define PI  acos(-1)
#define EPS (1e-10)
#define endl "\n"
#define SZ(v) (int)(v.size())
#define IO ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL), cerr.tie(NULL);
typedef long long ll;
typedef long double ld;
 

 
ll MOD=1e9 + 7;
ll OO=1e9 + 100;
const int N=1e6 + 2,M=10 + 1;
int lvl[N];
ll comp[N];


ll n,m,k,T,cnt,SU;
int a,b,c,d;
ll l,r,mid;
vector<int> vec;
int val;

vector<int> adj[N];

ll SolveInc(){
	ll cnt = 0;
	for(int i=1;i<=n;++i)
		lvl[i] = SZ(adj[i]);
	
	ll len = 1;
	for(int i=n;i;--i){
		
		cnt += comp[i] = len;
		len += lvl[i] - 1;
		
		for(int j:adj[i])
			lvl[j]--;

	}
	return cnt;
}

ll SolveDec(){
	ll cnt = 0;
	for(int i=1;i<=n;++i)
		lvl[i] = SZ(adj[i]);
	
	ll len = 1;
	for(int i=1;i<=n;++i){
		
		cnt += comp[i] = len;
		
		len += lvl[i] - 1;
		
		for(int j:adj[i])
			lvl[j]--;

	}
	
	return cnt;
	
}



int main(){
	
	IO
	
	cin>>n;
	for(int i=1;i<n;++i){
		cin>>a>>b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	
	ll cnt = SolveInc();
	//ll val = SolveDec();
	
	
	ll ans = cnt;
	
	for(int i=1;i<n;++i){
		cnt -= (n-i+1);
		for(int j:adj[i])
			if(j > i)
				cnt += (n-j+1);
		
		ans+=cnt;
	}

	
	
	cout<<ans<<endl;
	
	
}




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

int main(){
  int N;
  cin >> N;
  int d[N];
  for(int i=0; i<N; i++){
    cin >> d[i];
  }
  sort(d, d+N);
  int tmp = 0;
  int layers = 0;
  for(int i=0; i<N; i++){
    if(d[i] > tmp){
      tmp = d[i];
      layers++;
    }
  }
  cout << layers << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
  int d[5],k;
  for(int i=0;i<5;i++)cin>>d[i];
  cin>>k;
  bool flag=false;
  for(int i=0;i<4;i++){
    for(int j=i+1;j<5;j++){
      if(d[j]-d[i]>k){
        flag=true;
        break;
      }
    }
  }
  if(flag)cout<<":("<<endl;
  else cout<<"Yay!"<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.io.*;
 
class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        String u, nl = System.getProperty("line.separator");
        StringBuilder
            p = new StringBuilder(1000),
            d = (new StringBuilder(100)).append('.'),
            s = (new StringBuilder(100)).append('#'),
            k = (new StringBuilder(100)).append('#');
        Scanner r = new Scanner(System.in);
        d.append(d.append(d)).append(d.append(d));
        s.append(s.append(s)).append(s.append(s));
        int h, w, ww = d.length();
        while (0 != ((h = r.nextInt()) | (w = r.nextInt()))) {
            while (w > ww) {
                d.append(d);
                s.append(s);
                ww = d.length();
            }
            p.append(u = s.substring(0, w)).append(nl);
            k.setLength(1);
            k.append(d.substring(1, w)).append(nl).replace(w - 1, w, "#");
            while (2 != h--) {
                p.append(k);
            }
            p.append(u).append(nl).append(nl);
        }
        System.out.print(p);
    }
}

Measured memory_bytes: 18404
import java.io.*;
import java.util.*;

public class Main {

	final static long MOD = 1000000007L;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static ArrayList<int[]> list = new ArrayList<>();
	public static void main(String[] args) throws Exception {


		long N=nextLong();

		int[] a = nextInts();
		int c4 = 0;
		int c2e4 =0;
		int ce24=0;
		for(int i=0;i<N;i++){
			if(a[i]%4==0){
				c4++;
			}else if(a[i]%2==0){
				c2e4++;
			}else{
				ce24++;
			}
		}
		if(c2e4!=0){
			ce24++;
		}
		String ans = "Yes";
		if(ce24-c4 -1> 0){
			ans="No";
		}

		System.out.println(ans);
	}


	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

int main()
{
    int n,i,ans=0,cnt=0;
    cin>>n;
    int h[n];
  	cin>>h[0];
    for(i=1;i<n;i++)
    {
        cin>>h[i];
        if(i>0&&h[i]<=h[i-1])
        {
            cnt++;
        }
        else
        {
            if(cnt>ans)
            {
    	        ans=cnt;
            }
            cnt=0;
        }
    }
  	  	if(cnt>ans)
    {
    	ans=cnt;
    }
    cout<<ans;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
#define s 131072
using namespace std;
typedef long long ll;
typedef pair<ll,ll>pii;
class segtree
{
public:
	ll seg[s*2];
	ll lazy[s*2];
	void lazy_evaluate(int k)
	{
		if(k*2+2>=s*2) return ;
		lazy[k*2+2]+=lazy[k];
		lazy[k*2+1]+=lazy[k];
		seg[k*2+2]+=lazy[k];
		seg[k*2+1]+=lazy[k];
		lazy[k]=0;
	}
	ll update(int beg,int end,int idx,int lb,int ub,ll num)
	{
		if(ub<beg||end<lb)
		{
			return seg[idx];
		}
		if(beg<=lb&&ub<=end)
		{
			lazy[idx]+=num;
			seg[idx]+=num;
			return seg[idx];
		}
		if(lazy[idx])
		{
			lazy_evaluate(idx);
		}
		return seg[idx]=max(update(beg,end,idx*2+1,lb,(lb+ub)/2,num),update(beg,end,idx*2+2,(lb+ub)/2+1,ub,num));
	}
	ll query(int beg,int end,int idx,int lb,int ub)
	{
		if(ub<beg||end<lb)
		{
			return -1000000000000000000LL;
		}
		if(beg<=lb&&ub<=end)
		{
			return seg[idx];
		}
		if(lazy[idx])
		{
			lazy_evaluate(idx);
		}
		return max(query(beg,end,idx*2+1,lb,(lb+ub)/2),query(beg,end,idx*2+2,(lb+ub)/2+1,ub));
	}
};
segtree seg_tree;
int main()
{
	ll n,x;
	scanf("%lld %lld",&n,&x);
	seg_tree.update(0,s-1,0,0,s-1,x);
	ll ret=0LL;
	priority_queue<pii>que;
	for(int i=0;i<n-1;i++)
	{
		ll za,zb;
		scanf("%lld %lld",&za,&zb);
		que.push(make_pair(zb,i));
		for(;;)
		{
			if(que.empty())	break;
			if(seg_tree.query(i+1,i+1,0,0,s-1)>za) break;
			pii zan=que.top();
			ll ka=(x-seg_tree.query(zan.second,i+1,0,0,s-1))/zan.first,kb=(1-seg_tree.query(i+1,i+1,0,0,s-1)+za+zan.first-1)/zan.first;
			if(ka>=kb)
			{
				ret+=kb;
				seg_tree.update(zan.second,s-1,0,0,s-1,kb*zan.first);
			}
			else
			{
				ret+=ka;
				que.pop();
				que.push(make_pair((x-seg_tree.query(zan.second,i+1,0,0,s-1))%zan.first,zan.second));
				seg_tree.update(zan.second,s-1,0,0,s-1,ka*zan.first);
			}
		}
		seg_tree.update(i+1,s-1,0,0,s-1,-za);
	}
	printf("%lld\n",ret);
}

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

using namespace std;
typedef long long ll;
const int MAXN = 6100;
const ll MOD = 998244353;

int N, S;
int arr[MAXN];
ll dp[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);

    cin >> N >> S;
    for (int i = 0; i < N; i++)
        cin >> arr[i];

    dp[0] = 1;
    ll ans = 0;
    for (int i = N - 1; i >= 0; i--)
    {
        int x = arr[i];
        for (int j = S; j >= 0; j--)
        {
            if (j) dp[j+x] = (dp[j+x] + dp[j]) % MOD;
            else dp[j+x] = (dp[j+x] + (N - i) * dp[j]) % MOD;
        }

        ans = (ans + dp[S]) % MOD;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <vector>
#include <sstream>
#include <string>
#include <cstdio>
#include <array>
#include <stack>
#include <queue>
#include <list>
#include <numeric> //accumulate

using namespace std;

//???????????°??????TEST????????????????????¬???????????????????????????????????¢????????????
#define TEST //*******************************************************************************************************************************************

//?????????????????¨??§?????\????????????????????????????????°?????????????¨???????????????????dout???????????????????????§???????????¬??????????????????????????????????????????
#ifdef TEST
    #define dout cout
#else
    stringstream dummy; //???????????°??????dout?????????????????????????????????
    #define dout dummy.str(""); dummy.clear(stringstream::goodbit); dummy //dummy?????????????????????????????????????????¨?????¢?????¢???????????????
    //???????????¨??????????????????goodbit?????????????????????????????¨???????????´????????????????????????????????¨?????°?????????????????§???????????????????????????????????? http://d.hatena.ne.jp/linden/20060427/p1
#endif


int main(void) {
    int n, q;
    
    cin >> n;
    int S[n];
    for(int i=0; i<n; i++) cin>>S[i];
    
    cin >> q;
    int T[n];
    for(int i=0; i<q; i++) cin>>T[i];
    
    
//    dout<<"S = ";
//    for(int i=0; i<n; i++) dout<<S[i]<<" ";
//    dout<<endl;
//    
//    dout<<"T = ";
//    for(int i=0; i<q; i++) dout<<T[i]<<" ";
//    dout<<endl;
    
    
    //search T from S
    int ans = 0;
    for (int i=0; i<q; i++) {
        for (int j=0; j<n; j++) {
            if(T[i]==S[j]) {
                ans++;
                break;
            }
        }
    }
    
    
    //output
    cout << ans << endl;
    
    
    return 0;
}

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

#define     int long long
#define     pii pair<int,int>
#define     x first
#define     y second
#define     __FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define     MOD 1000000007
#define     INF 100000000
#define     nll cout << "\n"
#define     nl "\n"
#define     MAX 1000003
#define     print(v) cout << v << " "
#define     dbgv(v) cout << v << nl
#define     asdf(v) cout << v << nl
#define     pasdf(p) cout << p.x << " " << p.y << nl
#define     dbg cout << "dbg\n"
#define     vi vector<int>
#define     vl vector<ll>
#define     pb push_back
#define     con continue

int xx[] = {1, -1, 0, 0};
int yy[] = {0, 0, -1, 1};

int factorial[MAX];
int iFactorial[MAX];

int bigMod(int a, int b){
    int ans = 1;
    while(b){
        if(b&1){
            ans = (ans*a)%MOD;
        }
        a = (a*a)%MOD;
        b >>= 1;
    }
    return ans%MOD;
}

void pro(){
    factorial[0] = 1;
    iFactorial[0] = 1;
    for(int i = 1; i < MAX; i++){
        factorial[i] = (factorial[i-1]*i)%MOD;
        iFactorial[i] = (iFactorial[i-1]*bigMod(i, MOD-2))%MOD;
    }
}

int ncr(int n, int r){
    if(n < r)return 0;
    int ans = factorial[n];
    ans = (ans*iFactorial[r])%MOD;
    ans = (ans*iFactorial[n-r])%MOD;
    return ans;
}

int32_t main(){
    pro();
    int x, y;
    while(cin >> x >> y){
       if((x+y)%3 > 0){
            asdf("0"); con;
       }
       int big = (2*y - x)/3;
       int small = (2*x-y)/3;
       int total = big+small;
       if(big < 0 || small < 0){
            asdf(0); con;
       }
       asdf(ncr(total, big));
    }
    return 0;
}


Measured memory_bytes: 19264
#include <iostream>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
	LL A,B,C,K;
	cin>>A>>B>>C>>K;
	if (A>=K){
		cout<<K<<endl;
		return 0;
	}
	if (A+B>=K){
		cout<<A<<endl;
		return 0;
	}
	LL T=K-(A+B);
	cout<<A-T<<endl;
	return 0;
}

Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)cin>>a[i];
  int p=0;
  for(int i=0;i<n;i++){
    p+=a[i]/(n+1);
    a[i]=a[i]%(n+1);
  }
  int ans=p;
  if(p>n){
    ans+=(p-n)*n;
    p=n;
  }
  priority_queue<int> que;
  for(int i=0;i<n;i++)que.push(a[i]+p);
  p=0;int t;
  while(que.top()+p>n-1){
    t=que.top();
  // cerr<<t<<' ';
    que.pop();
    que.push(t-(n+1));
    p++;
    ans++;
  }
  cout<<ans;


  
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main(void){
        int x,y,z;
        char a[11], b[11], c[11];

        scanf("%s%s%s",a,b,c);
        x = strlen(a);
        y = strlen(b);

        if((a[x-1] == b[0])&&(b[y-1] == c[0]))
           printf("YES\n");
        else
           printf("NO\n");
        return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;
int main() 
{
	int x;
	scanf("%d", &x);

	if (x >= 400 && x <= 599)
	{
		printf("8\n");
	}
	else if (x >= 600 && x <= 799)
	{
		printf("7\n");
	}
	else if (x >= 800 && x <= 999)
	{
		printf("6\n");
	}
	else if (x >= 1000 && x <= 1199)
	{
		printf("5\n");
	}
	else if (x >= 1200 && x <= 1399)
	{
		printf("4\n");
	}
	else if (x >= 1400 && x <= 1599)
	{
		printf("3\n");
	}
	else if (x >= 1600 && x <= 1799)
	{
		printf("2\n");
	}
	else
	{
		printf("1\n");
	}



	return 0;
}

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

using namespace std;

using ll = long long;

const ll MOD = 1e9 + 7;

template <typename T, typename U>
T mypow(T b, U n) {
    if (n == 0) return 1;
    if (n == 1) return b % MOD;
    if (n % 2 == 0) {
        return mypow(b * b % MOD, n / 2);
    } else {
        return mypow(b, n - 1) * b % MOD;
    }
}

int main() {
    int N, K;
    string S;
    cin >> N >> S;
    K = S.length();

    ll dp[N + 1];
    fill(dp, dp + N + 1, 0);
    dp[0] = 1;
    // dp[i] = i文字打たれているパターン数

    for (int q = 0; q < N; ++q) {
        ll ndp[N + 1];
        fill(ndp, ndp + N + 1, 0);

        for (int i = 0; i < N; ++i) {
            ndp[i + 1] += dp[i] * 2;
            ndp[max(0, i - 1)] += dp[i];
        }

        for (int i = 0; i <= N; ++i) {
            dp[i] = ndp[i] % MOD;
        }
    }

    // 2^Kで割る = 2^Kの逆元を掛ける
    cout << dp[K] * mypow(mypow(2LL, K), MOD - 2) % MOD << endl;

    return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
char a[16],b[16]={'C','O','D','E','F','E','S','T','I','V','A','L','2','0','1','6'};
int ans;
int main()
{
    cin >> a;
    for(int i = 0; i < 16; i ++)
        if(a[i] != b[i]) ans ++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//登録しよう！→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示

void solve(long long A, long long B){
  cout << roundup((B-1),(A-1)) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>

#define REP(i, max)	for(int i = 0, iMax = max; i < iMax; i ++)
using namespace std;

int main(int args, char **ppArgs)
{
	int numTables;
	
	while(::scanf("%d", &numTables), numTables)
	{
		// Input conversion tables
		map<char, char>	conversionMap;
		char	from, to;
		REP(i, numTables)	cin >> from >> to,	conversionMap[from]	= to;
		
		// Input text
		int textLen;
		::scanf("%d", &textLen);
		string	text(textLen, 0);
		REP(i, text.size())
		{
			char ch;
			cin >> ch;
			text[i]	= conversionMap.count(ch) ? conversionMap[ch] : ch;
		}
		::puts(text.c_str());	
	}
}

Measured memory_bytes: 3256
//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
//#define iinf (3000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
ll c[200][200],dp[200][200],c1[200];
int main(){
	std::ios::sync_with_stdio(false);
	int h,w,i,j,x,k,k1;
	ll val=0;
	cin>>h>>w;
	rep(i,10){
		rep(j,10){
			cin>>c[i][j];
		}
	}	
	rep(i,10){
		rep(j,10){
			if(i==j){
				dp[i][j]=0;
			}
			else{
				dp[i][j]=c[i][j];
			}
		}
	}	
	rep(i,h){
		rep(j,w){
			cin>>x;
			if(x!=-1){
				c1[x]++;
			}
		}
	}
	rep(i,10){
		rep(j,10){
			rep(k,10){
				dp[i][j]=min(dp[i][k]+dp[k][j],dp[i][j]);
			}
		}
	}
	rep(k1,100){
		rep(i,10){
			rep(j,10){
				rep(k,10){
					dp[i][j]=min(dp[i][k]+dp[k][j],dp[i][j]);
				}
			}
		}
	}
	rep(i,10){
		val+=c1[i]*dp[i][1];
	}
	cout<<val<<endl;
} 


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
long M=1e9+7;
long ans;
string s;
int q;
long a,b,c;
long pow(long a,long b){return b?pow(a*a%M,b/2)*(b%2?a:1)%M:1;}
main()
{
	cin>>s;
	for(int i=0;i<s.size();i++)q+=s[i]=='?';
	long A[2]={},AB[3]={};
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='A')
		{
			A[0]=(A[0]+1)%M;
		}
		else if(s[i]=='B')
		{
			AB[0]=(AB[0]+A[0])%M;
			AB[1]=(AB[1]+A[1])%M;
		}
		else if(s[i]=='C')
		{
			for(int j=0;j<3&&j<=q;j++)ans=(ans+AB[j]*pow(3,q-j)%M)%M;
		}
		else
		{
			for(int j=0;j<3&&j+1<=q;j++)ans=(ans+AB[j]*pow(3,q-j-1)%M)%M;
			AB[1]=(AB[1]+A[0])%M;
			AB[2]=(AB[2]+A[1])%M;
			A[1]=(A[1]+1)%M;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 640
/*ex3_2
    takafumi_ueki*/
#include <stdio.h>
int main(void){
    int x;
    scanf("%d",&x);
    //xを10割った余り、つまり1の位が何かによって条件分岐
    //”||”は、またはという意味
        if((x%10 == 2)||(x%10 == 4)||(x%10 == 5)||(x%10 == 7)||(x%10 == 9)){
        printf("hon\n");
    }
    if((x%10 == 0)||(x%10 == 1)||(x%10 == 6)||(x%10 == 8)){
        printf("pon\n");
    }
    if(x%10 == 3){
        printf("bon\n");
    }
    return 0;
}


Measured memory_bytes: 1664
using System;

namespace ITP1_6_C
{
  class Program
  {
    static void Main()
    {
      int n = int.Parse(Console.ReadLine());
      int[, ,] A = new int[4, 3, 10];
      for (int i = 0; i < n; i ++)
      {
        string[] inputs = Console.ReadLine().Split(' ');
        int b = int.Parse(inputs[0]); //0<b<=4
        int f = int.Parse(inputs[1]); //0<f<=3
        int r = int.Parse(inputs[2]); //0<r<=10
        int v = int.Parse(inputs[3]);
        //b棟f階のr番目の部屋にv人が追加で入居したことを示す。
        A[b - 1, f - 1, r - 1] += v;
      }
      for (int i = 0; i < 4; i ++)
      {
        for (int j = 0; j < 3; j ++)
        {
          for (int k = 0; k < 10; k ++)
          {
            if (A[i, j, k] == null) A[i, j, k] = 0;
            Console.Write(" {0}", A[i, j, k]);
          }
          Console.WriteLine();
        }
        string text = new String('#', 20);
        if (i != 3) Console.WriteLine(text);
      }
    }
  }
}

//フロア10部屋、3階建ての公舎４棟から入居、退居の情報を読み取り出力するプログラム



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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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; }



void func(long long N, long long M, long long Q, std::vector<long long> L, std::vector<long long> R, std::vector<long long> p, std::vector<long long> q){
    vector<vector<int> > a(N+10, vector<int>(N+10));
    for (int i = 0; i < M; ++i){
        a[L[i]][R[i]]++;
    }

    // 二次元累積和
    vector<vector<int> > s(N+1, vector<int>(N+1, 0));
    for (int i = 0; i < N; ++i)
        for (int j = 0; j < N; ++j)
            s[i+1][j+1] = s[i][j+1] + s[i+1][j] - s[i][j] + a[i][j];

    // クエリ [x1, x2) × [y1, y2) の長方形区域の和
    for (int i = 0; i < Q; ++i) {
        lli x2 = q[i]+1;
        lli y2 = q[i]+1;
        lli x1 = p[i];
        lli y1 = p[i];
        LOG4(x1,x2,y1,y2);
        cout << s[x2][y2] - s[x1][y2] - s[x2][y1] + s[x1][y1] << endl;
    }
}

int main(){
    // cout << fixed << setprecision(5);

    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    long long Q;
    scanf("%lld",&Q);
    std::vector<long long> L(M);
    std::vector<long long> R(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&L[i]);
        scanf("%lld",&R[i]);
        L[i]--,R[i]--;
    }
    std::vector<long long> p(Q);
    std::vector<long long> q(Q);
    for(int i = 0 ; i < Q ; i++){
        scanf("%lld",&p[i]);
        scanf("%lld",&q[i]);
        p[i]--,q[i]--;
    }
    func(N, M, Q, std::move(L), std::move(R), std::move(p), std::move(q));
    return 0;
}


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

int main(){
    int N;
    string S;
    cin >> N >> S;
    priority_queue<int> que;
    int A[N][N];
    for(int i = N-1; i >= 0; i--){
        int j = i+1;
        while(j < N){
            int k = 0;
            while(j+k < N && S[i+k] == S[j+k]){
                k++;
            }
            A[i][j] = k;
            if(k == 0){
                j++;
            }
            else{
                rep2(l, 1, k){
                    if(l + A[i][i+l] >= k){
                        if(j+k < N){
                            A[i][j+l] = (k-l) + A[i+(k-l)][j+k];
                        }
                        else{
                            A[i][j+l] = k-l;
                        }
                    }
                    else{
                        A[i][j+l] = A[i][i+l];
                    }
                }
                j += k;
            }
        }
    }
    rep(i, N){
        rep2(j, i+1, N){
            que.push(min(A[i][j], j-i));
        }
    }
    cout << que.top() << endl;
}

Measured memory_bytes: 165096
n = gets.to_i

s='753'

r = 0

10.times do |k|
  k = k+1
  (3**k).times do |i|
    i = i.to_s(3).rjust(k, ?0)
    t = k.times.map{|j| s[i[j].to_i]}.join
    next unless s.chars.all?{|c| t.include? c}
    r += 1 if t.to_i <= n
  end
end

puts r


Measured memory_bytes: 1788
n = int(input())
p = list(map(int, input().split()))
p.sort()
if len(p) % 2 == 1 and n % 2 == 1:
    print(0)
else:
    p = list(p)
    cnt = p[len(p)//2] - p[len(p)//2 -1]
    print(cnt)

Measured memory_bytes: 14428
/*/ Author: KaySeeKay /*/

#include<bits/stdc++.h>
using namespace std;	

/*/---------------------------Defines-----------------------------------------/*/

#pragma GCC optimize("Ofast") 
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)	
#define fn1 for( int i =1;i<=n;	i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
#define PI  3.14159265358979323846
#define MOD 1000000007
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
const int N = 2e6+5;	
const int INF = 1e18L;
//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
/*/-----------------------------Debug begins----------------------------------/*/
vector<string> split(const string& s, char c) {
    vector<string> v; stringstream ss(s); string x;
    while (getline(ss, x, c)) v.emplace_back(x); return move(v);
}
template<typename T, typename... Args>
inline string arrStr(T arr, int n) {
    stringstream s; s << "[";
    for(int i = 0; i < n - 1; i++) s << arr[i] << ",";
    s << arr[n - 1] << "]";
    return s.str();
}
#define trace(args...) {__trace_begin(__LINE__); __trace(split(#args, ',').begin(), args);}
inline void __trace_begin(int line) { cerr << "#" << line << ": "; }
template<typename T> inline void __trace_out_var(vector<T> val) { cerr << arrStr(val, val.size()); }
template<typename T> inline void __trace_out_var(T* val) { cerr << arrStr(val, 10); }
template<typename T> inline void __trace_out_var(T val) { cerr << val; }
inline void __trace(vector<string>::iterator it) { cerr << endl; }
 
template<typename T, typename... Args>
inline void __trace(vector<string>::iterator it, T a, Args... args) {
    cerr << it->substr((*it)[0] == ' ', it->length()) << "=";
    __trace_out_var(a);
    cerr << "; ";
    __trace(++it, args...);
}
/*/-----------------------------Code begins----------------------------------/*/
int ar[N];
int dp[N];

signed main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	IOS;
	int T=1;
	// cin >> T;
	while(T--){
		int d ,t ,s;
		cin >> d >> t >>s;
		cout<<(s*t>=d?"Yes\n":"No\n");
		
	
	}
	return 0;
}

Measured memory_bytes: 3628