akhauriyash/Code-Regression huggingface dataset:
//
#include <vector>
#include <set>
#include <map>
#include <array>
#include <iostream>
#include <cstdio>
#include <cstdint>
#include <algorithm>
#include <numeric>
#include <bitset>
//
using ll = long long;
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);++i)
inline void yes(bool cond) { cond ? puts("Yes") : puts("No"); }
template<typename Type> inline void chmin(Type& a, Type b) { if (a > b) a = b; }
template<typename Type> inline void chmax(Type& a, Type b) { if (a < b) a = b; }
template<typename Arr, typename Type> inline void fill(Arr& arr, Type v) { std::fill(arr.begin(), arr.end(), v); }
template<typename Type> inline void sort(Type& arr) { std::sort(arr.begin(), arr.end()); }
template<typename Type> inline Type nth(vector<Type>& arr, size_t pos) { std::nth_element(arr.begin(), arr.begin() + pos, arr.end()); return arr[pos]; }
constexpr double BIGP = 1000000007L;
constexpr double INF_I = std::numeric_limits<double>::max();
constexpr double INF_F = std::numeric_limits<float>::infinity();
constexpr double PI = 3.14159265358979323846L;
//
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    ll A;
    double b;
    cin >> A >> b;
    ll B = b * 100.0 + 0.5;
    cout << A * B/100;
    return 0;
}

Measured memory_bytes: 3172
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long n,ans,k;
  ans=0;
  cin>>n;
  vector<long> vec(n);
  vector<long> ko(0);
  for(long i=0; i<n; i++){
    cin>>vec.at(i);
  }
  for(long i=1; i<n; i++){
    vec.at(i)=vec.at(i-1)+vec.at(i);
  }
  for(long i=0; i<n; i++){
    ko.push_back(vec.at(i));
    if(vec.at(i)==0){
      ans++;
    }
  }
  sort(ko.begin(),ko.end());
  k=1;
  for(int i=1; i<n; i++){
    if(ko.at(i)==ko.at(i-1)){
      k++;
    }
    else{
      if(k>1){
        ans=ans+k*(k-1)/2;
        k=1;
      }
    }
  }
  if(k>1){
    ans=ans+k*(k-1)/2;
  }
  cout<<ans;
}

Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
vector<int>e[N];
int n,m,i,u,v,a[N],x,y,z,sz;
int dfs(int x,int v){
	int ans=1;a[x]=v;++sz;
	for(int y:e[x])if(a[y]==-1)ans&=dfs(y,v^1);else ans&=a[x]!=a[y];
	return ans;
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	cin>>n>>m;for(i=1;i<=m;++i)cin>>u>>v,e[u].push_back(v),e[v].push_back(u);
	memset(a+1,-1,n<<2);for(i=1;i<=n;++i)if(a[i]==-1)sz=0,y+=dfs(i,0),++z,x+=sz==1;
	y-=x;z-=x;
	cout<<1ll*y*y+1ll*z*z+2ll*x*n-1ll*x*x<<endl;
	return 0;
}

