akhauriyash/Code-Regression huggingface dataset:
fn main() {
    let x: String = read();
    let y: String = read();
    if x < y {
        println!("<");
    } else if x > y{
        println!(">");
    } else {
        println!("=");
    }
}

// 以下関数

use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 10e9 as u64 + 7;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}


Measured memory_bytes: 4352
#include <stdio.h>
int main(void){
int n,m,i,j;
scanf("%d%d",&n,&m);
int a[n][m];
for(i=0;i<n;i++){
    for(j=0;j<m;j++){
        scanf("%d",&a[i][j]);
    }
}
int c[100]={};
for(i=0;i<m;i++){
    int b;
    scanf("%d",&b);
    for(j=0;j<n;j++){
        c[j]+=a[j][i]*b;
    }
}
for(i=0;i<n;i++){
    printf("%d\n",c[i]);
}
return 0;
}

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

int main()
{
    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     ll n;
     cin>>n;
     ll count = 0;
     for(ll x = 1; x <=(n)/2; x++)
     {
         count++;
         if(x == (n-x))
         {
             count--;
         }
     }
     cout<<count;

}

Measured memory_bytes: 256
import numpy as np
import collections
import sys
base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
ret = ''
for c in S:
    K = base.find(c)
    ret += base[K+N]
print(ret)


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

int main() {
    int n;
    while(cin >> n, n) {
        int cnt[5] = {5, 7, 5, 7, 7};
        vector<string> v(n);
        for(int i=0; i<n; ++i) {
            cin >> v[i];
        }
        int res = 0;
        for(int i=0; i<n; ++i) {
            int c = 0, len = 0;
            bool ok = false;
            for(int j=i; j<n; ++j) {
                len += v[j].size();
                if(len == cnt[c]) {
                    if(c == 4) {
                        ok = true;
                        res = i+1;
                        break;
                    }
                    c++;
                    len = 0;
                } else if(len > cnt[c]) {
                    break;
                }
            }
            if(ok) {
                cout << res << endl;
                break;
            }
        }
    }
}


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

int main(void) {
  int i, j, ans;
  char h[30] = "111111110000000001111011101";
  while( 1 ) {
    ans = 0;
    char s[100];
    scanf("%s", s);
    if(s[0] == '#') break;
    for(i = 0; i < strlen(s); ++i) s[i] -= 'a' - 1;
    for(i = 1; i < strlen(s); ++i) if(h[s[i]] != h[s[i - 1]]) ++ans;
    printf("%d\n", ans);
  }
  return 0;
}


Measured memory_bytes: 2724
#include<bits/stdc++.h>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopb(i,a,b) for(int i=a;i>=b;i--)
#define loopm(i,a,b,step) for(int i=a;i<b;i+=step)
#define loopbm(i,a,b,step) for(int i=a;i>=b;i-=step)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define INF 1000000007
#define MOD 1000000007
#define BINF 1000000000000000001
#define int long long int
#define double long double

using namespace std;


#undef int
int main()
{
#define int long long int
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
   // freopen("input.txt","r",stdin);
 int a,b;
 cin>>a>>b;
 if(a<=8 and b<=8) cout<<"Yay!";
 else cout<<":(";
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
typedef long long int64;
static const int MAXN = 200004;
static const int ALPHA = 26;

int n;
char s[MAXN];
int ct[ALPHA] = { 0 };

int main()
{
    scanf("%s", s);
    n = strlen(s);

    for (int i = 0; i < n; ++i) ++ct[s[i] - 'a'];

    int64 ans = (int64)n * (n + 1) / 2;
    for (int i = 0; i < ALPHA; ++i) ans -= (int64)ct[i] * (ct[i] + 1) / 2;
    printf("%lld\n", ans + 1);

    return 0;
}


Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
  #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl "\n"
#define all(c) c.begin(),c.end()
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
   int k,ans;
   cin>>k;
   if(k&1)ans=(k>>1)*((k>>1)+1);
   else ans=(k>>1)*(k>>1);
   cout<<ans<<endl;
}
int32_t main(){
   IOS;
   solve();
   //debug();
  #ifdef LOCAL_DEFINE
   cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
  #endif	
}


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

constexpr int MOD = 1e9 + 7;
struct mint {
  long long x;
  mint(long long x = 0) noexcept : x((x + MOD) % MOD) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x -= a.x) < 0) 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 == 0) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  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; }
};

int main(){
  int N, K; cin >> N >> K;
  vector<mint> sumN(N + 2, 0);
  rep(i, N + 1) sumN[i + 1] = sumN[i] + i + 1;

  mint ans = 0;
  rep1(i, N + 1) {
    if (i < K) continue;
    mint mn = sumN[i], mx = sumN[N + 1] - sumN[N + 1 - i];
    ans += mx - mn + 1;
  }

  cout << ans.x << endl;
}


