akhauriyash/Code-Regression huggingface dataset:
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item = U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}

const INF: usize = 1 << 60;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let K: usize = sc.get();
    let a: Vec<usize> = sc.vec(N);
    let mut ans = INF;
    for bit in 0..1<<(N-1) {
        if usize::count_ones(bit) as usize != K-1 {
            continue;
        }
        let mut price = 0;
        let mut max_h = a[0];
        for i in 1..N {
            if bit>>(i-1) & 1 != 0 {
                if a[i] <= max_h {
                    price += max_h - a[i] + 1;
                    max_h += 1;
                }
            }
            max_h = max(max_h, a[i]);
        }
        ans = min(ans, price);
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
n = int(input())
person = list(map(int,input().split())) 
color = [False] * 8
over = []

for i in range(n) :
    if (person[i] < 400) :
        color[0] = True
    elif (person[i] < 800) :
        color[1] = True
    elif (person[i] < 1200) :
        color[2] = True
    elif (person[i] < 1600) :
        color[3] = True
    elif (person[i] < 2000) :
        color[4] = True
    elif (person[i] < 2400) :
        color[5] = True
    elif (person[i] < 2800) :
        color[6] = True
    elif (person[i] < 3200) :
        color[7] = True
    else :
        over.append(True)

p = color.count(True)
if ((color.count(True) == 0) and (over.count(True) > 0)) :
    p = 1

q = color.count(True) + over.count(True)

print(p,q)

Measured memory_bytes: 3316
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var N = Sarray()[0];
            if(N%2!=0)
            {
                WriteLine(0);
                return;
            }
            N /= 2;
            var ans = 0L;
            while (N != 0)
            {
                ans += N / 5;
                N /= 5;
            }
            WriteLine(ans);
            //Out.Flush();
        }
    }
}

Measured memory_bytes: 13396
N, L = map(int, input().split())
# N = 30
# L = -50
T_N = (N**2 + (2*L -1)*N)/2
# print(T_N)
array = []
num = 0
for i in range(1,N+1):
    T_i = L + i -1
    T_Ni = T_N - T_i
#     print(T_i)
    T_abs = abs(T_N - T_Ni)
    array.append(T_abs)
    if (min(array) == T_abs):
        num = T_Ni
# print(array)
print(int(num))

Measured memory_bytes: 3060
from copy import deepcopy

def readinput():
    h,w,k=list(map(int,input().split()))
    c=[]
    for _ in range(h):
        l=list(input())
        c.append(l)
    return h,w,k,c

def printC(c):
    for l in c:
        print(l)

def main(h,w,k,c):
    ans=0
    for g in range(2**h):
        for r in range(2**w):
            cc=deepcopy(c)
            for i in range(h):
                b=2**i
                if g & b == b:
                    for j in range(w):
                        cc[i][j]='*'
            for j in range(w):
                b=2**j
                if r & b == b:
                    for i in range(h):
                        cc[i][j]='*'
            #print(g,r)
            #printC(cc)
            count=0
            for i in range(1,h+1):
                for j in range(1,w+1):
                    if cc[i-1][j-1]=='#':
                        count+=1
            if count==k:
                ans+=1

    return ans

if __name__=='__main__':
    h,w,k,c=readinput()
    ans=main(h,w,k,c)
    print(ans)


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

using namespace std;
typedef long long ll;

int main()
{
    int n;
    cin >> n;
    ll a=0;
    for(ll i=1;i<=n;i++) if((i%3)>0&&(i%5)>0) a+=i;
    cout << a << endl;
    return 0;
}


Measured memory_bytes: 3652
import sys
write = sys.stdout.write

temp = list(map(int,input().split()))
sx = temp[0]
sy = temp[1]
tx = temp[2]
ty = temp[3]
H = ty - sy
W = tx - sx
for i in range(H):
    write("U")
for i in range(W):
    write("R")
for i in range(H):
    write("D")
for i in range(W+1):
    write("L")
for i in range(H+1):
    write("U")
for i in range(W+1):
    write("R")
write("D")
write("R")
for i in range(H+1):
    write("D")
for i in range(W+1):
    write("L")
write("U\n")

Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
int ans[100000];
int finish[100000];
void DFS(int src,int n,vector<int> adj[],bool visited[],int &count){
    visited[src]=true;
    ++count;
    for(unsigned i=0;i<adj[src].size();i++)
    if(!visited[adj[src][i]]) DFS(adj[src][i],n,adj,visited,count);
    finish[src]=++count;
}
bool Comparator(int i,int j){
    if(finish[i]>finish[j]) return true;
    else return false;
}
void topoSort(int n,vector<int> adj[],int ans[]){
    bool visited[n];
    for(int i=0;i<n;i++) visited[i]=false;
    int count=0;
    for(int i=0;i<n;i++)
    if(!visited[i]) DFS(i,n,adj,visited,count);
    sort(ans,ans+n,Comparator);
}

int main()
{ int n,m;
cin>>n>>m;
vector<int> adj[n];
int x,y;
for(int i=0;i<m;i++) {
    cin>>x>>y;
    x--;
    y--;
    adj[x].push_back(y);
}
int ans[n];
for(int i=0;i<n;i++) ans[i]=i;
topoSort(n,adj,ans);
int dp[n];
for(int i=0;i<n;i++) dp[i]=0;
for(int i=0;i<n;i++) 
for(unsigned int j=0;j<adj[ans[i]].size();j++)
dp[adj[ans[i]][j]]=max(dp[adj[ans[i]][j]],dp[ans[i]]+1);
int maxi=-1;
for(int i=0;i<n;i++) maxi=max(maxi,dp[i]);
cout<<maxi<<endl;
return 0;
}

