akhauriyash/Code-Regression huggingface dataset:
// Problem : C - Multiplication 3
// Contest : AtCoder - AtCoder Beginner Contest 169
// URL : https://atcoder.jp/contests/abc169/tasks/abc169_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

// Mere bas ka nahi hai
// still i'm trying
// apna time aayega
//
//        .--------------.  
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |  
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'                          		  
//
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll power(ll x,ll y,ll m){if(y==0)return 1;ll p=power(x,y/2,m)%m;p=(p*p)%m;return (y%2==0)?p:(x*p)%m;}
ll nCr(ll n,ll r,ll m){if(r>n)return 0;ll a=1,b=1,i;for(i=0;i<r;i++){a=(a*n)%m;--n;}while(r){b=(b*r)%m;--r;}return (a*power(b,m-2,m))%m;}
#define Test int t;cin>>t;while(t--)
#define endl '\n'
void solve()
{
	long double a,b;
	cin >> a >> b;
	cout << (ll)(a*b) << endl;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//Test
	solve();
	return 0;
}


Measured memory_bytes: 3736
// C++ code to find maximum possible product of 
// sub-sequence of size k from given array of n 
// integers 
#include <algorithm> // for sorting 
#include <iostream> 
#include <vector> 
using namespace std; 
#define int long long

const int mod = 1e9 + 7;

// Required function 
int maxProductSubarrayOfSizeK(vector<int> &A, int n, int k) 
{ 
	// sorting given input array 
	sort(A.begin(), A.end());

	// variable to store final product of all element 
	// of sub-sequence of size k 
	int product = 1; 

	// CASE I 
	// If max element is 0 and 
	// k is odd then max product will be 0 
	if (A[n - 1] == 0 && (k & 1)) 
		return 0; 

	// CASE II 
	// If all elements are negative and 
	// k is odd then max product will be 
	// product of rightmost-subarray of size k 
	if (A[n - 1] <= 0 && (k & 1)) { 
		for (int i = n - 1; i >= n - k; i--) {
			product *= A[i]; 
			product %= mod;
			product += mod;
			product %= mod;
		}
		return product; 
	} 

	// else 
	// i is current left pointer index 
	int i = 0; 

	// j is current right pointer index 
	int j = n - 1; 

	// CASE III 
	// if k is odd and rightmost element in 
	// sorted array is positive then it 
	// must come in subsequence 
	// Multiplying A[j] with product and 
	// correspondingly changing j 
	if (k & 1) { 
		product *= A[j]; 
			product %= mod;
			product += mod;
			product %= mod;
		j--; 
		k--; 
	} 

	// CASE IV 
	// Now k is even 
	// Now we deal with pairs 
	// Each time a pair is multiplied to product 
	// ie.. two elements are added to subsequence each time 
	// Effectively k becomes half 
	// Hence, k >>= 1 means k /= 2 
	k >>= 1; 

	// Now finding k corresponding pairs 
	// to get maximum possible value of product 
	for (int itr = 0; itr < k; itr++) { 

		// product from left pointers 
		int left_product = A[i] * A[i + 1];
		int old_left_product = left_product;
		left_product %= mod;
		left_product += mod;
		left_product %= mod; 

		// product from right pointers 
		int right_product = A[j] * A[j - 1]; 
		int old_right_product = right_product;
		right_product %= mod;
		right_product += mod;
		right_product %= mod; 

		// Taking the max product from two choices 
		// Correspondingly changing the pointer's position 
		if (old_left_product > old_right_product) { 
			product *= left_product; 
			product %= mod;
			product += mod;
			product %= mod;
			i += 2; 
		} 
		else { 
			product *= right_product; 
			product %= mod;
			product += mod;
			product %= mod;
			j -= 2; 
		} 
	} 

	// Finally return product 
	return product; 
} 

// Driver Code to test above function 
int32_t main() 
{ 

	int n, k;
	cin >> n >> k;

	vector<int> A;
	for (int i = 0; i < n; ++i)
	{
		int x;
		cin >> x;
		A.push_back(x);
	}

	cout << maxProductSubarrayOfSizeK(A, n, k); 

	return 0; 
} 


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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)


int main(){
	while(true){
		int b,r,g,c,s,t;
		cin>>b>>r>>g>>c>>s>>t;
		if(t==0) break;
		int game_count=t;
		game_count-=5*b+3*r+s;
		int medal_count=15*b+15*r+7*g+2*c+100-game_count*3;
		int bonus_count=b*5+r*3;
		medal_count+=bonus_count*13;
		printf("%d\n", medal_count);
	}
	return 0;
}

Measured memory_bytes: 1144
# BC179-B Go to Jail
N = int(input())
D = []
for i in range(N):
    D.append(input())
yes = 0
yes3 = 0
for i in range(N):
    D1, D2 = map(int, D[i].split(' '))

    # print(D1, D2)
    if D1 == D2:
        yes += 1
        if yes >= 3:
            yes3 = 1
    else:
        yes = 0
if yes3 == 1:
    print('Yes')
else:
    print('No')

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

using namespace  std;

