akhauriyash/Code-Regression huggingface dataset:
/*
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡖⠁⠀⠀⠀⠀⠀⠀⠈⢲⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣧⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣸⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⢀⣀⣤⣤⣤⣤⣀⡀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣔⢿⡿⠟⠛⠛⠻⢿⡿⣢⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣀⣤⣶⣾⣿⣿⣿⣷⣤⣀⡀⢀⣀⣤⣾⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀
⠀⠀⢠⣾⣿⡿⠿⠿⠿⣿⣿⣿⣿⡿⠏⠻⢿⣿⣿⣿⣿⠿⠿⠿⢿⣿⣷⡀⠀⠀
⠀⢠⡿⠋⠁⠀⠀⢸⣿⡇⠉⠻⣿⠇⠀⠀⠸⣿⡿⠋⢰⣿⡇⠀⠀⠈⠙⢿⡄⠀
⠀⡿⠁⠀⠀⠀⠀⠘⣿⣷⡀⠀⠰⣿⣶⣶⣿⡎⠀⢀⣾⣿⠇⠀⠀⠀⠀⠈⢿⠀
⠀⡇⠀⠀⠀⠀⠀⠀⠹⣿⣷⣄⠀⣿⣿⣿⣿⠀⣠⣾⣿⠏⠀⠀⠀⠀⠀⠀⢸⠀
⠀⠁⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⢇⣿⣿⣿⣿⡸⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠈⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠐⢤⣀⣀⢀⣀⣠⣴⣿⣿⠿⠋⠙⠿⣿⣿⣦⣄⣀⠀⠀⣀⡠⠂⠀⠀⠀
⠀⠀⠀⠀⠀⠈⠉⠛⠛⠛⠛⠉⠀⠀⠀⠀⠀⠈⠉⠛⠛⠛⠛⠋⠁⠀⠀⠀
              ~ARD~
*/



#include <bits/stdc++.h>

#define ll                          long long int
#define ull                         unsigned long long int

//  LOOPS
#define loop(i,a,n)                 for(int i=a; i<n; i++)
#define loopr(i,n,a)                for(int i=n; i>=a; i--)
#define loopit(it,s)                for(auto it=s.begin(); it!=s.end(); it++)
#define CASE(t)                      cout<<"Case #"<<(t)<<": ";
//  INP_OUT
#define looparri(i,a,n,arr)          int arr[n]; for(int i=0;i<n;i++) cin>>arr[i];
#define looparro(i,a,n,arr)          for(int i=0;i<n;i++) cout<<arr[i]<<" ";
#define inp1(x)                     ll x; cin>>x;
#define inp2(x,y)                   ll x,y; cin>>x>>y;
#define inps1(str,len)              string str;cin>>str; int len; len=str.length()
#define opt(x)                      cout<<x<<endl;
#define line                        cout<<'\n';
#define mset(a,val)                 memset(a,val,sizeof(a))
//  MISC
#define ff                          first
#define ss                          second
#define pb                          push_back
#define mkp                         make_pair
#define pii                         pair<ll,ll>
#define vi                          vector<ll>
#define vs                          vector<string>
#define mii                         map<ll,ll>
#define vpp                         vector< pair <ll, ll> >
#define vv                          vector<vi>
#define xxx                         INT_MAX
#define nnn                         INT_MIN

#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)

using namespace std;
const unsigned int M = 1000000007;


void solve()
{
    inp1(d);
    inp1(t)
    inp1(s);
    int dis = s*t;
    if(dis>=d)
        cout<<"Yes"<<endl;
    else
    {
        cout<< "No" <<endl;
    }
    

    

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



 
  


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pair;
const int inf = 1000000000; //10^9
const ll inff = 1000000000000000000; //10^18

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) {
        int b;
        cin >> b;
        a[b-1]++;
    }
    sort(a.begin(), a.end());
    reverse(all(a));

    int kr = 0;

    rep(i, k) {
        kr += a[i];
    }

    cout << n - kr << endl;

    return 0;
}

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

int main()
{
  	int h,w;
  
 	cin >> h >> w;
  
  	while(h != 0 || w != 0){
      for(int i = 0;i < h;i++){
     	 for(int j = 0;j < w;j++){
           cout << '#';
         }
        cout << endl;
      }
      cout << endl;
      
      cin >> h >> w;
    }
 	
    
}