Measured memory_bytes: 9984
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {
            var A = cin.ReadInt;
            var B = cin.ReadInt;
            var C = cin.ReadInt;

            for (int i = 1; i <= B; i++)
            {
                if (A * i % B == C)
                {
                    WriteLine("YES");
                    return;
                }
            }

            WriteLine("NO");

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

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

//namespace _1_D
//{
    class Program
    {
        static void Main(string[] args)
        {
        //????????????
        string S = Console.ReadLine();
        //int?????´???
        int ss = int.Parse(S);
        //?????????????§?????????????
        int h = ss / 3600;
        int a = ss - h * 3600;
        int m = a / 60;
        int s = a - m * 60;
        Console.WriteLine(h+":"+m+":"+s);

        }
    }
//}

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

#define INF 1LL << 60

using Weight = long long;
struct Edge {
	int src, dst;
	Weight weight;
	Edge(int src_, int dst_, Weight weight_) : src(src_), dst(dst_), weight(weight_) { }
};
bool operator<(const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : e.dst < f.dst;
}
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void edgesToGraph(const Edges &edges, int V, Graph &g) {
	g.resize(V);
	for (auto e : edges) g[e.src].push_back(e);
}

void edgesToGraphUndir(const Edges &edges, int V, Graph &g) {
	g.resize(V);
	for (auto e : edges) {
		g[e.src].push_back(e);
		g[e.dst].push_back(Edge(e.dst, e.src, e.weight));
	}
}

//edgesToGraphUndir
pair<Weight, Edges> prim(const Graph &g, int r = 0) {
	int n = g.size();
	Edges T;
	Weight total = 0;

	vector<bool> visited(n);
	priority_queue<Edge> Q;
	Q.push(Edge(-1, r, 0));
	while (!Q.empty()) {
		Edge e = Q.top(); Q.pop();
		if (visited[e.dst]) continue;
		T.push_back(e);
		total += e.weight;
		visited[e.dst] = true;
		for(auto f : g[e.dst]) if (!visited[f.dst]) Q.push(f);
	}
	return pair<Weight, Edges>(total, T);
}

int main(void) {
	int V, E;
	cin >> V >> E;
	Edges edges;
	for (int i = 0; i < E; ++i) {
		long long s, t, w;
		cin >> s >> t >> w;
		edges.emplace_back(s, t, w);
	}
	Graph g;
	edgesToGraphUndir(edges, V, g);
	pair<Weight, Edges> p = prim(g);
	cout << p.first << endl;
	return 0;
}



Measured memory_bytes: 13028
def examA():
    a, b = LS()
    if (a=="H" and b=="H") or (a=="D" and b=="D"):
        ans = "H"
    else:
        ans = "D"
    print(ans)

import sys
import copy
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Measured memory_bytes: 3444
/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*/
//vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  double a,b;
  cin >> a >> b;
  int flag=1;
  for(int i=0;i<10000;i++){
    int k= i*0.08;
    int m= i*0.10;
    if( k == a && m == b) {
      cout<<i<<endl;
      flag =0;
      break;
    }
  }
  if(flag==1) cout<<"-1"<<endl;    
}


Measured memory_bytes: 256
from collections import deque
import sys

N,M = map(int,input().split())
graph = [[] for _ in range(N + 1)]
for i in range(M):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

que = deque([1])
ans = [0]*(N+1)

while que:
    x = deque.popleft(que)
    for i in graph[x]:
        if ans[i] != 0:
            continue
        ans[i] = x
        que.append(i)
        
for i in range(2,N+1):
    if ans[i] == 0:
        print('No')
        sys.exit()
        
print('Yes')
for i in range(2,N+1):
    print(ans[i])

Measured memory_bytes: 34192
#include<bits/stdc++.h>
using namespace std;
 
ostream& operator<<(ostream &out, string str) {
	for(char c : str) out << c;
	return out;
}
 
template<class L, class R> ostream& operator<<(ostream &out, pair<L, R> p) {
	return out << "(" << p.first << ", " << p.second << ")";
}
 
template<class T> auto operator<<(ostream &out, T a) -> decltype(a.begin(), out) {
	out << "{";
	for(auto it = a.begin(); it != a.end(); it = next(it))
		out << (it != a.begin() ? ", " : "") << *it;
	return out << "}";
}
 
void dump() { cerr << "\n"; }
template<class T, class... Ts> void dump(T a, Ts... x) {
	cerr << a << ", ";
	dump(x...);
}

#ifdef DEBUG
#  define debug(...) cerr << "[" #__VA_ARGS__ "]: ", dump(__VA_ARGS__)
#else
#  define debug(...) false
#endif
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define ST first
#define ND second
 
template<class T> int size(T && a) { return a.size(); }
 
using LL = long long;
using PII = pair<int, int>;

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

	string str;
	cin >> str;

	int n = size(str);
	if(n % 2 == 1) {
		cout << "No\n";
		return 0;
	}

	REP(i, n) {
		if(i % 2 == 0 && str[i] != 'h') {
			cout << "No\n";
			return 0;
		}
		else if(i % 2 == 1 && str[i] != 'i') {
			cout << "No\n";
			return 0;
		}
	}

	cout << "Yes\n";
}


Measured memory_bytes: 256
// </> : towhid1zaman

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;typedef vector<ll> vll;
#define fill(a,b) memset(a, b, sizeof (a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0; i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define _ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(a) int(a.size())
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main(){
        _ios;

        ll  x;
        cin>>x;
        ll a = 100;
        ll t = 0;
        ll ans = 0;
        while(a<x){
            t = a/100;
            a +=t;
            ans++;
        }
        cout<<ans<<endl;

return 0;
}



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

