akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string ATCG;
    int N,Q;
    int li[100000],ri[100000];

    cin >> N >> Q;
    cin >> ATCG;
    for(int i=0; i<Q; i++) cin >> li[i] >> ri[i];

    int ruiseki[100000] = {0};
    int count = 0;

    for(int i=0; i<N; i++){
        if(ATCG[i] == 'C' && ATCG[i-1] == 'A')    count++;

        ruiseki[i] = count;
    }


    for(int i=0; i<Q; i++){
        cout << ruiseki[ri[i]-1] - ruiseki[li[i]-1] << '\n';
    }

}

Measured memory_bytes: 2176
if __name__ == '__main__':
    n, a, b = map(int, input().split())
    if b < a:
        print(0)
    elif n == 1:
        if a == b:
            print(1)
        else:
            print(0)
    else:
        print((b - a) * (n - 2) + 1)


Measured memory_bytes: 38384
S=input()

first=int(S[0]+S[1])
second=int(S[2]+S[3])


if first==0 or first >12 :
  if second ==0 or second > 12:
    print("NA")
  else:
    print("YYMM")
    
elif second==0 or second >12 :
  if first==0 or first> 12:
    print("NA")
  else:
    print("MMYY")
else:

  print("AMBIGUOUS")
  

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define FOR(itr, v) for (auto itr = (v).begin(); itr != (v).end(); ++itr)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a)  (a).rbegin(),(a).rend()
#define ERASE(a)  (a).erase(unique((a).begin(), (a).end()), (a).end()); // sortしてから
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> void PrintVector(const vector<T> &vec) {for (auto val : vec) cout << val << " "; cout << endl;}
const long long INF = 1LL << 60;
const long long minusINF = -(1LL << 40);
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    int n; cin >> n;
    map<string, int> ma;
    rep(i, n)
    {
        string s; cin >> s;
        ma[s]++;
    }

    cout << "AC x " << ma["AC"] << endl;
    cout << "WA x " << ma["WA"] << endl;
    cout << "TLE x " << ma["TLE"] << endl;
    cout << "RE x " << ma["RE"] << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>


/* 
*    coder :: ATUL_PANDEY_2608
*        >>> INDIA <<<
*/
using namespace std;
using namespace __gnu_pbds;

// #define  part ..
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end() 
#define mod 1000000007
//#define maxx 200006
#define ll long long 
#define quick    ios_base::sync_with_stdio(NULL),cin.tie(0);
#define listll vector< long long > 
#define listi vector< int> 
#define pii   pair<int , int> 
#define pll pair<long long , long long > 
#define minheap priority_queue<long long , vector< long long >, greater<long long > >
#define rep(i,a,b) for(int i=a;i<b;i++)
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}


template < class T > using oset = tree< T , null_type, less  < T  > , rb_tree_tag , tree_order_statistics_node_update > ;


// end of #define 

// define globals ...
const int maxx = 2e5+26;

//write function from here ...







int Main(){


 ll n,k;
 cin>>n>>k;
 ll ans  =0 ;
 
 for( int i =0 ; i < n;i++){
	 
	 ll a;
	 cin>>a;
	 if( a>= k )
	 ans++;
 }
 cout<<ans<<endl;


return 0;

}






int main(){
 quick;
int t =1; 
//cin>>t;
while(t-- )
 Main();

 return 0;


}


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

