akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    ll d,g;
    cin >> d >> g;
    vector<ll>c(d),p(d),all_solved(d);
    ll score,answer=INT_FAST64_MAX,tmp;
    int solve;
    REP(i,d){
        cin >> p[i] >> c[i];
    }
    for(int bit = 0;bit < (1<<d);bit++){
        score = 0;
        tmp = 0;
        REP(i,d)all_solved[i] = 0;
        for(int i = 0;i < d;i++){
            if(bit & (1<<i)){
                all_solved[i] = 1;
                score+=100*(i+1)*p[i]+c[i];
                tmp += p[i];
            }
        }
        FORR(i,d-1,0){
            if(!all_solved[i]){
                solve = i;
                break;
            }
        }
        int count = 0;
        
        while(score < g){
            score+=100*(solve+1);
            tmp++;
            count++;
            if(count >= p[solve]){
                tmp = INT_FAST64_MAX;
                break;
            }
        }
        //cout << tmp << " " << solve << endl;
        answer = min(answer,tmp);
    }
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,k,a[200010]={};
	cin>>n>>k;
	for(ll i=0;i<n;i++){
		cin>>a[i];
	}
	for(ll i=0;i<k;i++){
		bool ch=true;
		ll p[200010]={};
		ll m[200010]={};
		for(ll i=0;i<n;i++){
			ll now=a[i];
			ll l=max(ll(0),i-now);
			ll r=min(n-1,i+now);
			p[l]++;
			m[r]++;
		}
		ll now=0;
		for(ll i=0;i<n;i++){
			now+=p[i];
			a[i]=now;
			now-=m[i];
			if(a[i]!=n){
				ch=false;
			}
		}
		if(ch){
			for(ll i=0;i<n;i++){
				cout << a[i]<<" ";
			}
			return 0;
		}
	}
	for(ll i=0;i<n;i++){
		cout << a[i]<<" ";
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 8312
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include<vector>
using namespace std;

int main(void){
    
    int a,b,c;
    cin>>a>>b>>c;
    if(c-a+b < 0)cout<<0<<endl;
    else cout<<c-a+b<<endl;

    
    return 0;

}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <math.h>
#include <time.h>
using namespace std;
const long long mod = 1000000007;
#define ll long long
#define P pair<int, int>
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
bool dbg = false;
long long gcd(long long a, long long b){
   if (a % b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a % b));
   }
}
long long lcm(long long a, long long b){
   return (a / gcd(a, b))* b;
}
//---------------------------------------------------------------------------------------------------
/*ここからいじる*/
//---------------------------------------------------------------------------------------------------

void solve(){
}
int main(){
    int a, b;
    string s;
    cin >> s;
    a = 0;
    b = 0;
    for(int i = 0; i < 3; i++){
        if(s.at(i) == 'A'){
            a++;
        }
        else{
            b++;
        }
    }
    int num = a * b;
    if(num == 0){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
    solve();
    return 0;
}



Measured memory_bytes: 256
import java.util.*

class Node {
    var left = -1
    var right = -1
    var parent = -1
    var depth = -1
    var degree = 0
    var height = -1
}

class BinaryTree(var n: Int) {
    var nodes = Array(n) { Node() }

    fun setNode(id: Int, left: Int, right: Int) {
        nodes[id].left = left
        nodes[id].right = right
        if (left != -1) { nodes[left].parent = id; nodes[id].degree += 1 }
        if (right != -1) { nodes[right].parent = id; nodes[id].degree += 1 }
    }

    fun getDepth(id: Int) : Int {
        if (nodes[id].depth != -1) return nodes[id].depth
        nodes[id].depth = when (nodes[id].parent) {
            -1 -> 0
            else -> getDepth(nodes[id].parent) + 1
        }
        return nodes[id].depth
    }

    fun getSibling(id: Int) : Int {
        if (nodes[id].parent != -1) {
            val parent = nodes[nodes[id].parent]
            return if (parent.left == id) parent.right else parent.left
        }
        return -1
    }

    fun getHeight(id: Int) : Int {
        if (id == -1) return -1
        if (nodes[id].height == -1) {
            nodes[id].height = Math.max(getHeight(nodes[id].left), getHeight(nodes[id].right)) + 1
        }
        return nodes[id].height
    }

    fun hoge() {
        for (i in 0 until n) {
            val node = nodes[i]
            println("node ${i}: parent = ${node.parent}, sibling = ${getSibling(i)}, degree = ${node.degree}, depth = ${getDepth(i)}, height = ${getHeight(i)}, ${if (node.parent == -1) "root" else if (node.height == 0) "leaf" else "internal node"}")
        }
    }
}

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val tree = BinaryTree(n)
    for (i in 1..n) {
        val a = Array<Int>(3) { sc.nextInt() }
        tree.setNode(a[0], a[1], a[2])
    }
    tree.hoge()
}


