akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll a,b;
	cin>>a>>b;
	rep(i,10005){
		if(ll(i*0.08)==a&&ll(i*0.1)==b){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<memory>
#include<map>
#include<set>
#include<unordered_map>
#include<array>
#include<vector>
#include<algorithm>
#include<list>
#include<limits>
#include<stdio.h>
#include<math.h>
#include<string>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using lst = list<ll>;
using pr  = pair<ll, ll>;

const ll MOD = 998244353;

int main()
{
	string S;
	cin >> S;

	if (S == "ABC") { cout << "ARC" << endl; }
	else { cout << "ABC" << endl; }


	return 0;
}

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

    cin >> N >> S ;

   int  cnt = 0;

   for(int i=0;i<N-2;i++) {
       //cout << S.compare(i,3,"ABC") << endl;

       if(S.compare(i,3,"ABC") == 0) {
            cnt = cnt + 1;
       }
       
   }
  
    cout << cnt << endl;
    
}

Measured memory_bytes: 256
/*
    AUTHOR : TANMAY SINHA
    INORMATION TECHNOLOGY
    BIT MESRA ,RANCHI
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ld long double
#define ull unsigned long long int
#define ll long long int
#define pb(x) push_back(x)
#define eb(x) emplace_back(x)
#define mp make_pair
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define rep(j,L,R) for(j=L;j<R;j++)
#define per(i,L,R) for(i=L;i>= R;i--)
#define all(con) (con).begin(),(con).end()
#define fi first
#define se second
#define foreach(iter,con) for(auto iter=(con).begin(); iter!=(con).end(); iter++)
#define DEBUG
#ifdef DEBUG
#define deb2(args...) {dbg,args; cerr<<endl;}
#else
#define deb2(args...)
#endif
struct debb{template<typename T> debb& operator,(const T &v){cerr<<v<<" ";return *this;}}dbg;
#define deb1(args...) do {cerr << #args << " : "; dbg,args; cerr << "\n";} while(0)
#define printa(a,L,R) rep(i,L,R) cout << a[i] <<' ';cout<<"\n";
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
template<typename T>T gcd(T a,T b){if(b==0)return a;else return gcd(b,a%b);}
template<typename T>T lcm(T a,T b){return a/gcd(a,b)*b;}
ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1)res=((res%p)*(x%p))%p;y=y>>1;x=(x*x)%p;}return res;}
ll power1(ll x,ll y){ll res=1;while(y>0){if(y&1)res=(res*x);y=y>>1;x=x*x;}return res;}
const ll INF = 1e18l+10;
int main()
{
   SPEED
   ll n,w,i,j;
   cin>>n>>w;
   ll wt[n+1],v[n+1];
   ll sumval=0;
   for(i=0;i<n;++i)
   {
       cin>>wt[i]>>v[i];
       sumval+= v[i];
   }
   vector <ll> dp(sumval+1,INF);
   //dp[i] contains the minimum weight of value exact i..
   dp[0]=0;
   for(ll item = 0;item<n;++item)
   {
       for(ll val_already = sumval-v[item];val_already>=0;--val_already)
        dp[val_already+v[item]] = min(dp[val_already+v[item]],dp[val_already]+wt[item]);
//        for(j=0;j<=sumval;j++)
//            cout<<dp[j]<<" ";
//        cout<<"\n";
   }
   ll ans  =0;
   for(i=0;i<=sumval;++i)
    if(dp[i]<=w)
    ans=max(ans,i);
   cout<<ans;
}







Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <string>
#include <complex>

#include <cassert>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <cstring>

#define REP(i,e) for(int i=0;i<(int)(e);i++)
#define FOR(i,b,e) for(int i=(int)(b);i<(int)(e);i++)
#define ALL(c) (c).begin(), (c).end()
#define EACH(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define RALL(c) (c).rbegin(), (c).rend()
#define ALLA(a,n) ((a)+0), ((a)+n)

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef vector<string> vstring;
typedef vector<double> vdouble;

template<class T>void pp(T v,int n){ REP(i,n)cout<<v[i]<< ' ' ; cout << endl; }
template<class T>void pp(T v){ EACH(it,v) cout << *it << ' ' ; cout << endl;  }
template<class T>T& ls(T& a,T b){ if(b<a) a=b; return a; }
template<class T>T& gs(T& a,T b){ if(b>a) a=b; return a; }
inline ll to_i(const string& s){ll n;sscanf(s.c_str(),"%lld",&n);return n;}
inline string to_s(ll n){char buf[32];sprintf(buf,"%lld",n);return string(buf);}

struct __scanner__{ bool e; operator bool(){ return e; } } IN = { false };
inline __scanner__& operator>>(__scanner__& in,int &n)
{ in.e = scanf("%d",&n)==1; return in; }
inline __scanner__& operator>>(__scanner__& in,ll &n)
{ in.e = scanf("%lld",&n)==1; return in; }
inline __scanner__& operator>>(__scanner__& in,double &n)
{ in.e = scanf("%lf",&n)==1; return in; }
inline __scanner__& operator>>(__scanner__& in,char &n)
{ in.e = scanf(" %c",&n)==1; return in; }
inline __scanner__& operator>>(__scanner__& in,string &n) // BUFFER SIZE!
{ static char buf[1000000]; in.e = scanf(" %s",buf)==1; n = buf; return in; } 

int main(){
  string s;
  while (cin >> s) {
    if (s.length() >= 4 && s.substr(0, 4) == "YAKI")
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

 
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;

using namespace std;

#define ll long long
const int MOD = 1e9 + 7;
#define INF 2e9

#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)

#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement) regex_replace(_str, regex(_ptn), _replacement)

# define pb push_back

# define INIT() cin.tie(0); ios::sync_with_stdio(false); cout << fixed << std::setprecision(20)

#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << (x) << "( (L" << __LINE__ << ")" << endl;
using namespace std;

#define ll long long

template <typename T>
struct PrimeFact {
    vector<T> spf;
    PrimeFact(T N) { init(N); }
    void init(T N) { // 前処理。spf を求める
        spf.assign(N + 1, 0);
        for (T i = 0; i <= N; i++) spf[i] = i;
        for (T i = 2; i * i <= N; i++) {
            if (spf[i] == i) {
                for (T j = i * i; j <= N; j += i) {
                    if (spf[j] == j) {
                        spf[j] = i;
                    }
                }
            }
        }
    }
    map<T, T> get(T n) { // nの素因数分解を求める
        map<T, T> m;
        while (n != 1) {
            m[spf[n]]++;
            n /= spf[n];
        }
        return m;
    }
};

ll n,m;
string s;
int main() {
    INIT();
    PrimeFact<ll> prime(1e7);
    ll n;
    Bint result = 0;

    cin >> n;
    
    ll hoge = 1;

    if(n >= 9000000) {
        hoge = 9000001;
        result = 675021515919670;
    } else if(n >= 8000000) {
        hoge = 8000001;
        result = 529581632274134;
    } else if(n >= 7000000) {
        hoge = 7000001;
        result = 402188826344049;
    } else if(n >= 6000000) {
        hoge = 6000001;
        result = 292711324081941;
    } else if(n >= 5000000) {
        hoge = 5000001;
        result = 200992441246692;
    } else if(n >= 4000000) {
        hoge = 4000001;
        result = 126850549017804;
    } else if(n >= 3000000) {
        hoge = 3000001;
        result = 70058785460280;
    } else if(n >= 2000000) {
        hoge = 2000001;
        result = 30326413365285;
    } else if(n >= 1000000) {
        hoge = 1000001;
        result = 7235062807366;
    }
    for(ll i = hoge; i <= n; i++) {
        ll tmp = 1;
        for(auto&& [k,v] : prime.get(i)) {
            tmp *= (v+1);
        }
        result += i * tmp;
    }
    cout << result;
}


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

class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	
    	final int NUM = scan.nextInt();
    	int[] side = new int[3];
    	try {
			for(int i = 0; i < NUM; i++){
				for(int j = 0; j < 3; j++){
					side[j] = scan.nextInt();
				}
				Arrays.sort(side);
				if(side[2]*side[2] == side[0]*side[0] + side[1]*side[1]){
					System.out.println("YES");
				}else{
					System.out.println("NO");
				}
			}
		} catch (NumberFormatException e) {
			System.out.println("数字を入力してください");
		}
    }
}

Measured memory_bytes: 23380
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace AtCoder.C
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();

            var q = new Queue<Num753>();
            q.Enqueue(new Num753 { Has3 = true, Value = 3 });
            q.Enqueue(new Num753 { Has5 = true, Value = 5 });
            q.Enqueue(new Num753 { Has7 = true, Value = 7 });
            var count = 0;
            while (q.Count > 0)
            {
                var v = q.Dequeue();
                if (v.Value > N) continue;

                if (v.Is753) count++;
                var v3 = v.Clone();
                v3.Value = v3.Value * 10 + 3;
                v3.Has3 = true;
                q.Enqueue(v3);
                var v5 = v.Clone();
                v5.Value = v5.Value * 10 + 5;
                v5.Has5 = true;
                q.Enqueue(v5);
                var v7 = v.Clone();
                v7.Value = v7.Value * 10 + 7;
                v7.Has7 = true;
                q.Enqueue(v7);
            }

            return count;
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
    class Num753
    {
        public bool Has7 { get; set; }
        public bool Has5 { get; set; }
        public bool Has3 { get; set; }
        public bool Is753 { get { return Has3 && Has5 && Has7; } }
        public long Value { get; set; }

        public Num753 Clone()
        {
            return new Num753
            {
                Has7 = Has7,
                Has5 = Has5,
                Has3 = Has3,
                Value = Value,
            };
        }
    }
}


Measured memory_bytes: 31276
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

int main(void)
{
  int temp;
  scanf("%d", &temp);
  if (temp >= 30)
  {
    printf("Yes\n");
  }
  else
  {
    printf("No\n");
  }

  return 0;
}


Measured memory_bytes: 1660
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))//memset only use to initialize 0 or -1 no other number.
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 1e9
#define INFL 1e18
#define mod 1000000007
//#define mod 998244353
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os;
typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> os_pair;

ll power(ll x,ll n){ll res =1;while(n>0){if(n%2==1){res=res*x;}x=x*x;n=n/2;}return res;}
ll powm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

//cout<< fixed << setprecision(10)
ll fact[500005];
void facto(ll n){
	fact[0]=1;
    for(ll i=1;i<=n;i++){
    	fact[i]=fact[i-1]*i;
    	fact[i]%=mod;
	}
}
ll modInv(ll a){
	return powm(a,mod-2)%mod;
}
ll ncr(ll n,ll r){
	ll b=modInv(fact[n-r]);
	ll c=modInv(fact[r]);
	ll a=fact[n]*b;
	a%=mod;
	a*=c;
	a%=mod;
	return a;
}
int main(){

    fast;
    int T;
    T=1;
    //cin>>T;
    while(T--){
    	ll n,m,i,j;
    	
    	cin>>n>>m;
    	facto(m);
    	
    	ll ans=0;
    	int x=1;
    	for(i=0;i<=n;i++)
    	{
    		ll y=ncr(n,i)*ncr(m-i,n-i);
    		y=y%mod;
    		y=(y*fact[n-i])%mod;
    		ans+=x*y;
    		
    		
    		x=-1*x;
    		ans+=mod;
    		ans%=mod;
		}
		ll z=ncr(m,n);
		z=z*fact[n];
		z%=mod;
		ans=ans*z;
		ans%=mod;
		

		cout<<ans<<"\n";
		
    	
    	

    }

}

Measured memory_bytes: 7480
X,Y=list(map(int,input().split()))

mod=10**9+7

def modinv(x):
    return pow(x,mod-2,mod)

def enumfactorial(x):
    ret=1
    for i in range(1,x+1):
        ret*=i
        ret%=mod
    
    return ret

def denomfactorial(x):
    ret=1
    for i in range(1,x+1):
        ret*=modinv(i)
        ret%=mod
    
    return ret

if (2*Y-X)%3>0 or (2*X-Y)%3>0:
    print(0)
else:
    m=(2*Y-X)//3
    n=(2*X-Y)//3

    if m<0 or n<0:
        print(0)
    else:
        print((enumfactorial(m+n)*denomfactorial(m)*denomfactorial(n))%mod)

Measured memory_bytes: 38896
#include <stdio.h>
#include <vector>
using namespace std;

const int N = 100005, P = 1000000007;
int n, a[N], lg2[N], mn[N][17];

int power(int a, int x) {
  int ans = 1;
  for (; x; x >>= 1, a = 1LL * a * a % P)
    if (x & 1) ans = 1LL * ans * a % P;
  return ans;
}

int better(int i, int j) {
  return (a[i] < a[j] || (a[i] == a[j] && i < j)) ? i : j;
}
int query(int l, int r) {
  int x = lg2[r - l + 1];
  return better(mn[l][x], mn[r - (1 << x) + 1][x]);
}

struct node {
  int c0, c1, c2;
  node(int d0 = 0, int d1 = 0, int d2 = 0) {
    c0 = d0, c1 = d1, c2 = d2;
  }
};

node solve(int l, int r, int h) {
  int pos = query(l, r), mnv = a[pos];
  vector<int> v;
  for (;;) {
    v.push_back(pos);
    if (pos == r) break;
    int nxt_pos = query(pos + 1, r);
    if (a[nxt_pos] == a[pos])
      pos = nxt_pos;
    else
      break;
  }
  node res;
  if (v[0] != l) {
    res = solve(l, v[0] - 1, mnv);
    res.c1 = (res.c0 + res.c1) % P;
    res.c0 = res.c1;
    res.c2 = (2LL * res.c2 + res.c0 + res.c1) % P;
  } else
    res = node(1, 1, 0);
  for (int i = 1; i < (int)v.size(); ++i) {
    if (v[i - 1] + 1 < v[i]) {
      node tmp = solve(v[i - 1] + 1, v[i] - 1, mnv);
      tmp.c1 = (tmp.c0 + tmp.c1) % P;
      tmp.c0 = tmp.c1;
      if (v[i - 1] - l & 1)
        res = node(1LL * res.c0 * tmp.c0 % P, 1LL * res.c1 * tmp.c1 % P,
          (1LL * res.c0 * tmp.c1 + 1LL * res.c1 * tmp.c0 + (0LL + tmp.c0 + tmp.c1 + tmp.c2) * res.c2 + (0LL + res.c0 + res.c1) * tmp.c2) % P);
      else
        res = node(1LL * res.c0 * tmp.c1 % P, 1LL * res.c1 * tmp.c0 % P,
          (1LL * res.c0 * tmp.c0 + 1LL * res.c1 * tmp.c1 + (0LL + tmp.c0 + tmp.c1 + tmp.c2) * res.c2 + (0LL + res.c0 + res.c1) * tmp.c2) % P);
    }
    res.c2 = (2LL * res.c2 + res.c0 + res.c1) % P;
  }
  if (v.back() != r) {
    node tmp = solve(v.back() + 1, r, mnv);
    tmp.c1 = (tmp.c0 + tmp.c1) % P;
    tmp.c0 = tmp.c1;
    if (v.back() - l & 1)
      res = node(1LL * res.c0 * tmp.c0 % P, 1LL * res.c1 * tmp.c1 % P,
        (1LL * res.c0 * tmp.c1 + 1LL * res.c1 * tmp.c0 + (0LL + tmp.c0 + tmp.c1 + tmp.c2) * res.c2 + (0LL + res.c0 + res.c1) * tmp.c2) % P);
    else
      res = node(1LL * res.c0 * tmp.c1 % P, 1LL * res.c1 * tmp.c0 % P,
        (1LL * res.c0 * tmp.c0 + 1LL * res.c1 * tmp.c1 + (0LL + tmp.c0 + tmp.c1 + tmp.c2) * res.c2 + (0LL + res.c0 + res.c1) * tmp.c2) % P);
  }
  res = node(mnv == h + 1 ? res.c0 : 1LL * (res.c0 + res.c1) * power(2, mnv - h - 2) % P,
    mnv == h + 1 ? res.c1 : 1LL * (res.c0 + res.c1) * power(2, mnv - h - 2) % P, res.c2);
  return res;
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    mn[i][0] = i;
  }
  for (int i = 2; i <= n; ++i)
    lg2[i] = lg2[i >> 1] + 1;
  for (int j = 1; 1 << j <= n; ++j)
    for (int i = 1; i + (1 << j) - 1 <= n; ++i)
      mn[i][j] = better(mn[i][j - 1], mn[i + (1 << j - 1)][j - 1]);
  node res = solve(1, n, 0);
  int ans = (0LL + res.c0 + res.c1 + res.c2) % P;
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 256
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  
  int n; rd(n);
  auto a=readln.split.to!(int[]);

  auto c=new int[](100009);
  foreach(ref e; a) e+=2;
  foreach(e; a) c[e]+=1;

  int mx=0;
  foreach(i; 2..c.length-2){
    mx=max(mx, c[i-1]+c[i]+c[i+1]);
  }

  writeln(mx);

}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}

Measured memory_bytes: 3644
N = int(input())
T,A = list(map(int, input().split()))
H = list(map(int, input().split()))
ansx=T-H[0]*0.006
ans=1
for i in range(N):
    subans=T-H[i]*0.006
    if abs(A-subans)<abs(A-ansx):
        ansx=subans
        ans=i+1
print(ans)


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

vector<int> primes;

void list_prime(int N){
	bool flag[N + 1] = {true,true};
	for(int i = 4;i <= N;i += 2) flag[i] = true;
	for(int i = 3;i * i <= N;i += 2){
		if(flag[i]) continue;
		for(int j = i * 2;j <= N;j += i) flag[j] = true;
	}
	for(int i = 0;i <= N;i++) if(!flag[i]) primes.push_back(i);
}

int main(){
	list_prime(1300000);
	int n;
	while(cin >> n,n){
		int low = lower_bound(primes.begin(),primes.end(),n) - primes.begin();
		if(primes[low] == n) cout << 0 << endl;
		else{
			cout << primes[low] - primes[low - 1] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 4492
#include <stdio.h>
 int main(){
     int a,b;
     scanf("%d %d",&a,&b);
     if (a > b){
     printf("a > b\n");
}
     if (a < b){
     printf("a < b\n");
}    
     if (a == b){
     printf("a == b\n");
}   
     return 0;
}



Measured memory_bytes: 1976
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <chrono>
#include <tuple>
#include <random>
#include <cmath>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SIZE = 1e6 * 2 + 10, INF = 1e9 * 1e9 + 10;

vector<pair<ll, ll>> mines;
vector<ll> lines, pills;

int main()
{
    fastInp;

    ll h, w, m;
    cin >> h >> w >> m;
    lines.resize(h);
    pills.resize(w);
    ll ans = 0;
    vector<pair<ll, ll>> vrt;
    set<pair<ll, ll>> s;
    for (int i = 0; i < m; i++) {
        ll u, v;
        cin >> u >> v;
        u--; v--;
        lines[u]++;
        pills[v]++;
        vrt.push_back({u, v});
        s.insert({u, v});
    }

    for (auto cur : vrt) {
        ans = max(ans, lines[cur.first] + pills[cur.second] - 1);
    }

    ll mxl = -1, mxpl = -1;
    for (int i = 0; i < lines.size(); i++) {
        mxl = max(mxl, lines[i]);
    }

    for (int i = 0; i < pills.size(); i++) {
        mxpl = max(mxpl, pills[i]);
    }

    vector<ll> lls, pls;
    for (int i = 0; i < lines.size(); i++) {
        if (mxl == lines[i]) {
            lls.push_back(i);
        }
    }

    for (int i = 0; i < pills.size(); i++) {
        if (mxpl == pills[i]) {
            pls.push_back(i);
        }
    }

    for (int i = 0; i < lls.size(); i++) {
        for (int j = 0; j < pls.size(); j++) {
            if (s.find({lls[i], pls[j]}) == s.end()) {
                cout << mxl + mxpl;
                return 0;
            }
        }
    }
    cout << ans;
    
    return 0;
}

Measured memory_bytes: 40080
#include<bits/stdc++.h>
using namespace std ; 
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fast ios_base:: sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long int
#define endl "\n"
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define pii pair<int,int> 
long long M  = 1e9+7;
 
 
signed main(){
    fast;
    string s; cin >> s;
    for(int i=0 ; i<s.size() ; i++)
        cout << 'x' ;
    cout << endl;
}


Measured memory_bytes: 256
//#include"cpp_kyopro.h"
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include<stdio.h>

using namespace std;

int main(void) {
	int n,a[1000];
	double sum = 0,waru;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		waru = 1.0 / a[i];
		sum +=waru;
		//cout << sum << endl;
	}
	printf("%.10lf", pow(sum, (-1)));
	//cout << pow(sum,(-1)) << endl;
	//cout << sum << endl;


	return 0;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN,"%d %d %d",$n,$m,$c);
$clrs = explode(" ",trim(fgets(STDIN)));
// print_r($clrs);
for($i = 0;$i < $n;++$i) {
    fscanf(STDIN,"%d %d",$cn,$wn);
    // echo $cn." ".$wn.PHP_EOL;
    $balls[$wn][] = $cn - 1;
}
krsort($balls);
$result = 0;
$j = 0;
foreach($balls AS $price => $array) {
    foreach($array AS $color) {
    // echo $clrs[$color].PHP_EOL;
    // echo $color." ".$price.PHP_EOL;
    // echo $j." ".$m.PHP_EOL;
        if ($clrs[$color] > 0) {
            $result += (int)$price;
            --$clrs[$color];
            if(++$j >= $m) {
                break 2;
            }
        }
    }
}
echo $result.PHP_EOL;
?>


Measured memory_bytes: 39580
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
s_dict = {}
max_n = 0
for i in range(0, n):
    s = input()
    if s in s_dict:
        s_dict[s] += 1
        if s_dict[s] > max_n:
            max_n = s_dict[s]
    else:
        s_dict[s] = 1
        if max_n == 0:
            max_n = 1
s_list = []
for s in s_dict:
    if s_dict[s] == max_n:
        s_list.append(s)
s_list = sorted(s_list)
for s in s_list:
    print(s)

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

using namespace std;

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

int main()
{
    int N, M;
    cin >> N >> M;
    int time = M * 1900 + (N - M) * 100;
    int count = pow(2, M);
    cout << (time * count) << endl;
    return 0;
}

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

int main(){
	vector<int> a(3);
	for(int i=0; i<3; i++){
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());
	int ans=a.at(0)+a.at(1);
	cout << ans << endl;
}


Measured memory_bytes: 3480
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(unsigned long long i=0;i<n;i++)
int dp[10000];
const long double PI = (acos(-1));
int main() { 
  long double a,b,x;
  long double kari,space;
  cin>>a>>b>>x;
  space=a*a*b-x;
  kari=(PI/2)-atan(2*x/(a*b*b));
  if(tan(kari)*a<b){kari=atan(2*(a*a*b-x)/(a*a*a));}
  cout<<fixed << setprecision(10) <<((180*kari)/PI)<<endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
vector<string>split(string s, char c = ' ') {
	vector<string>vec;
	string h = "";
	for (int i = 0; i < s.size();) {
		int j = i;
		while (j < s.size() && s[j] != ' ') {
			h += s[j++];
		}
		if (h.size() > 0) vec.push_back(h);
h = "";
i = j + 1;
	}
	return vec;
}
template<typename T>
void print_vec(vector<T>a) {
	for (int i = 0; i < a.size(); i++) {
		cout << (i == 0 ? "" : " ") << a[i];
	}
	cout << endl;
}
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n, q;
int a[200000];
string s;
int b[200000];
signed main() {
	cin >> n >> q >> s;
	for (int i = 0; i < s.size() - 1; i++) {
		if (s[i] == 'A'&&s[i + 1] == 'C') {
			b[i + 1]++;
		}
	}
	for (int i = 1; i < n; i++) b[i] += b[i - 1];
	for (int i = 0; i < q; i++) {
		int l, r;
		cin >> l >> r;
		l--; r--;
		int sum = b[r] - (l == 0 ? 0 : b[l - 1]);
		if (l > 0 && s[l - 1] == 'A'&&s[l] == 'C') {
			sum--;
		}
		cout << sum << endl;
	}
}

Measured memory_bytes: 1792
#include<iostream>
#include <algorithm>
#include <string>
#include<math.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (a - c)*(b - d) << endl;
    return 0;
}


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

bool isA(string s) {
  int cnt1 = 0;
  for (int i = 2; i < s.size(); ++i) {
    if (s[i] == '=') {
      ++cnt1;
    } else if (s[i] == '#') {
      if (cnt1 == 0) return false;
      break;
    } else {
      return false;
    }
    if (i == s.size() - 1) return false;
  }
  int cnt2 = 0;
  for (int i = cnt1 + 3; i < s.size(); ++i) {
    if (s[i] == '=') {
      ++cnt2;
    } else if (s[i] == '~') {
      return (cnt1 == cnt2 && i == s.size() - 1);
    } else {
      return false;
    }
  }
  return false;
}

bool isB(string s) {
  if (s.size() % 2) return false;
  int cnt = 0;
  for (int i = 2; i < s.size(); i += 2) {
    if (s[i] == 'Q' && s[i + 1] == '=') {
      ++cnt;
    } else if (s[i] == '~' && s[i + 1] == '~') {
      return (i + 1 == s.size() - 1) && cnt;
    } else {
      return false;
    }
  }
  return false;
}

int main() {
  int n; cin >> n;
  vector<string> s(n); for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < n; ++i) {
    if (s[i][0] != '>' || s[i].size() == 3) {
      cout << "NA" << endl;
      continue;
    }
    if (s[i][1] == '\'') {
      cout << ( (isA(s[i])) ? "A" : "NA") << endl;
    } else if (s[i][1] == '^') {
      cout << ( (isB(s[i])) ? "B" : "NA") << endl;
    } else {
      cout << "NA" << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3372
from collections import  deque
import sys
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())
 
def inp_list(): return list(map(int, sys.stdin.readline().split()))

def lcm(x, y): return (x * y) // gcd(x, y)

N, K = inp_list()
ans = 0
for k in range(K, N + 2):
    # M => 和の最大値, m => 和の最小値, k について和としてありえるものの個数は M - m + 1
    M = ( N * (N + 1) // 2 - (N - k) * (N + 1 - k) // 2 ) % mod
    m = k * (k - 1) // 2 % mod
    ans += (M - m + 1) % mod

print(ans % mod)


Measured memory_bytes: 9948
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define M 1000001
#define mod 10007

int main(void){
    double R;
    scanf("%lf",&R);
    printf("%lf\n",R*2*3.14);
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

vector<pair<ll,int>> prime_factor(ll n) {
  vector<pair<ll,int>>res;
  for(ll i = 2; i * i <= n; i++) {
    if(n % i == 0) {
      int t = 1;
      n /= i;
      while(n%i==0){
        t++;
        n/=i;
      }
      res.push_back(pair<ll,int>(i,t));
    }
  }
  if(n != 1) res.push_back(pair<ll,int>(n,1));
  return res;
}

int main(){
    ll n;
    cin >> n;
    auto mp = prime_factor(n-1);
    ll ans = 1;
    for(auto p:mp){
        ans *= p.second+1;
    }
    ans--;//1を除く
    ans++;//それ自身n
    //auto mp_c = prime_factor(n);
    for(ll i = 2;i*i<=n;i++){
        if(n%i==0){
            ll t = n;
            while(t%i==0){
                t/=i;
            }
            if(t%i==1)ans++;
        }
    }
    // if(mp_c.size()==1){
    //     auto mp_t = prime_factor(mp_c.size());
    //     ll c = 1;
    //     for(auto p:mp_t){
    //         c*=p.second;
    //     }
    //     c -= 2;
    //     cout << c << endl;
    //     ans += c;
    // }
    //cout << mp_c.size() << endl;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

int N, K;

int main()
{
    cin >> N >> K;
    N -= K;
    cout << (K == 1 ? 0 : N) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
typedef long long ll;
using namespace std;
#define INF 0x3f3f3f3f
/**
*超时有可能是输入的问题
*注意边界
*仔细读题
*没思路试试逆向思维
**加油，奥利给！！！ 
**/
map<int,int>p;
/*struct knd{
	int x,y,z;
}s[200000];*/ 
int main()
{
	ll m,n,i,j,t,k,a,b,c;
	cin>>a>>b>>c>>k;
      i=0;
      if(a>=k)
      {
      	cout<<k; return 0;
	  }
	  if(a<k&&a+b>=k)
	  {cout<<a; return 0;
	  	
	  }
	  if(a+b<k)
	  {
	  	cout<<2*a+b-k;return 0;
	  }
     
 } 

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  bool G[10][10]={false};
  for(int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    a--,b--;
    G[a][b]=true;
    G[b][a]=true;
  }
  vector<int>ord(N);
  for(int i=0;i<N;i++){
    ord[i]=i;
  }
  int res=0;
  do{
    if(ord[0]!=0)continue;
    bool ok=true;
    for(int i=0;i<N-1;i++){
      int from=ord[i];
      int to=ord[i+1];
      if(!G[from][to])ok=false;
    }
    if(ok)res++;
  }while(next_permutation(ord.begin(),ord.end()));
  cout<<res<<endl;
}

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