Measured memory_bytes: 4840
// Problem : A - Plural Form
// Contest : AtCoder - AtCoder Beginner Contest 179
// URL : https://atcoder.jp/contests/abc179/tasks/abc179_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
const long long int  modu=1e9+7;
#define endl '\n'
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define inp(x)  for(auto &t:x) cin>>t;
#define itr     vector<int>::iterator
#define debug(a) cout << #a << "=" << a << ' '<<endl;
#define out(x)  for(auto &t:x) cout<<t<<" "; cout<<endl;
#define ff first
#define ss second
#define pb push_back
#define initialize(a,v)  for(int i=0;i<a.size();++i) a[i]=v;
#define all(x) x.begin(),x.end()
#define mpt(mp) for(auto it=mp.begin();it!=mp.end();it++)
#define trav(x) for(int i=0;i<(int)x.size();++i)
#define mkp(a,b) make_pair(a,b)
#define sz(x)  (int)x.size()

int noofdig(int N)
{
	return floor(log10(N))+1;
}


ll f(ll a)
{

return 0;

}



void pre()
{

}



void solve()
{
  
  string s;
  cin>>s;
  if(s[s.length()-1]=='s')
  s+="es";
  else
  s+="s";
  
  cout<<s<<endl;
  





}



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

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


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

typedef vector<double> V;

int main () {
    int N, T, L, B;
    while (cin >> N >> T >> L >> B, N || T || L || B) {
        V lose(L,0), back(B,0);

        for (int i = 0; i < L; i++) cin >> lose[i];
        for (int i = 0; i < B; i++) cin >> back[i];

        vector<V> dp(T+3, V(N+1));
        dp[0][0] = 1;

        for (int i = 0; i < T; i++) {
            dp[i+1][N] += dp[i][N];
            for (int j = 0; j < N; j++) {
                if (dp[i][j] > 0) {
                    for (int k = 1; k < 7; k++) {
                        int next = j + k <= N ? j + k : N * 2 - (j + k);
                        if (find(lose.begin(), lose.end(), next) != lose.end()) {
                            dp[i+2][next] += dp[i][j] / 6;
                        } else if (find(back.begin(), back.end(), next) != back.end()) {
                            dp[i+1][0] += dp[i][j] / 6;
                        } else {
                            dp[i+1][next] += dp[i][j] / 6;
                        }
                    }
                }
            }
        }

        printf("%.6f\n", dp[T][N]);
    }

    return 0;
}

Measured memory_bytes: 1344
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
const int N=2e5+100;
const int mod=1e9+7;
bool judge(int x)
{
    if(x<=1)
        return 0;
    else if(x==2)
        return 1;
    int up=sqrt(x);
    for(int i=2; i<=up; i++)
        if(x%i==0)
            return 0;
    return 1;
}
int prime[N];
int tot=0;
int cal(int n,int x)
{
    //cout<<n<<" "<<x<<endl;
    if(n<x)
        return 0;
    return (n/x+cal(n/x,x))%mod;
}
int main()
{
    int n;
    cin>>n;

    tot=0;
    for(int i=1; i<=n; i++)
        if(judge(i))
            prime[++tot]=i;
    ll ans=1;
    for(int i=1; i<=tot; i++)
    {
        int x=prime[i];
        ans=(ans*(ll)(cal(n,x)+1))%mod;
    }
    cout<<ans<<endl;

    return 0;
}


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

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {

            Solve();

            //Console.WriteLine(ans);
            Console.ReadKey();
        }

        static void Solve()
        {
            var cin = GetIntArray();
            var ans = 0;
            for(int i = cin[0]; i < cin[1] + 1; i++)
            {
                var s = i.ToString();
                if (s == new string (s.Reverse().ToArray())) ans++;
            }


            Console.WriteLine(ans);
        }


        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
    }
}

Measured memory_bytes: 17464
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define dump(x) cerr << #x << " = " << (x) << endl;
typedef long long LL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);

int main() {
	int n; cin >> n;
	string s; cin >> s;

	int cb = 0, alb = count(all(s), '#');
	int ans = alb;
	rep(i, n) {
		int cnt = (n - i) - (alb - cb) + cb;
		ans = min(ans, cnt);
		if (s[i] == '#')cb++;
	}
	Cout(ans);
}

Measured memory_bytes: 640
/**********************************************************************/
/********                                                      ********/
/********                     Writer:孙~~                      ********/
/********                       Lang:C++                       ********/
/********                     Status:Unknow                    ********/
/********                                                      ********/
/**********************************************************************/
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <cstring>
#include <cmath>
//#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f3f;