Measured memory_bytes: 3088
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main(){
    int a,b,c,d,sum=0;
    cin >> a >> b >> c >> d;
    for(int i=0;i<a;i++){
        if(i<b){
            sum += c;
        }else{
            sum += d;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
#include<stack>
//#include<Windows.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<int> vii;
int n,h,w,num[10005],g[105][105];
void print(){
	for(int i=0;i<h;i++){
		for(int j=0;j<w-1;j++)
			cout<<g[i][j]<<' ';
		cout<<g[i][w-1];
		puts("");
	}
}
void go(int a,int b,int c,int k,int u,int v){
	g[a][b]=u+1;
	if(k==h*w){
		print();
		exit(0);
	}
	v++;
	if(v>=num[u]) u++,v=0;
	if(c==0){
		b++;
		if(b>=w)
			go(a+1,b-1,1,k+1,u,v);
		else go(a,b,0,k+1,u,v);
	}
	else{
		b--;
		if(b==-1)
			go(a+1,0,0,k+1,u,v);
		else go(a,b,1,k+1,u,v);
	}
}
int main()
{
	cin>>h>>w>>n;
	for(int i=0;i<n;i++) cin>>num[i];
	go(0,0,0,0,0,0);
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    int p[110];for(int i=0;i<n;i++)cin>>p[i];
    int ans=0;
    for(int i=1;i<=100;i++){
        int c=0;
        for(int j=0;j<n;j++){
            if(p[j]>=i){
                c++;
            }
        }
        if(c>=i){
            ans=i;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3100
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};
const main=()=>{
  let n=tn()
  for(let i=n;i>0;i--){
    if(Number.isInteger(Math.sqrt(i))){
      to(i)
      return
    }
  }
}
main()

Measured memory_bytes: 7756
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int treeCount = Integer.parseInt(line[0]);
		int canWatch = Integer.parseInt(line[1])*2+1;
		for(int i = 1;i<=20;i++) {
			if(treeCount <= canWatch*i) {
				System.out.println(i);
				break;
			}
		}
		
		
		
		
	}
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

ll N, n,m , M, K,a;

vector<ll> v,w;
int main(){
    cin >> N;
    n = 0, m = 1;
    K = N;
    int number_of_digits = 0;
    ll lim = pow(10,18);
    while(10*m < lim){
        v.push_back(10*m);
        m *= 5;
    }
    do {
        ++number_of_digits; 
        K /= 10;
    } while (K);
    for(int j = 0; j < v.size(); ++j){
        w.push_back(N);  
    }

  for(int j = 0; j < w.size(); ++j){
    n += N/v[j];
  }
	if(N%2 == 1) {std::cout << 0;}
    else{std::cout << n;}
}

Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <cfenv>
#include <cinttypes>
#include <cstdint>
#endif
#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>
#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <forward_list>
#include <initializer_list>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#if __cplusplus >= 201402L
#include <shared_mutex>
#endif

#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;

const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9+7;
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};

ll gcd(ll x,ll y){
    x = x%y;
    return x == 0 ? y : gcd(y,x);
}
ll lcm(ll x, ll y){
    return x*y/gcd(x,y);
}



int main(){
 
    string x;
    cin >> x;
    int ans = 0;
    rep(i,x.length()){
        if(x[i] == 'R'){
            ans++;
        }else{
            break;
        }
    }
    int b = 0;
    for(int i = x.length()-1; i >= 0; i--){
        if(x[i] == 'R'){
            b++;
        }
        else{
            break;
        }
    }
    int c = 0;
    if(x[1] == 'R') c= 1;

    cout << max(ans,max(b,c)) << endl;

    return 0;
}


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

//#define DEBUG

using namespace std;

template <class T>
void print_vect(std::vector<T> v){
    for(int i = 0 ; i < v .size(); i++) cout << v[i] << " ";
    cout << endl;
}


void func_to_create(){
    uint64_t A, B, N;
    cin >> A >> B >> N;
    uint64_t x = B - 1;
    if( N < B -1){
        x = N;
    }
    double ans = 1.0 * A * x / B;
    cout << static_cast<int>(ans) << endl;

}
int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/

    #ifdef DEBUG
    int TEST_CASES = 2;
    while(TEST_CASES--){
    #endif // DEBBUG

    func_to_create();

    #ifdef DEBUG
    }
    #endif // DEBUG
    
    return 0;
}


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

int main(){
    int n,cnt=1;
    cin >> n;
    int a[n];
    bool flag=true,up;
    cin >>a[0];
    for(int i=0; i<n-1; i++){
        cin >> a[i+1];
        if(a[i]!=a[i+1]&&flag){
            up=a[i]<a[i+1];
            flag=false;
        }else if(!flag&&((up&&a[i]>a[i+1])||(!up&&a[i]<a[i+1]))){
                cnt++;
                flag=true;
        }
    }
    cout << cnt << endl;
}


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

int solve(int n) {
    vector<vector<int>> know(n);
    for (int i = 0; i < n; i++) {
        vector<int> &cur = know[i];
        int m; cin >> m; cur.resize(m);
        for (int j = 0; j < m; j++) {
            cin >> cur[j]; cur[j]--;
        }
    }
    int k; cin >> k;
    vector<int> subject(k);
    for (int i = 0; i < k; i++) {
        cin >> subject[i]; subject[i]--;
    }
    int cnt = 0, ans = -1;
    for (int i = 0; i < n; i++) {
        bool flag = true;
        for (int& k : subject) {
            flag &= find(know[i].begin(), know[i].end(), k) != know[i].end();
        }
        if (flag) {
            cnt++;
            ans = i + 1;
        }
    }
    if (cnt == 1) return ans;
    else return -1;
}

int main() {
    int n;
    while (cin >> n, n) {
        cout << solve(n) << endl;
    }
    return 0;
}


Measured memory_bytes: 3160
import math
from functools import reduce
def gcd (*numbers):
    return reduce(math.gcd,numbers)

K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += gcd(a,b,c)
print(ans)

Measured memory_bytes: 69756
#include <bits/stdc++.h>
#define rep(i, N) for (long long i = 0; i < N; i++)
using namespace std;

int main()
{
    int N, K, sum = 0;
    cin >> N >> K;
    rep(i, N)
    {
        int x;
        cin >> x;
        sum += min(x, K - x);
    }
    cout << sum * 2 << endl;
}

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

int main(){
  int a, b,c,d;
  cin >> a >> b >> c >> d;
  if ((a+b) > (c+d)){
    cout << "Left" << endl;
  }
  else if ((a+b) < (c+d)){
    cout << "Right" << endl;
  }
  else {
    cout << "Balanced" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int Q = sc.nextInt();
    int[] players = new int[N];
    Arrays.fill(players, 0);
    for (int i = 0; i < Q; i++)
      players[sc.nextInt() - 1]++;
    for (int i = 0; i < N; i++)
      System.out.println(Q - players[i] < K ? "Yes" : "No");
  }
}

Measured memory_bytes: 58264
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}

template<unsigned int mod_>
struct ModInt{
	using uint = unsigned int;
	using ll = long long;
	using ull = unsigned long long;

	constexpr static uint mod = mod_;

	uint v;
	ModInt():v(0){}
	ModInt(ll v):v(normS(v%mod+mod)){}
	explicit operator bool() const {return v!=0;}
	static uint normS(const uint &x){return (x<mod)?x:x-mod;}		// [0 , 2*mod-1] -> [0 , mod-1]
	static ModInt make(const uint &x){ModInt m; m.v=x; return m;}
	ModInt operator+(const ModInt& b) const { return make(normS(v+b.v));}
	ModInt operator-(const ModInt& b) const { return make(normS(v+mod-b.v));}
	ModInt operator-() const { return make(normS(mod-v)); }
	ModInt operator*(const ModInt& b) const { return make((ull)v*b.v%mod);}
	ModInt operator/(const ModInt& b) const { return *this*b.inv();}
	ModInt& operator+=(const ModInt& b){ return *this=*this+b;}
	ModInt& operator-=(const ModInt& b){ return *this=*this-b;}
	ModInt& operator*=(const ModInt& b){ return *this=*this*b;}
	ModInt& operator/=(const ModInt& b){ return *this=*this/b;}
	ll extgcd(ll a,ll b,ll &x,ll &y) const{
		ll u[]={a,1,0},v[]={b,0,1};
		while(*v){
			ll t=*u/ *v;
			rep(i,3) swap(u[i]-=t*v[i],v[i]);
		}
		if(u[0]<0) rep(i,3) u[i]=-u[i];
		x=u[1],y=u[2];
		return u[0];
	}
	ModInt inv() const{
		ll x,y;
		extgcd(v,mod,x,y);
		return make(normS(x+mod));
	}
	bool operator==(const ModInt& b) const { return v==b.v;}
	bool operator!=(const ModInt& b) const { return v!=b.v;}
	friend istream& operator>>(istream &o,ModInt& x){
		ll tmp;
		o>>tmp;
		x=ModInt(tmp);
		return o;
	}
	friend ostream& operator<<(ostream &o,const ModInt& x){ return o<<x.v;}
};
using mint = ModInt<998244353>;
const int MX = 300010;
mint f[MX],g[MX],inv[MX];
void precalc(){
	f[0]=1;
	rep1(i,MX-1) f[i] = f[i-1] * i;

	const int mod = 998244353;
	inv[1]=1;
	for(int i=2;i<=MX-1;i++) inv[i] = -inv[mod%i] * (mod/i);

	g[0]=1;
	rep1(i,MX-1) g[i] = g[i-1] *inv[i];
}
mint C(int x,int y){
	if(y<0 || x<y) return 0;
	return f[x]*g[y]*g[x-y];
}

using ll = long long;

int main(){
	precalc();
	ll N,A,B;
	ll K;
	cin>>N>>A>>B>>K;
	mint ans =0;
	rep(a,N+1){
		if( (K-a*A)%B !=0 ) continue;
		ll b = (K-a*A)/B;
		if(!(0<=b && b<=N)) continue;
		ans += C(N,a)*C(N,b);
	}
	cout<<ans<<endl;
}


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

int main() {
	int n, sum = 0;
	vector<int> p;

	cin >> n;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		p.push_back(a);
	}

	sort(p.begin(), p.end());

	for (int i = 0; i < n - 1; i++) {
		sum += p[i];
	}
	sum += p[n - 1] / 2;
	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define loop(n, i) for(int i=0;i<n;i++)
#define loop1(n, i) for(int i=1;i<=n;i++)
#define rloop(n, i) for(int i=n;i;i++)
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;

int n;
V<ll> A;

int main() {
    cin >> n;
    A.resize(n);
    loop (n, i) cin >> A[i];

    V<int> B = { - 1 };
    loop (n, i) {
        if (B[B.size() - 1] >= A[i]) {
            B.push_back(A[i]);
        } else {
            auto itr = upper_bound(B.begin(), B.end(), A[i], greater<int>());
            *itr = A[i];
        }

        // for (auto k : B) {
        //     cout << k << " ";
        // }
        // cout << endl;
    }

    cout << B.size() << endl;
    return 0;
}



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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

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

void solve_A(){
    string s;
    cin >> s;

    bool ok = false;
    int n = s.size();
    for(int i = 0; i < n-1 ; i++){
        if(s[i] == 'h' && s[i+1] == 'i') ok = true;
    }
    if(ok) cout << "Yes";
    else cout << "No";
}

void solve_B(){
    int A, B, M;
    cin >> A >> B >> M;
    int a[A], b[B];
    int min_A = 1000000, min_B = 1000000;
    REP(i,A){
        cin >> a[i];
        if(min_A >= a[i]) min_A = a[i];
    }
    REP(i,B){
        cin >> b[i];
        if(min_B >= b[i]) min_B = b[i];
    }

    int x[M], y[M], c[M];
    REP(i,M) cin >> x[i] >> y[i] >> c[i];

    int ans = 10000000;
    for(int i = 0; i < M; i++){
        if(ans >= a[x[i]-1] + b[y[i]-1] - c[i]) ans = a[x[i]-1] + b[y[i]-1] - c[i];
    }

    
    if(ans >= min_A + min_B) cout << min_A + min_B;
    else cout << ans;
}

int main(void){
    solve_B();
    
    return 0;
}

Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define F first
#define S second
#define int long long
#define double long double
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,int> Pi;
typedef pair<P,P> PP;
double eps=1e-8;
int mod=1e9+7;
int inf=1LL<<55;

priority_queue<P,vector<P>,greater<P> > pq;

template <typename T>
int Count(const vector<T> &v, T l,T r){
  //counting [l,r]
  auto L = lower_bound(v.begin(), v.end(), l );
  auto R = upper_bound(v.begin(), v.end(), r );
  // [l,r) change upper -> lower
  return R-L;
}

signed main(){
  int a[3],b[3];
  int cnt[5]={},mx=0;  
  for(int i=0;i<3;i++){
    cin>>a[i]>>b[i];
    cnt[a[i]]++,cnt[b[i]]++;
  }
  for(int i=1;i<=4;i++)mx=max(cnt[i],mx);
  cout<<(mx>2?"NO":"YES")<<endl;
  return 0;
}


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

g = [[] for _ in range(n+1)]
cood= [None for _ in range(n+1)]


def dfs(start):
    if cood[start] != None:
        return True
    stack = [start]
    cood[start] = 0
    while stack:
        v = stack.pop()
        for to, dist in g[v]:
            if cood[to] == None:
                stack.append(to)
                cood[to] = cood[v] + dist
            elif cood[v] + dist != cood[to]:
                return False
    return True

for i in range(m):
    l, r, d = map(int, input().split())
    g[l].append((r, d))
    g[r].append((l, -d))

flag = True
for i in range(1,n+1):
    if not dfs(i):
        flag = False
if flag:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 65964
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#define maxn 100010
using namespace std;
int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n;
int a[maxn];
bool cmp(int x,int y)
{
    return x>y;
}
int main()
{
    n=read();
    for(int i=1;i<=n;i++)  a[i]=read();
    sort(a+1,a+n+1,cmp);
    int x;
    for(int i=n;i>=1;i--)
    {
        if(a[i]>=i)
        {
            x=i;
            break;
        }
    }
    int y=0;
    while(a[x+y+1]==x)  y++;
    if(((a[x]-x)&1)||(y&1))  puts("First");
    else                     puts("Second");
    return 0;
}

Measured memory_bytes: 640
H,W=map(int,input().split())
S=[[0 for i in range(W)] for j in range(H)]
for i in range(H):
  a=list(map(str,input()))
  for j in range(W):
    S[i][j]=a[j]
  a=[]
#print(S)
V=[[0 for i in range(W)] for j in range(H)]
for m in range(H):
  for n in range(W):
    if S[m][n]=="#":
      V[m][n]="#"
      continue
      
    if m > 0 and n > 0 and S[m-1][n-1]=="#":
      V[m][n] += 1
    if m > 0 and S[m-1][n]=="#":
      V[m][n] += 1
    if m > 0 and n < W - 1 and S[m-1][n+1]=="#":
      V[m][n] += 1
    if n > 0 and S[m][n-1]=="#":
      V[m][n] += 1
    if n < W - 1 and S[m][n+1]=="#":
      V[m][n] += 1
    if m < H - 1 and n > 0 and S[m+1][n-1]=="#":
      V[m][n] += 1
    if m < H - 1 and S[m+1][n]=="#":
      V[m][n] += 1
    if m < H - 1 and n < W - 1 and S[m+1][n+1]=="#":
      V[m][n] += 1

a=[]
#print(V)
for k in range(H):
  for l in range(W):
    a.append(V[k][l])
  print("".join(map(str,a)))
  a=[]

Measured memory_bytes: 3188
n = int(input())
t, x, y = 0, 0, 0

for i in range(n):
    tb, xb, yb = t, x, y
    t, x, y = map(int, input().split())
    tn = t - tb
    xn = x - xb
    yn = y - yb
    move = abs(xn) + abs(yn)

    if tn < move or (tn - move) % 2 == 1:
        ans = 'No'
        break

else:
    ans = 'Yes'

print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,a,b,i,x,j;
    cin>>x;
    vector<ll>v;
   for(i=-200;i<=200;i++)
   v.push_back(i);
   for(i=0;i<v.size();i++)
   {
   	for(j=0;j<=i;j++)
   	{
   		if(v[i]*v[i]*v[i]*v[i]*v[i]-v[j]*v[j]*v[j]*v[j]*v[j]==x)
   		{
   			cout<<v[i]<<" "<<v[j]<<endl;
   			return 0;
		}
		
		   
	}
   }
}

Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#define _USE_MATH_DEFINES
#include <cmath>

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