Measured memory_bytes: 22024
n,k=map(int,input().split())
kakuritu=0
for i in range(1,n+1):
  if i>=k:
    kakuritu+=1/n
  else:
    kaisu=k/i
    count=0
    while kaisu>1:
      kaisu=kaisu/2
      count+=1
    kakuritu+=0.5**count/n
print(kakuritu)
      


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>

int main(void){
  int A, B, C;
  std::cin >> A >> B >> C;
  std::vector<int> v = {A, B, C};
  std::sort(v.begin(), v.end());
  
  std::cout << v[0] + v[1] << std::endl;
}


Measured memory_bytes: 256
N = int(input())

A = []
xy = []

for i in range(N):
    a = int(input())
    A.append(a)
    xy.append([list(map(int, input().split())) for j in range(a)])

ans = 0
p = [-1]*N

def dfs(i, p):
    global ans
    if i == N:
        ans = max(ans, sum(p))
    else:
        p_true = p.copy()
        if p_true[i] != 0:
            p_true[i] = 1
            ok = True
            for x, y in xy[i]:
                if y == p_true[x-1] or p_true[x-1] == -1:
                    p_true[x-1] = y
                else:
                    ok = False
            if ok:
                dfs(i+1, p_true)
        p_false = p.copy()
        if p_false[i] != 1:
            p_false[i] = 0
            dfs(i+1, p_false)

dfs(0, p)

print(ans)


    



Measured memory_bytes: 3064
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, C, K = list(map(int, sys.stdin.readline().split()))
T = [int(sys.stdin.readline()) for _ in range(N)]

T.sort()
ans = 1
cnt = 0
departure = T[0] + K
for t in T:
    cnt += 1
    if t > departure or cnt > C:
        ans += 1
        cnt = 1
        departure = t + K
print(ans)


Measured memory_bytes: 17708
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e9 + 7;

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

  ll n, tt;
  cin >> n >> tt;
  ll c[n], t[n];
  ll ans = 10000;
  REP(i, n){
    cin >> c[i] >> t[i];
    if(t[i] <= tt) ans = min(ans, c[i]);
  }
  if(ans == 10000) cout << "TLE" << endl;
  else cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

const int MAXN = 1E5 + 10;

int n;
char s[MAXN];
int a[MAXN];

int main(){
	scanf("%d", &n);
	scanf("%s", s);
	s[n] = s[0], s[n + 1] = s[1];

	for (int i = 0; i < 4; ++i){
		a[0] = i & 1, a[1] = i >> 1 & 1;
		for (int j = 2; j <= n + 1; ++j)
			a[j] = s[j - 1] == 'x' ^ a[j - 1] ^ a[j - 2];
		if (a[0] == a[n] && a[1] == a[n + 1]){
			for (int j = 0; j < n; ++j)
				putchar(a[j] ? 'W' : 'S');
			puts("");
			return 0;
		}
	}
	puts("-1");
	return 0;
}


Measured memory_bytes: 768
using System;
using System.Linq;

class F
{
	static void Main()
	{
		var n = int.Parse(Console.ReadLine());
		var p = new int[n].Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).Select(x => new V(x[0], x[1])).ToArray();

		if (n == 2) { Console.WriteLine((p[1] - p[0]).Norm / 2); return; }

		var M = 0.0;
		for (int i = 0; i < n; i++)
			for (int j = i + 1; j < n; j++)
				for (int k = j + 1; k < n; k++)
					M = Math.Max(M, GetRadius(p[i], p[j], p[k]));
		Console.WriteLine(M);
	}

	static double GetRadius(V p0, V p1, V p2)
	{
		var v1 = p1 - p0;
		var v2 = p2 - p0;
		var v3 = p2 - p1;
		var a = v1.Norm;
		var b = v2.Norm;
		var c = v3.Norm;

		var s_4 = Math.Abs(v1.X * v2.Y - v2.X * v1.Y) * 2;
		if (s_4 == 0) return Math.Max(Math.Max(a, b), c) / 2;
		if (Cos(a, b, c) <= 0) return a / 2;
		if (Cos(b, c, a) <= 0) return b / 2;
		if (Cos(c, a, b) <= 0) return c / 2;
		return a * b * c / s_4;
	}

	static double Cos(double a, double b, double c)
	{
		return (b * b + c * c - a * a) / (2 * b * c);
	}
}

struct V
{
	public static V Zero = new V();
	public static V XBasis = new V(1, 0);
	public static V YBasis = new V(0, 1);

	public int X, Y;
	public V(int x, int y) { X = x; Y = y; }

	public double Norm => Math.Sqrt(Math.Pow(X, 2) + Math.Pow(Y, 2));