long long ans;
char S[20] = {0};

void pro(int now,long long mem,long long sum)
{
    if(now == strlen(S))
    {
        ans += sum + mem;
        return;
    }
    pro(now + 1, mem * 10 + S[now] - '0', sum);
    pro(now + 1, S[now] - '0', sum + mem);
    return;
}

int main()
{
    scanf("%s",S);
    pro(1,S[0] - '0',0);
    printf("%lld\n",ans);
    return 0;
}


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

int a, b;
int d[1000000];

int main() {
    cin >> a >> b;

    int east_idx = 0;
    for (int i = 1; i <= 999; i++) {
        d[i] += d[i - 1] + i;
        if (b - a == i) {
            east_idx = i;
            break;
        }
    }

    cout << d[east_idx] - b << endl; 

    // cout << d[4] << endl;
}

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

class Main {
	static final String YES = "Yes";
	static final String NO = "No";

	public static void main(String[] args) throws Exception {
		final Scanner sc = new Scanner(System.in);
		long H;
		H = sc.nextLong();
		long N;
		N = sc.nextLong();
		long sum = 0;
		long[] A = new long[(int) (N)];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			sum += A[i];
		}

		if (H > sum) {
			System.out.println(NO);
		} else {
			System.out.println(YES);
		}
	}
}


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

int main(){
    int n,d;
    cin>>n>>d;
    vector<vector<int>>a(n,vector<int>(d));
    for(int i=0;i<n;i++){
        for(int j=0;j<d;j++){
            cin>>a.at(i).at(j);
        }


    }
    int ans=0;
    for(int i=0; i<n;i++){
        for(int j=0;j<i;j++){
            int sq=0;
            for(int k=0;k<d;k++){
                int s=a.at(i).at(k)-a.at(j).at(k);
                sq+=s*s;
            }
            int s=sqrt(sq)+0.5;
            if(s*s==sq)ans++;
        }
    
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> s = new ArrayList<>();
        for(int i = 0;i < n;i++){
            s.add(sc.nextInt());
        }
        Collections.sort(s);
        int sum = 0;
        for(int i = 0;i < n;i++){
            sum += s.get(i);
        }
        for(int i = 0;i < n;i++){
            if(sum % 10 != 0){
                break;
            }
            if(s.get(i) % 10 == 0){
                continue;
            }
            sum -= s.get(i);
        }
        if(sum % 10 == 0){
            System.out.println(0);
            return;
        }
        System.out.println(sum);
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)2e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

void solve() {
    int n, m, k;
    cin>>n>>m>>k;
    vector<int> a(n), b(m);
    f(i, n) cin>>a[i];
    f(i, m) cin>>b[i];

    int ans = 0;
    for(int i = 1; i < n; i++) a[i] += a[i - 1];
    for(int i = 0; i <= m; i++) {
        int tot = i + (upper_bound(all(a), k) - a.begin());
        ans = max(ans, tot);
        if(i == m) break;
        k -= b[i];
        if(k < 0) break;
    }
    cout<<ans;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    int t = 1;
    //cin>>t;
    for(int test = 1; test <= t; test++) {
        //cout<<"Case #"<<test<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 6348
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int flag = 0;
        for(int i = A;i <= B;i++){
            if(i % K == 0){
                flag += 1;
                break;
            }
        }
        if(flag == 1){
            System.out.println("OK");
        }else{
            System.out.println("NG");
        }
    }
}


Measured memory_bytes: 35768
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

const int mod = 1'000'000'007;
struct mint {
    ll x;
    mint(ll x = 0) : x ((x%mod + mod)  %mod) {}
    mint operator - () {return mint(-x);}
    mint & operator +=(const mint a) {
        (x += a.x) %= mod;
        return *this;
    }
    mint & operator -=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint & operator *=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator + (const mint a) const {return mint(*this)+=a;}
    mint operator - (const mint a) const {return mint(*this)-=a;}
    mint operator * (const mint a) const {return mint(*this)*=a;}

    mint pow(ll t) const {
        mint res(1);
        mint a(x);
        while(t > 0) {
            if(t&1) {
                res *= a;
            }
            a *= a;
            t >>= 1;
        }
        return res;
    }

    mint inv() const {return pow(mod-2);}
    mint & operator /=(const mint a) {
        *this *= a.inv();
        return *this;
    }
    mint operator / (const mint a) { return mint(*this) /= a;}
};

mint choose(int n, int a) {
    mint x(1), y(1);
    REP(i,a) {
        x *= n-i;
        y *= i+1;
    }
    return x / y;
}

int main(void) {
    int n, a, b;
    cin >> n >> a >> b;
    mint ans = mint(2).pow(n);
    ans -= 1;
    ans -= choose(n, a);
    ans -= choose(n, b);
    cout << ans.x << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main{
	Scanner s=new Scanner(System.in);

	void solve(){
		int n=gInt();
		int[]a=INTS(n).toArray();


		int min=Integer.MAX_VALUE;
		int r=0;
		for(int i:a) {
			if(min>i) {
				++r;
				min=i;
			}
		}
		System.out.println(r);
	}

	public static void main(String[] args){
		new Main().solve();
	}

	int gInt(){
		return Integer.parseInt(s.next());
	}
	long gLong(){
		return Long.parseLong(s.next());
	}
	double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,this::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,this::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,this::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(this::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}

class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}

class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}
	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}
}