int main() {
    int n ; cin>>n;
    bool ok = true;
    for(int i = 0 ; i < n; ++i){
        int x ; cin>>x;
        if(!(x&1)){
            ok &= !(x%3) | !(x%5);
        }
    }
    cout<<(ok?"APPROVED":"DENIED")<<endl;
}

Measured memory_bytes: 256
fun main(args:Array<String>):Unit {
    val (n, k) = readLine()!!.trim().split(' ').map(String::toInt)
    val mapper:MutableMap<Char, ReplaceMatrix> = mutableMapOf()
    repeat(k){
        val (p, h) = readLine()!!.trim().split(' ')
        val replace = Array(n){it}
        repeat(h.toInt() - 1){
            readLine()!!.trim().split(' ').map(String::toInt).forEachIndexed { index, i ->
                if (i == 1) {
                    val temp = replace[index]
                    replace[index] = replace[index + 1]
                    replace[index + 1] = temp
                }
            }
        }
        mapper[p.first()] = ReplaceMatrix(replace)
    }
    repeat(readLine()!!.trim().toInt()){
        val e = takeExpress(readLine()!!.trim(), mapper)!!
        println(e.first.toReplaceArray().map{it + 1}.joinToString(" "))
    }
}

class ReplaceMatrix(replace:Array<Int>) {
    private val mReplace:Array<Int> = replace
    operator fun times(that:ReplaceMatrix):ReplaceMatrix {
        return ReplaceMatrix(that.mReplace.map{mReplace[it]}.toTypedArray())
    }
    fun exp(e:Int):ReplaceMatrix {
        return when(e){
            0 -> ReplaceMatrix(Array(mReplace.size){it})
            1 -> this
            else -> exp(e / 2).let{
                if (e % 2 == 0) it * it
                else it * it * this
            }
        }
    }
    fun toReplaceArray():Array<Int> {
        return mReplace
    }
}
fun takeNumber(str:String):Pair<Int, String>? {
    return when{
        str.first().isDigit() -> {
            var i = 1
            while(i < str.length && str[i].isDigit()){
                ++i
            }
            Pair(str.substring(0, i).toInt(), str.substring(i))
        }
        else -> null
    }
}
fun takeToken(str:String, mapper:Map<Char, ReplaceMatrix>):Pair<ReplaceMatrix, String>? {
    return when{
        str.first().isUpperCase() -> Pair(mapper[str.first()]!!, str.substring(1))
        str.first() == '(' -> {
            val res = takeExpress(str.substring(1), mapper)!!
            Pair(res.first, res.second.substring(1))
        }
        else -> {
            val num = takeNumber(str)!!
            val res = takeToken(num.second, mapper)!!
            Pair(res.first.exp(num.first), res.second)
        }
    }
}
fun takeExpress(str:String, mapper:Map<Char, ReplaceMatrix>):Pair<ReplaceMatrix, String>? {
    return when{
        str.isEmpty() -> null
        else -> {
            val token = takeToken(str, mapper)!!
            if (token.second.isNotEmpty() && token.second.first() == '+') {
                val tail = takeExpress(token.second.substring(1), mapper)!!
                Pair(token.first * tail.first, tail.second)
            }else{
                token
            }
        }
    }
}