int main(){
	int a[3];
	scanf("%d%d%d",a,a+1,a+2);
	sort(a,a+3);
	int s=a[2]-a[1];
	s+=(a[1]-a[0])/2;
	if((a[1]-a[0])%2) s+=2;
	printf("%d\n",s);
	return 0;
}




Measured memory_bytes: 256
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),r=sc.nextInt(),minv=r,maxv=Integer.MIN_VALUE;
		for(int i=1;i<n;++i) {
			r=sc.nextInt();
			maxv=Math.max(maxv, r-minv);
			minv=Math.min(minv, r);
		}
		sc.close();
		System.out.println(maxv);
	}
}


Measured memory_bytes: 98848
#include <bits/stdc++.h>
using std::cout;
using std::endl;
using std::cin;

std::vector<std::map<int, std::vector<std::pair<std::pair<int, int>, int>>>> g;
std::vector<std::set<int>> st;
int n, m;

int main(){
	cin >> n >> m; g.resize(n); st.resize(n);
	for(int i = 0; i < m; i++){
		int a, b, c; cin >> a >> b >> c;
		
		g[a - 1][c].push_back({{b - 1, c}, 0});
		g[b - 1][c].push_back({{a - 1, c}, 0});
		st[a - 1].insert(c);
		st[b - 1].insert(c);
	}
	
	for(int i = 0; i < n; i++){
		for(auto s : st[i]){
			g[i][s].push_back({{i, -1}, 0});
			g[i][-1].push_back({{i, s}, 1});	
		}
	}
	
	typedef std::pair<int, std::pair<int, int>> P;
	std::priority_queue<P, std::vector<P>, std::greater<P>> qu; qu.push({0, {0, -1}});
	std::vector<std::map<int, int>> min_cost(n, std::map<int, int>()); min_cost[0][-1] = 0;
	while(!qu.empty()){
		auto p = qu.top(); qu.pop();
		
		for(auto e : g[p.second.first][p.second.second]){
			if(min_cost[e.first.first][e.first.second] and p.first + e.second >= min_cost[e.first.first][e.first.second]) continue;
			min_cost[e.first.first][e.first.second] = p.first + e.second;
			qu.push({p.first + e.second, e.first});
		}
	}
	
	cout << (min_cost[n - 1][-1] ? min_cost[n - 1][-1] : -1) << endl;
	return 0;
}


Measured memory_bytes: 117128
import java.io.BufferedReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int sx = sc.nextInt();
        int sy = sc.nextInt();
        int tx = sc.nextInt();
        int ty = sc.nextInt();
        
        for (int i = sx; i < tx; i++) System.out.print("R");
        for (int i = sy; i < ty; i++) System.out.print("U");
        for (int i = sx; i < tx; i++) System.out.print("L");
        for (int i = sy; i < ty; i++) System.out.print("D");
        
        System.out.print("L");
        for (int i = sy; i <= ty; i++) System.out.print("U");
        for (int i = sx; i <= tx; i++) System.out.print("R");
        System.out.print("DR");
        for (int i = sy; i <= ty; i++) System.out.print("D");
        for (int i = sx; i <= tx; i++) System.out.print("L");
        System.out.print("U");
        
    }
}


Measured memory_bytes: 25412
//By : BebekJK
#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;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//Declare -> ordered_set NAMA;
//Nth smallest integer -> find_by_order(N-1)
//Number of elements less than N -> order_of_key(N)
//Delete N from the set -> erase(N)

#define endl '\n'
#define MOD 1000000007
#define PI 3.141592653
#define fi first
#define sc second
#define pb push_back
#define pbb pop_back

//#pragma GCC optimize("Ofast")
//#pragma GCC target ("string"...)
//#pragma GCC push_options
//#pragma GCC pop_options
//#pragma GCC reset_options
//#pragma GCC optimize ("O3")

typedef long long ll;
typedef long double ld;
typedef pair<int , int> pii;
typedef pair<long long , long long> pll;

void BOOST(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
}
void fcin(int &x){
	bool neg = false;
	register int c;
	x = 0;
	c = getchar();
	if(c=='-'){
		neg = true;
		c = getchar();
	}
	for(;(c>47 && c<58);c=getchar())x = (x<<1)+(x<<3)+c-48;
	if(neg)x*=-1;
}
ll pmod(ll a , ll b){
	if(b==0)return 1;
	ll temp = pmod(a , b/2);
	if(b%2==0)return(temp*temp)%MOD;
	return (((temp*temp)%MOD)*a)%MOD;
}
ll N , Arr[200005] , Max , Ans;
int main(){
	cin>>N;
	for(int i=1;i<=N;i++)cin>>Arr[i];
	for(int i=1;i<=N;i++){
		if(Arr[i] >= Max)Max = Arr[i];
		else Ans+=(Max-Arr[i]);
	}
	cout<<Ans<<endl;
}