	public static V operator +(V v) => v;
	public static V operator -(V v) => new V(-v.X, -v.Y);
	public static V operator +(V v1, V v2) => new V(v1.X + v2.X, v1.Y + v2.Y);
	public static V operator -(V v1, V v2) => new V(v1.X - v2.X, v1.Y - v2.Y);

	public static bool operator ==(V v1, V v2) => v1.X == v2.X && v1.Y == v2.Y;
	public static bool operator !=(V v1, V v2) => !(v1 == v2);
	public override bool Equals(object obj) => obj is V && this == (V)obj;
	public override int GetHashCode() => X ^ Y;
	public override string ToString() => $"{X} {Y}";
}


Measured memory_bytes: 13524
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file=0





def solve():


    # for _ in range(ii()):
    
        

    n=ii()
    n%=1000
    if(n!=0):
        n=1000-n
    print(n)
 








        
if __name__ =="__main__":

    if(file):

        if path.exists('input1.txt'):
            sys.stdin=open('input1.txt', 'r')
            sys.stdout=open('output1.txt','w')
        else:
            input=sys.stdin.readline
    solve()


Measured memory_bytes: 68072
#include <bits/stdc++.h>
#include <limits>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
#define fi(i, n) for( int i=0 ; i<n ; i++ )
#define f(i, a, b) for( int i=a ; i<b ; i++ )
#define vi vector<int>
#define pb push_back
#define MOD 1000000007
int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll fact(ll n)
{
    ll ans = 1e14;
    for(ll i = 1; i<=sqrt(n); i++)
    {
        if(n%i==0)
        {
            ll sol = (i - 1) + (n/i - 1);
            ans = min(ans,sol);
        }
    }
    return ans;
}
int visited[200000] = {0};
vector<vector<int> > v(200000);
int dfs(int x)
{
    int ans = 0;
    if(visited[x]==0)
    {
        visited[x] = 1;
        ans++;
        int a = v[x].size();
        for(int j = 0; j<a; j++)
        {
            int data = v[x][j];
            ans = ans + dfs(data);
        }
    }
    return ans;
}
void primefactors(int n)
{
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        // While i divides n, print i and divide n
        while (n % i == 0)
        {
            cout << i << " ";
            n = n/i;
        }
    }

    // This condition is to handle the case when n
    // is a prime number greater than 2
    if (n > 2)
        cout << n << " ";

}
double fib(int n)
{
    double sol1,sol2;
    sol1 = (1 + sqrt(5))/2;
    sol2 = (1 - sqrt(5))/2;
    sol1 = pow(sol1,n);
    sol2 = pow(sol2,n);
    double ans = sol1 - sol2;
    ans = ans/sqrt(5);
    //ans = int(ans);
    return ans;
}

ll digits(ll n)
{
    return floor(log10(double(n))) + 1;
}