char board[11][1010];
signed main() {
    int h,w,K;
    cin >> h >> w >> K;
    rep(i,h) rep(j,w) cin >> board[i][j];

    int ans = 1e9;
    for(int bit = 0; bit < (1 << (h - 1)); bit++) {
        int sum = 0;

        vector<int> div;
        for (int i = 0; i < (h - 1); i++) {
            if ((bit >> i) & 1) {
                div.push_back(i);
            }
        }

        int sec = div.size();
        sum += sec;
        vector<int> tot(sec + 1);

        bool possible = true;
        for (int j = 0; j < w; j++) {
            bool flag = false;
            int res = 0;
            int cur = 0;
            for (int i = 0; i <= sec; i++) {
                res = 0;
                int next;
                if(i == sec or sec == 0) next = h - 1;
                else next = div[i];
                for (int k = cur; k <= next; k++) {
                    res += ((board[k][j] == '1') ? 1 : 0);
                }
                tot[i] += res;
                cur = next + 1;
                if(tot[i] > K) {
                    sum++;
                    flag = true;
                    break;
                }
            }

            if(flag){
                res = 0;
                cur = 0;
                for (int i = 0; i <= sec; i++) {
                    res = 0;
                    int next;
                    if(i == sec or sec == 0) next = h - 1;
                    else next = div[i];
                    for (int k = cur; k <= next; k++) {
                        res += ((board[k][j] == '1') ? 1 : 0);
                    }
                    tot[i] = res;
                    cur = next + 1;
                    if(tot[i] > K) {
                        possible = false;
                        break;
                    }
                }
            }
            if(!possible) break;
        }
        if(possible) ans = min(ans,sum);
    }
    cout << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <queue>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

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

struct edge {
	int from,to;
	int cost;

	edge(int t,int c) : to(t),cost(c) {}
	edge(int f,int t,int c) : from(f),to(t),cost(c) {}

	bool operator<(const edge &e) const {
		return cost < e.cost;
	}
};

vector<edge> G[100005];
int d[100005];

void dijkstra(int s,int n) {
	priority_queue<P,vector<P>,greater<P> > que;
	fill(d,d+n,INF);

	d[s] = 0;
	que.push(P(0,s));

	while(que.size()) {
		P p = que.top();
		que.pop();

		int v = p.second;
		if(d[v] < p.first) continue;

		rep(i,G[v].size()) {
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to],e.to));
			}
		}
	}
}

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

	rep(i, m) {
		int s, t, c;
		cin >> s >> t >> c;
		G[s].push_back(edge(t, c));
	}

	dijkstra(r, n);

	rep(i, n) {
		if(d[i] == INF) cout << "INF" << endl;
		else cout << d[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 13700
N, K = map(int,input().split())
V = list(map(int,input().split()))
ans = 0
for l in range(K+1):
  for r in range(K-l+1):
    if l + r > N:
      continue
    d = K - l - r
    now = 0
    S = []
    for i in range(l):
      now += V[i]
      S.append(V[i])
    for i in range(N-r,N):
      now += V[i]
      S.append(V[i])
    S = sorted(S)
    #print(l,r,S,now)
    for i in range(d):
      if i > len(S)-1:
        break
      if S[i] > 0:
        break
      now -= S[i]
    ans = max(ans,now)
print(ans)
      

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

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

  int n;
  while (cin >> n) {
    vector<int> a(n);
    each (i, a) cin >> i;

    map<int, int> cnt;

    auto fn =
      [&] () {
        bool f = true;
        for (int i = 0; i < 32; ++i) {
          f = f && (cnt[i] <= 1);
        }
        return f;
      };

    auto include =
      [&] (int n) {
        for (int i = 0; i < 32; ++i) {
          if (n & (1 << i)) {
            ++cnt[i];
          }
        }
        return ;
      };

    auto exclude =
      [&] (int n) {
        for (int i = 0; i < 32; ++i) {
          if (n & (1 << i)) {
            --cnt[i];
          }
        }
        return ;
      };

    int begin = 0;
    int end = 0;

    lli sum = 0;
    while (begin <= end) {
      while (end < n && fn()) {
        include(a[end]);
        ++end;
        if (!fn()) {
          --end;
          exclude(a[end]);
          break;
        }
      }

      // cout << ">> " << make_pair(begin, end) << ' ' << fn() << ' ' << end - begin << endl;
      sum += (end - begin) * fn();

      exclude(a[begin]);
      ++begin;
    }

    cout << sum << endl;
  }

  return 0;
}


Measured memory_bytes: 1024
/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <utility>
#include <stack>
#include <bitset>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    if(n==2){
        cout<<1<<endl;
        return 0;
    }
    set<ll> st;
    rep3(i,1,sqrt(n)+1){
        if((n-1)%i==0){
            st.insert(i);
            st.insert((n-1)/i);
        }
        if(n%i==0){
            if(i==1)continue;
            ll temp=n;
           // cout<<i<<endl;
            while(temp%i==0){
                temp/=i;
               // cout<<" "<<temp<<endl;
            }
            if(temp%i==1){
                st.insert(i);
            }
        }
    }
  /*  for(auto itr = st.begin(); itr != st.end(); ++itr) {
        std::cout << *itr << "\n";      // イテレータの指す先のデータを表示
    }*/
    cout<<st.size()<<endl;
    
}


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

int main()
{
	int n;
	cin>>n;
	int m,c;
	cin>>m>>c;
	int t=0;
	int a[m],b[m];
	for(int i=0;i<m;i++)
	{
		cin>>b[i];
	}
	int d=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			cin>>a[j];
			d+=a[j]*b[j];
		}
		if(d+c>0)
		{
			t++;
		}
		d=0;
	 } 
	 cout<<t<<endl;
	return 0;
}

Measured memory_bytes: 256
while True:
    n = int(input())
    if n == 0: break

    data = {}
    staff = []
    for i in range(n):
        tmp = list(map(int, input().split(' ')))
        if tmp[0] in data:
            data[tmp[0]] += tmp[1] * tmp[2]
        else:
            data[tmp[0]] = tmp[1] * tmp[2]
            staff.append(tmp[0])

    if max(data.values()) < 1000000:
        print('NA')
    else:
        for k in staff:
            if data[k] >= 1000000:
                print(k)

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

using namespace std;

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

//#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
  #define db(x) cerr << #x << " == " << x << endl
  #define dbs(x) cerr << x << endl
  #define _ << ", " <<
#else
  #define db(x) ((void)0)
  #define dbs(x) ((void)0)