Measured memory_bytes: 5160
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
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; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        cin >> N;
        vll A(N);
        rep(i, 0, N) cin >> A[i];

        set<ll> s;
        rep(i, 0, N) s.insert(A[i]);

        if (even(len(s))) {
                cout << len(s) - 1 << endl;
        } else {
                cout << len(s) << endl;
        }
}


Measured memory_bytes: 8732
#include<stdio.h>
int main(){
	int i,j,k,a[2][10],x=0;
	for(i=0;i<2;i++)for(j=0;j<10;j++)scanf("%d",&a[i][j]);
	for(i=0;i<2;i++)for(j=0;j<10;j++)for(k=j;k<10;k++){
		if(a[i][k]>a[i][j]){
			x=a[i][j];
			a[i][j]=a[i][k];
			a[i][k]=x;
		}
	}
	i=a[0][0]+a[0][1]+a[0][2];
	j=a[1][0]+a[1][1]+a[1][2];
	printf("%d %d\n",i,j);
	return 0;
}


Measured memory_bytes: 2064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int t = i;
    int d = 0;
    while (t > 0) {
      d++;
      t /= 10;
    }
    if (d % 2 == 1) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lli long long int
#define MO 1000000007
using namespace std;
vector<lli>fact(2001,1);
int main()
{
    string str;
    lli n,i,count=0;
    
    cin >> n;
    cin >> str;
    for(i=0;i<str.length()-2;i++)
    {
    	if(str[i]=='A' && str[i+1]=='B' && str[i+2]=='C')	count++;
	}
	cout << count << endl;
    
    return 0;
}


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

#define  SZ(items) (int)items.size()
#define  CLR(a)  memset(a,0,sizeof(a))
#define  SET(a)  memset(a,-1,sizeof(a))

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

template <class T> inline T biton(T n, T pos) { return n | ((T)1 << pos); }
template <class T> inline T bitoff(T n, T pos) { return n & ~((T)1 << pos); }
template <class T> inline T ison(T n, T pos) { return (bool)(n & ((T)1 << pos)); }
template <class T> inline T gcd(T a, T b) { while (b) { a = a%b; swap(a, b); } return a; }
template <class T> inline T bigmod(T p, T e, T m) { T ret = 1; for (; e > 0; e >>= 1) { if (e & 1) ret = (ret * p) % m; p = (p * p) % m; } return (T)ret; }

char grid[2005][2005];

int res[2005][2005][2];

void solve() {

	int h, w;
	cin >> h >> w;


	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			cin >> grid[i][j];
		}
	}

	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
	
			if (grid[i][j] == '.' && res[i][j][0] == 0)
			{
				int start = j;
				int end = j;

				while (true) {

					if (end > w) {
						end = w;
						break;
					}
					if (grid[i][end] == '#') {
						end--;
						break;
					}
					end++;
				}

				for (int k = start; k <= end; k++) {
					res[i][k][0] = end - start + 1;
				}
			}
		}
	}


	for (int j = 1; j <= w; j++) {
		for (int i = 1; i <= h; i++) {

			if (grid[i][j] == '.' && res[i][j][1] == 0)
			{
				int start = i;
				int end = i;

				while (true) {

					if (end > h) {
						end = h;
						break;
					}
					if (grid[end][j] == '#') {
						end--;
						break;
					}
					end++;
				}

				for (int k = start; k <= end; k++) {
					res[k][j][1] = end - start + 1;
				}
			}
		}
	}

	int mx = 0;

	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {

			if (grid[i][j] == '.')
			{
				mx = max(mx, res[i][j][0] + res[i][j][1]-1);
			}
		}
	}

	cout << mx << endl;
}

int main()
{

	ios_base::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(10); cout.tie(nullptr); cin.tie(nullptr);

	int t = 1;

	while (t--) {

		solve();
	}


	return 0;
}

Measured memory_bytes: 35584
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, 0, n) cin >> a[i];
  int max_val = *max_element(a.begin(), a.end());
  int min_val = *min_element(a.begin(), a.end());
  cout << max_val - min_val << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <climits> 
#include <time.h>

int main()
{
 //clock_t start=clock();
    long N;
    std::cin >> N;
    long A[200000]={};
    for(long i=0; i<N; i++){
        std::cin >> A[i];
    }

    long B[200000]={};
    long C[200000]={};
    for(long i=0; i<N; i++){
        long Bs,Cs;
        Bs=(i+1)+A[i];
        Cs=(i+1)-A[i];
        if(0<Bs && Bs<=200000){
            B[Bs-1]++;
        }
        if(0<Cs && Cs<=200000){
            C[Cs-1]++;
        }
    }
    long count=0;
    for(long i=0;i<200000;i++){
        count+=(B[i]*C[i]);
    }
    std::cout << count << std::endl;
    //clock_t end=clock();
//std::cout << static_cast<double>(end-start)/CLOCKS_PER_SEC * 1000.0 << std::endl;
    return 0;
}