Measured memory_bytes: 52156
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	static void solve(){//Here is the main function
		ArrayList<Integer> one = nextIntArray();
		int N = one.get(0);
		int R = one.get(1);
		if(N >= 10){
			myout(R);
		}else{
			myout(R + 100 * (10 - N));
		}
	}
	//Method addition frame start



	//Method addition frame end

	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
}


Measured memory_bytes: 32820
n=int(input())

A=list(map(int,input().split()))
B=list(map(int,input().split()))
s=0
for i in range(n):
    if A[i]>B[i]:
        s+=B[i]
    
    elif A[i]<=B[i] and B[i]<=A[i+1]+A[i]:
        s+=B[i]
        A[i+1]=A[i+1]+A[i]-B[i]
    elif B[i]>A[i+1]+A[i]:
        s+=A[i]+A[i+1]
        A[i+1]=0
print(s)

Measured memory_bytes: 18476
t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())
a1 -= b1
a2 -= b2

if a1*t1+a2*t2 == 0:
	print("infinity")
	quit()

if a1 < 0:
	a1 = -a1
	a2 = -a2

# assert a1 > 0

if a2 > 0:
	print(0)
	quit()

# assert a2 < 0

d = a1*t1+a2*t2

if d > 0:
	print(0)
	quit()

ans = ((a1*t1-1)//(-d)+1)*2-1
if a1*t1%(-d) == 0:
	ans += 1
print(ans)


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

const int maxn=310;
const int maxm=maxn*4;
int n;
char a[maxm][maxm], s[maxn], b[maxn][maxn];

bool calc(int A,int B){
	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) b[i][j]=a[i+A][j+B];
	for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) if(b[i][j]!=b[j][i]) return false;
	return true;
}

int main(){

	scanf("%d", &n);
	for(int i=1;i<=n;i++){
		scanf("%s", s+1);
		for(int j=1;j<=n;j++) a[i][j]=s[j];
	}
	for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) a[i+n][j+n]=a[i+n][j]=a[i][j+n]=a[i][j];
	int ans=0;
	for(int i=0;i<n;i++) ans+=calc(i,0);
	printf("%d\n", ans*n);
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    stack<int> S;
    int a, b, x;
    string s;

    while(cin >> s) {  
        if(s[0] == '+') {
            a = S.top(); S.pop();
            b = S.top(); S.pop();
            S.push(a + b);
        }
        else if(s[0] == '-') {
            b = S.top(); S.pop();
            a = S.top(); S.pop();
            S.push(a - b);
        }
        else if(s[0] == '*') {
            a = S.top(); S.pop();
            b = S.top(); S.pop();
            S.push(a * b);
        }
        else {
            S.push(atoi(s.c_str()));
        }
    }

    cout << S.top() << endl;

    return 0;
}


Measured memory_bytes: 3228
#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

typedef int64_t  ll;
typedef uint64_t ull;