int main()
{

    string s,t;
    cin>>s>>t;
    cout<<t + s;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;
using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void ioinit() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline vi32 plist(i32 n) { vi32 f(n, 1); f[0] = f[1] = 0; repi(i, 2, n) for (int j = i * 2; j < n; j += i) f[j] = 0; return f; }
inline bool isprime(i32 n) { if (n < 2) return 0; for (i32 i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; }
template<class T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<class T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<class T> inline bool amax(T &x, T y) { if (x >= y) return 0; x = y; return 1; }
template<class T> inline bool amin(T &x, T y) { if (x <= y) return 0; x = y; return 1; }
template<class T> inline i64 lbi(vector<T> &v, T e) { return lower_bound(all(v), e) - v.begin(); }
template<class T> inline i64 ubi(vector<T> &v, T e) { return upper_bound(all(v), e) - v.begin(); }
template<class T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }

int main() {
  ioinit();
  int n;
  cin >> n;
  vi32 a(n);
  rep(i, n) cin >> a[i];
  vi32 l(n + 1), r(n + 1);
  rep(i, n) l[i + 1] = gcd(l[i], a[i]);
  rrep(i, n) r[i] = gcd(r[i + 1], a[i]);
  i32 ans = 0;
  rep(i, n) amax(ans, (i32) gcd(l[i], r[i + 1]));
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>

int main()
{
  int n;
  scanf("%d",&n);
  int p[n];
  int i;
  int counter;
  
  counter = 0;
  i = 0;
  while (i < n)
  {
    scanf("%d",&p[i]);
    if ((i > 1 && p[i - 2] > p[i - 1] && p[i - 1] > p[i]) || (i > 1 && p[i - 2] < p[i - 1] && p[i - 1] < p[i])) 
      counter++;
    i++;
  }
  printf("%d",counter);
}

Measured memory_bytes: 128
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

const int mod = 998244353;
struct mint {
    long long x;
    mint(long long x=0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
bool operator==(const mint& a, const mint& b) { return a.x == b.x;}

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

    int n, s;
    cin >> n >> s;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<mint> dp(s+1);
    mint ans = 0;
    rep(i, n) {
        dp[0] += 1;
        rrep(j, s+1) if (j-a[i] >= 0) dp[j] += dp[j-a[i]];
        ans += dp[s];
    }
    cout << ans << endl;
}


Measured memory_bytes: 3664
#include<iostream>
#define N 4

using namespace std;

int main(){
  int t, n;
  for(int i=0; i<N; ++i){
    cin >> t >> n;
    if(t == 1) cout << 6000*n << endl;
    if(t == 2) cout << 4000*n << endl;
    if(t == 3) cout << 3000*n << endl;
    if(t == 4) cout << 2000*n << endl;
  }
  return 0;
}

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


int main(){


    string s;


    cin >> s;


    if( s.at(0) == s.at(1) || s.at(1) == s.at(2) || s.at(2) == s.at(3) ){

        cout << "Bad" << endl;

        }

    else cout << "Good" << endl;

    
    return 0;


    }


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	string S=in<string>(),T=in<string>();
	int SN=S.size(),TN=T.size();
	for(int i=0;i<SN-TN+1;i++){
		auto U=S.substr(i,TN);
		if(U==T){
			out(i);
		}
	}

	return 0;
}



Measured memory_bytes: 3212
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include<math.h>
#include<bitset>
#include<iomanip>
using namespace std;

int main() {
	int N,b; cin >> N;
	vector<int> a(9);
	for (int i = 0; i < N; i++) {
		cin >> b; 
		if(b/400<=7)a[b/400] = 1;
		else a[8]++;
	}
	int max, min=0;
	for (int i = 0; i < 8; i++) {
		if (a[i] == 1)min++;
	}
	max = min + a[8];
	//if (min + a[8] > 8)max = 8;
	if (min == 0)min = 1;
	cout << min << " " << max << endl;

}



Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)
INF = float('inf')
N = int(input())
a = list(map(int,input().split()))
cum = [0]*(N+1)
for i in range(N):
    cum[i] = cum[i-1]+a[i]
dp = [[-1]*N for _ in range(N)]
for i in range(N):
    dp[i][i] = 0

def cal(i,j):
    if dp[i][j] != -1:
        return dp[i][j]
    else:
        res = INF
        for k in range(i,j):
            res = min(res,cal(i,k)+cal(k+1,j)+cum[j]-cum[i-1])
        dp[i][j] = res
        return res

print(cal(0,N-1))

Measured memory_bytes: 45148
import std.stdio, std.math, std.algorithm, std.array, std.string, std.conv, std.container, std.range;
T Read(T)() { return readln.chomp.to!(T); }
T[] Reads(T)() { return readln.split.to!(T[]); }
alias read = Read!(int);
alias reads = Reads!(int);

struct Info {
    int p, y;
}


int bsearch(T)(T[] a, int x) {
    int n = a.length.to!int;
    int lb = -1, rb = n;
    while (rb - lb > 1) {
        int mid = lb + (rb - lb) / 2;
        if (a[mid] >= x) rb = mid;
        else lb = mid;
    }
    return rb;
}

void main() {
    int n, m; readf("%d %d\n", &n, &m);
    auto city = new Info[m];
    int[][] ys = new int[][](n);
    foreach (ref c ; city) {
        readf("%d %d\n", &c.p, &c.y);
        ys[c.p - 1] ~= c.y;
    }

    foreach (ref y ; ys) sort(y);

    foreach (c; city) {
        int rnk = bsearch(ys[c.p - 1], c.y) + 1;
        writefln("%06s%06s", c.p, rnk);
    }
}

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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)x.size())
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int inf = 1LL<<60;
const int mod = 1e9 + 7;
const double eps = 1e-9;

/*{
  }*/