#endif

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f
#define cl(x, v) memset((x), (v), sizeof(x))
#define all(x) x.begin(),x.end()
#define sz(x) int(x.size())
#define MOD 1000000007LL
#define endl '\n'
#define mdc(a, b) (__gcd((a), (b)))
#define mmc(a, b) (( (a)/__gcd((a), (b)) )*(b))

double memo[310][310][310];
bool calc[310][310][310];
char mat[1010][1010];
int n, m;

double dp(int i, int j, int k){
	if( (i<0) or (j<0) or (k<0) )
		return 0;
		
	if( (i == 0) and (j==0) and (k==0))
		return 0;
	if(calc[i][j][k])
		return memo[i][j][k];
	
	calc[i][j][k] = true;
	
	return memo[i][j][k] = (i*(dp(i-1, j, k) + 1) + j*(dp(i+1, j-1, k) + 1) + k*(dp(i, j+1, k-1) + 1) + n - i - j - k)/double(i+j+k);
}

int main() {
	memset(mat, '#', sizeof(mat));
	memset(memo, -1, sizeof(memo));
	
	cin.sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	int a=0, b=0, c=0;
	for(int i=1; i<=n; i++){
		int x;
		cin >> x;
		if(x == 1)
			a++;
		if(x == 2)
			b++;
		if(x == 3)
			c++;		
	}
	
	cout << setprecision(12) << fixed << dp(a, b, c) << endl;

	return 0;	
}


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

using namespace std;

int main()
{
  vector<int> n(3);

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

  sort(n.begin(), n.end());

  cout << (n[2] == n[0] + n[1] ? "Yes" : "No");
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    double x[100], y[100], p[4]={0};
    scanf("%d", &n);
    for (int i=0; i<n; i++) scanf("%lf", &x[i]);
    for (int i=0; i<n; i++) scanf("%lf", &y[i]);
    for (int i=0; i<n; i++)
    {
        p[0]+=abs(x[i]-y[i]);
        p[1]+=pow(abs(x[i]-y[i]), 2);
        p[2]+=pow(abs(x[i]-y[i]), 3);
        p[3]=max(p[3], abs(x[i]-y[i]));
    }
    printf("%.10f\n%.10f\n%.10f\n%.10f\n", p[0], sqrt(p[1]), cbrt(p[2]), p[3]);
    return 0;
}



Measured memory_bytes: 3008
N = int(input())
A = [a - 1 for a in map(int, input().split())]
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
prev = 100000
for a in A:
    if prev + 1 == a:
        ans += B[a] + C[a - 1]
    else:
        ans += B[a]

    prev = a

print(ans)


Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  int n; cin >> n;
  vector<int> a(n + 1, 0);
  REP(i, n) {
    int ai; cin >> ai;
    ++a[ai];
  }
  sort(ALL(a));
  vector<int> sum(a);
  FOR(i, 1, n + 1) sum[i] += sum[i - 1];
  FOR(t, 1, n + 1) {
    int lb = 0, ub = n / t + 1;
    while (ub - lb > 1) {
      long long mid = (lb + ub) / 2;
      int idx = lower_bound(ALL(a), mid) - a.begin();
      long long tmp = (idx - 1 >= 0 ? sum[idx - 1] : 0) + mid * (n + 1 - idx);
      (tmp >= mid * t ? lb : ub) = mid;
    }
    cout << lb << '\n';
  }
  return 0;
}


Measured memory_bytes: 3200
#include<iostream>
using namespace std;
#include<string>
#include<stdio.h>

#define A 1995455101 // large prime number.
#define B 1995455447 // large prime number, bigger than A.

int main()
{
	char T[1000000]; scanf("%s", T); int len_T = 0; while(T[len_T]){ len_T++; };
	char P[10000];   scanf("%s", P); int len_P = 0; while(P[len_P]){ len_P++; };
    long long *has_T, *has_P;
    has_T = new long long [len_T];
    has_P = new long long [len_P];

    long long h = 0; int i;  // hash coding.
    // has_T[i] = (T[0]A^{i-1} + T[1]A^{i-2} + ... + T[i-1]A + T[i]) % B.
    for(i = 0; i < len_T; i++){ h = (h * A + T[i]) % B; has_T[i] = h; }
    h = 0;
    // has_P[i] = (P[0]A^{i-1} + P[1]A^{i-2} + ... + P[i-1]A + P[i]) % B.
    for(i = 0; i < len_P; i++){ h = (h * A + P[i]) % B; has_P[i] = h; }

    // last_has = (P[0]A^{len_P-1} + P[1]A^{len_P-2} + ... + P[len_P-1]) % B.
    long long last_has = has_P[len_P - 1];
    // A^{len_P} Mod B.
    long long power, x, y, z;
    x = A, y = len_P, z = 1;
    for( ; y; y /= 2){
        if((y & 1) != 0){ z = (z * x) % B; }
        x = (x * x) % B;
    }
    power = z;

    for(i = len_P - 1; i < len_T; i++){
        if(has_T[i] == ((i >= len_P ? has_T[i - len_P] : 0) * power + last_has) % B){
			printf("%d\n", i - len_P + 1);
        }
    }
    delete [] has_T; delete [] has_P;

    return 0;
}