Measured memory_bytes: 8324
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<iostream>

using namespace std;

struct Node {
    int key;
    Node *right, *left, *parent;
};

Node *root, *NIL;

Node * treeMinimum(Node *x) {
    while(x->left!=NIL) 
             x=x->left;
    return x;
}

Node * find(Node *u,int k) {
    while( u!=NIL&&k!=u->key) {
        if (k<u->key)
                      u=u->left;
        else 
                     u=u->right;
        
    }
    return u;
}

Node * treeSuccessor(Node *x) {
    if (x->right!=NIL) 
           return treeMinimum(x->right);
    Node *y = x->parent;
    while( y != NIL && x == y->right ) {
           x = y;
           y = y->parent;
        
    }
         return y;
}

 void treeDelete(Node *z) {
      Node *y; 
      Node *x;     

      if ( z->left == NIL || z->right == NIL ) 
                        y = z;
      else 
                        y = treeSuccessor(z);

     if ( y->left != NIL ) {
         x = y->left;
     }else {
         x = y->right;
         
     }
     
     if(x!=NIL){
         x->parent=y->parent;
     }
     
     if(y->parent==NIL){
         root=x;
     }else {
         if(y==y->parent->left){
             y->parent->left=x;
         } else{
              y->parent->right=x;
         }
     }
   
     if(y!=z){
         z->key = y->key;
     }
     
     free(y);
 }