Measured memory_bytes: 9984
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
typedef pair<ll,ll> ipair;
#define F first
#define S second
 
/*
//functions from gfg
 
long long int power(long long int x,long long int y,long long  int p)
{
    long long int res = 1;     // Initialize result
 
    x = x % p;  // Update x if it is more than or 
                // equal to p
 
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            {//d=(long double)x/p;
            res = (res*x) % p;
            }
 
        // y must be even now
        y = y>>1; // y = y/2
        x=(x*x)%p;
        
    }
    return res%p;
}
 
long long int gcd(long long int a,long long int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
 
long long int binomialCoeff(long long int n, ll k) 
{ 
    ll res = 1; 
  
    // Since C(n, k) = C(n, n-k) 
    if (k > n - k) 
        k = n - k; 
  
    // Calculate value of [n*(n-1)*---*(n-k+1)] / [k*(k-1)*---*1] 
    for (ll i = 0; i < k; ++i) 
    { 
        res *= (n - i); 
        res /= (i + 1); 
    } 
  
    return res; 
} 
 

void sieve(int n, vector<ll> &primes) 
{ 
    vector<int> prime(n,1);
    ll p;
    for ( p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == 1) 
        { 
            
            for (int i=p*p; i<=n; i += p) 
                prime[i] = 0; 
        } 
    } 
  
    for(p=2;p<=n;p++)
    {
        if(prime[p])
        primes.pb(p);
    }
   
} 


void dfs(vector<ll> adj[] ,ll src,vector<ll> &vis)
{
    vis[src]=1;
    for(ll i=0;i<adj[src].size();i++)
    {
        if(vis[adj[src][i]]==0)
        dfs(adj,adj[src][i],vis)
    }
}
 
*/

int main() {
	ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);
    
    
	ll n,i,j,p,k,m,ans=0;
    cin>>n;
    vector<string> a(n);
    map<string,ll> mp;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        sort(a[i].begin(),a[i].end());
        ans+=mp[a[i]];
        mp[a[i]]++;
    }
    cout<<ans<<endl;
    
    
    
    
    
    
    // for(i=0;i<n;i++)
    // {
    //     cout<<a[i]<<" ";
    // }
    // cout<<endl;
    
	return 0;
}

Measured memory_bytes: 14224
import numpy as np

a, b, x = map(int, input().split())
ans = 0
if a*a*b > 2*x:
    ans =180.0/np.pi*np.arctan((a*b*b)/(2*x))
else:
    ans = 180.0/np.pi*np.arctan((2*(a*a*b-x))/a**3)

print(ans)



Measured memory_bytes: 12488
def comb(n, r, p):
    numer = 1
    denom = 1
 
    for i in range(n-r+1, n+1):
        numer = numer * i % p
    for i in range(1, r+1):
        denom = denom * i % p
    return numer * pow(denom, p-2, p) % p
 
p = pow(10, 9) + 7
n, a, b = map(int, input().split())
print(((pow(2, n, p) - comb(n, a, p) - comb(n, b, p) - 1)) % p)
 

Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
bool solve(){
	int h,w;
	cin>>h>>w;
	string s[50];
	rep(i,h) cin>>s[i];
	vector<char> ash;
	rep(i,h) rep(j,w) if(s[i][j]!='.') ash.pb(s[i][j]);
	sort(all(ash));
	ash.erase(unique(all(ash)),ash.end());
	map<char,int> mp;
	rep(i,ash.size()) mp[ash[i]]=i;
	int n=ash.size();
	if(n==0) return true;
	int ord[7];
	rep(i,n) ord[i]=i;
	do{
		bool can=true;
		int inv[7];
		rep(i,n) inv[ord[i]]=i;
		rep(i,n){
			int o=ord[i];
			int l=100,r=-1,u=100,b=-1;
			rep(j,h) rep(k,w){
				if(s[j][k]!='.'&&s[j][k]==ash[o]){
					l=min(l,k),r=max(r,k),u=min(u,j),b=max(b,j);
				}
			}
			for(int j=u;j<=b;j++) for(int k=l;k<=r;k++){
				if(s[j][k]=='.'||inv[mp[s[j][k]]]>i){
					can=false;
					goto hoge;
				}
			}
		}
		hoge:
		if(can) return true;
	}while(next_permutation(ord,ord+n));
	return false;
}
int main(){
	int t;
	cin>>t;
	rep(tt,t){
		if(solve()) puts("SAFE");
		else puts("SUSPICIOUS");
	}
}

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

const int64_t INF=pow(10,18);
int64_t N,K;
vector<int64_t> A;

//ソート済みの数列Aに対して、A[i]A[j]>=Xなる(i,j)の数を求める
int64_t binary(int i,int64_t X){

  if(A[i]==0){
    if(X<=0) return N;
    else return 0;
  }

  if(A[i]>0){
    int64_t r=N;
    int64_t l=-1;
    while(r-l>1){
      int64_t mid=(l+r)/2;
      if(A[i]*A[mid]>=X) r=mid;
      else l=mid;
      if(r-l==1) return N-r;
    }
  }

  if(A[i]<0){
    int64_t r=N;
    int64_t l=-1;
    while(r-l>1){
      int64_t mid=(l+r)/2;
      if((-A[i])*A[mid]>-X) r=mid;
      else l=mid;
      if(r-l==1) return l+1;
    }
  }

}