Measured memory_bytes: 9840
import java.util.ArrayList;
import java.util.Scanner;
import java.util.stream.Stream;


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

        int diff = b - a;

        int ans = kaijou(diff);

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

    public static int kaijou(int n){
        if(n == 1){
            return 1;
        }
        return n + kaijou(n-1);
    }
}


Measured memory_bytes: 21972
// (c) 2020, redotter

// Roses are red
// The Tardis is blue
// The Doctor once said
// Rose Tyler...

#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#pragma comment(linker, "/stack:500000000")
#endif

#define pb push_back
#define the(a) (a).begin(), (a).end()
#define ft first
#define sd second
#define endl "\n"
#define forn(i, n) for (int i = 0; i < (n); i++)
#define forr(i, s, n) for (int i = (s); i < (n); i++)

using i64 = long long;
using i32 = int;
using f64 = long double;

template <class T> using vec = vector<T>;
using str = string; using p64 = pair<i64, i64>;
using v64 = vec<i64>; using vv64 = vec<v64>;
using s64 = set<i64>; using m64 = map<i64, i64>;
template <size_t Size1> using a64 = array<i64, Size1>;
template <size_t Size1, size_t Size2> using aa64 = array<a64<Size2>, Size1>;
template <class T> using hash_set = unordered_set<T>;
template <class T, class U> using hash_map = unordered_map<T, U>;

mt19937 gen(998244353);
const i64 inf = numeric_limits<i64>::max() / 2;

template <class T> inline i64 len(const T& a) { return (i64)(a.size()); }
inline void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
template <class T, class S>
inline bool check_min(T& a, S b) { if (a > b) return a = b, 1; return 0; }
template <class T, class S>
inline bool check_max(T& a, S b) { if (a < b) return a = b, 1; return 0; }

void read() {}
template<class T, class ...U>
void read(T& a, U& ...b) { cin >> a; read(b...); }
void print() {}
template<class T, class ...U>
void print(const T& a, const U& ...b) { cout << a << " "; print(b...); }
void println() { cout << "\n"; }
template<class T, class ...U>
void println(const T& a, const U& ...b) { cout << a << " "; println(b...); }

struct Problem {
	void files(str in, str out) {
#ifdef ONLINE_JUDGE
		freopen(in.c_str(), "r", stdin), freopen(out.c_str(), "w", stdout);
#endif
	}
	void solve(), input();
	void many() { i32 t; cin >> t; while (t--) input(), solve(); }
	void make(bool mt = 0) { if (mt) many(); else input(), solve(); }
} problem;

signed main() {
	fast();
	problem.make();
#ifdef _DEBUG
	println(); println("[finished]"); system("pause > nul");
#endif
	return 0;
}

const i64 R = 1e9 + 7;

i64 n, m;
vv64 a;

void Problem::solve() {
	vv64 dp(n + 1, v64(m + 1, 0));
	dp[0][0] = 1;
	forn(i, n) {
		forn(j, m) {
			if (!a[i][j]) continue;
			dp[i + 1][j] += dp[i][j];
			dp[i + 1][j] %= R;
			dp[i][j + 1] += dp[i][j];
			dp[i][j + 1] %= R;
		}
	}
	i64 ans = dp[n - 1][m - 1];
	println(ans);
}

void Problem::input() {
	read(n, m);
	a.resize(n, v64(m, 0));
	forn(i, n) {
		forn(j, m) {
			char c;
			read(c);
			a[i][j] = c == '.';
		}
	}
}


Measured memory_bytes: 18996
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
for(ll i=0;i<5;i++) {
ll x;
  cin>>x;
  if(x==0) {
cout<<i+1<<endl;
return 0;
  }
}
}

Measured memory_bytes: 3560
#include"bits/stdc++.h"

void Main() {
  int n, k;
  std::cin >> n >> k;

  std::string s;
  std::cin >> s;

  int score = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == s[i + 1]) score++;
  }

  if (score + 2 * k < n - 1) {
    std::cout << score + 2 * k << std::endl;
  } else {
    std::cout << n - 1 << std::endl;
  }
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main() {
    int n;
    int a[2*100000+1];
    int b[2*100000+1]={0};
    int i;
    scanf("%d", &n);
    for (i=2;i<n+1;i++) {
        scanf("%d", &a[i]);
        b[a[i]]++;
    }
    for (i=1;i<n+1;i++) printf("%d\n", b[i]);
    return 0;
}