signed main(){
  int n, c;
  cin >> n >> c;

  vi a(n), b(n);
  rep(i, 0, n) cin >> a[i];
  rep(i, 0, n) cin >> b[i];

  vvi pre(401, vi(c+1, 1));
  rep(i, 0, 401) rep(j, 0, c){
    (pre[i][j+1] = pre[i][j]*i) %= mod;
  }
  rep(i, 0, c+1){
    rep(j, 0, 400) (pre[j+1][i] += pre[j][i] ) %= mod;
  }

  vvi dp(n+1, vi(c+1));
  dp[0][0] = 1;
  rep(i, 0, n) rep(j, 0, c+1){
    rep(k, 0, j+1){
      int tmp = (pre[b[i]][k] - pre[a[i]-1][k] + mod)%mod;
      (dp[i+1][j] += dp[i][j-k]*tmp%mod) %= mod;
    }
  }

  cout << dp[n][c] << endl;

//  rep(i, 0, n+1) rep(j, 0, c+1){
//    cout << dp[i][j] << " \n"[j==c];
//  }
//  rep(i, 0, 401) rep(j, 0, c){
//    cout << pre[i][j] << " \n"[j==c-1];
//  }
  
  return 0;
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
 
using namespace std;
using ll = long long;
 
#define INF (1LL << 60)
#define MOD 1000000007
 
#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((int)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back
 
 
 
int main()
{
    ll N;
    cin >> N;
    vector<ll> C(N);
    REP(i,0,N) cin >> C[i];    
 
    ll ans = 0;
    sort(ALL(C), greater<ll>());
    REP(i,0,N) ans = (ans + (i + 2) * (C[i] % MOD)) % MOD;
    REP(i,0,N-1) ans = ans * 4 % MOD;
    _PR(ans);
 
    return 0;
}

Measured memory_bytes: 1920
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int q = sc.nextInt();
 		for(int i = 0; i < q; ++i){
 			BigInteger n1 = sc.nextBigInteger();
 			BigInteger n2 = sc.nextBigInteger();
 			BigInteger ans = n1.add(n2);
 			String sa = ans.toString();
 			if(sa.length() > 80){
 				System.out.println("overflow");	
 			}
 			else{
 				System.out.println(sa);
 			}
 		}	
	}
}

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

#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define pll         pair<long,long>
#define vi          vector<int>
#define vll         vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)      (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define mod        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define rem(i,a,b)  for(int i=a;i>b;i--)
#define mp(a,b)     make_pair(a,b)
#define vvi(a,b,name)    vector<vector<int>> name(a,vector<int>(b,-1))


void solve(){
    map<ll,ll> m;
    ll n;cin>>n;
    ll temp;
    rep(i,0,n){
        cin>>temp;
        m[temp]++;
        m[temp-1]++;
        m[temp+1]++;
    }
    ll ans=1;
    for(auto u:m){
        ans=max(ans,u.y);
    }
    cout<<ans;

}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 6144
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn acc(x: u64) -> u64 {
    if x % 4 == 1 {
        1
    } else if x % 4 == 3 {
        0
    } else if x % 4 == 0 {
        x
    } else {
        x + 1
    }
}