int main(void) {
    long double w,h,x,y;
    cin >> w >> h >> x >> y;
    cout << (w*h)/2.0 << " " << ((x==w/2.0 && y==h/2.0) ? "1" : "0") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 200002

char s[N], x, y;
int p[N];

int main()
{	 
	int i, j, tp, l;
	
	s[0] = 0;
	scanf("%s", s + 1);
	for(i = 1, j = 0; s[i]; j = i++){
		p[i] = j;
	}
	p[i] = j, l = i - 1;
	for(i = 2; x = s[i]; i++){
		if(x == 'T'){
			if(s[tp = p[i]] == 'S'){
				l -= 2;
				p[i + 1] = p[tp];
			}
		}
	}
	printf("%d\n", l);
		
	return 0;
}

Measured memory_bytes: 2604
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<double, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); 
	int n;
	cin >> n;
	vector<ll> a(n), b(n);
	rep(i, n) cin >> a[i] >> b[i];
	sort(all(a));
	sort(all(b));
	long double med1, med2;
	if (n % 2 == 0) {
		med1 = (a[n / 2 - 1] + a[n / 2]) / (long double)2;
		med2 = (b[n / 2 - 1] + b[n / 2]) / (long double)2;
	}
	else {
		med1 = a[(n + 1) / 2 - 1];
		med2 = b[(n + 1) / 2 - 1];
	}
	if (n % 2 == 0) {
		med1 *= 2;
		med2 *= 2;
	}
	ll ans = med2 - med1 + 1;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 6352
// https://atcoder.jp/contests/abc082/tasks/abc082_a
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    double a, b;
    cin >> a >> b;
    cout << ceil((a + b) / 2) << endl;

    return 0;
}


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