Measured memory_bytes: 3256
// ref. https://img.atcoder.jp/agc043/editorial.pdf
// ref. https://atcoder.jp/contests/agc043/submissions/11047912

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <time.h>       /* time */

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  string s;
  cin >> s;
  vector<ll> a(n);
  bool has1 = false;
  rep(i, n) {
    a[i] = (s[i] - '0') - 1;
    if (a[i] == 1) { has1 = true; }
  }
  if (!has1) {
    rep(i, n) {
      // 0 => 0, 2 => 1
      a[i] /= 2;
    }
  }
  // Here, calculate the answer of [0, 1, ..., 0]
  int ans = 0;
  rep(i, n) {
    // We want to known the contribution of (n-1)C(i) using Lucas's theorem.
    // The bit representatio of n-1 must have all bits in i. (n-1)C(i) mod 2 == 1 if ((n-1)&i) == i, else 0.
    if (((n-1)&i) != i) { continue; }
    ans ^= a[i]%2;
  }

  if (!has1) { // Here, ans is ans is answer is odd
    ans *= 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 9244
#include<iostream>
#define MAX 3000000
using namespace std;
int msNum[MAX];
int prime[MAX];
bool is_prime[MAX+1];

int sieve(int n){
  int p=0;
  for(int i=0;i<=n;i++)is_prime[msNum[i]]=true;
  is_prime[msNum[0]]=is_prime[msNum[1]]=false;
  for(int i=2;i<=n;i++){
    if(is_prime[msNum[i]]==true){
      prime[p++]=msNum[i];
      //cout<<msNum[i]<<endl;
      for(int j=2*msNum[i];j<=n;j+=msNum[i])is_prime[j]=false;
    }
  }
  return p;
}

int main(){
  int n,p,i=0;
  while(msNum[2*i]<MAX){
    msNum[2*i+1]=7*i+1;
    msNum[2*i+2]=7*i+6;
    i++;
  }
  while(cin>>n){
    if(n==1)break;
    p=sieve(n);
    cout<<n<<":";
    for(int i=0;i<p;i++){
      if(n%prime[i]==0){
	while(n%prime[i]!=0)n%=prime[i];
	cout<<" "<<prime[i];
      }
    }
    cout<<endl;
  }
  return 0;
}

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

int main()
{
	int N;
	cin >> N;

	int count = 0;
	if (N < 10)
	{
		count = N % 10;
	}
	else if (N < 100)
	{
		count = 9;
	}
	else if (N < 1000)
	{
		count = 9;
		count += N - 99;
	}
	else if (N < 10000)
	{
		count = 9;
		count += 999 - 99;
	}
	else if (N < 100000)
	{
		count = 9;
		count += 999 - 99;
		count += N - 9999;
	}
	else
	{
		count = 9;
		count += 999 - 99;
		count += 99999 - 9999;
	}

	cout << count << endl;
	return 0;
}


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

#define rep(i,n)  for(int i=0;i<n;++i)
#define sc1(a)  scanf("%d",&a)
#define sc2(a,b)  scanf("%d %d",&a,&b)
#define sc3(a,b,c)  scanf("%d %d %d",&a,&b,&c)

int main(){
    int n,cnt=0;
    int d[8][2];
    double ans=0.0;
    sc1(n);
    vector <int>  p(n);
    rep(i,n) p[i]=i;
    rep(i,n) sc2(d[i][0],d[i][1]);
    do {
        //printf("%d %d %d\n",p[0],p[1],p[2]);
        cnt++;
        rep(i,n-1) ans+=pow(pow(d[p[i+1]][0]-d[p[i]][0],2)+pow(d[p[i+1]][1]-d[p[i]][1],2),0.5);
    } while (next_permutation(p.begin(),p.end()));

    printf("%.15lf\n",ans/(cnt*1.0));
    return 0;
}


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

using namespace std;

int main(void)
{
    int N;
    cin >> N;
    string S;
    int MARCH[5] = {0};

    for (int i = 0; i < N; i++) {
        cin >> S;
        switch(S[0]) {
            case 'M':
                MARCH[0]++;
                break;
            case 'A':
                MARCH[1]++;
                break;
            case 'R':
                MARCH[2]++;
                break;
            case 'C':
                MARCH[3]++;
                break;
            case 'H':
                MARCH[4]++;
                break;
        }
    }

    long count = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                // cout << i << j << k << endl;
                count += MARCH[i] * MARCH[j] * MARCH[k];
            }
        }
    }
    
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932
int main(){
    long double a,b,h,m;
    cin>>a>>b>>h>>m;
    long double angle=((11*m)/2)-(30*h);
    long double ans=sqrt((a*a)+(b*b)-(2*a*b*cos(angle*PI/180)));
    cout<<fixed<<setprecision(10)<<ans<<endl;
    
}

Measured memory_bytes: 4168
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        while (x != 0) {
            if (x % 10 == 7) {
                System.out.println("Yes");
                return;
            }
            x /= 10;
        }
        System.out.println("No");
    }

}


Measured memory_bytes: 26992
import math
import numpy as np
from fractions import gcd
import fractions
import statistics
import collections
from functools import reduce
import itertools
from collections import defaultdict
import bisect
from fractions import Fraction
 
n = int(input())
l = [list(map(int, input().split())) for i in range(0, n) ]
 
for i in range(0, n):
    if l[i][2] != 0:
        p = l[i]
        break
 