fn main() {
    let mut sc = Scanner::new();
    let mut a: u64 = sc.cin();
    let mut b: u64 = sc.cin();
    if a == 0 {
        put!(acc(b));
    } else {
        put!(acc(b) ^ acc(a - 1));
    }
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;



int main() {
    int n, q;
    cin >> n >> q;
    vector<array<int, 3>> query(2*n+1);
    query.back() = {INF<int>};
    for (int i = 0; i < n; ++i) {
        int s, t, x;
        scanf("%d %d %d", &s, &t, &x);
        query[2*i] = {s-x, x, 1};
        query[2*i+1] = {t-x, x, -1};
    }
    sort(query.begin(),query.end());
    set<int> s;
    int cur = 0;
    for (int i = 0; i < q; ++i) {
        int x;
        scanf("%d", &x);
        while(query[cur][0] <= x){
            if(query[cur][2] == 1){
                s.insert(query[cur][1]);
            }else {
                s.erase(query[cur][1]);
            }
            cur++;
        }
        if(s.empty()) puts("-1");
        else cout << *s.lower_bound(0) << "\n";
    }
    return 0;

}

Measured memory_bytes: 15360
#include<iostream>

using namespace std;
main(){
int te=0;
cin>>te;
while(te--){
  int x,y,w,h,n;
  while(cin>>x>>y>>w>>h>>n){
    int cnt = 0;
    for(int i=0;i<n;i++){
      int a,b;
      cin>>a>>b;
      if ( x<=a && a <=x+w && y<=b && b <=y+h)cnt++;
    }
    cout << cnt<<endl;
  }
}
}

Measured memory_bytes: 0
#include<stdio.h>

int main(void){
  long long int i,c,tmp;
  long long int N;
  scanf("%ld",&N);
  long long int A[N+1],B[N];
  for(i=0;i<N+1;i++){
    scanf("%ld",&A[i]);
  }
  for(i=0;i<N;i++){
    scanf("%ld",&B[i]);
  }  
  
  for(tmp=0,c=0,i=0;i<N;i++){
    if(A[i]+A[i+1] <= B[i]){
      c = c + A[i]+A[i+1];
      A[i+1] = 0;
    }else{     // A[i]+A[i+1] > B[i]
      if(A[i] < B[i]){
      	A[i+1] = A[i]+A[i+1] - B[i];
        c = c + B[i];
      }else{  // A[i] >= B[i]
        c = c + B[i];      
      }
    }
  }
  
  printf("%ld",c);
  
}


Measured memory_bytes: 1664
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
const MOD: u64 = 1_000_000_007;
fn main() {
    input!{
        s: chars,
    }
    let l = s.len();

    let mut dp = vec![vec![0; 13]; l+1];

    dp[0usize][0usize] = 1;

    for i in 0..l {
        for j in 0..13 {
            let acc = dp[i][j] % MOD;
            for k in 0..10 {
                if (s[i] as usize) - 48 ==  k || s[i] == '?' {
                    dp[i+1][(10*j + k)% 13] += acc;
                }
            }
        }
        for j in 0..13 {
            dp[i + 1][j] %= MOD;
        }
    }

    println!("{}", dp[l][5]);
}


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

int main(){
	long cnt = 0;
	long minj, tmp;
	long N;
	cin >> N;
	vector<long> A(N);
	for (long i = 0; i < N; i++){
		cin >> A[i];
	}
	for (long i = 0; i < N; i++){
		minj = i;
		for (long j = i; j < N; j++){
			if (A[j] < A[minj]){
				minj = j;
			}
		}
		tmp = A[i];
		A[i] = A[minj];
		A[minj] = tmp;
		if (tmp != A[i]) cnt++;
	}
	for (long i = 0; i < N - 1; i++){
		cout << A[i] << " ";
	}
	cout << A[N - 1] << endl;
	cout << cnt << endl;
	return 0;
}

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

#define debug(...) fprintf(stderr, __VA_ARGS__)

#ifndef AT_HOME
#define getchar() IO::myGetchar()
#define putchar(x) IO::myPutchar(x)
#endif

namespace IO {
	static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;

	inline char myGetchar() {
		static char buf[IN_BUF], *ps = buf, *pt = buf;
		if (ps == pt) {
			ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
		}
		return ps == pt ? EOF : *ps++;
	}

	template<typename T>
	inline bool read(T &x) {
		bool op = 0;
		char ch = getchar();
		x = 0;
		for (; !isdigit(ch) && ch != EOF; ch = getchar()) {
			op ^= (ch == '-');
		}
		if (ch == EOF) {
			return false;
		}
		for (; isdigit(ch); ch = getchar()) {
			x = x * 10 + (ch ^ '0');
		}
		if (op) {
			x = -x;
		}
		return true;
	}

	inline int readStr(char *s) {
		int n = 0;
		char ch = getchar();
		for (; isspace(ch) && ch != EOF; ch = getchar())
			;
		for (; !isspace(ch) && ch != EOF; ch = getchar()) {
			s[n++] = ch;
		}
		s[n] = '\0';
		return n;
	}

	inline void myPutchar(char x) {
		static char pbuf[OUT_BUF], *pp = pbuf;
		struct _flusher {
			~_flusher() {
				fwrite(pbuf, 1, pp - pbuf, stdout);
			}
		};
		static _flusher outputFlusher;
		if (pp == pbuf + OUT_BUF) {
			fwrite(pbuf, 1, OUT_BUF, stdout);
			pp = pbuf;
		}
		*pp++ = x;
	}

	template<typename T>
	inline void print_(T x) {
		if (x == 0) {
			putchar('0');
			return;
		}
		static int num[40];
		if (x < 0) {
			putchar('-');
			x = -x;
		}
		for (*num = 0; x; x /= 10) {
			num[++*num] = x % 10;
		}
		while (*num){
			putchar(num[*num] ^ '0');
			--*num;
		}
	}

	template<typename T>
	inline void print(T x, char ch = '\n') {
		print_(x);
		putchar(ch);
	}

	inline void printStr_(const char *s, int n = -1) {
		if (n == -1) {
			n = strlen(s);
		}
		for (int i = 0; i < n; ++i) {
			putchar(s[i]);
		}
	}

	inline void printStr(const char *s, int n = -1, char ch = '\n') {
		printStr_(s, n);
		putchar(ch);
	}
}
using namespace IO;

int n, k;
char s[105];

int main() {
	n = readStr(s + 1);
	read(k);
	std::vector<int> a;
	int lst = 0;
	for (int i = 1; i <= n; ++i) {
		if (i == n || s[i] != s[i + 1]) {
			a.push_back(i - lst);
			lst = i;
		}
	}
	if ((int)a.size() == 1) {
		print(1ll * n * k / 2);
		return 0;
	}
	if (s[1] == s[n]) {
		long long ans = 0;
		for (int i = 1; i < (int)a.size() - 1; ++i) {
			ans += a[i] / 2;
		}
		ans = ans * k + 1ll * (a.front() + a.back()) / 2 * (k - 1);
		ans += a.front() / 2 + a.back() / 2;
		print(ans);
		return 0;
	}
	long long ans = 0;
	for (int v : a) {
		ans += v / 2;
	}
	print(ans * k);
}


Measured memory_bytes: 3620
def main(istr, ostr):
    n, d = list(map(int, istr.readline().strip().split()))
    d2 = d ** 2
    c = 0
    for i in range(n):
        x, y = list(map(int, istr.readline().strip().split()))
        if x ** 2 + y ** 2 <= d2:
            c += 1
    print(c, file=ostr)


if __name__ == "__main__":
    import sys

    main(sys.stdin, sys.stdout)


Measured memory_bytes: 9196
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define answer cout << ans << endl;
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;

signed _main(){
  string S; cin >> S;
  int N = SZ(S);
  v<int> dp(N,0);
  unordered_map<int,int> mp;
  int tenscale=1;
  dp[0]=S[N-1]-'0';
  mp[0]++;
  mp[dp[0]]++;
  rep(i,N-1){
    tenscale = tenscale*10%2019;
    dp[i+1]=(dp[i]+(S[N-i-2]-'0')*tenscale%2019)%2019;
    //cout << dp[i+1] << endl;
    mp[dp[i+1]]++;
  }
  int ans=0;
  fore(i,mp){
    //cout << i.second << endl;
    ans+=i.second*(i.second-1)/2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5216
#include <bits/stdc++.h>
using namespace std;
int main(void){
    
    int N;
    cin >> N;
    map<int,double> mpx;
    map<int,double> mpy;
    double x;
    double y;
    vector<int> v;
    double sum = 0;
    int cont = 0;
    
    for(int i = 1; i <= N;i++){
        cin >> x >> y;
        mpx[i] = x;
        mpy[i] = y;
    }
    
   
    
    for(int i = 1; i <= N;i++) v.push_back(i);
    
    do {
        for(int i = 0; i < N-1; i++){
            //cout << v[i] << endl;
            if(i == N) continue;
            sum += hypot(mpx[v[i]] - mpx[v[i+1]], mpy[v[i]] - mpy[v[i+1]]);
        }
        //cout <<"-------------"<<endl;
        cont++;
    } while (std::next_permutation(v.begin(), v.end()));
    
    cout <<setprecision(12) << sum / cont << endl;
    
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
#define PI 3.141592653589793
double sy,sx,ey,ex;
int n;
void coch(double sx,double sy,double ex,double ey,int count){
    if(count<n){
        double t1x,t1y,midx,midy,t2x,t2y;
        t1x=(2*sx+ex)/3.0; t1y=(2*sy+ey)/3.0;
        t2x=(sx+2*ex)/3.0; t2y=(sy+2*ey)/3.0;
        midx=t1x+(t2x-t1x)*cos(PI/3)-(t2y-t1y)*sin(PI/3);
        midy=t1y+(t2x-t1x)*sin(PI/3)+(t2y-t1y)*cos(PI/3);
        coch(sx,sy,t1x,t1y,count+1);
        coch(t1x,t1y,midx,midy,count+1);
        coch(midx,midy,t2x,t2y,count+1);
        coch(t2x,t2y,ex,ey,count+1);
    }
    if(count==n){printf("%.7f ",ex);printf("%7f",ey);cout<<endl;}
}
int main(){
    cin>>n;
    double sy=0.0,sx=0.0,ey=0.0,ex=100.0;
    printf("%.7f ",sx);printf("%.7f",sy); cout<<endl;
    coch(sx,sy,ex,ey,0);
    return 0;
}


Measured memory_bytes: 3176
#include <iostream>
#include <map>
#include <queue>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

long long N;
long long A[1 << 18], B[1 << 18];

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

	if (N % 2 == 0) {
		int M = (N / 2);
		long long V1 = B[M - 1] + B[M];
		long long V2 = A[M - 1] + A[M];
		cout << V1 - V2 + 1LL << endl;
	}
	else {
		int M = (N / 2);
		long long V1 = B[M];
		long long V2 = A[M];
		cout << V1 - V2 + 1LL << endl;
	}
	return 0;
}

Measured memory_bytes: 6764
import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	}
	public static boolean isPrime(int p){
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	}
}

Measured memory_bytes: 40796
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder
{
	class Program
	{
		static int In => int.Parse(Console.ReadLine());
		static int[] Ins => Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
		static void Out(bool b) => Console.WriteLine(b ? "Yes" : "No");

		static void Main(string[] args)
		{
			var N = In;
			var a = Ins;
			int ans = 1;
			int aa = 1;
			for(int i = 0;i < a.Length;i++)
			{
				aa *= 3;
				if (a[i] % 2 == 0) ans *= 2;
				else ans *= 1;
			}
			Console.WriteLine(aa - ans);
			//Console.ReadLine();
		}
	}
}

Measured memory_bytes: 13396
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

constexpr long long MOD = 1000000007;

int main() {
  int N, M;
  std::cin >> N >> M;
  std::vector<bool> A(N, true);
  while (M--)
  {
    int a;
    std::cin >> a;
    --a;
    A[a] = false;
  }
  std::vector<long long> dp(N, 0);
  dp.back() = 1;
  for (int i = N - 2; 0 <= i; --i)
  {
    if (A[i])
    {
      if (i + 1 < N && A[i + 1])
        dp[i] += dp[i + 1];
      if (i + 2 < N && A[i + 2])
        dp[i] += dp[i + 2];
      dp[i] %= MOD;
    }
  }
  long long ans = 0;
  if (A[0])
    ans += dp[0];
  if (1 < N && A[1])
    ans += dp[1];
  ans %= MOD;
  std::cout << ans << std::endl;
  return 0;
}



Measured memory_bytes: 1024
n,k = map(int,input().split())
if k == 0:
  print(n)
  exit()
dislike = list(input().split())
 
ans = n-1
flag = 1
while flag == 1:
  ans+=1
  flag = 0
  for i in str(ans):
    if i in dislike:
      flag = 1
      break
print(ans)


Measured memory_bytes: 9132
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}