Measured memory_bytes: 82572
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int n,t;cin>>n;
  vector<int> v(n);
  t=n*(n-1);
  t=t/2;
  vector<int> b(t);
  for(int i=0;i<n;i++){
    cin>>v[i];
  }
  int x=0;
  for(int i=0;i<n && x<t;i++){
   for(int j=i+1;j<n && x<t;j++){
    b[x]=v[i]*v[j];
     x++;
  }
  }
  int sum=0;
  for(int i=0;i<t;i++){
    sum+=b[i];
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
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 main(){
    ll A, B, X;
    cin >> A >> B >> X;
    string res = "YES\n";
    if (A+B < X) res = "NO\n";
    if (A > X) res = "NO\n";
    cout << res;
}


Measured memory_bytes: 256
from fractions import gcd

A,B = map(int,input().split())
x = gcd(A,B)

def prime_factrization(n):
    exponent = 0
    while n%2 == 0:
        exponent += 1
        n //= 2
    if exponent == 0:
        a = []
    else:
        a = [[2,exponent]]
    
    q = 1
    while q*q <= n:
        q += 2
        if n%q != 0:
            continue
        exponent = 0
        while n%q == 0:
            exponent += 1
            n //= q
        a.append([q,exponent])
        
    if n != 1:
        a.append([n,1])
    return a

if x == 1:
    print(1)
else:
    a = prime_factrization(x)
    print(len(a)+1)

Measured memory_bytes: 5044
# モンスターの体力H
# アライグマの必殺技の種類N
# i番目の必殺技使うと、モンスターの体力Ai減らせる

# H - (A1 + A2 + A3...) <= 0 となるなら 'Yes',
# ならないなら'No'が出力される

h, n = map(int, input().split())
damage = list(map(int, input().split()))

if h - sum(damage) <= 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 20520
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author lstd
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <random>
#include <chrono>
#include <complex>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

#define sqr(x) ((x)*(x))
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define RE(i, n) FOR(i,1,n)
#define REP(i,n) FOR(i, 0, (int)(n)-1)
#define fst first
#define snd second

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

string to_string(string s) {
    return '"' + s + '"';
}

string to_string(const char* s) {
    return to_string((string) s);
}

string to_string(bool b) {
    return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for (const auto &x : v) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}



void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

int XMOV[4] = {0, 0, 1, -1};
int YMOV[4] = {1, -1, 0, 0};

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using namespace std;

class DModSum {
public:
	void solve(std::istream& in, std::ostream& out) {
		ll n;

		in >> n;

		n--;
		out << n*(n+1)/2L;

	}
};

int main() {
	DModSum solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

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

using namespace std;

int main(int, char**) {
        int a, b, h, m;
        cin >> a >> b >> h >> m;
        static const double pi = 3.141592653589793;
        double th_a = pi / 6 * (h + m/60.0);
        double th_b = pi * 2 * m / 60.0;
        double x_a, y_a, x_b, y_b;
        x_a = a * cos(th_a);
        y_a = a * sin(th_a);
        x_b = b * cos(th_b);
        y_b = b * sin(th_b);
        double l2, l;
        l2 = pow(x_a-x_b, 2) + pow(y_a-y_b, 2);
        l = pow(l2, 0.5);
        cout << setprecision(20) << l << endl;
        return 0;
}


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

int main()
{
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  
  for(int i = 0; 'a' + i <= 'z'; ++i)
  {
    for(int k = 0; k < s.size(); ++k)
    {
      if(s[k] == 'a' + i) break;
      if(s[k] != 'a' + i && k == s.size() - 1)
      {
        cout << (char)('a' + i) << endl;
        return 0;
      }
    }
  }
  cout << "None" << endl;
}

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

int main()
{


        long long n,m,a,b,c,d,e,f,g,h,p,q,r,fr,sc,tr,sz,tz,i,j,k,mx=LLONG_MIN,mn=LLONG_MAX;
        long long x=0,y=0,cnt=0,res=0,ttl=0,ans=0,sum=0; long long flg=0,flag=1,na=0,as=1;
        vector<long long>u,v,w; vector< pair<long long,long long> >vct; vector<string>vst;
        set<long long>st,nt,tt; map<long long,long long>mp,nq,qr; string str,ttr,ntr;

        scanf("%lld",&n);

        for(i=0;i<n;i++)
        {

            scanf("%lld",&a);  mp[a]++;  sum=sum+a;

        }

        scanf("%lld",&q);

        for(i=1;i<=q;i++)
        {

            scanf("%lld %lld",&a,&b);

            fr=(b-a)*mp[a];   mp[b]=mp[b]+mp[a];  mp[a]=0;

            sum=sum+fr;  printf("%lld\n",sum);

        }




    return 0;
}





Measured memory_bytes: 9716
n = gets.strip.to_i
a = gets.strip.split.map(&:to_i).sort

max_a = a.last

half_max_a = a.first

half_max = max_a/2.0
a.each do |current|
  half_max_a = current if (half_max - current).abs < (half_max - half_max_a).abs
end

puts [max_a, half_max_a].join(' ')





Measured memory_bytes: 11008
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mem(arr,v) memset(arr,v,sizeof(arr))
/*bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
} */
int main()
{
     ll t,a,b,c,k;
     cin>>a>>b>>c>>k;
     if(k%2==0)
        cout<<a-b<<endl;
     else
        cout<<b-a<<endl;
}


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

ac = 0
wa = 0
tle = 0
re = 0

for _ in range(N):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    else:
        re += 1

print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))

Measured memory_bytes: 9212
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    void solve() {
        input();
        int N, K;
        cin >> N >> K;
        vector<ll> V(N);
        rep(i, 0, N)cin >> V[i];
        ll best = INFl;

        for (int l = 0; l < N; ++l) {
            for (int r = l; r <= N; ++r) {
                int zaiko = K - (N - (r - l));
                if (zaiko < 0) continue;
                ll val = 0;
                vector<ll> gomi;
                for (int i = 0; i < N; ++i) {
                    if (i >= l && i < r)val += V[i];
                    else gomi.push_back(V[i]);
                }
                sort(all(gomi));
                for (int i = 0; i < zaiko; ++i) {
                    if (i < gomi.size() && gomi[i] < 0) val += gomi[i];
                }
                chmin(best, val);
            }
        }
        ll ans = accumulate(all(V), 0ll);
        ans -= best;
        cout << ans << endl;


    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <map>
#include <algorithm>
#include <regex>
using namespace std;

int main(){
  string s;
  cin >> s;
  regex re("^(eraser|erase|dreamer|dream)*$");
  if(regex_match(s,re)){
    cout << "YES"<<endl;
  }else{
    cout << "NO"<<endl;
  }
  return 0;
}


Measured memory_bytes: 39808
#pragma once
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

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

	ll A, B;

	cin >> A >> B;

	ll n = gcd(A, B);
	vector<ll> ans;

	ans.push_back(1);
	for (int i = 2; i < sqrt(n); i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				n /= i;
			}
			ans.push_back(i);
		}
	}

	if (n > 1) {
		ans.push_back(n);
	}

	cout << ans.size() << "\n";

	return 0;
}


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