for x in range(0, 101):
    for y in range(0, 101):
        h = p[2] + abs(x-p[0]) + abs(y-p[1])
        for i in range(0, n):
            if l[i][2] != max(h - abs(x-l[i][0]) - abs(y-l[i][1]), 0):
                break
        else:
            print(x, y, h)
            exit()

Measured memory_bytes: 22204
import java.util.HashMap;
import java.util.Scanner;
public class Main {
	public static void main(String[] args)throws Exception{
		Scanner stdIn=new Scanner(System.in);
		int X=stdIn.nextInt();
		int Y=stdIn.nextInt();
		int Z=stdIn.nextInt();
		System.out.println(Z);
		System.out.println(X);
		System.out.println(Y);
	}
}


Measured memory_bytes: 22100
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String T = sc.next();
    int count = 0;
    for(int i=0;i<S.length();i++){
      if(S.charAt(i)!=T.charAt(i)){
        count++;
      }
    }
    System.out.print(count);
  }
}

Measured memory_bytes: 41208
#include <stdio.h>

int main()
{
	int i, t, s, f, n, a;

	scanf("%d", &t);
	
	while (t > 0) {
		a = 0;
					
		scanf("%d", &n);
		for (i = 0; i < n; i++) {
			scanf("%d %d", &s, &f);
			a += (f - s);
		}
					
		if (a < t)
			printf("%d\n", t - a);
		else
			printf("OK\n");
					
		scanf("%d", &t);
	}

	return 0;
}

Measured memory_bytes: 612
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<vector<pair<int, int>>> rest(n + 1);
    for (int i = 0; i < m; ++i) {
        int l, r, x;
        cin >> l >> r >> x;
        rest[r].emplace_back(l, x);
    }
    vector<vector<vector<lint>>> dp(n + 1, vector<vector<lint>>(n + 1, vector<lint>(n + 1, 0)));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            for (int k = 0; k < n; ++k) {
                int z = max({i, j, k}) + 1;
                // r
                bool rok = true;
                for (auto &p : rest[z]) {
                    int l = p.first;
                    int x = p.second;
                    int y = 1;
                    if (j >= l)
                        y++;
                    if (k >= l)
                        y++;
                    if (x != y)
                        rok = false;
                }
                if (rok)
                    (dp[z][j][k] += dp[i][j][k]) %= mod;
                // g
                bool gok = true;
                for (auto &p : rest[z]) {
                    int l = p.first;
                    int x = p.second;
                    int y = 1;
                    if (k >= l)
                        y++;
                    if (i >= l)
                        y++;
                    if (x != y)
                        gok = false;
                }
                if (gok)
                    (dp[i][z][k] += dp[i][j][k]) %= mod;
                // b
                bool bok = true;
                for (auto &p : rest[z]) {
                    int l = p.first;
                    int x = p.second;
                    int y = 1;
                    if (i >= l)
                        y++;
                    if (j >= l)
                        y++;
                    if (x != y)
                        bok = false;
                }
                if (bok)
                    (dp[i][j][z] += dp[i][j][k]) %= mod;
            }
        }
    }
    lint ret = 0;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= n; ++j) {
            ret += dp[n][i][j];
            ret %= mod;
            ret += dp[i][n][j];
            ret %= mod;
            ret += dp[i][j][n];
            ret %= mod;
        }
    }
    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 218880
// AOJ 1379 Parallel Lines
// 2018.3.9 bal4u

#include <stdio.h>

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = 10*n + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

#define BASE 2000
#define SFT  12		// 2^12 = 4096
int slope[16][16];
int x[16], y[16];
int dp[1<<16];

int main()
{
	int m, i, j, lim, s, a, b, f;
	int dx, dy;

	m = in(), lim = 1 << m;
	for (i = 0; i < m; i++) x[i] = in(), y[i] = in();

	for (i = 0; i < m; i++) for (j = i+1; j < m; j++) {
		dx = x[i] - x[j], dy = y[i] - y[j];
		if (dx < 0) dx = -dx, dy = -dy;
		if (!dx) dy = 1;
		else if (!dy) dx = 1;
		else {
			a = gcd(dx, dy); if (a < 0) a = -a;
			if (a > 1) dx /= a, dy /= a;
		}
		slope[i][j] = ((dx+BASE) << SFT) | (dy+BASE);
	}

	for (s = 0; s < lim; s++) {
		for (i = 0; i < m; i++) if ((1 << i) & s) {
			for (j = i+1; j < m; j++) if ((1 << j) & s) {
				f = 0;
				for (a = 0; a < m; a++) if ((1 << a) & s) {
					for (b = a+1; b < m; b++) if ((1 << b) & s) {
						if (slope[i][j] == slope[a][b]) f++;
					}
				}
				f = (f*(f-1)) >> 1;
				if (dp[s] < f) dp[s] = f;
			}
		}
	}

	for (s = 0; s < lim; s++) for (i = s; i; i = i-1 & s) {
		if (dp[s] < (f = dp[i]+dp[i^s])) dp[s] = f;
	}
	printf("%d\n", dp[lim-1]);
	return 0;
}