int main(){
	long long N,K,a,b,cnt=0;
	cin >> N >> K;
	
	a = N/K;
	b = (N+K/2)/K;
 
	if(K%2)
		cnt = pow(a,3);
	else
		cnt = pow(a,3)+pow(b,3);
    
	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
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; }


int main(){
    int n;
    cin>>n;
    int a[n],b[n],c[n-1];
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++) cin>>b[i];
    for(int i=0;i<n-1;i++) cin>>c[i];
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=b[a[i]-1];
        if(a[i]==a[i-1]+1) ans+=c[a[i-1]-1];
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
    int main(){
      int n;
      cin >> n;
      int i,j,k,sum=0;
      for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
          for(k=1;k<=n;k++)
            sum+=__gcd(i,__gcd(j,k));
      cout << sum << endl;
      return 0;
    }  

Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <string>

int main(){
	unsigned long long x;
	double a = 100.;
	std::cin >> x;
	
	int i = 0;
	while(a < (double)x){
		++i;
		a = (double)((unsigned long long)a);
		a += a * 0.01;
	}

	std::cout << i << std::endl;

	return 0;	
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
  
int main(int argc, char *argv[])
{
  int n,i,j,k;
  int *A;
  int cnt,m,G[12],v;
  
  scanf("%d",&n);
  
  A=(int *)malloc(sizeof(int)*n);
  
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  
  cnt=0;
  m=1;
  G[0]=1;
  while(3*G[m-1]+1 < n)
  {
    G[m]=3*G[m-1]+1;
    m++;
  }
  
  for(i=0;i<m/2;i++)
  {
    v=G[i];
    G[i]=G[m-1-i];
    G[m-1-i]=v;
  }
  
  printf("%d\n",m);
  for(i=0;i<m;i++)
  {
    if(i!=m-1)printf("%d ",G[i]);
    else printf("%d\n",G[i]);
  }
  
  for(i=0;i<m;i++)
  {
    for(j=G[i];j<n;j++)
    {
      v=A[j];
      k=j-G[i];
       
      while(k>=0 && A[k]>v)
      {
        A[k+G[i]]=A[k];
        k-=G[i];
        cnt++;
      }
      A[k+G[i]]=v;
    }
  }
  
  printf("%d\n",cnt);
  for(i=0;i<n;i++)printf("%d\n",A[i]);
  
  return 0;
}

Measured memory_bytes: 4504
#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>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)
vector<complex<double>>  DFT(vector<complex<double>> a) {
	int n = a.size();
	if (n == 1) return a;
	vector<complex<double>> a0(n / 2), a1(n / 2);
	REP(i, n) {
		if (i % 2 == 0) {
			a0[i / 2] = a[i];
		}
		else {
			a1[i / 2] = a[i];
		}
	}
	vector<complex<double>> inversed_a0 = DFT(a0), inversed_a1 = DFT(a1);
	vector<complex<double>> inversed_a(n);
	for (int i = 0; i < n; ++i) {
		complex<double> zeta = complex<double>(cos(2 * Ma_PI * i / n), sin(2 * Ma_PI * i / n));
		inversed_a[i] = inversed_a0[i % (n / 2)] + zeta * inversed_a1[i % (n / 2)];
	}
	return inversed_a;
}
vector<complex<double>> IDFT(vector<complex<double>> inversed_a) {
	int n = inversed_a.size();
	vector<complex<double>> now = DFT(inversed_a);
	reverse(now.begin(), now.end());
	for (int q = now.size() - 1; q >= 1; --q) {
		swap(now[q], now[q - 1]);
	}
	REP(i, n) {
		now[i] /= complex<double>(n, 0);
	}
	return now;
}
vector<complex<double>> conv(vector<complex<double>> a, vector<complex<double>> b) {
	int deg = a.size() + b.size() - 1;
	int n = 1;
	while (n < deg) n <<= 1;
	a.resize(n);
	b.resize(n);
	vector<complex<double>> inversed_a = DFT(a),inversed_b = DFT(b);
	vector<complex<double>> inversed_c(n);
	REP(i, n) {
		inversed_c[i] = inversed_a[i] * inversed_b[i];
	}
	return IDFT(inversed_c);
}

vector<long long> inputs;
long long dp[200000][301] = {};
deque<long long> tmp[301];

void inserting(long long value,long long itr) {
	while (tmp[itr].empty() == false && dp[tmp[itr].back()][itr] < dp[value][itr]) {
		tmp[itr].pop_back();
	}
	tmp[itr].push_back(value);
}

int main() {
	int n, m, k;
	cin >> n >> m >> k;
	REP(i, n) {
		long long a;
		cin >> a;
		inputs.push_back(a);
	}
	REP(i, 200000) {
		REP(q, 301) {
			dp[i][q] = -LONG_INF;
		}
	}
	REP(i, n) {
		for (long long q = k - 1; q >= 1; --q) {
			if (tmp[q].empty() == true) continue;
			while(tmp[q].front() == i - m - 1) {
				tmp[q].pop_front();
			}
			dp[i][q + 1] = dp[tmp[q].front()][q] + inputs[i] * (q + 1LL);
			inserting(i, q + 1);
		}
		dp[i][1] = inputs[i];
		inserting(i, 1);
	}
	long long ans = 0;
	REP(i, n) {
		ans = max(ans, dp[i][k]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 471672
#include <bits/stdc++.h>
#define endl        '\n'
#define pi          2*acos(0.0)
#define pb(a)       push_back(a)
#define db          double
#define ld          long double
#define ll          long long
#define ull         unsigned long long
#define mod         1000000007
#define inf         1000000000000000001
#define sqr(x)      (x) * (x)
#define gcd(a, b)   __gcd(a, b)
#define lcm(a, b)   ((a/gcd(a,b)) * b)
#define debug(x) 	cerr << #x << " = " << (x) <<endl
#define all(x)      (x).begin(), (x).end()
#define unsyncIO    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)


using namespace std;

int main()
{
    //freopen("/home/taalpatar_shepai/Documents/my_codes/out.txt", "w", stdout);
    string s;
    vector<int> v;
    cin>>s;
    for (int i = 0; i < s.length(); i++) {
        int temp;
        temp = count(all(s), s[i]);
        v.pb(temp);
    }
    bool check = false;
    for (int i = 0; i < v.size(); i++) {
        if(v[i] % 2 != 0) {
            check = true;
        }
    }
    if(!check)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3564
#include<stdio.h>

int main(void) {
    int n, m, c;
    int sum, result=0;
    int b[20];
    int i, j, tmp;
    scanf("%d %d %d", &n, &m, &c);
    for (i=0; i<m; i++) {
         scanf("%d", &b[i]);
    }
    for (i=0; i<n; i++){
        sum = 0;
        for (j=0; j<m; j++){
            scanf("%d", &tmp);
            sum += (b[j] * tmp);
        }
        if (sum+c>0) {
            result += 1;
        }
    }
    printf("%d\n", result);
    return 0;
}

Measured memory_bytes: 128
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	N := nextInt()
	H := make([]int, N)
	s := make([]int, N)

	for i := 0; i < N; i++ {
		H[i] = nextInt()
	}
	m := 0
	s[N-1] = 0
	for i := 1; i < N; i++ {
		n := N - i - 1

		if H[n] < H[n+1] {
			s[n] = 0
		} else {
			s[n] = s[n+1] + 1
		}
		m = max(s[n], m)
	}

	fmt.Println(m)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 4864
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
m=ct[0][0]
idx=0
for i in range(n):
  if ct[i][1]<=t:
    m=[ct[i][0],m][ct[i][0]>m]
    idx=i
print(m if ct[idx][1]<=t else "TLE")

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

int main()
{
    int n;
    long long k;
    cin >> n >> k;
    vector<long long> a(n), b(n);
    for(int i=0; i<n; ++i)
        cin >> a[i];
    for(int i=0; i<n; ++i)
        cin >> b[i];
    sort(a.begin(), a.end());
    sort(b.rbegin(), b.rend());

    long long left = 0;
    long long right = 1000000000000LL;
    while(left < right){
        long long mid = (left + right) / 2;
        long long cnt = 0;
        for(int i=0; i<n; ++i){
            long long x = max(0LL, a[i] * b[i] - mid);
            cnt += (x + b[i] - 1) / b[i];
        }
        if(cnt <= k)
            right = mid;
        else
            left = mid + 1;
    }
    cout << left << endl;

    return 0;
}


Measured memory_bytes: 3328
function Main(input){
  var numbers = input.split(" ").map(x => Number(x));
  var flag = new Boolean(false);
  if (numbers[0] === numbers[1]){
    if (numbers[0] != numbers[2]){
      flag = true;
    }
  }else{
    if (numbers[1] === numbers[2]){
      flag = true;
    }else{
      if (numbers[0] === numbers[2]){
        flag = true;
      }
    }
  }
  if (flag === true){
    console.log("Yes");
  }else{
    console.log("No");
  }
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

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

    public static void solve(){
        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();
        }
      	Deque<Integer> b = new ArrayDeque<Integer>();
      	boolean flag = true;

      	for(int i=0;i<n;i++){
      		if(flag){
      			b.addLast(a[i]);
      		}
      		else{
      			b.addFirst(a[i]);
      		}
      		flag = !flag;
      	}

      	if(flag){
      		for(int i=0;i<n;i++){
      			if(i!=n-1){
      				System.out.print(b.pollFirst()+" ");
      			}
      			else{
      				System.out.println(b.pollFirst());
      			}
      		}
      	}
      	else{
      		for(int i=0;i<n;i++){
      			if(i!=n-1){
      				System.out.print(b.pollLast()+" ");
      			}
      			else{
      				System.out.println(b.pollLast());
      			}
      		}
      	}
    }
}

Measured memory_bytes: 96980
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define repr(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define all(x) (x).begin(),(x).end()
template<typename T> constexpr auto square(T x) { return (x)*(x); }

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

	vector<int> A(N), mt(N, 0);
	for (auto& a : A) cin >> a;

	int sign = 1;
	for (auto& a : A) {
		mt[0] += sign * a;
		sign *= -1;
	}
	mt[0] /= 2;

	rep(i, N-1) mt[i + 1] = A[i] - mt[i];

	for (auto& ans : mt) cout << ans*2 << ' ';
	cout << endl;

	return 0;
}

Measured memory_bytes: 2048
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <queue>
#include <vector>
#include <cmath>
#include <map>
#include <stack>
#include <algorithm>
typedef long long int ll;
using namespace std;
const int MAX=5000+10;
const double eps=1e-8;
const double PI=acos(-1.0);

int sgn(double x)
{
    if (fabs(x)<eps) {
        return 0;
    }
    if (x<0) {
        return -1;
    }
    else return 1;
}
struct point
{
    double x,y;
    point(){}
    point(double _x,double _y)
    {
        x=_x;y=_y;
    }
    point operator -(const point &b)const
    {
        return point(x-b.x,y-b.y);
    }
    double operator ^(const point &b)const
    {
        return x*b.y-y*b.x;
    }
    double operator *(const point &b)const
    {
        return x*b.x+y*b.y;
    }
};
int main(){
    //freopen("/Users/mac/Desktop/C++?¨????/test/test.txt", "r", stdin);
    int q;
    point p0,p1,p2,p3;
    scanf("%d",&q);
    while(q--){
        scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&p0.x,&p0.y,&p1.x,&p1.y,&p2.x,&p2.y,&p3.x,&p3.y);
        point l1=p0-p1;
        point l2=p2-p3;
        double cross=l1^l2;
        double dot=l1*l2;
        if (!sgn(dot)) {
            printf("1\n");
        }
        else if (!sgn(cross)){
            printf("2\n");
        }
        else{
            printf("0\n");
        }
    }
    return 0;
}

Measured memory_bytes: 3248
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(true){


			int n =sc.nextInt();
			int m =sc.nextInt();
			if(n+m==0)break;
			long[][]dp=new long[100][100];
			int k = sc.nextInt();
			for(int i=0;i<k;i++){
				dp[sc.nextInt()][sc.nextInt()]=-1;
			}
			dp[1][1]=1;
			for (int i = 1; i < dp.length; i++) {
				for (int j = 1; j < dp[i].length; j++) {
					if(dp[i][j]==-1)continue;
					if(dp[i-1][j]!=-1){
						dp[i][j]+=dp[i-1][j];
					}
					if(dp[i][j-1]!=-1){
						dp[i][j]+=dp[i][j-1];
					}
				}
			}
			System.out.println(dp[n][m]);
		}
	}

}

Measured memory_bytes: 21132