void insert(int k){
    Node *y = NIL;
    Node *x = root;
    Node *z;
    z = (Node *)malloc(sizeof(Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;
    while ( x != NIL ) {
        y = x;
        if ( z->key < x->key ) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
        z->parent =y;
        if(y==NIL){
            root=z;
        } else{
            if(z->key < y->key){
                y->left =z;
            } else{
                y->right=z;
            }
        }
    }
    

void inorder(Node *u){
    if ( u == NIL ) 
              return;
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}

void preorder(Node *u){
    if ( u == NIL )
           return;
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
     }

int main(){
    int n, i, x;
    string com;
     scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ) {
        cin >> com;
         if ( com[0] == 'f' ) {
scanf("%d", &x);
Node *t = find(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
         }
else
     if ( com == "insert" ) {
        scanf("%d", &x);
       insert(x);
} 
else
      if ( com == "print" ) {
        inorder(root);
        printf("\n");
        preorder(root);
        printf("\n");
}
 else 
       if ( com == "delete") {
          scanf("%d", &x);
         treeDelete(find(root, x));
        }
         }
             return 0;
         }




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

using namespace std;

int mod=1e9+7;

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

    int a,b;
    cin>>a>>b;

    int ans=a;

    if(a>b)ans--;

    cout<<ans<<endl;

}

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

using Int = long long;
template<class T> inline void chmin(T & x, T y) { x = min(x, y); }

const int N = 1<<11<<3;
int n;
int A[N];
vector<int> adj[N];

struct Answer {
	int min_cost_allpositive;
	vector<Int> min_sum;
};

Answer dfs(int x, int pare) {
	int min_cost_allpositive = (A[x] > 0) ? 0 : 1e9;
	vector<Int> min_sum (1, A[x]);
	for (int y : adj[x]) if (y != pare) {
		Answer sub = dfs(y, x);
		int min_cost_allpositive2 = 1e9;
		vector<Int> min_sum2 (min_sum.size() + sub.min_sum.size(), 1e18);
		// 1. cut
		{
			chmin(min_cost_allpositive2, min_cost_allpositive + 1 + sub.min_cost_allpositive);
			for (int child = 0; child < (int) sub.min_sum.size(); child++)
				if (sub.min_sum[child] < 0)
					chmin(min_cost_allpositive2, min_cost_allpositive + 1 + child);
			for (int at = 0; at < (int) min_sum.size(); at++)
				for (int child = 0; child < (int) sub.min_sum.size(); child++)
					if (sub.min_sum[child] < 0)
						chmin(min_sum2[at + child + 1], min_sum[at]);
			if (sub.min_cost_allpositive != 1e9)
				for (int at = 0; at < (int) min_sum.size(); at++)
					chmin(min_sum2[at + sub.min_cost_allpositive + 1], min_sum[at]);
		}
		// 2. do not cut
		{
			chmin(min_cost_allpositive2, min_cost_allpositive + sub.min_cost_allpositive);
			for (int at = 0; at < (int) min_sum.size(); at++)
				for (int child = 0; child < (int) sub.min_sum.size(); child++)
					chmin(min_sum2[at + child], min_sum[at] + sub.min_sum[child]);
		}
		min_cost_allpositive = min_cost_allpositive2;
		min_sum = min_sum2;
	}
	return {min_cost_allpositive, min_sum};
}

int main() {
	cin >> n;
	for (int i=1; i<=n; i++) cin >> A[i];
	for (int e=0; e<n-1; e++) {
		int x, y; cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	Answer the_answer = dfs(1, 1);
	int answer = the_answer.min_cost_allpositive;
	for (size_t i = 0; i < the_answer.min_sum.size(); i++) {
		if (the_answer.min_sum[i] < 0) answer = min<int>(answer, i);
	}
	cout << answer << endl;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int r, g, b;
  cin >> r >> g >> b;
  if((100*r + 10*g + b) % 4 == 0 ){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

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

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	int mx = 0;
	int sum = 0;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		mx = max(x, mx);
		sum += x;
	}
	sum -= mx;
	if (sum > mx) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;	
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
using namespace std;

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


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

	vector<int> vec(100010);
	rep(i, N) {
		cin >> vec.at(i);
	}
	vector<bool> visit(N, false);

	int idx = 0;
	int cnt = 0;
	while (!visit.at(idx)) {

		int prev = idx;
		idx = vec.at(idx) - 1;
		cnt += 1;
		if (idx == 1) {
			cout << cnt << endl;
			return 0;
		}
		visit.at(prev) = true;
	}
	cout << -1 << endl;
}

Measured memory_bytes: 640
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int64_t, int64_t>;
constexpr int64_t kInf = INT64_MAX / 2L;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  int64_t N, K;
  string S;
  cin >> N >> K >> S;
  vector<int64_t> A(N);
  vector<int64_t> counts;
  int64_t count = 0;
  int64_t pval = 1;
  for (int64_t i = 0; i < N; ++i) {
    const int64_t cval = static_cast<int64_t>(S[i] - '0');
    if (cval == pval) {
      ++count;
    } else {
      counts.emplace_back(count);
    // cerr << " " << count << endl;
      count = 1;
      pval = cval;
    }
  }
  if (count > 0) {
    counts.emplace_back(count);
  }
  if (S[N - 1] == '0') {
    counts.emplace_back(0);
  }
  int64_t result = 0;
  for (int64_t i = 0; i < static_cast<int64_t>(counts.size()); i += 2) {
    int64_t sum = 0;
    for (int64_t j = i; j < min(static_cast<int64_t>(counts.size()), i + K * 2 + 1); ++j) {
      sum += counts[j];
    }
    result = max(result, sum);
    // cerr << " " << sum << endl;
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 5252
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner in = new Scanner(System.in);
    	double r = in.nextDouble();
    	double l = r * 2 * Math.PI;
    	double s = r*r * Math.PI;
    	System.out.printf("%.6f %.6f",s,l);
	}
}

Measured memory_bytes: 18916
n,x,y=map(int,input().split())
ans=[0]*n #個数を数えるのにバケットを用意する
for i in range(1,n+1): #i<jなるすべての頂点の組について最短距離を求める
    for j in range(i+1,n+1):
        dist1=j-i
        dist2=abs(x-i)+abs(y-j)+1
        dist3=abs(y-i)+abs(x-j)+1
        d=min(dist1,dist2,dist3) #最短距離は上式により求められる
        ans[d]+=1 #最短距離がdとなる組の個数を1増やす
for i in range(1,n):
    print(ans[i])

Measured memory_bytes: 3444
#include<stdio.h>
int main(){
	char s[3];
	scanf("%s",&s);
	int i;
		if((s[0]=='B'&&s[1]=='B'&&s[2]=='B')||(s[0]=='A'&&s[1]=='A'&&s[2]=='A')){
			printf("No");
		}
		else{
			printf("Yes");
		}
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
#define int ll
#define fi first
#define se second
#define Sort(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/4
#define INTINF INT_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<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;}
/*----------------------------------------------------------------*/
const int MOD = 998244353;
// const int MOD = 1000000007;

/*----------------------------------------------------------------*/
signed main(){

	int a;
	rep(i,5){
		cin >> a;
		if(a == 0){
			cout<< i+1 << endl;
			return 0;
		}
	}
	


	return 0;
}
/*----------------------------------------------------------------*/

// g++ -std=gnu++17 code1.cpp
// sudo pip3 install --upgrade online-judge-tools
// rm -r -f test;oj dl https://code-festival-2018-quala.contest.atcoder.jp/tasks/code_festival_2018_quala_c
// rm -r -f test;oj dl https://pakencamp-2019-day3.contest.atcoder.jp/tasks/pakencamp_2019_day3_c
// rm -r -f test;oj dl https://atcoder.jp/contests/abc170/tasks/abc170_a


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

////////////////////////////////////////////////////////////////////////

template<typename flow_t>
struct Dinic {
    struct edge {
        int to;
        flow_t cap;
        int rev;
        edge(){}
        edge(int to, flow_t cap, int rev) : to(to), cap(cap), rev(rev) {}
    };

    vector<vector<edge>> G;
    vector<int> level,iter;
    Dinic(){}
    Dinic(int N) : G(N),level(N),iter(N) {} 

    int add_edge(int from, int to, flow_t cap) {
        G[from].emplace_back(to, cap, G[to].size());
        G[to].emplace_back(from, 0, G[from].size()-1);
        return G[to].back().rev;
    }

    void bfs(int s) {
        fill(level.begin(),level.end(),-1);
        queue<int> que;
        level[s] = 0;
        que.emplace(s);
        while (!que.empty()) {
            int v = que.front(); que.pop();
            for(int i = 0; i < (int)G[v].size(); i++) {
                edge &e = G[v][i];
                if(e.cap > 0 && level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    que.emplace(e.to);
                }
            }
        }
    }

    flow_t dfs(int v, int t, flow_t f) {
        if(v == t) return f;
        for (int &i=iter[v]; i < (int)G[v].size(); i++) {
            edge &e = G[v][i];
            if (e.cap > 0 && level[v] < level[e.to]) {
                flow_t d = dfs(e.to, t, min(f,e.cap));
                if (d == 0) continue;
                e.cap -= d;
                G[e.to][e.rev].cap += d;
                return d;
            }
        }
        return 0;
    }

    flow_t flow(int s, int t, flow_t lim) {
        flow_t fl = 0;
        while (true) {
            bfs(s);
            if (level[t] < 0 || lim == 0) break;
            fill(iter.begin(),iter.end(),0);

            while (true) {
                flow_t f = dfs(s,t,lim);
                if (f == 0) break;
                fl += f;
                lim -= f;
            }
        }
        return fl;
    }
};

/////////////////////////////////////////////////////////////////////////////////////////

void GRL_6_A() {
    int N,M; cin >> N >> M;
    Dinic<ll> D(N);
    for (int i = 0; i < M; i++) {
        int u,v,w; cin >> u >> v >> w;
        D.add_edge(u,v,w);
    }
    cout << D.flow(0,N-1,1e18) << endl;
}
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    GRL_6_A();
}


Measured memory_bytes: 3268
#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
const ll c = 1000000007;

ll power(int a, int b){
    ll powered=1;
    if(a == 0){
        return 1;
    }else if(a%2 == 0){
        ll t = power(a/2, b);
        return t*t%c;
    }else{
        return power(a-1, b)*b%c;
    }
}

ll combination(int n, int a){
    ll bunbo=1, bunshi=1;
    for(int i=n; i>n-a; i--){
        bunshi *= i;
        bunshi = bunshi%c;
    }
    for(int j=1; j<a+1; j++){
        bunbo *= power(c-2, j)%c;
        bunbo = bunbo%c;
    }
    return bunbo*bunshi%c;
}


int main(){
    int n, a, b; cin >> n >> a >> b;
    ll comba = combination(n, a);
    ll combb = combination(n, b);
    ll ans = power(n,2) - comba - combb - 1;
    //cout << power(n,2) << " " << comba << " " << combb << endl;
    if(ans >= 0) cout << ans << endl;
    else{
        while(ans < 0) ans += c;
        cout << ans << endl;
    }
    
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CSuccessiveSubtraction solver = new CSuccessiveSubtraction();
        solver.solve(1, in, out);
        out.close();
    }

    static class CSuccessiveSubtraction {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            StringBuilder sb = new StringBuilder();
            int n = in.nextInt();
            int pr = 0;
            ArrayList<Integer> ar = new ArrayList<Integer>();
            for (int i = 0; i < n; i++) {
                ar.add(in.nextInt());
            }
            Collections.sort(ar);
            if (ar.get(0) > 0) {
                // all plus
                int res = ar.get(0);
                for (int i = 1; i < ar.size() - 1; i++) {
                    sb.append(res + " " + ar.get(i) + "\n");
                    res -= ar.get(i);
                }
                sb.append(ar.get(ar.size() - 1) + " " + res + "\n");
                pr = ar.get(ar.size() - 1) - res;
            } else if (ar.get(ar.size() - 1) < 0) {
                // all minus
                int res = ar.get(ar.size() - 1);
                for (int i = 0; i < ar.size() - 1; i++) {
                    sb.append(res + " " + ar.get(i) + "\n");
                    res -= ar.get(i);
                }
                pr = res;
            } else {
                // ar(0) < 0
                // ar(size-1) > 0
                int high = ar.get(ar.size() - 1);
                int low = ar.get(0);
                for (int i = 1; i < ar.size() - 1; i++) {
                    if (ar.get(i) < 0) {
                        sb.append(high + " " + ar.get(i) + "\n");
                        high -= ar.get(i);
                    } else {
                        sb.append(low + " " + ar.get(i) + "\n");
                        low -= ar.get(i);
                    }
                }
                pr = high - low;
                sb.append(high + " " + low + "\n");
            }
            String ans = new String(sb);
            out.println(pr);
            out.print(ans);

        }

    }
}