int dp[105][2][4];

int k;
string s;

int solve(int ind, int f, int cnt){
	if(ind == s.length()){
		if(cnt == k ) return 1;
		else return 0;
	}
	int &res = dp[ind][f][cnt];
	if(res != -1) return res;
	res = 0;
	int lmt;
	lmt = s[ind] - '0';
	if(f) lmt = 9;
	
	for(int i = 0; i <= lmt; i++){
		int nf = f;
		if(i < lmt) nf = 1;
		if( i == 0 ) res += solve(ind + 1, nf, cnt);
		if(i != 0  and cnt < k)
		res += solve(ind + 1, nf, cnt + (i != 0));
	}
	
	return res;
}

int32_t main(){
	fastio();
	cin >> s;
	cin >> k;
	memset(dp, -1 , sizeof(dp));
	int ans = solve(0,0,0);
	cout << ans;
}

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

int main(){
  int h,w;
  while(true){
    cin >> h >> w;
    if(h == 0 && w == 0)break;
    for(int i = 0; i < h; i++){
      for(int j = 0; j < w; j++){
        if(j == 0 || j + 1 == w || i == 0 || i + 1 == h){
          cout << '#';
          continue;
        }
        cout << '.';
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int A,B;
  char op;
  int ans;
  cin >> A >> op >> B;
  bool flg;
  if(op=='+'){
    ans = A+B;
  } else {
    ans = A-B;
  }
 cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, e) for (int i = s; i < e; ++i)
#define sort_(a) stable_sort(a.begin(), a.end())
#define rsort(a) stable_sort(a.rbegin(), a.rend())
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define join(a, d) accumulate(a.begin() + 1, a.end(), a[0], [](string s, string t) {return s + d + t;})
#define all(a) a.begin(), a.end()
#define __lcm(a, b) std::__detail::__lcm(a, b)
typedef long long ll;
const long mod = 1e9 + 7;

int main(void) {
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
#endif

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

  int N;
  long C, K;
  cin >> N >> C >> K;
  vector<long> T(N);
  rep(i, 0, N) {
    cin >> T[i];
  }

  sort_(T);
  long ans = 0;
  long n = 0;
  long time = T[0] + K;
  for (auto t : T) {
    ++n;
    if (t > time || n > C) {
      ++ans;
      n = 1;
      time = t + K;
    }
  }
  ++ans;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i=a; i<(b); i++)

ll n, d;
long double X[200000], Y[200000];

void solve(){
    int ans = 0;
    FOR (i, 0, n){
        if (sqrt(X[i] * X[i] + Y[i] * Y[i]) <= d) ans++;
    }
    cout << ans << "\n";
}


int main(){
   	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> d;
    FOR (i, 0, n){
        cin >> X[i] >> Y[i];
    }
    solve();
	return 0;
}

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

void solve(long long H, long long A) {
    if (H % A == 0) {
        cout << H / A << endl;
    } else {
        cout << H / A + 1 << endl;
    }
}

int main() {
    long long H;
    scanf("%lld", &H);
    long long A;
    scanf("%lld", &A);
    solve(H, A);
    return 0;
}


Measured memory_bytes: 3740
"""B - Judge Status Summary"""
N = int(input())
ac, wa, tle, re = 0, 0, 0, 0
for i in range(N):
    S = input()
    if S == "AC":
        ac += 1
    elif S == "WA":
        wa += 1
    elif S == "TLE":
        tle += 1
    else:
        re += 1

print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))


Measured memory_bytes: 9044
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//みんなどんだけ頭いいの

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


	int N = 0;
	char c;
	while ((c = getchar_unlocked()) >= '0') N = N * 10 + c - '0';

	int L = 0;
	ll kotae = 1;
	ll mod = 1e9 + 7;
	rep1(i, N) kotae = kotae * i % mod;
	rep(i, N + N) {
		if ((getchar_unlocked() ^ i) & 1) kotae = kotae * L-- % mod;
		else L++;
	}

	if (L == 0) printf("%ld", kotae);
	else printf("0");

	Would you please return 0;
}

Measured memory_bytes: 128