int main(){
    int n,a[25],b,c[25];
    cin >> n;
    int ans = 0;
    rep(i,n) cin >> a[i];
    rep(i,n){
        cin >> b;
        ans += b;
    }
    rep(i,n-1) cin >> c[i];

    for(int i = 1; i < n; ++i){
        if(a[i] == a[i-1] + 1){
            ans += c[a[i-1]-1];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 998244353
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int n,a[100005];
set<int>S;
map<int,int>M;

int main(){
	cin >> n;
	rep(i,n) {cin >>  a[i]; S.insert(a[i]); M[a[i]]++;}
	if(S.size() > 3){
		puts("No");
		return 0;
	}
	vector<int>vi;
	for(auto it:S) vi.pb(it);
	rep(i,vi.size()) rep(j,vi.size()){
		vector<int>vec;
		vec.pb(vi[i]);
		vec.pb(vi[j]);
		for(int i=2;i<n;i++) vec.pb(vec[i-1]^vec[i-2]);
		bool fail = 0;
		for(int i=0;i<n;i++){
			int pre = (i+n-1)%n;
			int nxt = (i+1)%n;
			if(vec[i] != (vec[pre]^vec[nxt])) fail = 1;
		}
		if(fail) continue;
		map<int,int>MM;
		rep(k,vec.size()) MM[vec[k]]++;
		for(auto it:M){
			if(it.sc != MM[it.fi]) fail = 1;
		}
		if(fail) continue;
		puts("Yes"); return 0;
	}
	puts("No");
}

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

#define times(n, i)      uptil(0, n, i)
#define rtimes(n, i)     downto((n) - 1, 0, i)
#define upto(f, t, i)    for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(int _##i = (t), i = (f); i <  _##i; i++)
#define downto(f, t, i)  for(int _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(int _##i = (t), i = (f); i >  _##i; i--)
typedef long double LD;
#define long long long

#if defined(EBUG) && !defined(ONLINE_JUDGE)
#define debug true
#define ln << endl
#else
#define debug false
#define ln << '\n'
#endif
#define tb << '\t'
#define sp << ' '



signed main() { // long: 64bit
    if(!debug) {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }

    int i; cin >> i;
    cout << (i % 10 == 9 || i / 10 == 9 ? "Yes" : "No");

    return 0;
}


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


int main(){
    int N; cin>>N;
    string A,B,C;cin>>A>>B>>C;

    int oprs = 0;
    for(int i=0;i<N;i++){
        if(A[i] == B[i] && B[i] == C[i]) continue;
        if(A[i] == B[i] || B[i] == C[i] || A[i] == C[i]) oprs += 1;
        else oprs += 2;
    }
    cout<<oprs<<endl;
}

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

def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in "753"):
        ret = 1
    else:
        ret = 0

    for c in "753":
        ret += dfs(s + c)

    return ret

print(dfs('0'))

Measured memory_bytes: 2940
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>

int main(){
  int N;
  scanf("%d", &N);
  long long ans = (N/500)*1000+((N-(N/500)*500)/5)*5;
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define PI acos(-1)

int main(){
    int n;
    cin >> n;
    long long apple;
    bool odd = false;
    for(int i = 0;i < n;i++){
        cin >> apple;
        if(apple % 2)odd = true;
    }
    cout << (odd ? "first" : "second") << endl;
}


Measured memory_bytes: 256
def main():
    n = input()
    for i in xrange(n):
        X = raw_input()
        Y = raw_input()
        print lcs(X,Y)

def lcs(X,Y):
    m = len(X)
    n = len(Y)
    r1 = [0 for i in xrange(n+1)]
 
    for i in xrange(m):
        r0 = r1[:]
        for j in xrange(n):
            if X[i] == Y[j]:
                r1[j+1] = r0[j] + 1
            elif r0[j+1] < r1[j]:
                r1[j+1] = r1[j]
    return r1[-1]

if __name__ == "__main__":
    main()

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

typedef long long ll;

int main(){
	
	ll n,m,a,b; cin >> n >> m;
	ll x=0,acum=0;
	map <ll,ll> mp; 
	
	while (n){
		n--; cin >> a >> b;
		mp[a] += b;
	}
	
	for (auto it=mp.begin() ; it!=mp.end() ; it++){
		ll p=it->first;
	
		if (acum+mp[p] >= m){
			x += (m-acum)*p; break;
		}
		else{
			x += p*mp[p];
			acum += mp[p];
		}
	}
	
	cout << x << endl;
	
	return 0;
}

Measured memory_bytes: 9784
aGroup = [1,3,5,7,8,10,12].to_a
bGroup = [4,6,9,11].to_a
x,y=gets.chomp.split.map(&:to_i)
puts (aGroup.include?(x) && aGroup.include?(y)) || (bGroup.include?(x) && bGroup.include?(y)) ? "Yes" : "No"

Measured memory_bytes: 1788
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#define _GLIBCXX_DEBUG // check []
#define DIVISOR 1000000007

using namespace std;
typedef pair<int,int> pii;
typedef pair<int64_t, int64_t> pII;

template<typename T>
void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }

#ifdef DEBUG
#define debug(fmt, ...) \
    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)
#define ps(arr) \
    for(auto e: arr) cout << e << " "; \
    cout << endl;
#else
#define debug(fmt, ...)
#define ps(arr)
#endif

bool is_reach(string& str, pii p) {
    int cur = p.first;
    while(cur < p.second) {
        if(str[cur] == '#') {
            return false;
        }
        if(str[cur+1] == '#') {
            cur+=2;
        } else {
            cur++;
        }
    }
    return true;
}

int main(void) {
    int len;
    pii move1, move2;
    cin >> len;
    cin >> move1.first >> move2.first;
    cin >> move1.second >> move2.second;
    move1.first--; move1.second--;
    move2.first--; move2.second--;
    string str;
    cin >> str;

    // assume that a < b
    bool flag = 0;
    int b = move2.first;
    bool is_ok = 0;
    if(!is_reach(str, move1) || !is_reach(str, move2)) {
        debug("%s\n", "ng");
        goto finish;
    }

    // Does move1 pass move2?
    if(move1.second < move2.second) {
        flag = 1;
        goto finish;
    }
    while(1) {
        debug("move2: %d, %d -> %d\n", b, move2.second, is_ok);
        if(b == move2.second) {
            // 7 1 3 7 6
            // .#.#....
            flag = is_ok || (str[b+1] != '#' && str[b-1] != '#');
            break;
        }
        if(str[b] == '#') {
            flag = 0;
            break;
        } else if(str[b+1] == '#') {
            b+=2;
        } else {
            if(str[b-1] != '#') is_ok = 1;
            b++;
        }
    }
finish:
    cout << (flag ? "Yes" : "No") << endl;
    return 0;
}

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

int main(){
    ll n,a,b;
    cin>>n>>a>>b;

    ll ans;
    ll minimum=a*(n-1)+b;
    ll maximum=a+b*(n-1);
    if(a>b){
        ans=0;
    }else if(n==1 and a!=b){
        ans=0;
    }else if(a==b){
        ans=1;
    }else{
        ans=maximum-minimum+1;
    }
    cout<<ans<<endl;

    return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 62;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      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
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int n; cin >> n;
  vector<int> prime;
  vector<int> flag(55556, true);
  for(int i = 2; i <= 55555; ++i) {
    if(flag[i]) {
      if(i%5==1) prime.push_back(i);
      for(int j = 2; i*j <= 55555; ++j) flag[i*j] = false;
    }
  }
  rep(i, n) {
    cout << prime[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  string s;
  cin >> s;
  ll n=s.size();

  for(ll i=n-1;i;i--) {
    if(i%2) continue;
    string tmp=s.substr(0,i);
    if(tmp.substr(0,i/2)==tmp.substr(i/2,i/2)) {
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int l,r;cin>>l>>r;
  if(r-l>=2019)cout<<0<<endl,exit(0);
  l%=2019;r%=2019;if(l>r)r+=2019;
  int ans=2019;
  for(int i=l;i<=r;i++)for(int j=i+1;j<=r;j++){
  	ans=min(ans,i*j%2019);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll n; cin >> n;
    ll a[n];
    rep(i, n){
        cin >> a[i];
    }

    ll sum[n+1] = {};
    rep(i, n+1){
        sum[i+1] = sum[i] + a[i];
    }

    ll left = 0;
    ll right = 0;
    ll vmin = 1e18;
    rep(i, n){
        left = sum[i];
        right = sum[n] - sum[i];

        vmin = min(vmin, abs(right - left));
    }

    cout << vmin << endl;

    return 0;
}

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

#define INF INT32_MAX

int main()
{
	int n;
	cin >> n;
	vector<vector<int>> cost( n, vector<int>( n ) );
	for( int i = 0; i < n; i++ ) {
		for( int j = 0; j < n; j++ ) {
			int c;
			cin >> c;
			cost[i][j] = INF;
			if( c >= 0 ) cost[i][j] = c;
		}
	}

	vector<int> mincost( n, INF );
	vector<int> used( n );
	mincost[0] = 0;
	int ans = 0;
	while( true ) {
		int v = -1;
		for( int u = 0; u < n; u++ ) {
			if( used[u] == 0 && ( v < 0 || mincost[u] < mincost[v] ) ) v = u;
		}
		if( v < 0 ) break;
		used[v] = 1;
		ans += mincost[v];
		for( int u = 0; u < n; u++ ) {
			mincost[u] = min( mincost[u], cost[v][u] );
		}
	}

	cout << ans << endl;
}



Measured memory_bytes: 3148
MOD = 10**9 + 7


def main():
    from collections import Counter

    def prime_factorize(n):
        res = []
        for i in range(2, n+1):
            if i*i > n:
                break
            if n % i != 0:
                continue
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append((i, ex))
        if n != 1:
            res.append((n, 1))
        return res

    c = Counter()
    N = int(input())
    for p in range(2, N+1):
        divs = prime_factorize(p)
        for d, v in divs:
            c[d] += v
    ans = 1
    for v in c.values():
        ans *= (v+1)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 74388
N, A, B = map(int, input().split())
X = list(map(int,input().split()))

diff = []
for i in range(1, len(X)):
    diff.append(X[i]-X[i-1])

fatigue = 0

for j in diff:
    if j * A > B:
        fatigue += B
    else:
        fatigue += j*A
        
print(fatigue)

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

#define DEBUG(x) cerr << #x << ": " << x << endl;
#define ll long long

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

    /*
    ll cnt = 0;
    for (int i = a; i <= b; i++) {
        if (i % x == 0) {
            cnt++;
        }
    }
    */

    ll h;
    if ( (a-1)/x < 0 ) {
        h = 0; 
    } else {
        h = (a-1)/x;
    }

    ll ans = b / x - h;
    if (a == 0) ans++;

    cout << ans << endl;

    return 0;
}

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

using namespace std;

#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define MP make_pair
#define PB push_back
#define PH push
#define fst first
#define snd second
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

const int maxn = 1e5 + 5;
const ll INF = 1e18;

int n, e, t;
int x[maxn];
ll dp[maxn];

int main(){
	scanf("%d%d%d", &n, &e, &t);
	dp[0] = 0;
	REP(i, 1, n)
		scanf("%d", x + i);
	ll mn = INF;
	for(int i = 1, j = 1; i <= n; ++i){
		if(2 * (x[i] - x[1]) <= t)
			dp[i] = t;
		else{
			mn = min(mn, -2ll * x[1]);
			for(; 2 * (x[i] - x[j + 1]) > t; ++j){
				mn = min(mn, dp[j] - 2 * x[j + 1]);
			}
			dp[i] = mn + 2 * x[i];
			dp[i] = min(dp[i], dp[j] + t);
		}
	}
	printf("%lld\n", dp[n] + e);
	return 0;
}

Measured memory_bytes: 1536
N = int(input())
S = input()
ans = 0
for i in range(1000):
  p = str(i).zfill(3)
  if S.find(p[0])==-1:
    continue
  S1 = S[S.find(p[0])+1:]
  if S1.find(p[1])==-1:
    continue
  S2 = S1[S1.find(p[1])+1:]
  if S2.find(p[2])==-1:
    continue
  ans+=1
print(ans)

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

using namespace std;


int main(){
    int n;
    cin >> n;
    int a[n + 1];
    int dp[n + 1];
    for(int i = 0; i < n; i++) cin >> a[i];    
    /*
    dp[0] = a[0];
    dp[1] = a[0] + a[1];
    for(int i = 2; i <= n; i++){
        dp[i] = min(dp[i - 1] + a[i],dp[i - 2] + a[i]);
    }
    cout << dp[n - 1] << endl;
    */
    dp[0] = 0;
    dp[1] = abs(a[0] - a[1]);
    for(int i = 2; i <= n; i++){
        dp[i] = min(dp[i - 1] + abs(a[i] - a[i - 1]),dp[i - 2] + abs(a[i] - a[i - 2]));
    }
    cout << dp[n - 1] << endl;
}

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

int main() {
    int K, N;
    cin >> K >> N;
    vector<int> a(N, 0);
    int max_diff = 0;
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    max_diff = a[0]+K - a[N-1];
    for(int i=1;i<N;i++){
        int diff = a[i] - a[i-1];
        max_diff = max(max_diff, diff);
    }
    cout << K - max_diff << endl;
    return 0;
}

Measured memory_bytes: 1024
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    k = int(input())
    if k%2 == 0:
        print((k//2)**2)
    else:
        print((k//2)*(k//2+1))

if __name__ == '__main__':
    main()

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

int n;
int main() {
    cin >> n;
    cout << 48 - n << endl;
    return 0;
}


Measured memory_bytes: 3660
import java.util.*;

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

		a1=sc.next();

		a2=sc.next();
		String ans ="";
		for(int i=0;i<A;i++) {
			char aa =a1.charAt(i);
		    char bb =a2.charAt(i);
	        ans += String.valueOf(aa) + String.valueOf(bb);
			
		}
		
		System.out.println(ans);
	    
	    
	     
	}
	
}



Measured memory_bytes: 22100
#include<bits/stdc++.h>
using namespace std;
int main(){
	int x, a, b;
	scanf("%d %d %d", &x, &a, &b);
	if(b <= a) printf("delicious\n");
	else if(b > a && b <= x + a) printf("safe\n");
	else printf("dangerous\n");
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int A,B;
  cin>>A>>B;
int c,d,e;
  c=A+B;
  d=A-B;
  e=A*B;
if(d<=c&&e<=c) cout<<c<<endl;
else if(c<=d&&e<=d) cout<<d<<endl;
else cout<<e<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
 
//typedef  long long ll;
using ll = long long;
using ld = long double;
using uint = unsigned int ;
using ull = unsigned long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
#define endl "\n"
#define ioss ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
//#define all(x) x.begin(),x.end();
//#define fi first
//#define se second
 
double startTime;
double getCurrentTime()
{
    return ((double)clock()-startTime)/CLOCKS_PER_SEC;
}
 
void solve()
{
int n;cin>>n;ll sum=0;
for(int i=1;i<=n;i++)
{
  if(i%3!=0&i%5!=0)sum=sum+i;
}
  cout<<sum<<endl;
}
 
int main()
{
    startTime=(double)clock();
    //freopen("input.txt","r",stdin);
    //freopen("output.txt,"w",stdout);
 
    ioss
    //int t;scanf("%d",&t);
   // while(t--) 
            solve();
 
    return 0;
}

Measured memory_bytes: 3656