akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    int n;
    ll x,zb = 1;
    cin >> n;

    vector<ll> V;
    for(int i=0;i<n;i++)
    {
        cin >> x;
        V.push_back(x);
        if(x == 0)
        {
            cout << 0 << endl;
            return 0;
        }
    }

    for(int i=0;i<n;i++)
    {
        x = V[i];
        if(1000000000000000000/zb < x)
        {
            cout << -1;
            return 0;
        }
        zb *= x;
    }

    cout << zb;
    return 0;
}


Measured memory_bytes: 4284
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES cout<<"YES"<<'\n'
#define NO cout<<"NO"<<'\n'
#define Yes cout<<"Yes"<<'\n'
#define No cout<<"No"<<'\n'
#define yes cout<<"yes"<<'\n'
#define no cout<<"no"<<'\n'
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
int ABS(int a) {if(a<0) a = -a; return a;}
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数の個数*/int divisor_number(int n){auto p = prime_factor(n); int res = 1; for(auto x:p)res*=(x.second+1); return res;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    string a,b,c; cin >> a >> b >> c;
    cout << (char)toupper(a[0]) << (char)toupper(b[0]) << (char)toupper(c[0]) << endl;

    return 0;
}

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

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
}

public class Main {
  private static int solve(int n, String s, String t) {
    for (int commonLength = n; commonLength > 0; commonLength--) {
      String commonString = s.substring(n - commonLength);
      if (t.startsWith(commonString)) {
        return 2 * n - commonLength;
      }
    }
    return 2 * n;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    String s = reader.next();
    String t = reader.next();
    out.println(solve(n, s, t));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}



Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
int l[10000000];
int r[10000000];
int cnt = 0;
void merge(int n,int t[],int left,int mid,int right){
	int n1 = mid-left;
	int n2 = right -mid;
	for(int i = 0;i<n1;i++) l[i] = t[left+i];
	for(int i = 0;i<n2;i++) r[i] = t[mid+i];
	l[n1] = r[n2] = 99999999999;
	int i = 0,j = 0;
	for(int k = left;k<right;k++){
		cnt++;
		if(l[i] <=r[j]){
			t[k] = l[i];
			i++;
		}else{
			t[k] = r[j];
			j++;
		}
	}
}
void mergesort(int t[],int n,int left,int right){
	if(left +1<right){
	int mid = (left + right)/2;
	mergesort(t,n,left,mid);
	mergesort(t,n,mid,right);
	merge(n,t,left,mid,right);
	}
}
int main(){
	int n;
	cin>>n;
	int t[n];
	for(int  i = 0;i<n;i++){
		cin>>t[i];
	}
	mergesort(t,n,0,n);
	for(int i = 0;i<n;i++){
		if(i)cout<<" ";
		cout<<t[i];
	}
	cout<<endl;
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 7020
#include <stdio.h>
#include <string.h>
#include <math.h>

 
 
int main()
 {
	int n;

	scanf("%d",&n);

	if(n%10==2||n%10==4||n%10==5||n%10==7||n%10==9){
		printf("hon");
	}

	else if(n%10==0||n%10==1||n%10==6||n%10==8){
		printf("pon");
	}

	else{printf("bon");}
	



	return 0;
}

Measured memory_bytes: 1712
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int n;
	cin >> n;
	cout << "ABC" << n << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
  long long int n,a,b,sum;
  scanf("%lld %lld %lld",&n,&a,&b);
  sum=0;
  sum=(n/(a+b))*a;
  if(n%(a+b)<a) sum+=n%(a+b);
  else sum+=a;
  printf("%lld\n",sum);
  return 0;
}

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

using namespace std;

using ll= long long;

#define sz(x) (int)x.size()
#define all(x) (x).begin(),(x).end()
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _set(x) __builtin_popcount(x)
# define M_PI 3.14159265358979323846

void solve(){
    int n;
    cin>>n;
    int d= n%10;
    switch(d){
        case 2:
        case 4:
        case 5:
        case 7:
        case 9: cout<<"hon\n";
                break;
        case 0:
        case 1:
        case 6:
        case 8: cout<<"pon\n";
                break;
        default: cout<<"bon\n";
    }
}

int32_t main(){
	IOS
	// freopen("input.txt","r",stdin);
	int _;
	// cin>>_;
	_=1;
	while(_--){
        solve();
    }
	return 0;
}

/*
   check for overflows int long long
   correct size of array
*/

Measured memory_bytes: 3608
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int ll;
typedef int ull;
#define LONGMAX 1e18
#define dd double
#define MOD 1000000007
#define nl cout<<endl
#define rt ll Q[100005]={0}
#define mp make_pair
#define endl "\n"
#define test() ull t;cin>>t;while(t--)
#define pb push_back
#define ff first	
#define ss second
#define all(v) v.begin(),v.end()
#define s(ar,n) sort(ar,ar+n)
#define rs(ar,n) sort(ar, ar+n, greater<ll>()) 
#define oa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define ov(a,n) for(ll i=n-1;i>=0;i--)cout<<a[i]<<" ";nl
#define maxa(ar,N) *max_element(ar,ar+N)
#define mina(ar,N) *min_element(ar,ar+N)
#define INF 1e9
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
ll powe(ll x,ll y){ll res=1;while(y>0){if(y&1)res=res*x;y=y>>1;x=x*x;}return res;}
ll mpowe(ll n,ll m){if(m==0)return 1;ll t=powe(n,m/2);t%=MOD;if(m%2==0)return (t*t)%MOD;return (((t*t)%MOD)*n)%MOD;}
ll logtwo(ll n){if(n==1)return 0;return logtwo(n/2)+1;}
void ceilsearch(ll ar[],ll low,ll high,ll x,ll &y){ll mid=(low+high)/2;if(low>high)return;if(ar[mid]>=x){y=mid;ceilsearch(ar,low,mid-1,x,y);}else{ceilsearch(ar,mid+1,high,x,y);}}
int main()
{
	fastio();
    ll N,K;
    cin>>N>>K;
    ll ans=0;
    while(N>0)
    {
        N/=K;
        ans++;
    }
    cout<<ans<<endl;
}//*-A/BC-/AKL

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n],b=0,g;
  for(int i=0;i<n;i++){
    cin >> a[i];
    g=0;
    while(a[i]%2==0){
      a[i]/=2;
      g++;
    }
    b+=g;
  }
  cout << b;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;                                                            