Measured memory_bytes: 66352
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <deque>
#include <iomanip>
#include <cstdio>
#include <stack>
#include <numeric>

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf 1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define mod 1000000007
unsigned int dp[10001]={};
unsigned int dp2[5001][10001]={};
int main(){
    int n,k;
    cin >> n >> k;
    vector<int>a;
    rep(i,n){
        int t;
        cin >> t;
        if(t<k){
            a.push_back(t);
        }
    }
    n = a.size();
    ll s = 0;
    rep(i,n){
        s += a[i];
    }
    if(s<k){
        cout << n << endl;
        return 0;
    }
    dp[0] = 1;
    for(int i=0;i<n;i++){
        unsigned int dp3[10001]={};
        for(int j=10000-a[i];j>=0;j--){
            if(dp[j]>0){
                dp3[j+a[i]] += dp[j];
                dp3[j+a[i]] %= mod;
            }
        }
        for(int j=10000;j>=0;j--){
            dp3[j] += dp[j];
            dp3[j] %= mod;
        }
        for(int j=10000;j>=0;j--){
            dp[j] = dp3[j];
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<=10000;j++){
            
            if(j-a[i]>=0)dp2[i][j] = (mod+dp[j]-dp2[i][j-a[i]])%mod;
            else{
                dp2[i][j] = (mod+dp[j])%mod;
            }
        }
    }
    int cnt = 0;
    for(int i=0;i<n;i++){
        bool flag = 1;
        for(int j=k;j<k+a[i];j++){
            //cerr << i << " "<< j << " "  << dp[n][j] << " " << dp2[i][j] << endl;
            if(dp[j]!=dp2[i][j]){
                flag = 0;
            }
        }
        if(flag){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 195712
//
// Created by kuroneko on 2019-07-06.
//

using namespace std;

#include <iostream>

int main() {
    int N, L; cin >> N >> L;
    int taste[N];
    int min_taste = 1e9;
    int sum_taste = 0;
    for (int i = 0; i < N; i++) {
        taste[i] = L + i;
        if (abs(taste[i]) < abs(min_taste)) {
            min_taste = taste[i];
        }
        sum_taste += taste[i];
    }
    cout << sum_taste - min_taste << endl;
    return 0;
}

Measured memory_bytes: 256
// Traveling Budget

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <ios>
#include <iomanip>
#include <string>
#include <numeric>

using namespace std;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 1;
const long long LINF = (long long)9e18 + 1;

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

	string S, T;
	int cnt = 0;

	cin >> S >> T;

	for (int i = 0; i < 3; i++)
	{
		if (S[i] == T[i])
		{
			cnt++;
		}
	}

	cout << cnt << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10



bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

ll gcd(ll a,ll b) { return b ? gcd(b, a%b) : a; }

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}
const ll MAX = 5100000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

using graph = vector<vector<ll>>;
pair<pair<ll,ll>,ll> p[100010];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s;
    cin>>s;
    rep(i,s.size()){
        if(s[i]=='?') s[i]='D';
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 3728
#include<bits/stdc++.h>
 
using namespace std;
 
 
 
int main() {
	
	ios_base :: sync_with_stdio(0); cin.tie(NULL);
 
	int x, y;	
	cin >> x >> y;
 
	int t = (y - 2 * x) / 2;
	int c = x - t;
 
	if (t < 0 || c < 0)
		cout << "No" << '\n';
	else if (t + c != x || 2 * c + 4 * t != y) {
		cout << "No" << '\n';
	}
	else cout << "Yes" << '\n';
 
	return 0;	
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
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; }
const long double PI = acos(-1);
const long double EPS = 1e-9;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;


int main(){
    double a, b, x;
    cin >> a >> b >> x;


    function<bool(double)> check = [&](double mid){
        double s;
        if(a*tan(mid) <= b){
            s = a*b - 0.5*a*(a*tan(mid));
        }
        else{
            s = 0.5*b * b/tan(mid);
        }
        return s < x/a;
    };

    function<double(void)> binary_search = [&](){
        double ng = 0;
        double ok = PI/2;
        
        rep(i, 200){
            double mid = (ok + ng) / 2;
            if(check(mid)) ok = mid;
            else ng = mid;
        }
        return ok;
    };


    cout << setprecision(9) << binary_search()/PI*180 << endl;
}

Measured memory_bytes: 640