Measured memory_bytes: 2108
/* 
chirag11032000
Chirag Thakur
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;

template < typename T > using OrderedSet = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1) {
	cerr << name << " : " << arg1 << std :: endl;
}
template < typename Arg1, typename... Args >
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

const db PI = acos(-1);
const ll LINF = LLONG_MAX;
const int INF = INT_MAX, MOD = 1e9 + 7, N = 1e5 + 10;

void testCase();

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	testCase();
	cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
	return 0;
}

void testCase() {
	int m, k;
	cin >> m >> k;
	if (m == 1) {
		if (k == 0) {
			for (int i = 0; i < (1 << m); ++i) {
				cout << i << " " << i << " ";
			}
			cout << "\n";
		} else {
			cout << "-1\n";
		}
	} else if (k >= (1 << m)) {
		cout << "-1\n";
	} else {
		vector < int > o;
		for (int i = 0; i < (1 << m); ++i) {
			if (i != k) {
				o.eb(i);
			}
		}
		for (auto &el: o) {
			cout << el << " ";
		}
		cout << k << " ";
		reverse(all(o));
		for (auto &el: o) {
			cout << el << " ";
		}
		cout << k << "\n";
	}
}

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

const int MOD = (int)1e9+7;

void dfs(vector<int> &l,int N,vector<int> &ABC,int now,int a,int b,int c,int cost,int &ans){
	if(now>=N){
		if(a!=0 && b!=0 && c!=0)  ans=min(ans,cost+abs(ABC.at(0)-a)+abs(ABC.at(1)-b)+abs(ABC.at(2)-c));
		return;
	}
	dfs(l,N,ABC,now+1,a,b,c,cost,ans);
	dfs(l,N,ABC,now+1,a+l.at(now),b,c,cost+10*(a>0),ans);
	dfs(l,N,ABC,now+1,a,b+l.at(now),c,cost+10*(b>0),ans);
	dfs(l,N,ABC,now+1,a,b,c+l.at(now),cost+10*(c>0),ans);
}

int main(){
  int N;
  cin >> N;
  vector<int> ABC(3);
  for(int i=0;i<3;i++)  cin >> ABC.at(i);
  vector<int> l(N);
  for(int i=0;i<N;i++)  cin >> l.at(i);

  int ans=1e9;
  dfs(l,N,ABC,0,0,0,0,0,ans);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<long long int, long long int> P;
P dp[3000][3000][3];
int n;
int a[3000];

P dfs(int l, int r, int t)
{
    if (dp[l][r][t + 1] != P(-1, -1))
    {
        return dp[l][r][t + 1];
    }
    P pl = dfs(l + 1, r, -t);
    P pr = dfs(l, r + 1, -t);
    if (t == 1)
    {
        if (pl.first - pl.second + a[l] < pr.first - pr.second + a[n - r - 1])
        {
            pr.first += a[n - r - 1];
            dp[l][r][t + 1] = pr;
            return pr;
        }
        else
        {
            pl.first += a[l];
            dp[l][r][t + 1] = pl;
            return pl;
        }
    }
    else
    {
        if (pl.first - pl.second - a[l] < pr.first - pr.second - a[n - r - 1])
        {
            pl.second += a[l];
            dp[l][r][t + 1] = pl;
            return pl;
        }
        else
        {
            pr.second += a[n - r - 1];
            dp[l][r][t + 1] = pr;
            return pr;
        }
    }
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            dp[i][j][2] = P(-1, -1);
            dp[i][j][0] = P(-1, -1);
        }
    }
    for (int i = 0; i < n; i++)
    {
        dp[i][n - i - 1][2] = P(a[i], 0);
        dp[i][n - i - 1][0] = P(0, a[i]);
    }
    P p = dfs(0, 0, 1);
    cout << p.first - p.second << endl;
}

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

int main(){
  long long N; cin >> N;
  long long d;
  for(int i=1; i<=sqrt(N)+0.01; i++){
    if(N%i==0){
      d=i;
    }
  }
  cout << d+N/d-2 << endl;
}

Measured memory_bytes: 256
# Generated by AtcoderGreedy on 2018-05-20
# AGC024 B
# Your code here

N = gets.chomp.to_i

arr = []
N.times do
  arr << gets.chomp.to_i
end

h = {}
arr.each do |n|
  if h.key?(n - 1)
    s = h.delete(n - 1)
    h[n] = s + 1
  else
    h[n] = 1
  end
end

puts(arr.size - h.values.max)


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
const int MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) for (auto i = mp.begin(); i != mp.end(); ++i) { cout << i->first <<":"<<i->second << endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string l;
    cin>>l;
    ll n = (l.length());

    ll dp1[100005];
    ll dp2[100005];
    dp1[0]=1;
    dp2[0]=0;

    rep(i,n){
       // dbg(i);
        if(l[i]==*"1"){
            dp1[i+1]=2*dp1[i];
            dp2[i+1]=dp1[i]+3*dp2[i];
//            dbg(dp1[i+1]);
//            dbg(dp2[i+1]);
            dp1[i+1]%=MOD;
            dp2[i+1]%=MOD;
        }else{
            dp1[i+1]=dp1[i];
            dp2[i+1]=dp2[i]*3;
//            dbg(dp1[i+1]);
//            dbg(dp2[i+1]);
            dp1[i+1]%=MOD;
            dp2[i+1]%=MOD;
        }
    }
    ll ans= dp1[n]+dp2[n];
    ans %= MOD;
    cout<<ans<<endl;
    return  0;
}


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

using namespace std;

int main(){
  string s,t;
  cin>>s>>t;
  int count=0;
  for(int i=0;i<s.length();i++){
    if(s[i]!=t[i])
      count++;
  }
  cout<<count;
}

Measured memory_bytes: 3876
/**
 *    author : HikaruEgashira
 *    created: 08.29.2020 21:00:00
**/
use proconio::input;