#define pb push_back                                                            
#define mp make_pair                                                                                                                                
#define sqr(a) ((a) * (a))                                                      
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);   
#define co() cout.precision(10);                                                
#define F for(li i=0;i<n;i++)
#define fo(i,a,n) for(i=a;i<n;i++)
#define ne cout<<"\n"; 
#define test int t;cin>>t;while(t--)
//#define oj #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif

typedef long long li;
typedef long double ld;

const li mod = 1000000007; 

int main() 
{
	io();
		li n,k;
		cin>>n>>k;
		li arr[n],zeros=0,neg=0,pos=0;
		for(int i=0;i<n;i++)
		{
			cin>>arr[i];
			if(arr[i]==0)
			zeros++;
			else if(arr[i]>0)
			pos++;
			else
			neg++;
		}
		
		if(zeros>n-k)
		cout<<"0"<<endl;
		else
		{
			if(pos==0)
			{
				if(k&1)
				{
					if(zeros)
					cout<<"0"<<endl;
					else
					{
						li ans=1;
						sort(arr,arr+n);
						reverse(arr,arr+n);
						for(int i=0;i<k;i++)
						ans=(ans*arr[i])%mod;
						ans=(ans+mod)%mod;
						cout<<ans<<endl;
					}
				}
				else
				{
					li ans=1;
					sort(arr,arr+n);
					for(int i=0;i<k;i++)
					ans=(ans*(-arr[i]))%mod;
					cout<<ans<<endl;
				}
			}
			else if(neg==0)
			{
				li ans=1;
				sort(arr,arr+n);
				reverse(arr,arr+n);
				for(int i=0;i<k;i++)
				ans=(ans*arr[i])%mod;
				cout<<ans<<endl;
			}
			else
			{
				li ans;
				if(k&1)
				{
					sort(arr,arr+n);
					ans=arr[n-1];
					n--;
				}
				else
				{
					sort(arr,arr+n);
					ans=1;
				}
					
					int i,j;
					i=0;j=n-1;
					for(int t=0;t<k/2;t++)
					{
						li count1,count2;
						count1=arr[i]*arr[i+1];
						count2=arr[j]*arr[j-1];
						if(count1>count2)
							{
								ans=(ans*((arr[i]*arr[i+1])%mod))%mod;
								i=i+2;
							}
							else
							{
								ans=(ans*((arr[j-1]*arr[j])%mod))%mod;
								j=j-2;
							}
						
					}
					ans=(ans+mod)%mod;
				cout<<ans<<endl;
			}
		}
}

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

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    int x = n*a;
    cout << min(x,b) << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(n==1) {
			System.out.println("Hello World");
		}else if(n==2) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			System.out.println(a+b);
		}
	}
}

Measured memory_bytes: 21588
import sys
input = sys.stdin.readline
N = int(input())
robo_range = []
for _ in range(N):
  X, L = map(int,input().rstrip().split())
  robo_range.append((X-L,X+L))
robo_range_sort = sorted(robo_range,key = lambda x:x[1])
ans = 0
cut = -float('inf')
for i in range(N):
  if cut <= robo_range_sort[i][0]:
    ans += 1
    cut = robo_range_sort[i][1]