int main(){
    int n; cin >> n;
    vector<int> a(n);
    for(auto&& i: a)cin >> i;
    bool flag = true;
    for (int i = 0; i < n; i++)
    {
        if (a[i] % 2 == 0)
        {
            if (!(a[i] % 3 == 0 || a[i] % 5 == 0))
            {
                flag = false;
            }
            
        }
        
    }
    if(flag)cout << "APPROVED" << endl;
    else cout << "DENIED" << endl;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<math.h>
#include <iomanip>
#include <limits>

using namespace std;

void knock(int n,double *p1,double *p2){
    double s[2],t[2],u[2];
    if(n==0){
        return;
    }
    
    s[0] = ((2*p1[0])+p2[0])/3;
    s[1] = ((2*p1[1])+p2[1])/3;
    t[0] = (p1[0]+(2*p2[0]))/3;
    t[1] = (p1[1]+(2*p2[1]))/3;
    u[0] = ((t[0]-s[0])*cos(M_PI/3)) - ((t[1]-s[1])*sin(M_PI/3)) + s[0];
    u[1] = ((t[0]-s[0])*sin(M_PI/3)) + ((t[1]-s[1])*cos(M_PI/3)) + s[1];
    
    knock(n-1, p1, s);
    cout << fixed << s[0] << " " << fixed << s[1] << endl;
    knock(n-1, s, u);
    cout << fixed << u[0] << " " << fixed << u[1] << endl;
    knock(n-1, u, t);
    cout << fixed << t[0] << " " << fixed << t[1] << endl;
    knock(n-1, t, p2);
    
}

int main(){
    int n;
    cin >> n;
    double p1[2] = {0,0},p2[2] = {100,0};
    cout << fixed << p1[0] << " " << fixed <<p1[1] << endl;
    knock(n,p1,p2);
    cout << fixed << p2[0] << " " << fixed << p2[1] << endl;
    
}



Measured memory_bytes: 3232
#include <stdio.h>

int main(void)
{
	int t;
	int n;
	
	while (scanf("%d", &t), t != 0){
		scanf("%d", &n);
		while (n-- > 0){
			int s, f;
			
			scanf("%d %d", &s, &f);
			t -= f - s;
		}
		if (t <= 0){
			puts("OK");
		}
		else {
			printf("%d\n", t);
		}
	}
	
	return 0;
}

Measured memory_bytes: 612
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdio.h>
using namespace std;
#define ll long long
int main(int argc, char const *argv[])
{
    int n, d, x, y;
    cin >> n;
    cin >> d >> x;
    int sum = 0, cnt;
    while (n--) {
        cin >> y;
        cnt = 1;
        while (cnt <= d) {
            sum++;
            cnt += y;
        }
    }
    printf("%d\n", sum+x);
    return 0;
}

Measured memory_bytes: 256
n,m,c = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in range(len(A)):
  s = 0
  for j in range(m):
    s += A[i][j] * B[j]
  if s + c > 0:
    ans += 1
 
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main() {
  int m,d;
  cin >> m >> d;
  int ans=0;
  for ( int i=1; i<=m; i++ ) {
    for ( int j=2; j<10; j++ ) {
      for ( int k=2; k<10; k++ ) {
        if ( j*10+k<=d && j*k==i ) ans++;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3572
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
using namespace std;

void sort(int* rep) {
	bool flg = true;
	int temp;

	do{
		flg = false;
		if (rep[0] < rep[1]) {
			temp = rep[0];
			rep[0] = rep[1];
			rep[1] = temp;
			flg = true;
		}
		if (rep[1] < rep[2]) {
			temp = rep[1];
			rep[1] = rep[2];
			rep[2] = temp;
			flg = true;
		}
	} while (flg);
}




int main() {

	int size;

	cin >> size;

	int a[3];
	int ans[1000];

	for (int i = 0; i < size; i++) {
		for (int j = 0; j < 3; j++)cin >> a[j];
		sort(a);

		if (a[0] * a[0] == a[1] * a[1] + a[2] * a[2]) {
			ans[i] = true;
		}
		else {
			ans[i] = false;
		}
	}

	for (int i = 0; i < size; i++) {
		if (ans[i])printf("YES\n");
		else printf("NO\n");
	}

	//system("pause");
	return 0;
}


Measured memory_bytes: 2912
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

vector< vector<int> > Graph;
vector< int > value;









int main(int argc, const char * argv[]) {
    
    
    
    string s; cin >> s;
    if(s=="Sunny") cout << "Cloudy" << endl;
    else if(s=="Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
    
    
}


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

int main() {
    int n, T;
    cin >> n >> T;

    vector<int> a(n);
    vector<int> mx(n);
    int mnmn = INT_MAX;
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        if (i > 0) mx[i] = a[i] - mnmn;
        mnmn = min(mnmn, a[i]);
    }

    int maxi = *max_element(mx.begin(), mx.end());
    int ans = 0;
    for (int i = 0; i < n; i++) if (mx[i] == maxi) ans++;

    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll gcd(ll a, ll b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N), BIG;
    rep(i, N) cin >> A[i];

    ll check = A[0];
    sort(A.begin(), A.end());
    rep(i, N) { check = gcd(A[i], check); }
    rep(i, N) {
        if (A[i] >= K) BIG.push_back(A[i] - K);
    }

    bool ans = false;
    rep(i, BIG.size()) {
        if (BIG[i] % check == 0) ans = true;
    }

    if (ans)
        cout << "POSSIBLE\n";
    else
        cout << "IMPOSSIBLE\n";

    return 0;
}

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

int main() {
    int n;
    cin>>n;
    int cnt2 = 0, cnt4 = 0, cnt1 = 0;
    for (int i = 0; i < n; ++i) {
        int x;
        cin>>x;
        if (x % 4 == 0)
            cnt4 ++;
        else if (x % 2 == 0)
            cnt2 ++;
        else 
            cnt1 ++;
    }
    if (cnt4 >= cnt1)
        cout<<"Yes"<<endl;
    else if (cnt4 - cnt1 == -1 && cnt2 == 0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <string.h>

using namespace std;

int main()
{
    int n, i, k;
    char s[100];
    scanf("%d",&n);
    getchar();
    scanf("%s",s);
    scanf("%d",&k);
    for(i=0;i<n;i++)
    {
        if(s[i]==s[k-1])
            printf("%c",s[i]);
        else
            printf("*");
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

const int INF = 1e9;
const long long LINF = 1e18;
const double PI=3.14159265358979323846;

typedef priority_queue<int, vector<int>, greater<int>> priority_queue_asc;

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

    if (X >= 30) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3100
#include<cstdio>
#include<cmath>
#include<cctype>
#include<algorithm>
using namespace std;

int h[100100];
int f[100100];

void readint(int &v){
	char c;
	while(!isdigit(c=getchar()));
	v=c^48;
	while(isdigit(c=getchar())) v=(v<<3)+(v<<1)+(c^48);
}

int main(){
	int N,K;
	readint(N);
	readint(K);
	
	for(int i=1;i<=N;i++){
		readint(h[i]);
		if(~-i) f[i]=0x3f3f3f3f;
		for(int j=1;j<=min(i-1,K);j++) f[i]=min(f[i],f[i-j]+abs(h[i]-h[i-j]));
	}
	
	return printf("%d\n",f[N])&0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yn(int o){
    if (o == 0) cout << "No" << endl;
    else cout << "Yes" << endl;
}

int cul(int n){
    vector<int> ar(10,0);
    int re = 0;
    rep(i,10){
        ar[i] = n % 10;
        n /= 10;
        re += ar[i];
    }
    return re;
}

int main() {
    int r, g; cin >> r >> g;
    cout << 2 * g - r << endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;
import java.util.Arrays;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();

        int[] A = new int[4];
        for (int i = 0; i < 4; i++) {
            A[i] = str.charAt(i);
        }
        Arrays.sort(A);

        if (A[0] == A[1] && A[2] == A[3] && A[0] != A[3]) {
            System.out.println("Yes");
        } else { 
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 21844
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

uint64_t a, b, c;

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

	uint64_t ans = 0;
	if (a % 2 == 1 && b % 2 == 1 && c % 2 == 1) {
		ans = min(a * b, b * c);
		ans = min(ans, a * c);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  bool flag = false;
  
  for(int i = 0; i < N; i++){
    string h;
    cin >> h;

    if(h == "Y")
      flag = true;
  }
  if(flag){
    cout << "Four" << endl;
  }
  else{
    cout << "Three" << endl;
  }
}

Measured memory_bytes: 3580
<?php

while (true) {
    $a = array();
    $b = array();
    fscanf(STDIN, '%f %f %f %f %f %f', $a[], $a[], $a[], $b[], $b[], $b[]);
    if (feof(STDIN)) {
        break;
    }
    if ($a[0] === 0.0) {
        $tmp = $a;
        $a = $b;
        $b = $tmp;
    }
    $div = $a[0];
    for ($i = 0; $i < 3; $i++) {
        $a[$i] /= $div;
    }
    $t = $b[0] / $a[0];
    for ($i = 0; $i < 3; $i++) {
        $b[$i] -= $a[$i] * $t;
    }
    $div = $b[1];
    for ($i = 0; $i < 3; $i++) {
        $b[$i] /= $div;
    }
    $t = $a[1] / $b[1];
    for ($i = 0; $i < 3; $i++) {
        $a[$i] -= $b[$i] * $t;
    }
    echo sprintf('%.3f %.3f', round($a[2], 4), round($b[2], 4));
    echo PHP_EOL;
}

Measured memory_bytes: 6684
#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
#include<stack>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>
int main(void)
{
    int n,k;
    cin>>n>>k;
    vector<ll> a(n+3);
    vector<ll> wa(n+3);
     wa[0] =0;

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

    rep(j,n-k)
    {
        if(a[j]<a[j+k]) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }



}

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

int main()
{
	string s,t,t1;
	long long k;
	cin >> s;
	cin >> k;
	int l = s.length();
	t = s;
	t1 = s;
	long long ans1 = 0,ans2 = 0,ans3 = 0;
	for(int i = 1; i < l; i++){
		if(t[i] == t[i - 1]){
			ans1++;
			t[i] = '0';
		}
	}
	if(s[0] != s[l - 1])
		ans2 = ans1;
	else{
		if(s[0] == t[l - 1]){
			s[0] = '0';
			ans2++;
		}
		for(int i = 1; i < l; i++){
			if(s[i] == s[i - 1]){
				ans2++;
				s[i] = '0';
			}
		}
	}
	if(t1[0] == s[l - 1]){
		t1[0] = '0';
		ans3++;
	}
	for(int i = 1; i < l; i++){
		if(t1[i] == t1[i - 1]){
			ans3++;
			t1[i] = '0';
		}
	}
	long long sum = ans1 + (ans3 + ans2) * ((k - 1) / 2);
	if((k - 1) % 2 == 1)
		sum += ans2;
	cout << sum << endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=105,INF=1<<30;

struct data{
    int h;
    int w;
    int d;
    int f;
    int r;
};

bool can[MAX][MAX][7][7][7];
vector<data> G[MAX][MAX][7][7][7];

int S[MAX][MAX];
int H,W;

void DFS(data u,data p){
    for(data to:G[u.h][u.w][u.d][u.f][u.r]){
        if(to.h==p.h&&to.w==p.w&&to.d==p.d&&to.f==p.f&&to.r==p.r) continue;
        
        if(to.h<0||to.h>=H||to.w<0||to.w>=W) continue;
        
        if(to.d!=S[to.h][to.w]) continue;
        
        if(can[to.h][to.w][to.d][to.f][to.r]) continue;
        
        can[to.h][to.w][to.d][to.f][to.r]=1;
        DFS(to,u);
    }
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>H>>W;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            char c;cin>>c;
            if(c=='#') S[i][j]=0;
            else S[i][j]=c-'0';
        }
    }
    
    can[0][0][6][2][3]=1;
    
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            for(int d=1;d<=6;d++){
                for(int f=1;f<=6;f++){
                    for(int r=1;r<=6;r++){
                        if(d==f) continue;
                        if(d==r) continue;
                        if(f==r) continue;
                        
                        G[i][j][d][f][r].push_back({i+1,j,f,7-d,r});
                        G[i][j][d][f][r].push_back({i,j+1,r,f,7-d});
                        G[i][j][d][f][r].push_back({i-1,j,7-f,d,r});
                        G[i][j][d][f][r].push_back({i,j-1,7-r,f,d});
                    }
                }
            }
        }
    }
    
    DFS({0,0,6,2,3},{-1,-1,-1,-1,-1});
    
    bool ok=false;
    
    for(int f=1;f<=6;f++){
        for(int r=1;r<=6;r++){
            if(can[H-1][W-1][S[H-1][W-1]][f][r]) ok=true;
        }
    }
    
    if(ok) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


Measured memory_bytes: 206220
import sys
from collections import Counter, defaultdict
import numpy as np


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    S = list(input())
    C = Counter(S)
    K = C.keys()
    answer = []
    for k in K:
        cnt = 0
        counter = []
        for s in S:
            if s == k:
                counter.append(cnt)
                cnt = 0
            else:
                cnt += 1
        counter.append(cnt)
        answer.append(max(counter))
    print(min(answer))


if __name__ == "__main__":
    main()


Measured memory_bytes: 12500
#include<bits/stdc++.h>
using namespace std;
//vector<long long int>v;
long long  ara[100005];
long long  cost=1000000003;
int main()
{

    int test,candle,t,high,low,i;
    cin>>test>>candle;
    for(i=1; i<=test; i++)
    {
        cin>>ara[i];
//        v.push_back(t);

    }
    cost=1000000003;
    for(i=1; i+candle-1<=test; i++)
    {
        low=i;
        high=i+candle-1;
        cost=min(cost,ara[high]-ara[low]+min(abs(ara[low]),abs(ara[high])));
        //cout<<cost<<endl;
//        cout<<min(abs(ara[low]),abs(ara[high]))<<endl;
//        cout<<ara[high]-ara[low]+min(abs(ara[low]),abs(ara[high]))<<endl;
//        cout<<cost<<endl;
    }
    cout<<cost<<endl;
    return 0;
}


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


int main(){
  int n,i,j,cal,han;
  cin >> n;
  han=0;

  for(i=1;i<10;++i){
    for(j=i;j<10;++j){
      cal=i*j;
      if(cal==n){
        han=1;
        break;
      }

    }
  }
  if(han==1){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

  return 0;

}

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

char X[1000];
char Y[1000];
int c[1001][1001];

int LCSLength(char *,char *);

int main(){
  int q;
  int i;
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%s",X);
    scanf("%s",Y);
    printf("%d\n",LCSLength(X,Y));
    }

  
  return 0;
}

int LCSLength(char X[],char Y[]){
  int m,n;
  int i,j;
  m=strlen(X);
  n=strlen(Y);
  
  for(i=1;i<=m;i++)
    c[i][0]=0;
  for(j=0;j<=n;j++)
    c[0][j]=0;
  
  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i-1]==Y[j-1])
	c[i][j]=c[i-1][j-1]+1;
      else if(c[i-1][j]>=c[i][j-1])
	c[i][j]=c[i-1][j];
      else
	c[i][j]=c[i][j-1];
    }
  }
  return c[m][n];
}



Measured memory_bytes: 5660
#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    int c = 0;
    if (a >= 13) {
        c = b;
    } else if (a >= 6) {
        c = b / 2;
    }
    cout << c << endl;

    return 0;
}

Measured memory_bytes: 256
import sys
from collections import deque
sys.setrecursionlimit(20000000)
input = sys.stdin.readline


def main():
    n = int(input())

    a = 0
    for x in range(1, n+1):
        if len(str(x)) % 2 == 1:
            a += 1

    print(a)


if __name__ == '__main__':
    main()



Measured memory_bytes: 3316
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する


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

    int n;
    cin >> n;

    cout << 1110 - n << endl;


    return 0;
}


Measured memory_bytes: 888
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner as = new Scanner(System.in);
		int x = Integer.parseInt(as.next());
		int y = Integer.parseInt(as.next());
		int n;
		if(x<y&&x>=0){                            //2,3
			n = y-x;
		}else if(y<x&&y>=0){                      //3,2
			int k,l;
			k = y+x+1;
			l = x-y+2;
			n = Math.min(k,l);
		}else if(x>y&&x>=0&&y<0&&Math.abs(y)>x){ //2,-3
			n = Math.abs(y)-x+1;
		}else if(x>y&&x>=0&&y<0&&Math.abs(y)<x){ //3,-2
			n = x-Math.abs(y)+1;
		}else if(x<y&&x<0&&y>0&&Math.abs(x)>y){//-3,2
			n = Math.abs(x)-y+1;
		}else if(x<y&&x<0&&y>=0&&Math.abs(x)<y){//-2,3
			n = y-Math.abs(x)+1;
		}else if(x>y&&x<0){                     //-2,-3
			n = Math.abs(y)-Math.abs(x)+2;
		}else if(y>x&&y<=0){                     //-3,-2
			n = y-x;
		}else if(x==y){
			n = 0;
		}else{                                  //-2,2
			n = 1;
		}
		System.out.println(n);
	}
}

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

#define mp make_pair
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0)
#define FILE_IO(x) freopen((string(x) + ".in").c_str(), "r", stdin); freopen((string(x) + ".out").c_str(), "w", stdout)
#define sz(x) ((int)((x).size()))
#define len(x) ((int)((x).length()))
#define x first
#define y second
#define foreach(it, v) for (auto it : v)
#define rep(it, n) for (int it = 0; it < n; ++it)
#define forin(it, l, r) for (int it = l; it < r; ++it)
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = (1 << 31) - 1;
const ll LINF = (1ll << 63) - 1;
const double DINF = numeric_limits<double>::infinity();
const int MOD = 1e9 + 7;
const double EPS = 1e-7;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
mt19937 mmtw(MOD);
ll rnd(ll x, ll y) { static uniform_int_distribution<ll> d; return d(mmtw) % (y - x + 1) + x; }
template <class T> T arr_max(T a[], int n) { T res = a[0]; for (int i = 1; i < n; ++i) if (a[i] > res) res = a[i]; return res; }
template <class T> T arr_min(T a[], int n) { T res = a[0]; for (int i = 1; i < n; ++i) if (a[i] < res) res = a[i]; return res; }
////////////////////////////////////////////////////////////////////////////////////////////////

int n, t;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=3e6+10;
typedef long long LL;
LL x,y,z,k,t;
LL a[N],b[N],c[N];

int main()
{
	cin>>x>>y>>z>>k;
	for (int i=1;i<=x;i++) scanf("%lld",&a[i]);
	LL cnt=0;
	for (int i=1;i<=y;i++) {
		scanf("%lld",&t);
		for (int j=1;j<=x;j++) b[++cnt]=a[j]+t;
	}
	sort(b+1,b+cnt+1);
	reverse(b+1,b+cnt+1);
	LL cnt2=0;
	for (int i=1;i<=z;i++) {
		scanf("%lld",&t);
		for (int j=1;j<=min(k,cnt);j++) c[++cnt2]=b[j]+t;
	}
	sort(c+1,c+cnt2+1);
	reverse(c+1,c+cnt2+1);
	for (int i=1;i<=k;i++) printf("%lld\n",c[i]);
	return 0;
}

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

using namespace std;


int main() {
    int n;
    cin >> n;
    vector<int64_t> v(100010, 0);
    for(int i = 0; i < n; i++) {
        int64_t a;
        cin >> a;
        v[a]++;
    }
    int64_t ans = 0;
    for(int i = 0; i < 100010; i++) {
        ans += i * v[i];
    }
    int q;
    cin >> q;
    while(q--) {
        int64_t b, c;
        cin >> b >> c;
        ans -= b * v[b];
        ans += c * v[b];
        cout << ans << "\n";
        v[c] += v[b];
        v[b] = 0;
    }
    return 0;
}

Measured memory_bytes: 4028
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,i,j,k,l,a,b,c,d;
    string s1;
    cin>>a>>b;
    k=a*3+b;
    c=k/2;
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  ll W, H;
  cin>>W>>H;
  vector<pair<ll, int> > edge;
  ll tmp;
  for(int i=0;i<W;++i) {
    cin>>tmp;
    edge.push_back(mp(tmp, 0));
  }
  for(int i=0;i<H;++i) {
    cin>>tmp;
    edge.push_back(mp(tmp, 1));
  }
  sort(edge.begin(), edge.end());
  bool ok[H+1];
  for(int i=0;i<=H;++i) ok[i] = false;
  ll num = (H+1)*(W+1)-1;
  ll ans = 0;
  int hnum=0, wnum=0;
  for(int i=0;i<W+H;++i) {
    if(num==0) break;
    if(edge[i].se==0) {
      ans += (H+1-wnum)*edge[i].fi;
      num -= H+1-wnum;
      hnum++;
    }
    else {
      ans += (W+1-hnum)*edge[i].fi;
      num -= W+1-hnum;
      wnum++;
    }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 7472
#!/usr/bin/env python3

import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def nr_choose2(nr_ball):
    return nr_ball * (nr_ball - 1) // 2

def main():
    n = read(int)
    as_ = read_list(int)
    nr_balls_by_num = {}
    nr_choose2_by_num = {}
    for a in as_:
        if a not in nr_balls_by_num:
            nr_balls_by_num[a] = 0
        nr_balls_by_num[a] += 1

    nr_all_choose2 = 0
    for num in nr_balls_by_num:
        nr_choose2_by_num[num] = nr_choose2(nr_balls_by_num[num])
        nr_all_choose2 += nr_choose2_by_num[num]

    for k in range(len(as_)):
        ans = nr_all_choose2 - nr_choose2_by_num[as_[k]]
        ans += nr_choose2(nr_balls_by_num[as_[k]] - 1)
        print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 31828
/*
	
	@Raghul
*/
#include <bits/stdc++.h> 
using namespace std; 
#define ll long long
ll ans[100005];
ll fastpow(ll a,ll b){
	if(b==0)
		return 1LL;
	ll temp=fastpow(a,b/2);
	temp=temp*temp;
	if(b%2==1)
		temp=temp*a;
	return temp;
}	
int main(){ 
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    ll maxi = 1e9;
    for(int i=0;i<s.length()-2;i++){
    	ll num = (s[i]-'0')*100;
    	num += (s[i+1]-'0')*10;
    	num += (s[i+2]-'0');
    	//cout<<num<<endl;
    	num = fabs(num-753);
    	maxi = min(maxi, num);
    }
    cout<<maxi;
    return 0;
} 

Measured memory_bytes: 256
char buf[5000],k;
sz;
S,N,A,K,i,T;
main()
{
	read(0,buf,5000);
	for(;;)
	{
		k=buf[sz++];
		if(k<'0')break;
		N=N*10+k-'0';
	}
	for(i=0;i<N;i++)
	{
		A=K=0;
		for(;;)
		{
			k=buf[sz++];
			if(k<'0')break;
			A=A*10+k-'0';
		}
		for(;;)
		{
			k=buf[sz++];
			if(k<'0')break;
			K=K*10+k-'0';
		}
		while(T=A/K+1,A%K%T)A=A/K*K-T+A%K%T;
		S^=T-1;
	}
	S?write(1,"Takahashi",9):write(1,"Aoki",4);
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            ABC085_B();
        }

        static void ABC085_B()
        {
            var N = int.Parse(Console.ReadLine());
            var set = new HashSet<int>();
            for (var i = 0; i < N; i++)
            {
                set.Add(int.Parse(Console.ReadLine()));
            }
            Console.WriteLine(set.Count);
        }
    }
}

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

int main(void){
    string s,t,u;
    int a,b;
    cin >> s >> t >> a >> b >> u;
    
    if (u == t){
        cout << a << " " <<  b-1 << endl;
    }else{
        cout << a-1 << " " <<  b << endl;
    }
    
    
}

Measured memory_bytes: 256
n, m = map(int, input().split())
c = list(map(int, input().split()))

dp = [[0 for _ in range(n + 1)] for _ in range(m + 1)]

for i in range(m + 1):
    for j in range(n + 1):
        if i == 0 and j == 0:
            dp[i][j] = 0
        elif i == 0:
            dp[i][j] = 1000000000
        elif j == 0:
            dp[i][j] = 0
        else:
            if j - c[i - 1] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i - 1]] + 1)
            else:
                dp[i][j] = dp[i - 1][j]

ans = 10 ** 10
for i in range(m + 1):
    ans = min(ans, dp[i][n])
print(ans)


Measured memory_bytes: 43848
import java.util.*;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if(a<b&&b<c)
            System.out.println("Yes");
        else
            System.out.println("No");


    }
}

Measured memory_bytes: 26216