#[proconio::fastout]
fn main() {
    input! {
        d: i32,
        t: i32,
        s: i32,
    }

    println!("{}", if d <= t * s { "Yes" } else { "No" });
}


Measured memory_bytes: 2148
# TLE

n = int(input())
s = input()

count = 0
for a in range(10):
    for b in range(10):
        for c in range(10):
            f1 = False
            f2 = False
            p1 = 0
            p2 = 0
            for i in range(0, n-2):
                if int(s[i]) == a:
                    f1 = True
                    p1 = i
                    break
            if f1:
                for j in range(p1+1, n-1):
                    if int(s[j]) == b:
                        f2 = True
                        p2 = j
                        break
            if f2:
                for k in range(p2+1, n):
                    if int(s[k]) == c:
                        count += 1
                        break
            if not f1 or not f2:
                break
print(count)


Measured memory_bytes: 45276
#include<bits/stdc++.h>
 
#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;
 
const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9+7;





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

    int k,s;
    cin >> k >> s;
    int ans = 0;
    rep(i,k+1){
        rep(j,k+1){
            if(s-i-j <= k && s-i-j >= 0){
                ans++;
            }
        }
    }
    cout << ans << endl;


    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#define ll				long long
#define MOD				1000000007

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct data {
	int n;
	char s[16];
	int p;
} data;

data datas[100];
int dcnt;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outd(double d) {
	char s[128];
	sprintf(s, "%.10lf\n", d);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

// ソート - 昇順
int sortfnc(const void *v1, const void *v2) {
	data *d1 = (data *)v1;
	data *d2 = (data *)v2;

	int ret = strcmp(d1->s, d2->s);
	if (ret != 0) {
		return ret;
	}

	if (d1->p > d2->p) {
		return -1;
	}
	else if (d1->p < d2->p) {
		return 1;
	}

	return 0;
}

int fnc() {

	dcnt = geti();
	for (int i = 0; i < dcnt; i++) {
		datas[i].n = i + 1;
		getstr(datas[i].s);
		datas[i].p = geti();
	}

	qsort(datas, dcnt, sizeof(data), sortfnc);

	for (int i = 0; i < dcnt; i++) {
		outi(datas[i].n);
	}

	return 0;
}

int main() {

#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define hii cout << "hii" << endl
#define int long long
#define endl '\n'
#define all(s) s.begin(), s.end()
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE

const int N = 5e5 + 5;
const int MAX = 250000 + 5;
const int M = 5e6 + 5;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int INF = 1e15;
const int LG = 21;

int arr[N];
int brr[N];

void solve()
{
	int n, x, t;
	cin >> n >> x >> t;
	cout << ((n + x - 1) / x )* t << endl;
}
 
int32_t main() 
{	
	ios_base:: sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	    int t = 1;
	    // cin >> t;
	while(t--)solve();
	return 0;
}

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;

    char c = s.front();
    int score = 0;
    for(int i=0; i<n-1; i++)
    {
        if(s.at(i) == s.at(i+1)) score++;
    }
    int ans = min(score + 2*k, n-1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int k;
int main(){
	scanf("%d", &k);
	for(;;k++){
		bool pri = true;
		for(int i=2; i*i<=k; i++) if(k%i == 0) pri = false;
		if(pri) break;
	}
	printf("%d\n", k);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int A,B,C;
	cin>>A>>B>>C;
	if(A==5&&B==5&&C==7){
		cout<<"YES"<<endl;
		}else if(A==5&&B==7&&C==5){
			cout<<"YES"<<endl;
			}else if(A==7&&B==5&&C==5){
				cout<<"YES"<<endl;
				}else{
					cout<<"NO"<<endl;
}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 100000000;
typedef double D;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1};
using namespace std;
//typedef pair<int, int> P;

/** Problem0543 : Receipt **/
int main()
{
	int sum;
	while (cin>>sum, sum) {
		int tmp=0;
		rep(i, 9) {
			int t; cin>>t;
			tmp += t;
		}
		cout << sum-tmp << endl;
	}
}

Measured memory_bytes: 1160