print(ans)

Measured memory_bytes: 19028
import java.util.Scanner;
public class Main
{
    public static void main(String[] args)
    {
        long sl=0;
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        for(int j=0;j<n-1;j++)
        {
            if(a[j]>=a[j+1])
            {
                sl=sl+(a[j]-a[j+1]);
                a[j+1]=a[j+1]+(a[j]-a[j+1]);
            }
            
        }
        
        System.out.println(sl);
    }
}

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

using namespace std;

#define MOD 1000000007
#define PI 3.1415926535897932384626433832795
#define INF (int)1e9
typedef long long int int64;

void print() {
    cout << endl;
}

void print(const char* s, bool endline = true) {
    cout << s;
    if (endline) print();
}

void print(char s, bool endline = true) {
    cout << s;
    if (endline) print();
}

void print(string s, bool endline = true) {
    cout << s;
    if (endline) print();
}

void print(int64 s, bool endline = true) {
    cout << s;
    if (endline) print();
}

void print(int s, bool endline = true) {
    cout << s;
    if (endline) print();
}

template <typename T, typename T2>
void print(pair<T, T2>& p, bool endline = true) {
    cout << "(";
    print(p.first, false);
    cout << ", ";
    print(p.second, false);
    cout << ")";

    if (endline) print();
}

template <typename T>
void print(T& t, bool endline = true) {
    cout << "[";
    for (auto it = t.begin(); it != t.end(); ++it) {
        if (it != t.begin()) cout << ", ";
        print(*it, false);
    }
    cout << "]";

    if(endline) print();
}

template <typename T>
vector<T> operator+(const vector<T> &a, const vector<T> &b)
{
    vector<T> ret;
    ret.reserve( a.size() + b.size() );                // preallocate memory
    ret.insert( ret.end(), a.begin(), a.end() );        // add A;
    ret.insert( ret.end(), b.begin(), b.end() );        // add B;

    return ret;
}

template <typename T>
vector<T> &operator+=(vector<T> &a, const vector<T> &b)
{
    a.reserve( a.size() + b.size() );                // preallocate memory without erase original data
    a.insert( a.end(), b.begin(), b.end() );         // add B;
    return a;
}

bool c(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    return (a.first + a.second > b.first + b.second); 
}

int main() {
    // g++ -Wall -Wextra -O2 -std=c++17 helloworld.cpp
    int64 n, k;
    cin >> n >> k;

    string s;
    cin >> s;

    vector<int> arr;

    int cur = 0;
    char prev = s[0];

    for(auto& c : s) {
        if(c == prev) {
            cur++;
        } else {
            prev = c;
            arr.push_back(cur);
            cur = 1;
        }
    }

    if(cur != 0) {
        arr.push_back(cur);
    }

    int count = 0;
    for(int i = 1; i < (int) arr.size() and count < k; i += 2) {
        if (i < (int) arr.size() - 1) {
            arr[i] += arr[i + 1];
            arr[i + 1] = 1;
        }

        arr[i] += arr[i - 1];
        arr[i - 1] = 1;

        count++;
    }

    int ret = 0;
    for(auto& c : arr) {
        ret += max(0, c - 1);
    }

    print(ret);

    return 0;
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> a(n+1, 0);
	int cost = 0;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		cost += abs(a[i] - a[i-1]);
	}
	cost += abs(a[n] - a[0]);
	for (int i = 1; i <= n; i++)
		cout << cost + abs(a[i-1] - a[(i+1)%(n+1)]) - abs(a[i-1] - a[i]) - abs(a[i] - a[(i+1)%(n+1)]) << '\n';
	return 0;
}


Measured memory_bytes: 1664
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
ll dp[200010][5] = {};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll L;
    cin >> L;
    ll A[200010];
    rep(i,0,L) cin >> A[i];
    rep(i,0,L+1){
        rep(j,0,5){
            if(i == 0){
                dp[i][j] = 0;
            }else{
                dp[i][j] = INF;
            }
        }
    }

    rep(i,0,L){
        rep(j,0,5){
            rep(k,0,j+1){
                ll val = 0;
                if(j == 0 || j == 4){
                    val = A[i];
                }else if(j == 1 || j == 3){
                    val = A[i] % 2;
                    if(A[i] == 0) val += 2;
                }else{
                    val = (A[i] + 1) % 2;
                }
                dp[i+1][j] = min(dp[i+1][j], dp[i][k] + val);
            }
        }
    }
    ll ans = INF;
    rep(i,0,5) ans = min(ans, dp[L][i]);
    print(ans);
    

}

Measured memory_bytes: 9728
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

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

	int a, b;
	cin >> a >> b;
	if(a * b % 2 == 0){
		cout << "Even" << endl;		
	}else{
		cout << "Odd" << endl;
	}
}


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


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

	for (int i = 0; i < n; i++) {
		int atk;
		cin >> atk;
		h -= atk;
		if (h <= 0) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}


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