int main(){
  cin>>N>>K;
  A.resize(N);
  for(int i=0;i<N;++i) cin>>A[i];
  sort(A.begin(),A.end());

  int64_t r=INF+1;
  int64_t l=-INF-1;
  while(r-l>1){
    int64_t mid=(l+r)/2;
    int64_t res=0;
    for(int i=0;i<N;++i){
      res += N-binary(i,mid);
    }
    for(int i=0;i<N;++i){
      if(A[i]*A[i]<mid) --res;
    }

    res /= 2;
    //cout<<res<<endl;

    if(res>=K) r=mid;
    else l=mid;
    if(r-l==1) cout<<l<<endl;
  }
}

Measured memory_bytes: 1792
A, B = $stdin.gets.chomp.split(' ').map(&:to_i)

sum = [B/100 - A/100 - 1, 0].max

strA = A.to_s
cand = (strA[0..2] + strA[1] + strA[0]).to_i
if A <= cand && cand <= B
    sum += 1
end

strB = B.to_s
cand = (strB[0..2] + strB[1] + strB[0]).to_i
if A <= cand && cand <= B
    sum += 1
end

print sum

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

using ll = long long;

int main() {
    ll N, T;
    cin >> N >> T;
    vector<ll> t(N);
    rep(i, N) cin >> t[i];
    t.push_back(1e18);
    ll ans = T;
    rep(i, N - 1) {
        ans += min(t[i + 1] - t[i], T);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 4736
a = int(input())
hs = [int(x) for x in input().split()]

dp = [0]* len(hs)
dp[0] = 0
dp[1] = abs(hs[1] - hs[0])
     
for i in range(2, a):
	dp[i] = min(abs(hs[i-1]- hs[i]) + dp[i-1], abs(hs[i-2]- hs[i]) + dp[i-2] )
      
print(dp[-1])

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

int main() {
	int N, Y;
	cin >> N >> Y;
	
	int x, y, z;
	for (x = 0; x <= N; ++x) {
		for (y = 0; y <= N - x; ++y) {
			z = N - x - y;
			if (10000 * x + 5000 * y + 1000 * z == Y) {
				cout << x << " " << y << " " << z << endl;
				return 0;
			}
		}
	}
	
	cout << "-1 -1 -1" << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a < b) {
            System.out.println("a < b");
        } else if (a > b) {
            System.out.println("a > b");
        } else if (a == b) {
            System.out.println("a == b");
        }
    }
}


Measured memory_bytes: 26248
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set

using namespace std;

const ll MOD = 1000000007;

int main() {
  ll n, k;
  scanf("%lld %lld", &n, &k);

  ll dg = 1;

  ll sum = k;
  for (;;) {
    if (n < sum) {
      break;
    }
    sum = sum * k;
    dg += 1;
  }

  cout << dg << endl;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var a, b, c, k int
	fmt.Scan(&a, &b, &c, &k)

	if a >= k {
		fmt.Println(k)
	} else if a + b >= k {
		fmt.Println(a)
	} else {
		fmt.Println(a-(k-a-b))
	}
}

Measured memory_bytes: 1752
#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int t;