using namespace std;
typedef long long ll;

const int MAXN = 25;
const int NIL  = -1;

struct Node {
   int p, l, r;
};

Node T[MAXN];
int  D[MAXN], H[MAXN];

void preorder(int u) {
   cout << " " << u;
   if (T[u].l != NIL) preorder(T[u].l);
   if (T[u].r != NIL) preorder(T[u].r);
}

void inorder(int u) {
   if (T[u].l != NIL) inorder(T[u].l);
   cout << " " << u;
   if (T[u].r != NIL) inorder(T[u].r);
}

void postorder(int u) {
   if (T[u].l != NIL) postorder(T[u].l);
   if (T[u].r != NIL) postorder(T[u].r);
   cout << " " << u;
}

int main() {
   int id, l, r, root, n;

   cin >> n;
   rep(i, n) T[i].p = T[i].r = T[i].l = NIL;
   rep(i, n) {
      cin >> id >> l >> r;
      T[id].l = l;
      T[id].r = r;
      T[l].p  = T[r].p = id;
   }
   rep(i, n) {
      if (T[i].p == NIL) root = i;
   }
   cout << "Preorder" << endl;
   preorder(root);
   cout << endl;
   cout << "Inorder" << endl;
   inorder(root);
   cout << endl;
   cout << "Postorder" << endl;
   postorder(root);
   cout << endl;
   return(0);
}



Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
template<typename T>
inline void read(T &x)
{
	x=0;
	int f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9')
	{
		if(ch=='-') f=-1;
		ch=getchar();
}
	while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
	x*=f;
	return;
}	
template<typename T>
void write(T x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar(x%10+'0');
	return;
}
int k;
int tot=0;
void dfs(int step,int depth,string ans)
{
	if(step>=depth)
	{
		tot++;
		if(tot==k)
		{
			cout<<ans<<endl;
			exit(0);
		}
		return;
	}
	if(step==0)
	{
		for(int i=1;i<=9;i++) dfs(step+1,depth,ans+(char)(i+'0'));
		return;
	}
	int l=ans.length()-1;
	if(ans[l]>'0') dfs(step+1,depth,ans+(char)(ans[l]-1));
	dfs(step+1,depth,ans+(char)(ans[l]));
	if(ans[l]<'9') dfs(step+1,depth,ans+(char)(ans[l]+1));
}
int main()
{
	cin>>k;
	for(int i=1;i<=10;i++) dfs(0,i,"");
	return 0;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int main() {
	string a, b;
	cin >> a >> b;
	a += b;
	long long c = stoll(a);
	if ((int)sqrt(c) * (int)sqrt(c) == c) {
		cout << "Yes" << endl;
	}
	else cout << "No";
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<stdio.h>
using namespace std;
 
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<25

int a[100001] = {};
int main()
{
	int n;
	int s;
	cin >> n;
	REP(i, 1, n + 1) {
		cin >> a[i];
		s += abs(a[i] - a[i - 1]);
	}
	s += abs(a[n]);
	REP(i, 1, n + 1) {
		int ss = s - abs(a[i] - a[i - 1]);
		ss -= abs(a[i] - a[i + 1]);
		ss += abs(a[i - 1] - a[i + 1]);
		cout << ss << endl;
	}
	return 0;
}

Measured memory_bytes: 1664
#include <stdio.h>
 
using namespace std;
 
int main(){
    int a,b;
    while(true){
        scanf("%d %d",&a,&b);
        if(a == 0 && b == 0) break;
        if(a > b) printf("%d %d\n",b,a);
        else{
            printf("%d %d\n",a,b);
        }
    }
}


Measured memory_bytes: 2608
/* 
	بسم الله الرحمن الرحیم
	
	(; طلا یک جهانی
*/

#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 100 + 5;
int p[MAX_N], id[MAX_N];
string s[MAX_N];

bool cmp(int &i, int &j) {
	if (s[i] == s[j])
		return p[i] > p[j];
	return s[i] < s[j];
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> s[i] >> p[i];
	iota(id, id + n, 0);
	sort(id, id + n, cmp);
	for (int i = 0; i < n; i++)
		cout << id[i] + 1 << endl;
}


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

using namespace std;

int main()
{
    int n;
    long long int W;
    cin >> n >> W;
    vector<long long int>v(n+1);
    vector<long long int>w(n+1);
    for(int i=1;i<=n;++i){
        cin >> w[i] >> v[i];
    }
    long long int m=1e5+9;
    vector<long long int>dp(m,INT_MAX);
    dp[0]=0;
    for(int i=1;i<=n;++i){
        for(long long int j=m;j>=0;--j){
            if(j>=v[i]){
                if(dp[j-v[i]]!=INT_MAX)
                    dp[j]=min(dp[j],w[i]+dp[j-v[i]]);
            }
        }
    }
    long long int ans=0;
    for(long long int j=1;j<m;++j){
        if(dp[j]<=W)
            ans=j;
    }
     cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 4056
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;
const int maxn = 400;
ll C[maxn][maxn] , dp[maxn][maxn] , sum[maxn][maxn];
int n,K,mod;
int main(){
    scanf("%d%d%d",&n,&K,&mod);
    C[0][0] = 1;
    for(int i = 1;i <= n;i++){
        C[i][0] = 1;
        for(int j = 1;j <= i;j++){
            C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
        }
    }
    for(int j = 0;j <= K;j++) dp[1][j] = 1, sum[1][j] = K - j + 1;
    for(int i = 2;i <= n + 1;i++){
        for(int j = 0;j <= K;j++){
            for(int k = 1;k < i;k++){
                dp[i][j] = (dp[i][j] +  dp[i - k][j]  * sum[k][j + 1] % mod * C[i - 2][k - 1]) % mod;
            }
        }
        for(int j = K;j >= 0;j--) sum[i][j] = (sum[i][j + 1] + dp[i][j]) % mod;
    }
    printf("%lld",dp[n + 1][0]);
}


Measured memory_bytes: 2944
N = int(input())
h = [int(i) for i in input().split(' ')]


tmp_length = 0
max_length = 0
for idx in range(1, N):
    if h[idx] <= h[idx-1]:
        tmp_length += 1
    else:
        tmp_length = 0
    if tmp_length > max_length:
        max_length = tmp_length
print(max_length)


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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
int main() {
  int a,b;cin>>a>>b;
  int ans=6-a-b;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a; 
  
  cin >> a;
  int x = a;
  int z = std::pow(x, 2);
  int y = std::pow(x, 3);
  int ans = x+y+z;
  cout << ans << endl;
  return 0;
 }

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

int  main()
{
	int  n,s=0,tmp;
	
	cin>>n;
	tmp=n;
	
	while(tmp!=0)
	{
	    s+=tmp%10;
	    tmp=tmp/10;
    }
    
    if(n%s==0)
       cout<<"Yes"<<endl;
    else
       cout<<"No"<<endl;
       
    return 0;
}

Measured memory_bytes: 256
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Debug.Trace
import Data.List
import Control.Monad
import Data.Ord


r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine

rp :: IO (Int,Int)
rp  = toTup . unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine

toTup [a,b] = (a,b)



main :: IO ()
main = do
    [n,k] <- r'
    hs <- r n
    print $ U.length (U.filter (>= k) hs)

Measured memory_bytes: 2300
#ifdef __unix__
#include <bits/stdc++.h>
#else
#include <iostream>
#include <algorithm>
#include <math.h>
#include <functional>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_set>
#endif


#define fastIO ios_base::sync_with_stdio(0), cin.tie(NULL)
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
#define mkp make_pair
/*#define NUMTOSTR(x)  (unsigned char)((x) + 48);*/
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long  ull;
using namespace std;



int main() {
	fastIO;
	char c;
	cin >> c;
	if (isupper(c)) cout << 'A';
	else cout << 'a';
}

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

const int maxn = 500010, P = 1000000007;
int n, a[maxn][2], st[maxn];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &a[i][0], &a[i][1]);
        st[i * 2 - 1] = a[i][0], st[i * 2] = a[i][1];
    }
    sort(st + 1, st + n + n + 1);
    long long ans = 0, sum = 0;
    for (int i = 1; i <= n; i++) {
        ans += a[i][0], sum += a[i][1];
    }
    ans = min(ans, sum), sum = 0;
    for (int i = 1; i <= n; i++) {
        sum += st[i];
    }
    for (int i = 1; i <= n; i++) {
        if (max(a[i][0], a[i][1]) < st[n]) printf("%lld\n", sum), exit(0);
        if (min(a[i][0], a[i][1]) > st[n]) printf("%lld\n", sum), exit(0);
        long long t = sum + max(a[i][0], a[i][1]) - st[n];
        ans = min(ans, t + max(0, min(a[i][0], a[i][1]) - st[n - 1]));
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 3200
import kotlin.math.pow

fun main(args: Array<String>) {

    val (h, w, k) = readLine()!!.split(" ").map { it.toInt() }

    val hw = (1..h).map { readLine()!!.split("").filter { it.isNotBlank() }.toTypedArray() }.toTypedArray()

    var ans = 0

    // 0桁からh桁までの2進数のループ
    for (i in 0 until 2.0.pow(h).toInt()) {
        // 0桁からw桁までの2進数のループ
        for (j in 0 until 2.0.pow(w).toInt()) {
            val hb = ("%${h}s").format(Integer.toBinaryString(i)).replace(' ', '0')
            val wb = ("%${w}s").format(Integer.toBinaryString(j)).replace(' ', '0')

            var count = 0

            // 黒の個数を数える
            for (i in 0 until h) {
                for (j in 0 until w) {
                    if (hb[h - 1 - i] == '1') continue
                    if (wb[w - 1 - j] == '1') continue
                    if (hw[i][j] == "#") count++
                }
            }
            if (count == k) ans++
        }
    }

    println(ans)
}


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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> t chmax(t&a,u b){if(a<b)a=b; return a;};
template<class t, class u> t chmin(t&a,u b){if(a>b)a=b; return a;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

ll N, M;
vvll InvGraph;
vll dp;

ll search(ll pos){
  if(dp[pos]>=0) return dp[pos];
  if(InvGraph[pos].size()==0) return dp[pos] = 0;
  REP(i,InvGraph[pos].size()){
    ll next_pos = InvGraph[pos][i];
    chmax(dp[pos], search(next_pos)+1);
  }
  return dp[pos];
}

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  IN(N,M);
  InvGraph.resize(N);
  dp.resize(N, -1);
  REP(i,M){
    ll x, y;
    IN(x,y);
    InvGraph[y-1].pb(x-1);
  }

  REP(i,N) search(i);

  ll ans = 0;
  REP(i,N) chmax(ans, dp[i]);
  OUT(ans);


  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
/*
template<class... T>
ostream& operator<<(ostream& os, tuple<T...>& t) {
	for (size_t i = 0; i < tuple_size< tuple<T...> >::value; ++i) {
		if (i) os << " ";
		os << get<0>(t);
	}
	return os;
}
*/
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int a, b, c; cin >> a >> b >> c;
	int ans = 0;
	FOR(i, a, b+1) {
		if (c % i == 0) ++ans;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3196
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;
// const int MOD = 998244353;

ll dp[1 << 22];
int a[25][25];
int main() {
   cin.tie(0);
   ios_base::sync_with_stdio(0);

   int n;
   cin >> n;
   rep(i, 0, n) rep(j, 0, n) cin >> a[i][j];

   dp[0] = 1;
   rep(S, 1, 1 << n) {
      int i = __builtin_popcount(S);
      rep(j, 0, n) if ((S >> j) & 1 &&
                       a[i - 1][j] == 1)(dp[S] += dp[S ^ (1 << j)]) %= MOD;
   }
   ll ans = dp[(1 << n) - 1];
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 18688
#include<stdio.h>
#include<string.h>
 
int main(void)
{
	char s[101];
	char t[202];
	int len,c=0,i,j;
	
    scanf("%s%s",s,t);
	len=strlen(s);
	for(i=0;i<len;i++)
		t[len+i]=t[i];
	
	for(i=0;i<len;i++){
		for(j=0;j<len;j++){
			if(s[j]!=t[j+i])
				break;
		}
		if(j==len)
			c=1;
	}
	if(c==1)
		printf("Yes");
	else
		printf("No");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define INF INT_MAX 
#define mod 1000000007
using namespace std;
int main(){
    ll N;
    cin >> N;
    ll A[N];
    ll count = 0;
    ll nmax = 0;
    ll nmin = INF;
    for(int i=0;i<N;i++){
        cin >> A[i];
        if(A[i]<0)count++;
        nmax = abs(A[i]) + nmax;
        nmin = min(abs(A[i]),nmin);
    }
    if(count%2==0){
        cout << nmax << endl;
    }else{
        cout << nmax -  2*nmin  << endl;
    }
}
    


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

int main(){
	long n; cin >> n; std::vector<long> a(n);
	for(int i = 0; i < n; i++) cin >> a[i];
	
	long l = 0, pos = 0, ans = 0;
	for(int i = 0; i < n; i++){
		if(pos & a[i]) {
			while(l < i and pos & a[i]) {
				pos ^= a[l];
				l++;
			}
			pos ^= a[i];
			ans += i - l + 1;
		}else{
			pos ^= a[i];
		
			ans += i - l + 1;
		}
	}
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
char s[100000*2+5];
long long dp[2][10000+5];
int main(){

    long long sum=0;
    scanf("%s",s);
    int n = strlen(s);
    for(int i=0;i<n;i++){
        int t=s[i]-'0';
        memset(dp[i%2],0,2019*sizeof (long long));
        for(int j=0;j<2019;j++)
            dp[i%2][(j*10+t)%2019]+=dp[(i+1)%2][j];
        dp[i%2][t%2019]++;
        sum+=dp[i%2][0];
    }
    printf("%lld\n",sum);

}



Measured memory_bytes: 4012
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  for(int i = 0; i*4<=n; ++i){
    if((n-i*4)%7==0){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const ll MOD = (ll)(1e9 + 7);

/////////////////////////////////////////////////////////////
class CombinationModulo {
 public:
  static const ll MOD = (ll)(1e9 + 7);

  vector<ll> fact;
  vector<ll> inv;
  vector<ll> fact_inv;

  CombinationModulo(int n) {
    this->fact = vector<ll>(n + 1, 0LL);
    this->inv = vector<ll>(n + 1, 0LL);
    this->fact_inv = vector<ll>(n + 1, 0LL);
    init(n);
  }

  void init(int n) {
    inv[1] = fact[0] = fact_inv[0] = 1LL;
    for (int i = 2; i <= n; i++) {
      inv[i] = (MOD - (MOD / i) * inv[MOD % i] % MOD) % MOD;
    }
    for (int i = 1; i <= n; i++) {
      fact[i] = fact[i - 1] * i % MOD;
    }
    for (int i = 1; i <= n; i++) {
      fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
  }

  ll comb(int n, int r) {
    if (r > n) return 0LL;
    return fact[n] * fact_inv[r] % MOD * fact_inv[n - r] % MOD;
  }
};
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
class ModuloOperator {
 public:
  ll modulo;

  ModuloOperator(ll modulo) {
    this->modulo = modulo;
  }

  ll add(ll a, ll b) {
    ll ret = a + b;
    ret %= modulo;
    return ret;
  }

  ll sub(ll a, ll b) {
    ll ret = a - b;
    if (ret < 0)
      ret += modulo;
    else
      ret %= modulo;
    return ret;
  }

  ll mul(ll a, ll b) {
    ll ret = a * b;
    ret %= modulo;
    return ret;
  }

  ll div(ll a, ll b) { return mul(a, pow(b, modulo - 2)); }

  ll pow(ll x, ll y) {
    ll res = 1LL;

    x %= modulo;

    while (y > 0) {
      if (y & 1) {
        res = mul(res, x);
      }

      y = y >> 1;
      x = mul(x, x);
    }

    return res;
  }
};
/////////////////////////////////////////////////////////////

ll n, m, k;

ll ans;

ModuloOperator mo(MOD);

int main(void) {
  // Here your code !
  scanf("%lld %lld %lld", &n, &m, &k);

  int size = (int)(n * m + 3);
  CombinationModulo cm(size);

  ans = 0;

  ll base_comb = cm.comb((int)(n * m - 2), (int)(k - 2));

  for (ll i = 1; i <= n - 1; ++i) {
    ll slide_size = n - i;

    ll times = mo.mul(mo.mul(slide_size, mo.mul(m, m)), base_comb);
    ll commit = mo.mul(i, times);

    ans = mo.add(ans, commit);
  }

  for (ll i = 1; i <= m - 1; ++i) {
    ll slide_size = m - i;

    ll times = mo.mul(mo.mul(slide_size, mo.mul(n, n)), base_comb);
    ll commit = mo.mul(i, times);

    ans = mo.add(ans, commit);
  }

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <cstring>   
#include <cstdio> 
#include <algorithm>  
using namespace std; 

#define int long long

const int M=17;

int l,r;
int f[M][M];  
int bit[M];

inline int ass(int x){return x>0?x:-x;}

int k;

int dfs(int x,int s,bool z,bool e){
    if(x==0) return 1;
    if(!z&&!e&&f[x][s]!=-1) return f[x][s];
    int ans=0,u=e?bit[x]:9;
    for(int i=0;i<=u;i++){
        if(!z&&ass(i-s)>1) continue;
        ans+=dfs(x-1,i,z&&!i,e&&(i==u));  
    }
    return !z&&!e?f[x][s]=ans:ans;
}

int solve(int x){  
    int len=0;
    while(x) bit[++len]=x%10,x/=10;
    return dfs(len,0,1,1);
}

bool check(int x){
    return solve(x)>=k;
}

void work(){
    cin>>k;k++;
    int x1=1,x2=1e13,ans;
    while(x1<=x2){
        int mid=x1+x2>>1;
        if(check(mid)) x2=mid-1,ans=mid;
        else x1=mid+1;
    }
    cout<<ans<<endl;
}

void init(){
    memset(f,-1,sizeof(f));
}

signed main() 
{
    init();
    work();
    return 0;
}  


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

using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VS = vector<string>;
using PII = pair<int, int>;
using VPII = vector<PII>;
using VL = vector<long long>;
using VVL = vector<VL>;

#define sz(var) (int)var.size()
#define REP(var, start, end) for(int var = start; var < (int)end; ++var)
#define REPC(var, start, end) for(int var = start; var <= (int)end; ++var)
#define CLEAR(var, with) memset(var, with, sizeof(var))
#define ALL(x) x.begin(), x.end()
#define LL long long
#define ULL unsigned long long
#define TIME cerr << "Time elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms" << endl;
#define DBG(x) cerr << x << endl;

/*
	
*/
int n;
VL A;
LL lcm(LL a, LL b) {
	return a * (b / __gcd(a, b));
}
LL solve()
{
	LL ret = A[0];
	for(int i = 1; i < n; ++i)
		ret = lcm(ret, A[i]);
	return ret;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
//	freopen("tmp.in", "r", stdin);
	//freopen("tmp.out", "w", stderr);
#endif
	cin >> n;

	A.resize(n);
	REP(i, 0, n) cin >> A[i];

	cout << solve() << endl;

	return 0;
}

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

using namespace std;
long double pi = 3.1415926536;

/*bool secgreat(pair<int, int> a, pair<int, int> b){
    return a.second>b.second;
}
 */

long long MAXN = 1e6+3;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    int n = s.length();
    int sum = 0;
    int i;
    for(i = 0; i<n; i++){
        sum+=s[i]-48;
    }
    if(sum%9 == 0){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }

}

Measured memory_bytes: 3752
s1 = int(input())
s2 = int(input())
s3 = int(input())
s4 = int(input())
s5 = int(input())
s6 = int(input())
s7 = int(input())
s8 = int(input())
s9 = int(input())
s10 = int(input())

print(s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10)



Measured memory_bytes: 5588
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long N = sc.nextInt();

		String FizzBuzz = "";
		long SUM = 0;


		for(int i = 1; i <= N; i++) {

			if(i % 3 ==0 && i % 5 ==0) {
				FizzBuzz = "FizzBuzz";
			}
			else if(i % 3 ==0) {
				FizzBuzz = "FiZZ";
			}else if(i % 5 ==0) {
				FizzBuzz = "Buzz";
			}
			if(i%3 !=0 && i % 5 !=0) {
				SUM +=i;
			}
		}
		System.out.println(SUM);
		sc.close();
}
}


Measured memory_bytes: 35772