using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define out(ans) cout << ans << endl;
const long long mod = 1e9 + 7;

int main(){

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

  if(abs(x-a)>abs(x-b))out('B')
  else out('A')

  return 0;
}


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

// #define int long long // intで書いたけど心配なときにlong longに変換する
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using plglg = pair<ll, ll>;
using tlglglg = tuple<ll, ll, ll>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << endl;}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {REP(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
inline void yesno(bool ok, string yes = "Yes", string no = "No") {cout << (ok?yes:no) << endl;}


signed main() {
    //my-code
    int n, x, t; cin >> n >> x >> t;
    int ans = t * ((n-1)/x + 1);
    print(ans);

    return 0;
}

// https://github.com/kurokoji/.cpp-Template/wiki テンプレートについて
// http://www.creativ.xyz/dump-cpp-652 dump()について
// https://gist.github.com/rigibun/7905920 色々

Measured memory_bytes: 3608
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	cin>>s;
	for(int i=0;i<3;i++){
		if(s[i]=='1'){
			s[i]='9';
		}
		else if(s[i]=='9'){
			s[i]='1';
		}
		cout<<s[i];
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;

using Pos = pair<int, int>;
using PosList = vector<Pos>;
using Lengths = vector<double>;

void print(const std::vector<int> &v)
{
  std::for_each(v.begin(), v.end(), [](int x) {
    std::cout << x << " ";
  });
  std::cout << std::endl;
}

double distance(const Pos &a, const Pos &b)
{
  double sq = (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
  return sqrt(sq);
}

int main()
{
  int n;
  cin >> n;
  int x, y;
  PosList poslist;
  vector<int> indexes;
  for (int i = 0; i < n; ++i)
  {
    cin >> x >> y;
    poslist.push_back(Pos(x, y));
    indexes.push_back(i);
  }

  double totalLength = 0.0;
  int count = 0;
  do
  {
    for (int i = 1; i < indexes.size(); ++i)
    {
      auto p1 = poslist[indexes[i - 1]];
      auto p2 = poslist[indexes[i]];
      totalLength += distance(p1, p2);
    }
    count++;
  } while (next_permutation(indexes.begin(), indexes.end()));

  cout << setprecision(16) << (totalLength / count) << endl;
  return 0;
}

Measured memory_bytes: 256
while True:
    m,f,r=map(int, input().split())
    mf=m+f
    if m==f==r==-1:break
    elif min(m,f)==-1:
        print("F")
    elif mf>=80:
        print("A")
    elif mf>=65:
        print("B")
    elif mf>=50:
        print("C")
    elif mf>=30:
        if r>=50:
            print("C")
        else:
            print("D")
    else:
        print("F")


Measured memory_bytes: 5596
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
S = [list(sr()) for _ in range(H)]
S = np.array([[1 if x == '.' else 0 for x in row] for row in S])
up = np.zeros((H, W), np.int32)
down = np.zeros((H, W), np.int32)
right = np.zeros((H, W), np.int32)
left = np.zeros((H, W), np.int32)
for i in range(H-1):
    up[i+1] = (1+up[i]) * S[i]
for i in range(H-1, 0, -1):
    down[i-1] = (1+down[i]) * S[i]
for i in range(W-1):
    left[:, i+1] = (1+left[:, i]) * S[:, i]
for i in range(W-1, 0, -1):
    right[:, i-1] = (1+right[:, i]) * S[:, i]

answer = ((up + down + left + right) * S).max() + 1
print(answer)


Measured memory_bytes: 159068
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
#define INF (1e18)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    string S;
    cin >> N >> S;
    ll ans = 1;
    map<char, ll> mp;
    rep(i,0,N){
        mp[S[i]]++;
    }
    rep(i,0,26){
        if(mp['a'+i] == 0) continue;
        ans *= (mp['a'+i] + 1) % MOD;
        ans %= MOD;
    }
    print((ans-1+MOD) % MOD);


}

Measured memory_bytes: 512
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}

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

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

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

  vector<int> h(n);
  REP(i,n){
    cin >> h[i];
  }

  int ans = 0;
  REP(i,n){
    if(h[i] >= k) ans++;
  }

  cout << ans << endl;
  return 0;
}



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


int main()
{
    int N, K;
    cin >> N >> K;
    vector<int> h(N);
    for( int i = 0; i < N; ++i ) cin >> h[i];


    vector<int> dp(N, 1e+9);  // dp[i]: minimum cost to reach i
    dp[0] = 0;
    /*dp[1] = abs( h[1] - h[0] );
    for( int i = 2; i <= K; ++i ){
        for( int j = 1; j <= i; ++j ){
            dp[i] = min( dp[i], abs(h[i] - h[i-j]) + dp[i-j] );
        }
    }
    for( int i = K+1; i < N; ++i ){
        for( int j = 1; j <= K; ++j ){
            dp[i] = min( dp[i], abs(h[i] - h[i-j]) + dp[i-j] );
        }
    }*/

    for( int i = 1; i < N; ++i ){
        if( i <= K ){
            for( int j = 1; j <= i; ++j ){
                dp[i] = min( dp[i], abs(h[i] - h[i-j]) + dp[i-j] );
            }
        }else{
            for( int j = 1; j <= K; ++j ){
                dp[i] = min( dp[i], abs(h[i] - h[i-j]) + dp[i-j] );
            }
        }
    }


    cout << dp[N-1] << endl;

    return 0;
}

Measured memory_bytes: 1024
package main

import "fmt"

func main() {
	var n, i, sum int64
	fmt.Scan(&n)
	sum = 0
	for i = 1; i <= n; i++ {
		if i%3 != 0 && i%5 != 0 {
			sum += i
		}
	}
	fmt.Println(sum)
}


Measured memory_bytes: 1772
S = list(input())
len_s = len(S)
right = S[0:(len_s-1)//2]
left = S[(len_s+3)//2-1:]
if S != list(reversed(S)):
    print("No")
elif right != list(reversed(right)):
    print("No")
elif left != list(reversed(left)):
    print("No")
else:
    print("Yes")


Measured memory_bytes: 38704
nN = int(input())
nP = [ 0 for i in range(nN)]
 
for i in range(nN):
  nP[i] = int(input())

nP.sort(reverse=True)
 
nAns = 0
for i in range(nN):
  if i == 0:
    nAns += (nP[i]//2)
  else:
    nAns += nP[i]

print('%d' %(nAns))


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

using namespace std;

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

typedef long long ll;

const ll Inf = 1e11;
const double EPS = 1e-9;

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

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h, w;
    cin >> h >> w;
    ll ans = Inf;
    ll a, b, c;
    ll maxi = -1, mini = Inf;
    FOR (i, 1, h) {
      a = i * w;
      int tmp = (h - i) / 2;
      b = tmp * w;
      c = (h - i - tmp) * w;
      maxi = (ll)max(a, max(b, c));
      mini = (ll)min(a, min(b, c));
      ans = (ll)min(ans, maxi - mini);
    }

    FOR (i, 1, h) {
      a = i * w;
      int tmp = w / 2;
      b = (h - i) * tmp;
      c = (h - i) * (w - tmp);
      maxi = (ll)max(a, max(b, c));
      mini = (ll)min(a, min(b, c));
      ans = (ll)min(ans, maxi - mini);
    }

    FOR (i, 1, w) {
      a = i * h;
      int tmp = (w - i) / 2;
      b = tmp * h;
      c = (w - i - tmp) * h;
      maxi = (ll)max(a, max(b, c));
      mini = (ll)min(a, min(b, c));
      ans = (ll)min(ans, maxi - mini);
    }

    FOR (i, 1, w) {
      a = i * h;
      int tmp = h / 2;
      b = (w - i) * tmp;
      c = (w - i) * (h - tmp);
      maxi = (ll)max(a, max(b, c));
      mini = (ll)min(a, min(b, c));
      ans = (ll)min(ans, maxi - mini);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Comparator;
import java.util.PriorityQueue;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        System.out.println((N % K == 0)?"0":"1");
        sc.close();
    }
}

Measured memory_bytes: 19668
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long int lli;

int main() {
    int N;
    int K;
    int ans = 0;
    cin >> N >> K;
    vector<int> A;
    for (int i = 0; i < N; i++) {
        int temp;
        cin >> temp;
        A.push_back(temp);
    }
    sort(A.begin(), A.end());
    for (int i = 0; i < K; i++) {
        ans += A[i];
    }
    cout << ans << endl;
    return 0;
}

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

class Main {
	public static void main(String... args) {
		int N = IN.nextInt();
		int M = IN.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = IN.nextInt();
		}

		HashMap<Integer, Integer> B = new HashMap<>();
		B.put(0, 1);

		long ans = 0;
		int tot = 0;
		for (int a: A) {
			tot = (tot + a) % M;
			int tmp = B.getOrDefault(tot, 0);
			ans += (long) tmp;
			B.put(tot, tmp + 1);
		}

		puts(ans);		
		flush();
	}
	static final Scanner IN = new Scanner(System.in);
	static final PrintWriter OUT = new PrintWriter(System.out);
	static <T> void puts(T arg) { OUT.println(arg); }
	static void flush() { OUT.flush(); }
}


Measured memory_bytes: 49684
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
int dir[4][2]={{0,1},{1,0},{-1,0},{0,-1}};
int n,m;
char c[403][403];
int vis[403][403];
pair<int,int> dfs(int x,int y){
	vis[x][y]=1;
	pair<int,int> res=make_pair(0,0); 
	for (int i=0;i<4;i++){
		int u=x+dir[i][0],v=y+dir[i][1];
		if (u<0 || v<0 || u>=n || v>=m || c[u][v]!=((c[x][y]=='#')?'.':'#') || vis[u][v]) continue;
		pair<int,int> gg=dfs(u,v);
		res.first+=gg.first;
		res.second+=gg.second;
	}
	if (c[x][y]=='.') res.second++;
	else res.first++;
	return res;
}
long long ans=0;
int main(){
	memset (vis,0,sizeof(vis));
	int num[3];
	cin>>n>>m;
	for (int i=0;i<n;i++)
		for (int j=0;j<m;j++)
			cin>>c[i][j];
	for (int i=0;i<n;i++)
		for (int j=0;j<m;j++)
			if (c[i][j]=='#' && !vis[i][j]){
				pair<int,int> gg=dfs(i,j);
				ans+=1ll*gg.second*gg.first;
			}
	cout<<ans;
}

Measured memory_bytes: 13568
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define maxn 3010
using namespace std;
int n;
char a[26];
map<string,int>mp;
int main(){
	cin>>n;
	ll ans=0;
	for(int i=0;i<n;i++){
		scanf("%s",a);
		int m=strlen(a);
		sort(a,a+m);
		string b;
		for(int i=0;i<m;i++) b+=a[i];
		ans+=mp[b];
		mp[b]++;
	}
	printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 12800
#include <iostream>
using namespace std;
typedef unsigned long long u64;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  string a, b, c;
  cin >> a >> b >> c;
  int diff = 'A'-'a';
  cout << (char)(a[0]+diff) << (char)(b[0]+diff) << (char)(c[0]+diff) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr int INF = 2047483647;
constexpr long long INFF = 9223372036854775807;
int N;
vector<int> V(3),L;

int solve(int i,int j,int k,int h){
    if(N == i){
        if(min({j,k,h}) == 0) return INF;
        else return (abs(j - V[0]) + abs(k - V[1]) + abs(h - V[2]) - 30);
    }
    int ans = solve(i+1,j,k,h);
    ans = min(ans,solve(i+1,j+L[i],k,h)+10);
    ans = min(ans,solve(i+1,j,k+L[i],h)+10);
    ans = min(ans,solve(i+1,j,k,h+L[i])+10);
    return ans;
}

int main(){
    cin >> N >> V[0] >> V[1] >> V[2];
    int l;
    REP(i,N){cin >> l; L.pb(l);}
    cout << solve(0,0,0,0) << endl;
}

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

int main() {
  int N, T, c, t, minc = 10000;
  cin >> N >> T;
  for (int i = 0; i < N; i++) {
    cin >> c >> t;
    if (t <= T)
      minc = min(c, minc);
  }
  if (minc == 10000)
    cout << "TLE" << endl;
  else
    cout << minc << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
int main(){
    ll n, k;
    scll(n), scll(k);
    vector<int> a(n), port, used(n, -1);
    rep(i, 0, n) sc(a[i]), a[i]--;

    ll now = 0, cnt = -1, len, ans;
    while(1){
        if (used[now]!=-1){
            len = ++cnt - used[now];
            break;
        }
        used[now] = ++cnt;
        port.push_back(now);
        now = a[now];
    }
    if (k <= port.size()-1) ans = port[k];
    else ans = port[(k-used[now])%len + used[now]];
    cout << ans + 1 << endl;
    return 0;
}

Measured memory_bytes: 5868
#include <bits/stdc++.h>
#include <tuple>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;

string dp[10100];
int match[] = {2, 5, 5, 4, 5, 6, 3, 7, 6};
bool prime[200000] = {};
void Eratosthenes(int n)
{
  for (int i = 2; i <= (int)sqrt(n) + 1; ++i)
  {
    if (prime[i] == true)
    {
      for (int j = i * 2; j <= n; j += i)
      {
        prime[j] = false;
      }
    }
  }
}
int main()
{
  int q;
  cin >> q;
  for (int i = 0; i < 100100; ++i)
  {
    prime[i] = true;
  }
  prime[0] = prime[1] = false;
  Eratosthenes(100010);
  bool like2017[200000];
  for (int i = 0; i < 100010; ++i)
  {
    if (prime[i] && prime[(i + 1) / 2])
      like2017[i] = true;
    else
      like2017[i] = false;
  }
  vector<int> pool;
  for (int i = 0; i < 100010; ++i)
  {
    if (like2017[i])
      pool.push_back(i);
  }
  for (int i = 0; i < q; ++i)
  {
    int l, r;
    cin >> l >> r;
    int x = 0;
    for (int i = 0; i < pool.size(); ++i)
    {
      if (l <= pool[i] && pool[i] <= r)
        x++;
    }
    cout << x << endl;
  }

  return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <bitset>
#include <vector>
#include <map>

typedef long long ll;
//typedef vector<ll> vll;

using namespace std;

bitset<10000007> e_composto;
vector<ll> primos;

void crivo(ll max){

    e_composto.set();
    e_composto[0] = e_composto[1] = 0;        
    for(ll i = 2; i <= max + 1; i++){
        if(e_composto[i]){

            for(ll j = 2; j * i <= max; j++){
                e_composto[i * j] = 1;
            }
            primos.push_back(i);
        }
    }
    return;
}

//pp = primeiro_primo
map<ll, ll> fatoracao(ll n){
	ll ind = 0, pp = primos[0];
	map<ll, ll> ans;

	while(pp * pp <= n){

		if(n % pp == 0){
			ll count = 0;
			while(n % pp == 0){
				n = n/pp;
				count++;
			}
			ans[pp] = count;
		}

		ind++;
		if(ind == primos.size()) break;
		pp = primos[ind];

	}
	if(n != 1) ans[n] = 1;
	return ans;
}

//somatorio da qntds d numero necessario para fazer a soma
ll func(ll e){
	// s: 1 + 2 + 3 +..+i <= e
	ll sum = 0;
	ll i = 0;
	// e = 2
	while(sum <= e){
		i++;
		sum += i;
	}
	return i-1;
}

int main(){
    
    ll n;
	cin >> n;

	crivo(1000000);
	map<ll, ll> fats = fatoracao(n);
	// [p, e]
	ll ans = 0;
	
	for(auto x : fats){
		// printf("[%lld, %lld]\n", x.first, x.second);
		ll e = x.second;	
		ans += func(e);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 12804
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
//~ #pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define erase_duplicates(x) sort(all(x)); (x).resize(distance((x).begin(), unique(all(x))));


using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<
T,
null_type,
less<T>,
rb_tree_tag,
tree_order_statistics_node_update>;

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<" = "<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<" = "<<h<<", "; _dbg(sdbg+1, a...);
}

#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#define cerr if(0)cout
#endif

const int maxn = (1e6)+7;
const int maxk = 20;
const int inf = (1e9)+7;
const LL LLinf = ((LL)1e18)+7LL;
const LD eps = 1e-9;
const LL mod = 1e9+7;

// ***************************** CODE ***************************** //

int main()
{
	_upgrade
  int n;
  cin>>n;
  string a, b, c;
  cin>>a>>b>>c;
  int res = 0;
  for(int i = 0 ;i < n;i++)
  {
    if(a[i] != b[i] && a[i] != c[i] && c[i] != b[i])
      res += 2;
    else
      if(a[i] != b[i] || a[i] != c[i] || b[i] != c[i])
        res++;
  }
  cout<<res;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#define M 100000
#define MAX 1000000001
#define MIN -10000000000000000
#define mod 1000000007
#define ss second
#define ff first
#define ll long long int
#define pb push_back
#define ld double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;


int main(){
    int d,t,s;
    cin>>d>>t>>s;
    if(d <= s*t){
        cout<<"Yes\n";
    }
    else{
        cout<<"No\n";
    }
    return 0;
        
}


Measured memory_bytes: 3592
n = int(input())
a = list(map(int,input().split()))

check = True
for i in range(n):
    if a[i] > i+1:
        check = False
if check:
    ans = []
    for i in range(n):
        temp = 0
        tempindex = 0
        for k in range(len(a)):
            if k+1 == a[k]:
                temp = a[k]
                tempindex = k
        ans.append(temp)
        a.pop(tempindex)

    ans.reverse()
    for i in range(n):
        print(ans[i])
else:
    print("-1")

Measured memory_bytes: 3064
#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 pb push_back
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

int dp[100005][13];
const int mod = 1e9 + 7;

int main(){
    string s; cin >> s;
    dp[0][0] = 1;
    for(int i = 0; i < s.size(); i++){
        for(int j = 0; j < 13; j++){
            if(s[i] == '?'){
                for(int k = 0; k <= 9; k++){
                    (dp[i+1][(j * 10 + k) % 13] += dp[i][j]) %= mod; 
                }
            }else{
                int k = s[i] - '0';
                (dp[i+1][(j * 10 + k) % 13] += dp[i][j]) %= mod; 
            }
        }
    }
    cout << dp[s.size()][5] << endl;
}

Measured memory_bytes: 5504
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	long long n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	b -= a;
	for (int i = 0; i < n; i++) {
		long long l = ((n - 1) - i) * c - i * d;
		long long r = ((n - 1) - i) * d - i * c;
		if (l <= b && r >= b) {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string s;
	while(cin >> s) {
		string ns;
		rep(i,s.length()) {
			if(s[i] == '@') {
				string t;
				rep(j,s[i+1]-'0') {
					t += s[i+2];
				}
				ns += t;
				i += 2;
			} else {
				ns += s[i];
			}
		}
		cout << ns << endl;
	}
	return 0;
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
#define mx 1000000000000000000
#define ll long long int
ll a[2000100];
//ll number[20],used[20];
int main()
{
    ll n,i,count,sum=0;
    cin>> n >> count ;
    for(i=0;i<n;i++)
        cin >> a[i];
        sort(a,a+n);
    if(n<=count )
        cout << '0' << endl;
    else
    {
        n -=count;
        for(i=0;i<n;i++)
        sum+=a[i];
        cout << sum << endl;

    }
    return 0;
}


Measured memory_bytes: 5192
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(n) begin(n),end(n)
using ll = long long;
using P = pair<int,int>;
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;}

ll dp[110][100010];

int main() {
    int n, w;
    cin >> n >> w;
    vector<ll> weight(n);
    vector<ll> value(n);
    rep(i,n) cin >> weight[i] >> value[i];
    rep(i,n) {
        rep(W,w+1){
            if(W >= weight[i]) chmax(dp[i+1][W], dp[i][W-weight[i]]+value[i]);
            chmax(dp[i+1][W], dp[i][W]);
        }
    }
    cout << dp[n][w] << endl;
    return 0;
}

Measured memory_bytes: 79488
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007; // 998244353
using ll = long long;
using namespace std;

// dp[i][S]
ll dp[2200][2200];

int main(){
	dp[0][0] = 1;
	ll sum; cin >> sum;
	ll ans = 0;
	for( int i = 0; i < 2100; ++i ){
		ll pre = 0;
		for( int s = 0; s <= sum-3; ++s ){
			pre += dp[i][s];
			pre %= mod;
			dp[i+1][s+3] = pre;
		}
		ans += dp[i+1][sum];
		ans %= mod;
		/*
		for( int s = 0; s <= sum; ++s ){
			dp[i+1][s] = Σ dp[i][0からs-3まで];			
		}
		*/
	}
	cout << ans << endl;
}

Measured memory_bytes: 39516
import sys
input = sys.stdin.readline
n,k,q = map(int,input().split())
a = [int(input()) for _ in range(q)]
import collections
c = collections.Counter(a)
# print(c)
list_count = [0]*n
for i in range(n):
    list_count[i] = c[i+1]
# print(list_count)
list_score = [k]*n
for i in range(n):
    list_score[i] = list_score[i] + list_count[i] - q
# print(list_score)
for i in range(n):
    if list_score[i]>0:
        print("Yes")
    else:
        print("No")

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

int main(){
  int N, K, X, Y, ans;
  cin >> N >> K >> X >> Y;
  if(N > K){
    ans = K * X + (N - K) * Y;
  cout << ans << endl;
  }
  else{
    ans = N * X;
    cout << ans << endl;
  }
  return 0;
}


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

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

ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}

int main(){

    ll a,b;
    cin >> a >> b;

    cout << lcm(a,b) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<unordered_map>
using namespace std;
long long n,m,ok,pairs,v[100005],s[100005],r[100005];
unordered_map<int,int> hz;
int main (void) {
    cin >> n >> m;
    for (int i = 1; i <= n; i ++) {
        cin >> v[i];
    }
    for (int i = 1; i <= n; i ++) {
        s[i] = s[i-1] + v[i];
        r[i] = s[i] % m;
    }
    hz[0] = 1;
    for (int i = 1; i <= n; i ++) {
        pairs += hz[r[i]];
        hz[r[i]]++;
    }
    cout << pairs;
    return 0;
}


Measured memory_bytes: 6028
sum[3<<17],cnt[3<<17];
N,i,acc,t,k,x;
char f[10];
main()
{
	for(;;)
	{
		k=getchar_unlocked();
		if(k<'0'||k>'9')break;
		N=N*10+k-'0';
	}
	for(i=0;i<N;i++)
	{
		x=0;
		for(;;)
		{
			k=getchar_unlocked();
			if(k<'0'||k>'9')break;
			x=x*10+k-'0';
		}
		++sum[cnt[x]++];
	}
	i=0;
	for(t=N;t>0;t--)
	{
		while(acc>=i*t)acc+=sum[i++];
		cnt[t]=i-1;
	}
	for(i=1;i<=N;i++)
	{
		if(cnt[i])
		{
			k=0;
			while(cnt[i])
			{
				f[k++]=cnt[i]%10;
				cnt[i]/=10;
			}
			while(k--)putchar_unlocked(f[k]+'0');
		}
		else
		{
			putchar_unlocked('0');
		}
		putchar_unlocked('\n');
	}
}

Measured memory_bytes: 3072