int main()
{
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
    int a,b,c;
    vector<int> vec(15, 0);
    cin>>a>>b>>c;
    vec[a]++;
    vec[b]++;
    vec[c]++;
    if(vec[a]==2 || vec[b]==2) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

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

    string S;
    cin >> S;

    ll n = 3;
    for (ll bit = 0; bit < (1<<n); bit++) {
        ll tmp = S[0]-'0';
        string ans = "";
        ans += S[0];
        for (ll i = 0; i < n; i++) {
            if (bit & (1<<i)) {
                tmp += (S[i+1]-'0');
                ans += "+";
            } else {
                tmp -= (S[i+1]-'0');
                ans += "-";
            }
            ans += S[i+1];
        }

        if (tmp == 7) {
            cout << ans + "=7" << endl;
            return 0;
        }
    }
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    int cnt = 0;
    for(int i = 2; i < (int)s.size() - 1; ++i) {
        cnt += s[i] == 'C';
    }
    int cnt2 = 0;
    for(int i = 0; i < (int)s.size(); ++i) {
        cnt2 += 'A' <= s[i] && s[i] <= 'Z';
    }
    cout << (s[0] == 'A' && cnt == 1 && cnt2 == 2 ? "AC" : "WA") << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <set>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define 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 llong long long
#define pb(a) push_back(a)

#define INF 100000000
#define MOD 100000007

#define writeln(n) cout<<n<<endl

using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

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

llong pownew(llong m, llong n) {
    if (n == 0) { return 1; }
    if (n % 2 == 0) { return pow(m*m, n/2); }
    return pow(m, n-1) * m;
}

bool isprime(int p) {
    if (p == 1) return false;
    for (int i = 2; i < p; i++) {
        if (p%i == 0) return false;
    }
    return true;
}

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

const int inf=100000000;

long long modpow(long long a, long long n, long long mod) //a^n
{
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

llong gcd(llong a, llong b) {
    return b != 0 ? gcd(b, a % b) : a;
}
//setprecision(10);



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int k,x; cin>>k>>x;
    int cnt=x-k+1;
    for(int i=0; i<k*2-1; i++)
    {
        cout<<cnt<<" ";
        cnt++;
    }
    cout<<endl;


    return  0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include<cstring>
#include <math.h>
typedef long long ll;
using namespace std;
using namespace std;
const int MAXN = 2e5+7;
char a[1000];
int main()
{
    double n;
     double a,b,x;
    cin>>n;
    x=a=b=n/3;
   printf("%lf",a*b*x);
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
 
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;
 
#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,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second
 
int main(int argc, char **argv) {
	ll n, a, b;
	cin >> n >> a >> b;
	ll res = 0;
	FOR(i, 1, n+1) {
		ll s = 0, v = i;
		while (v > 0) {
			s += v % 10;
			v /= 10;
		}
		if (s >= a && s <= b) res += i;
	}
	cout << res << endl;
	return 0;
}
 

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

#define int long long

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

/*
#define cin ifs
#define cout ofs
ifstream ifs("in.txt");
ofstream ofs("out.txt");
//*/

int N;

signed main() {
    cin >> N;
    bitset<50> bs(N);
    stack<int> stk;
    int max_bit = 0;
    for (int i = 49; i >= 0; i--) {
        if (bs[i]) {
            stk.push(i);
            max_bit = max(max_bit, i);
        }
    }
    cout << stk.size() + max_bit + 100 << endl;
    cout << 100;
    for (int i = 0;; i++) {
        if (stk.top() == i) {
            if (stk.size() != 1) {
                cout << " " << stk.size() + max_bit - 1;
            }
            stk.pop();
        }
        if (stk.empty()) {
            break;
        }
        cout << " " << i + 1;
    }
    for (int i = 1; i <= 100; i++) {
        cout << " " << i;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);

	int N,a4=0,a2=0,a1=0;
    cin >> N;
    long long int a;
    string result="No";
    for(int i=0;i<N;i++){
        cin >> a;
        if(a%4==0) a4++;
        else if(a%2==0) a2++;
        else a1++;
    }
    if(a2>0) a1++;
    if((a1-2)<a4) result="Yes";

	cout << result << "\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);

		int[][] color = new int[s.nextInt()][3];

		int count = s.nextInt();
		int sum = count * color.length;
		char[] line = null;
		int sub = 0;
		int sub_2 = 0;
		int sub_3 = 0;
		int sub_4 = 0;

		for(int i = 0; i < color.length; i++)
			for(int j = 0; j < 3; j++)
				color[i][j] = 0;

		for(int i = 0; i < color.length; i++){

			line = s.next().toCharArray();

			for(int j = 0; j < count; j++){

				if(line[j] == 'W')
					color[i][0]++;
				else if(line[j] == 'B')
					color[i][1]++;
				else
					color[i][2]++;

			}

		}

		s.close();

		for(int i = 0; i < color.length - 2; i++){

			for(int j = i + 1; j < color.length - 1; j++){

				for(int k = 1; (k <= i && i != 0); k++)
					sub_2 += count - color[k][0];
				for(int l = i + 1; l <= j; l++)
					sub_3 += count - color[l][1];
				for(int m = j + 1; m < color.length - 1; m++)
					sub_4 += count - color[m][2];
				sub = sub_2 + sub_3 + sub_4;

				if(sub < sum)
					sum = sub;

				sub_2 = sub_3 = sub_4 = 0;

			}

		}


		sum += count - color[0][0];
		sum += count - color[color.length - 1][2];


		System.out.println(sum);

	}

}

Measured memory_bytes: 26360
let () = Scanf.scanf "%d %d\n" @@ fun n c ->
  let xvs = Array.init (n + 2) @@ function
    | 0 -> 0, 0
    | i when i = n + 1 -> c, 0
    | _ -> Scanf.scanf "%d %d\n" @@ fun x v -> x, v in
  let acc = Array.map snd xvs in
  for i = 1 to n + 1 do
    acc.(i) <- acc.(i) + acc.(i - 1)
  done;
  let ans_a = Array.copy acc in
  for i = 1 to n + 1 do
    ans_a.(i) <- max (acc.(i) - fst xvs.(i)) ans_a.(i - 1)
  done;
  let acc' = Array.map snd xvs in
  for i = n downto 0 do
    acc'.(i) <- acc'.(i) + acc'.(i + 1)
  done;
  let ans_b = Array.copy acc' in
  for i = n downto 0 do
    ans_b.(i) <- max (acc'.(i) - (c - fst xvs.(i))) ans_b.(i + 1)
  done;
  Printf.printf "%d\n" @@
    Array.fold_left max min_int @@
      Array.init (n + 1) @@ fun i ->
        max
          (acc.(i) - 2 * fst xvs.(i) + ans_b.(i + 1))
          (acc'.(i + 1) - 2 * (c - fst xvs.(i + 1)) + ans_a.(i))


Measured memory_bytes: 10496
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;
    string S,T;
    cin >> S >> T;

    string U = "";

    for(int i=0; i<N; i++){
        U += S.at(i);
        U += T.at(i);
    }

    cout << U << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)
using namespace std;

// _________コーディングはここから！！___________

int n, m, k, i;
constexpr int N = 200010;
int a[N], b[N];
constexpr int sz = 5000000;
char reader[sz];
char *pos = reader;
int nn, now, ans;
int kk;
main() {
    reader[fread(reader, sizeof(char), sizeof(char) * sz, stdin)];
    while('0' <= *pos) n = n * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) m = m * 10 + *pos++ - '0';
    pos++;
    while('0' <= *pos) k = k * 10 + *pos++ - '0';
    nn = n;
    pos++;
    rep(i, n) {
        while('0' <= *pos) {
            a[i + 1] <<= 1;
            a[i + 1] += a[i + 1] << 2;
            a[i + 1] += *pos++ - '0';
        }
        pos++;
        a[i + 1] += a[i];
        if(a[i + 1] > k) {
            nn = i;
            ++i;
            for(; i < n; ++i) {
                while('0' <= *pos) pos++;
                pos++;
            }
            break;
        }
    }
    rep(i, m) {
        while('0' <= *pos) {
            b[i + 1] <<= 1;
            b[i + 1] += b[i + 1] << 2;
            b[i + 1] += *pos++ - '0';
        }
        pos++;
        b[i + 1] += b[i];
        if(b[i + 1] > k) {
            m = i;
            break;
        }
    }
    now = ans = nn;
    for(i = 1; i <= m; i++) {
        kk = k - b[i];
        while(a[now] > kk) now--;
        ans = max(ans, i + now);
    }
    pos = reader;
    i = 0;
    do {
        *pos++ = ans % 10 + '0';
        ans /= 10;
        i++;
    } while(ans);
    reverse(reader, reader + i);
    fwrite(reader, sizeof(char), sizeof(char) * i, stdout);
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define IN freopen("C.in","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define DBG printf("Hi\n")
#define i64 long long int
#define ui64 unsigned long long int
#define eps (1e-10)
#define xx first
#define yy second
#define ln 17
#define off 2

#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace __gnu_pbds;
using namespace std ;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<int,int> pii;

#define log 20
#define mod 998244353LL
#define maxn 100005
#define INF 1000000000

i64 dp[600][maxn] ;
int val[3*maxn] , weight[3*maxn] ;

pair<i64,i64> canMake[5005] ;

int main()
{
    int n ;

    scanf("%d",&n) ;

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

    int loLim = 511 ;

    for(int i=1 ; i<=min(n,loLim) ; i++)
    {
        int par = (i/2) ;
        for(int j=1 ; j<maxn ; j++)
        {
            dp[i][j] = max(dp[par][j] , dp[i][j-1]) ;
            if( weight[i] <= j ) dp[i][j] = max( dp[i][j] , dp[ par ][ j-weight[i] ] + val[i] ) ;
        }
    }

    int q ;
    scanf("%d",&q) ;

    for(int i=1 ; i<=q ; i++)
    {
        int u , l ;
        scanf("%d %d",&u,&l) ;

        int cur = 1 ;
        canMake[1] = mp(0,0) ;

        while( u > loLim )
        {
            for(int j=1 ; j<=cur ; j++)
            {
                canMake[j+cur] = mp( canMake[ j ].xx + weight[u] , canMake[j].yy + val[u] ) ;
            }
            cur *= 2 ;
            u /= 2 ;
        }
        i64 ans = 0  ;
        for(int j=1 ; j<=cur ; j++)
        {
            if( canMake[j].xx <= l ) ans = max( ans , dp[ u ][ l-canMake[j].xx ] + canMake[j].yy ) ;
        }

//        printf("------------------   ") ;
        printf("%lld\n",ans) ;
    }

    return 0 ;
}


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

int main() {
    vector<int> K = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int a;
    cin >> a;
    cout << K[a-1] << endl;
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict

def main():
    N = int(input())
    S = defaultdict(int)
    for i in range(N):
        s = input()
        S[s] += 1
    max_cnt = max(S.values())
    ans = []
    for k,v in sorted(S.items(), key=lambda x:x[1], reverse=True):
        if v == max_cnt:
            ans.append(k)
        else:
            break
    for a in sorted(ans):
        print(a)

if __name__ == '__main__':
    main()

Measured memory_bytes: 117720
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

void c()
{
   int n, k;
    cin >> n >> k;
    map<int, int> a;
    for(int i = 0; i < n; i++)
    {
        int temp;
        cin >> temp;
        if(!a.count(temp))
        {
            a[temp] = 1;
        } else{
            a[temp]++;
        }
    }
    if(a.size() <= k)
    {
        cout << 0 << endl;
    }else{
        vector<int> result;
        for(auto e : a)
        {
            result.push_back(e.second);
        }
        sort(result.begin(), result.end());
        int count = 0;
        for(int i = 0; i < a.size() - k; i++)
        {
            count += result[i];
        }
        cout << count << endl;
    }
}

int main() {
    c();
    return 0;
}


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

typedef long long ll;
#define x first
#define y second

const int N = 2e5 + 10;
const ll mod = 1e9 + 7;


vector < int > cnt[N];
int pt[N], curcnt[N];
int pos[N];
ll ans;
vector < int > esketit(int l, int r)
{
	if (l == r - 1)
	{
		return {pos[l]};
	}
	int m = (l + r) / 2;
	vector < int > res;
	vector < int > f = esketit(l, m);
	vector < int > s = esketit(m, r);
	int pt = 0;
	for (int i = 0; i < f.size(); ++i)
	{
		while (pt < s.size() && s[pt] < f[i])
		{
			res.push_back(s[pt]);
			++pt;
			ans += ll(f.size() - i);
		}
		res.push_back(f[i]);
	}
	while (pt < s.size())
	{
		res.push_back(s[pt]);
		++pt;
	}
	return res;
}
string s;

main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	#ifdef KEK
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	cin >> s;

	for (int i = 0; i < s.size(); ++i)
	{
		cnt[s[i]].push_back(i);

	}
	
	int kek = 0;
	int aye = 0;
	for (int i = 'a'; i <= 'z'; ++i)
	{
		pt[i] = (int)cnt[i].size() - 1;

		if (cnt[i].size() % 2) ++kek, aye = i;
	}	
	if (kek > 1)
	{
		cout << -1;
		return 0;
	} 

	int cur = -1;
	for (int i = 0; i < s.size(); ++i)
	{
		++curcnt[s[i]];
		if (curcnt[s[i]] <= cnt[s[i]].size() / 2)
		{
			//cout << i << endl;
			++cur;
			pos[i] = cur;
			pos[cnt[s[i]][pt[s[i]]]] = s.size() - cur - 1;
			--pt[s[i]];
		} else if (curcnt[s[i]] == cnt[s[i]].size() / 2 + 1 && cnt[s[i]].size() % 2 != 0)
		{
			//cout << "AA" << endl;
			pos[i] = (s.size() - 1) / 2;
		}
	}
	esketit(0, s.size());

	cout << ans;
	return 0;	
}

Measured memory_bytes: 9612
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mod 1000000007
#define mod2 998244353
#define ll long long int
#define pi 3.141592653589793238
const int N = 1e5 + 10;
int main(){
    FAST;
    ll t=1;
    // cin>>t;
    while(t--)
    {
       ll k;
        cin>>k;
        while(k--)
        {
            cout<<"ACL";
        }
    }
    return 0;
}


Measured memory_bytes: 3588
#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 <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define PI 3.141592653589793238
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
typedef complex<double> com;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

int solve(vector<PP> p) {
	int n = p.size();
	int sum = 0;
	rep(i, n) sum += p[i].first;
	bool flag = true;
	rep(i, n) if (p[0].second.first != p[i].second.first) flag = false;
	if (flag) return sum;
	set<int> st;
	rep(i, n) st.insert(p[i].second.second);
	if (st.size() == n) return INF;
	return sum;
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	//modcalc();

	int n;
	cin >> n;
	vector<int> a(n), b(n);
	vector<PP> p(2 * n);
	rep(i, n) {
		cin >> p[2 * i].first;
		p[2 * i].second.first = 0;
		p[2 * i].second.second = i;
		cin >> p[2 * i + 1].first;
		p[2 * i + 1].second.first = 1;
		p[2 * i + 1].second.second = i;
	}
	sort(all(p));
	int ans = INF;
	vector<PP> q(n);
	rep(i, n) q[i] = p[i]; chmin(ans, solve(q));
	q[n - 1] = p[n]; chmin(ans, solve(q));
	q[n - 1] = p[n + 1]; chmin(ans, solve(q));
	q[n - 2] = p[n - 1]; q[n - 1] = p[n]; chmin(ans, solve(q));
	assert(ans != INF);
	cout << ans << endl;
}

Measured memory_bytes: 15872
#include<iostream>
using namespace std;
int main(){
    string str;
    int n;
    cin>>str>>n;
    while(n--){
        string command;
        int a, b;
        cin>>command>>a>>b;
        if(command=="print"){
            for(int i=a; i<=b; i++){
                cout<<str[i];
            }
            cout<<endl;
        }
        else if(command=="reverse"){
            for(int i=a; i<=(a+b)/2; i++){
                char memo=str[i];
                str[i]=str[a+b-i];
                str[a+b-i]=memo;
            }
        }
        else{
            string p;
            cin>>p;
            for(int i=a; i<=b; i++){
                str[i]=p[i-a];
            }
        }
    }
}


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    int2(h, w);
    vector<string> data(h);
    rep(i, h) {
        cin >> data[i];
    }

    deque<pii> que;
    rep(i, h) {
        rep(j, w) {
            if (data[i][j] == '#') {
                que.pb({i, j});
            }
        }
    }

    int ans = 0;
    while (que.size()) {
        deque<pii> next;
        bool fl = false;
        while (que.size()) {
            pii tmp = que.front();
            que.pop_front();
            rep(i, 4) {
                int nx = tmp.fir + dxy[i], ny = tmp.sec + dxy[i+1];
                if (in(nx, 0, h) && in(ny, 0, w) && data[nx][ny] == '.') {
                    next.pb({nx, ny});
                    data[nx][ny] = '#';
                    fl = true;
                }
            }
        }
        que = next;
        if (fl) ans++;
    }

    std::cout << ans << std::endl;

    return 0;
}





Measured memory_bytes: 17988
from string import ascii_uppercase
while 1:
    s, t = input().split()
    if t == 'X':
        break
    if "_" in s:
        W = s.split("_")
    else:
        W = []; w = []
        for c in s:
            if c in ascii_uppercase:
                if w:
                    W.append("".join(w).lower())
                w = [c]
            else:
                w.append(c)
        if w:
            W.append("".join(w).lower())
    if t == 'D':
        print(*W, sep='_')
    elif t == 'U':
        print(*map(lambda x: x.capitalize(), W), sep='')
    else:
        print(W[0], *map(lambda x: x.capitalize(), W[1:]), sep='')


Measured memory_bytes: 6676
#include <iostream>
#include <vector>
#include <map>
using namespace std;
using ll = long long;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin >> a[i];

  map<int,int> mp;
  for(int i=0;i<n;i++){
    auto itr = mp.find(a[i]);
    if(itr == mp.end()){
      mp.insert(make_pair(a[i],1));
    }else{
      itr->second++;
    }
  }

  for(auto itr = mp.begin();itr != mp.end();++itr){
    if(itr->second == 1){
      mp.erase(itr);
    }
  }

  ll ans = 0;
  for(auto i = mp.begin();i != mp.end();++i){
    ll v = i->second;
    ans += v*(v-1)/2;
  }

  for(int k=0;k<n;k++){
    auto itr = mp.find(a[k]);
    if(itr != mp.end()){
      ll v = itr->second;
      ll x = ans - v*(v-1)/2 + (v-1)*(v-2)/2;
      cout << x << endl;
    }else{
      cout << ans << endl;
    }
  }
}


Measured memory_bytes: 9088
from itertools import product

n, m = map(int, input().split())
ks = [map(int, input().split()) for _ in range(m)]
p = list(map(int, input().split()))


ks = [list(map(lambda x: x - 1, list(_)[1:])) for _ in ks]

ans = 0
for state in product(range(2), repeat=n):
    for pi, si in zip(p, ks):
        cum = 0
        for sij in si:
            cum += state[sij]
        if cum % 2 != pi:
            break
    else:
        ans += 1
print(ans)


Measured memory_bytes: 3064
w,h,x,y,r = gets.split.map(&:to_i)
xmax = w - r
ymax = h - r
puts r<=x&&x<=xmax&&r<=y&&y<=ymax ? :Yes : :No	# x軸方向[r<x&&x<(w-r)] y軸方向[r<y&&y<(h-r)]

Measured memory_bytes: 6096
using System;
public class Hello{
    public static void Main(){
        int N = int.Parse(Console.ReadLine());
 long[] num = new long[100];
        num[0] = 2;
        num[1] = 1;
        
        for(int x = 2;x <= N;x++){
            num[x] = num[x - 1] + num[x - 2];
        }
        Console.WriteLine(num[N]);
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
//const ll MOD=(ll)1e9+7;
const ll MOD=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);
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 (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};


void solve(int ca){
    int N; cin>>N;
    vector<int> a(N);
    int sum=0;
    for (int i = 0; i < N; ++i) {
        cin>>a[i];
        sum^=a[i];
    }
    for (int i = 0; i < N; ++i) {
        cout<<(sum^a[i])<<" ";
    }
    cout<<"\n";
}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 4036
s = [int(x) for x in list(input())]

def answer(count, total, formula):
  if count == 3:
    if total==7:
      print(formula + '=7')
      exit()
    return
  answer(count+1, total + s[count+1], formula+'+'+str(s[count+1]))
  answer(count+1, total - s[count+1], formula+'-'+str(s[count+1]))
  return

answer(0, s[0], str(s[0]))

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

using namespace std;


int main(void)
{
    int N;
    cin >> N;
    vector<int> v(N);
    double ans = 0;
    for(int i = 0; i<N; i++)
    {
        cin >> v.at(i);
    }
    sort(v.begin(),v.end());
    ans = (v.at(0) + v.at(1))/2.0;
    int i = 2;
    while(i<N)
    {
        ans = (ans + v.at(i))/2.0;
        i++;
    }
    
    cout << ans << endl;

}    

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int N,R;
  cin >> N >> R;
  int Nr = 0;//表示レーディング
  int ans = 0;
  if(N >= 10){
    ans = R;
    
  }
  if(N < 10){
    Nr = 100 * (10 - N);
    ans = R + Nr;

  }
  cout << ans << endl;

  return 0; 
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define Pi pair<int,int>
#define Pl pair<ll,ll>
#define Pd pair<double,double>
#define all(V) V.begin(),V.end()
const ll MOD = 1000000007;

double dis(Pd a,Pd b) {
	double x = a.first - b.first;
	double y = a.second - b.second;
	return sqrt(x * x + y * y);
}

int main(){
	int N;
	Pd s, t;
	double a, u;
	ll x, y, r, b;
	cin >> s.first >> s.second >> t.first >> t.second;
	cin >> N;
	vector<pair<Pl, ll>> T(N + 1);
	vector<double> rea(N + 1);
	vector<bool> rb(N, false);
	for (int i = 0;i < N;i++) {
		cin >> x >> y >> r;
		T[i] = { {x,y},r };
	}
	T[N] = { t,0 };
	priority_queue<pair<double,int>,vector<pair<double, int>>,greater<pair<double, int>>> Q;
	for (int i = 0;i <= N;i++) {
		u = dis(s, T[i].first) - T[i].second;
		rea[i] = max((double)0, u);
		Q.push({ rea[i], i });
	}
	while(!Q.empty()){
		s = Q.top();
		a = s.first;
		b = s.second;
		Q.pop();
		if (b == N) break;
		if (rb[b]) continue;
		for (int i = 0;i <= N;i++) {
			u = a + dis(T[i].first, T[b].first) - T[i].second - T[b].second;
			u = max(a, u);
			if (rea[i] > u) {
				rea[i] = u;
				Q.push({ u, i });
			}
		}
		rb[b] = true;
	}
	printf("%.10f", rea[N]);
}

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


// ABC130B - Bounding
// https://atcoder.jp/contests/abc130/tasks/abc130_b
void ABC130B() {

	/*
	  ※初見の感想※
	  ・普通に計算するだけで解けそう
	  　→ 自分で計算してみると何故か上手くいかない
	    → 漸化式の問題は素直に全ての値を計算した後に判定した方が良さそう
	*/
	

	int N, X;
	cin >> N >> X;

	//vector<int> L(N);
	vector<int> D(N+1);
	D[0] = 0;
	for (int i = 0; i < N; i++)
	{
		int l;
		cin >> l;
		D[i + 1] = D[i] + l;
		//cin >> L[i];
		//D[i + 1] = D[i] + L[i];
		
	}

	int ans = 0;
	for (int i = 0; i <= N; i++)
	{
		if (D[i] <= X) {
			ans++;
		}
	}
	cout << ans << endl;



	/*
	int d = 0; //座標の初期値
	for (int i = 2;i <= N+1; i++)
	{
		//i回目に跳ねる座標を計算
		d += L[i - 1];

		//跳ねた座標が座標Xを超えていたら終了
		if (d > X) {
			cout << i << endl;
			return;
		}
	}
	*/
}

int main() {
	ABC130B();

	return 0;
}




Measured memory_bytes: 256
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
cnt = 0

for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i % 2 == 1:
        cnt += 1
print(cnt)

Measured memory_bytes: 9136
from collections import deque
N = int(input())
G = {i:[] for i in range(1,N+1)}
for _ in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
dist = [0 for _ in range(N+1)]
que = deque([(1,0)])
hist = [0 for _ in range(N+1)]
hist[1] = 1
while que:
    x,d = que.popleft()
    for y in G[x]:
        if hist[y]==0:
            hist[y] = 1
            dist[y] = d+1
            que.append((y,d+1))
pa ={}
x = N
while x!=1:
    for y in G[x]:
        if dist[y]==dist[x]-1:
            pa[x] = y
            break
    x = pa[x]
ch = {}
x=N
while x!=1:
    y = pa[x]
    ch[y] = x
    x = y
if dist[N]%2==1:
    k = dist[N]//2
    cnt = 0
    x = 1
    y = N
    while cnt<k:
        x = ch[x]
        y = pa[y]
        cnt += 1
    G[x].remove(y)
    G[y].remove(x)
    hist = [0 for _ in range(N+1)]
    que = deque([1])
    hist[1] = 1
    while que:
        a = que.popleft()
        for b in G[a]:
            if hist[b]==0:
                hist[b]=1
                que.append(b)
    n1 = sum(hist)
    n2 = N-n1
    if n1>n2:
        print("Fennec")
    else:
        print("Snuke")
else:
    k = dist[N]//2
    cnt = 0
    x = 1
    while cnt<k:
        x = ch[x]
        cnt += 1
    y = ch[x]
    G[x].remove(y)
    G[y].remove(x)
    hist = [0 for _ in range(N+1)]
    que = deque([1])
    hist[1] = 1
    while que:
        a = que.popleft()
        for b in G[a]:
            if hist[b]==0:
                hist[b]=1
                que.append(b)
    n1 = sum(hist)
    n2 = N-n1
    if n1>n2:
        print("Fennec")
    else:
        print("Snuke")

Measured memory_bytes: 124596
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

void mod_inverse(int n, vector<long long>& inv, int mod)
{
    inv.assign(n+1, -1);
    inv[1] = 1;
    for(int i=2; i<=n; ++i)
        inv[i] = inv[mod % i] * (mod - mod / i) % mod;
}

class FactorialCalculation
{
private:
    const int mod;
    vector<long long> factorial;
    vector<long long> invFactorial;
public:
    FactorialCalculation(int n, int mod) : mod(mod)
    {
        factorial.resize(n+1, 1);
        invFactorial.resize(n+1, 1);
        vector<long long> inv;
        mod_inverse(n, inv, mod);
        for(int i=1; i<=n; ++i){
            factorial[i] = factorial[i-1] * i % mod;
            invFactorial[i] = invFactorial[i-1] * inv[i] % mod;
        }
    }
    long long getFactorial(int n){
        return factorial[n];
    }
    long long getInvFactorial(int n){
        return invFactorial[n];
    }
    long long getPermutation(int n, int r){
        if(n < r)
            return 0;
        return factorial[n] * invFactorial[n-r] % mod;
    }
    long long getCombination(int n, int r){
        if(n < r)
            return 0;
        return getPermutation(n, r) * invFactorial[r] % mod;
    }
    long long getHomogeneous(int n, int r){
        return getCombination(n+r-1, r);
    }
};

const int MOD = 1000000007;

int main()
{
    int h, w, n;
    cin >> h >> w >> n;
    vector<pair<int, int> > v(n);
    for(int i=0; i<n; ++i)
        cin >> v[i].first >> v[i].second;
    v.push_back(make_pair(1, 1));
    v.push_back(make_pair(h, w));
    sort(v.begin(), v.end());
    n += 2;

    FactorialCalculation fc(h+w, MOD);
    vector<vector<long long> > dp(2, vector<long long>(n, 0));
    dp[1][0] = 1;
    for(int i=1; i<n; ++i){
        for(int j=0; j<i; ++j){
            int dy = v[i].first - v[j].first;
            int dx = v[i].second - v[j].second;
            if(dx < 0)
                continue;

            long long tmp = fc.getCombination(dy + dx, dy);
            for(int k=0; k<2; ++k){
                dp[k][i] += dp[k^1][j] * tmp;
                dp[k][i] %= MOD;
            }
        }
    }

    long long ans = (dp[0].back() - dp[1].back() + MOD) % MOD;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4992