akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n+2);
    for (int i = 1; i <= n; i++) cin >> a[i];

    vector<int> acc(n+2);
    for (int i = 0; i + 1 < n + 2; i++) acc[i+1] = acc[i] + abs(a[i+1] - a[i]);

    for (int i = 1; i <= n; i++) {
        cout << acc[i-1] + (acc[n+1] - acc[i+1]) + abs(a[i+1] - a[i-1]) << endl;
    }
}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b;
    cin>>a>>b;
    if(b == 1)
    {
        cout<<"0"<<endl;
        return 0;
    }
    b -= a;
    a--;
    int ans = 1;
    while(b > 0)
    {
        b -= a;
        ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define test(s) \
  if (!(s))     \
    cout << "Line " << __LINE__ << ": [" << #s << "] is false" << endl;
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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;
}

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  int X, N;
  cin >> X >> N;
  vector<int> p(N);
  rep(i, N) {
    cin >> p[i];
  }

  set<int> st;
  repp(i, -1, 101) {
    st.insert(i);
  }

  rep(i, N) {
    st.erase(p[i]);
  }

  int mn = INF;
  for (int i : st) {
    chmin(mn, abs(i - X));
  }

  for (int i : st) {
    if (abs(i - X) == mn) {
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3644
import java.util.*;

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

		for (;;) {
			int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			if ("?".equals(op)) {
				break;
			}
			if ("+".equals(op)) {
				System.out.println(a + b);
			} else if ("-".equals(op)) {
				System.out.println(a - b);
			} else if ("*".equals(op)) {
				System.out.println(a * b);
			} else {
				System.out.println(a / b);
			}
		}
	}
}



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

#define f first
#define s second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define px pair<db, db>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define input(a) for (auto& el : a) cin >> el;
#define output(a) cout << '!'; for (auto& el : a) cout << el << ' '; cout << '\n'; cout.flush();
#define sz(el) int(el.size())
#define sq(a) ((a) * (a))
#define xll bitset<128>
#define xmin(a,b) a = min(a, b)
#define xmax(a,b) a = max(a, b)
#define sun(a) sort(all(a)); a.resize(unique(all(a)) - a.begin());
/**/  /// extra
//#define forn(i,n) for (int i = 0; i < n; ++i)
//#define rforn(i,n) for (int i = n - 1; i >= 0; --i)
#define bn '\n'
#define vi vector<int>
#define vii vector<vi>
#define vl vector<ll>
#define vll vector<vl>
//#define G vector<vector<pii>>
#define GVE vector<vector<edge>>
#define usi unordered_set<int>
#define usp set<pii>
/**/

using namespace std;

const int INF = 1'000'000'017;
const ll LLINF = 1'000'000'000'000'000'017LL;
const ld inf = 1.0 / 0.0;
const ld eps = 1e-9;
const int MOD = 1e9 + 7;

//mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

//uniform_int_distribution<int> uid(l, r); [l, r]
//int x = uid(rng);

const int N = 2e5 + 7;

int dp[N][2];

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

    string s;
    cin >> s;
    int n = sz(s);
    if (n == 1) {
        cout << 1;
        return 0;
    }
    dp[0][0] = 1;
    dp[1][0] = (s[0] == s[1] ? -INF : 2);
    dp[1][1] = 1;
    for (int i = 2; i < n; ++i) {
        for (int j = 0; j < 2; ++j) {
            dp[i][j] = -INF;
            for (int k = 0; k < 2; ++k) {
                if (j + 1 + k > i) {
                    break;
                }
                string t1 = "", t2 = "";
                for (int xi = i - j; xi <= i; ++xi) {
                    t1 += s[xi];
                }
                for (int xi = i - j - k - 1; xi < i - j; ++xi) {
                    t2 += s[xi];
                }
                if (t1 != t2) {
                    xmax(dp[i][j], dp[i - j - 1][k] + 1);
                }
            }
        }
    }
    cout << max(dp[n - 1][0], dp[n - 1][1]);
    return 0;
}


Measured memory_bytes: 2196
#include<bits/stdc++.h>
using namespace std;
static const int MAX = 200000;

int main() {
  int N;
  cin >> N;
  vector<int> cur(N);

  for (int i=0; i<N; i++) cin >> cur.at(i);

  int minv = cur.at(0);
  int diff = - 2000000000;
  for (int i=1; i<N; i++) {
    minv = min(cur.at(i - 1), minv);
    diff = max(cur.at(i) - minv, diff);
  }
  cout << diff << endl;
}


Measured memory_bytes: 3612
#include<stdio.h>
int TK(int x,long int sum);
void main(){
   int x;
   scanf("%d",&x);
   long int sum=0,happy;
   happy=TK(x,sum);
   printf("%ld",happy);
}
int TK(int x,long int sum){
   if(x-500>=0){
      TK(x-500,sum+1000);
   }else if(x-5>=0){
      TK(x-5,sum+5);
   }else{
      return sum;
   }
}


Measured memory_bytes: 1716
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vll vector <ll>
#define fi first
#define se second
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 5e5+100;
const ll INF = 1e9;
const ll kek=998244353;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n;
    cin>>n;
    vector <ll> a(n);
    rep(i,n)
    cin>>a[i];
    vector <ll> b(60,0);
    for (int i=0;i<n;i++)
    {
        for (int j=0;j<60;j++)
        {
            if ((((a[i])>>j)&1)==1)
                b[j]++;
        }
    }
    ll ans=0;
    ll f=1;
    for (int i=0;i<60;i++)
    {
      ans+=(f*(((n-b[i])*b[i])%mod1))%mod1;
      ans%=mod1;
      f*=2;
      f%=mod1;
    }
    cout<<ans;
}








Measured memory_bytes: 2560
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())
A, B = map(int, input().split())

for i in range(A, B + 1):
    if i % N == 0:
        print("OK")
        break
else:
    print("NG")

Measured memory_bytes: 9420
#include <math.h>
#include <limits.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

#define ipair pair<int,int>
#define rep(I,N) for(int I=0; I<N; I++)
#define rrep(I,N) for(int I=N; I>=0; I--)
#define repj(i,j,n) for(int i=j;i<n;i++)

#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()

#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl

int main() {
  int N;
  int h[100001];
  int dp[100001];
  cin >> N;
  rep(i, N) {
    cin >> h[i];
  }
  rep(i, N) {
    dp[i] = INT_MAX;
  }

  dp[0] = 0;
  rep(i, N) {
    repj(s, 1, 3) {
      dp[i+s] = min(dp[i+s], dp[i] + abs(h[i] - h[i+s]));
    }
  }
  printf("%d\n", dp[N-1]);

  return 0;
}


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

using namespace std;

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long double ld;

const int inf = 1e9;
const ll inf64 = 1e18;

int main() {

#ifdef debug
    freopen("input.txt", "r", stdin);
#endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int h, w, a, b;

    cin >> h >> w >> a >> b;

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (i < b && j < a || i >= b && j >= a) {
                cout << "1";
            } else {
                cout << "0";
            }
        }
        cout << "\n";
    }

    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;

Int N, K;
vector<Int> A(200010, 0), S(200010, 0);

Int id(Int i){
    Int res = S[i] - i;
    if(res >= 0){
        res %= K;
    } else {
        res = (K - (-res) % K) % K;
    }
    return res;
}

int main(){
    cin >> N >> K;
    rep1(i, N){
        cin >> A[i];
        S[i] = S[i-1] + A[i];
        S[i] %= K;
    }

    map<Int,Int> M;

    Int ans = 0;
    rep1(j,N){
        Int R = j-1, L = j-K;
        M[id(R)]++;
        if(L >= 0){
            M[id(L)]--;
        }

        ans += M[id(j)];
    }

    cout << ans << endl;




}

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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  string s;
  cin >> s;
  int a = 0, z = s.size() - 1;
  while (s[a] != 'A') ++a;
  while (s[z] != 'Z') --z;
  cout << z - a + 1 << endl;
}



Measured memory_bytes: 720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define all(x) (x).begin(), (x).end()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end());
const long long INF = 1LL << 60;
// map<int,int> mp;

int main() {
  double D,T,S;
  cin >> D>>T>>S ;

if(D/T <=S){
  cout << "Yes" << endl;
}else{
  cout << "No" << endl;

}



}

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

const int MAX_N = 100;

int main() {
	int N, A[2][MAX_N];
	std::cin >> N;
	for(int i = 0; i < 2; ++i) {
		for(int j = 0; j < N; ++j) {
			std::cin >> A[i][j];
		}
	}

	int ans = 0;
	for(int x = 0; x < N; ++x) {
		int sum = 0;
		for(int j = 0; j <= x; ++j) {
			sum += A[0][j];
		}
		for(int j = x; j < N; ++j) {
			sum += A[1][j];
		}
		ans = std::max(ans, sum);
	}

	std::cout << ans << std::endl;
 }


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000007

using namespace std;
typedef long long ll;

mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

template <typename T> void read(T &x) {
  x = 0;
  char c = getchar();
  T sig = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-')
      sig = -1;
  for (; isdigit(c); c = getchar())
    x = (x << 3) + (x << 1) + c - '0';
  x *= sig;
}

class Solution {
public:
  void solve() {
    ll x, k, d;
    read(x), read(k), read(d);
    if (x < 0)
      x = -x;
    ll f = x / d;
    if (f >= k)
      printf("%lld", x - k * d);
    else {
      ll rem = x % d;
      if ((f - k) % 2 == 0)
        printf("%lld", rem);
      else
        printf("%lld", d - rem);
    }
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  Solution solution = Solution();
  solution.solve();
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
int H, W;
vector< vector<int> > memo;
vector< vector<int> > m;
int dy[] = {0,1}, dx[] = {1, 0};

int dfs(int y, int x){
  if(memo[y][x] != INT_MAX)
    return memo[y][x];
  if(y == H-1 && x == W-1)
    return 0;
  int n[] = {INT_MAX, INT_MAX};
  for(int p=0; p < 2; p++){
    int ny = y + dy[p], nx = x + dx[p];
    if(ny < H && nx < W){
      n[p] = dfs(ny, nx) + m[y][x];
    }
  }
  memo[y][x] = min(n[0], n[1]);
  return memo[y][x];
}

int main(void){
  cin >> H >> W;
  m = vector< vector<int> > (H, vector<int>(W));
  memo = vector< vector<int> > (H, vector<int>(W, INT_MAX));
  for(int p = 0; p < H; p++){
    string tmp; cin >> tmp;
    for(int j=0; j < tmp.length(); j++)
      m[p][j] = tmp[j] - '0';
  }

  cout << dfs(0,0) << endl;

  return 0;
}

Measured memory_bytes: 1268
# gcdをmathからimport
from math import gcd
n = int(input())
ans = 0

for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            # gcd(i,j)とkのgcdを計算
            # 1番小さい数字が制限になる
            ans += gcd(gcd(i, j), k)
 
print(ans)

Measured memory_bytes: 9172
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;
using namespace std;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
template <typename TL, typename TR>
inline void print(const std::vector<std::pair<TR,TL>>& rhs){
    std::cout<<" = [";
    uint i=0;
    for(; i<rhs.size()-1; ++i){ std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"], "; }
    std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"]]" << endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

int inner_product(const vector<int>& vA, const vector<int>& vB){
    int ret=0;
    for(uint i=0; i<vA.size(); ++i){
        ret += vA[i] * vB[i];
    }
    return ret;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int N, M, C; cin >> N >> M >> C;
    vector<int> vB(M); for(int i=0; i<M; ++i){ cin >> vB[i]; }
    vector<vector<int>> vvA(N, vector<int>(M)); for(int vi=0; vi<N; ++vi){ for(int i=0; i<M; ++i){ cin >> vvA[vi][i]; } }
    
    int num=0;
    for(int i=0; i<N; ++i){
        if( inner_product(vvA[i], vB) + C > 0 ){ ++num; };
    }
    cout << num << endl;
    
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) throws IOException {
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		
		String[] inputs = reader.readLine().split(" ");
		int n = Integer.parseInt(inputs[0]);
		int k = Integer.parseInt(inputs[1]);
		
		int[] weights = new int[n];
		int sum = 0;
		int max = Integer.MIN_VALUE;
		for (int i = 0; i < n; i++) {
			int weight = Integer.parseInt(reader.readLine());
			weights[i] = weight;
			sum += weight;
			max = Math.max(max, weight);
		}
		
		int start = max;
		int end = sum;
		int capacity = 0;
		while (start <= end) {
			capacity = start + (end - start) / 2;
			boolean canAllocate = checkAllocation(weights, k, capacity);
			if (!canAllocate) {
				start = capacity + 1;
			} else {
				if (start == end) {
					break;
				}
				end = capacity;
			}
		}
		System.out.println(capacity);
	}

	private static boolean checkAllocation(int[] weights, int k, int capacity) {
		
		int num = 1;
		int current = 0;

		for (int i = 0; i < weights.length; i++) {
			int weight = weights[i];
			if (current + weight > capacity) {
				current = weight;
				num++;
				if (num > k || current > capacity) {
					return false;
				}
			} else {
				current += weight;
			}
		}
		return true;
	}
}


Measured memory_bytes: 35324
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k == x:
                cnt+=1

print(cnt)

Measured memory_bytes: 39536
import java.util.*;
public class Main {
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	// 整数の入力
	int a = sc.nextInt();

	// 出力
	if (a == 25){
	    System.out.println("Christmas");
	}else if (a == 24){
	    System.out.println("Christmas Eve");
	}else if (a == 23){
	    System.out.println("Christmas Eve Eve");
	}else if (a == 22){
	    System.out.println("Christmas Eve Eve Eve");
	}
    }
}


Measured memory_bytes: 20564
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <math.h>
#include <complex>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const ll INF = 1e18;


int main() {
	int a[3][3];
	rep(i, 0, 3) rep(j, 0, 3) {
		cin >> a[i][j];
	}
	string ans = "Yes";
	int b[2] = { a[0][0] - a[1][0],a[1][0] - a[2][0] };
	rep(i, 1, 3) {
		rep(j, 0, 2) {
			if (b[j] != a[j][i] - a[j + 1][i]) {
				ans = "No";
			}
		}
	}
	b[0] = a[0][0] - a[0][1]; b[1]= a[0][1] - a[0][2];
	rep(i, 1, 3) {
		rep(j, 0, 2) {
			if (b[j] != a[i][j] - a[i][j + 1]) {
				ans = "No";
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

n,r=get_i
if n<10
  puts r+100*(10-n)
else
  puts r
end

Measured memory_bytes: 1788
N = int(input())
numbers = [int(i) for i in input().split()]

d = set()
s = set()

for n in numbers:
    if n in s: 
        d.add(n)
    else :
        s.add(n) 

M = max(s) 

X = [1 for _ in range(M+1)] 

for a in s:
    if a in d:
        X[a] = 0 
    for i in range(2*a, M+1, a): 
        X[i] = 0
    
output = 0

for n in numbers:
    if X[n] == 1:
        output += 1
print(output)

Measured memory_bytes: 39240
function main(input) {
  // 入力値の分離
  param = input.split(" ");
  var calc = 0;
  for(var i = 0; i < param.length; i++){
    calc += parseInt(param[i]);
  }
  var base = 1+2+3+4+5;
  const result = base - calc;
  console.log(parseInt(result));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));parseInt

Measured memory_bytes: 29636
#include <iostream>
#include <limits>
#include <cmath>
using namespace std;
int main()
{
    int n;
    cin >> n;
    double t,a;
    cin >> t >> a;
    double min = numeric_limits<double>::max();
    int index = 1;
    for(int i=1; i<=n; i++)
    {
        int x;
        cin >> x;
        double tmp = t - 0.006 * x;
        double diff = abs(a - tmp);
        if(diff < min)
        {
            min = diff;
            index = i;
        }
    }
    cout << index << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
signed main(){
int n,d;int sum=0;
cin>>n>>d;d*=d;
while(n--){
    int x,y;
    cin>>x>>y;
    x*=x,y*=y;
    if(x+y<=d)sum++;
}
cout<<sum<<endl;
}

Measured memory_bytes: 3632
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))

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

using namespace std;
#define inf 1000000000
#define unvisited -1
#define visited 1
#define eps 1e-9
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define uint64 unsigned long long
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define debug if(true)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

int main(){
	ll h;
	scanf("%lld",&h);
	ll ans = 0;
	ll tambah = 1;
	while(h){
		ans += tambah;
		tambah *= 2LL;
		h /= 2LL;
	}
	printf("%lld\n",ans);
	return 0;
};

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    vector <char>v,v1,v2;
    int a,b,i,j,t,sum,n,cunt1=0,cunt2=0,cunt=0,tem=0,k;
    string s;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
        if(s[i]=='A')
            cunt1=1;
        else cunt2=1;

    }
    if(cunt1==1&&cunt2==1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define CMAX(m, x)  m = max(m,x);
#define CMIN(m, x)  m = min(m,x);
#define itn int
typedef long long lint;
const int INF = 1e9;
const lint LINF = 1e18;
int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    while(1){
        c -= b;
        a -= d;
        if(c <= 0 || a <= 0)
            break;
    } 
    if(c <= 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
 
#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
 
int main(){
  string right = "qwertasdfgzxcvb";
  string left = "yuiophjklnm";

  while(1){

	string str;
	cin >> str;

	if(str[0]=='#')
	  break;

	int size = str.size();
	int r = right.size();
	int x[500]={0};
	int ans=0;

	REP(i,size){
	  REP(j,r){
		if(str[i]==right[j]){
		  x[i]=1;
		}
	  }
	  if(i!=0&&x[i]!=x[i-1])
		ans++;
	}
	cout << ans<<endl;
  }
}

Measured memory_bytes: 1200
package main

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

const mod int = 1e9 + 7

func main() {
	n := readInt()

	zeros := make([]int, 60)
	ones := make([]int, 60)
	abins := make([][]byte, n)
	for i := 0; i < n; i++ {
		a := readInt()
		abins[i] = []byte(fmt.Sprintf("%060b", a))

		for j, b := range abins[i] {
			if b == '0' {
				zeros[j]++
			} else {
				ones[j]++
			}
		}
	}

	times := make([]int, 60)
	for i := 0; i < n-1; i++ {
		for j, b := range abins[i] {
			if b == '0' {
				zeros[j]--
				times[j] += ones[j]
			} else {
				ones[j]--
				times[j] += zeros[j]
			}
		}
	}

	ans := 0
	for i := range times {
		ans += 1 << uint(60-i-1) % mod * (times[i] % mod)
		ans %= mod
	}

	fmt.Println(ans)
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

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

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 37248
// Hail god Yato
 
#include <bits/stdc++.h> 
using namespace std;
 
#define add(x) accumulate(x)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end() 
#define rep(i, a, b) for (int i=a; i<(b); i++)
#define hs ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
const ll mod = 1000000007;
const ll INF = 1e18;
const ll MAX = 2002;
//
//
ll store[MAX][MAX];
vector<pll> vec;
ll n;
                ll dp(int idx, int l, int r){
                        if(l > r)
                                return 0;
                        ll &ans = store[l][r];
                        if(ans!=-1)
                                return ans;
                        ans = abs(vec[idx].second - l)*vec[idx].first + dp(idx+1, l+1, r);
                        ans = max(ans, abs(r-vec[idx].second)*vec[idx].first + dp(idx+1, l ,r-1));

                        return ans;
                }
                void solve(){
                        // ll n;
                        cin>>n;
                        vec.resize(n);
                        memset(store, -1, sizeof(store));
                        for(int i = 0; i < n; i++){
                                cin>>vec[i].first;
                                vec[i].second = i;
                        }
                        sort(vec.begin(), vec.end());
                        reverse(vec.begin(), vec.end());
                        cout<< dp(0, 0, n-1);
                }
                int main(){ 
                        hs;
                        ll t;
                        t=1;
                        // cin>>t;
                        for (int i=1; i<=t; i++){
                                //cout<<"Case #"<<i<<": ";
                                solve();
                         }
        return 0; 
}         
 

Measured memory_bytes: 35156
#include <bits/stdc++.h>
using namespace std;
#define hyperspeed ios::sync_with_stdio(false);cin.tie(NULL);
#define ll long long  
#define ull unsigned long long
#define ui unsigned int
#define li long int
#define uli unsigned long int
#define pb push_back
#define ld long double
#define vi vector<int>
#define vvi vector<vector<int>>
#define vli vector<li>
#define vll vector<ll>
#define all(v) v.begin(),v.end()
#define pi pair<int,int>
#define FOR(i,s,n) for(auto i=s;i<n;++i)
#define FORN(i,s,n) for(auto i=s;i<=n;++i)
#define FORR(i,s,n) for(auto i=s;i>=n;--i)
#define FORE(i,a) for(auto i : a)
#define mp make_pair
const int MOD = 1e9+7;

void solve(int t) {
    int score;
    cin >> score;
    if(score>=400 and score<=599) {
        cout << 8;
    }
    else if(score>=600 and score <=799)
        cout << 7;
    else if(score>=800 and score<=999)
        cout << 6;
    else if(score>=1000 and score<=1199)
        cout << 5;
    else if(score>=1200 and score<=1399)
        cout << 4;
    else if(score>=1400 and score<=1599)
        cout << 3;
    else if(score>=1600 and score<=1799)
        cout << 2;
    else 
        cout << 1;
}

int32_t main()
{
    hyperspeed
    int test=1;
    int t = 1;
    while(test--) {
        solve(t);
        t++;
    }
    return 0;
}

//--n1m5


Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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; }

//INT_MAX	2,147,483,647 = 2*1.0e9

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

  int ans = C - (A - B);
  if(ans < 0) ans = 0;
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int a,x;

    scanf("%d", &a);

    int b[a];

    for(int i = 0; i < a; i ++){
        scanf("%d",&x);
        b[x - 1] = i + 1;
    }
    for(int i = 0; i < a; i ++){
        printf("%d ",b[i]);
    }
    return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	string S;
	cin >> S;
	
	int cnt = S.find('A') != string::npos;
	cnt += S.find('B') != string::npos;
	puts([&] {
		return cnt >= 2;
	}() ? "Yes": "No");
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))
#define PRECISION(x) std::fixed << std::setprecision(x)

using namespace std;

using ll = long long;
using VI = std::vector<int>;
using VI2D = std::vector<vector<int>>;
using VLL = std::vector<long long>;
using VLL2D = std::vector<vector<long long>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T, std::size_t N>
struct make_vector_type {
	using type =
		typename std::vector<typename make_vector_type<T, (N - 1)>::type>;
};

template <typename T>
struct make_vector_type<T, 0> {
	using type = typename std::vector<T>;
};

template <typename T, size_t N>
auto make_vector_impl(const std::vector<std::size_t>& ls, T init_value) {
	if constexpr(N == 0) {
		return std::vector<T>(ls[N], init_value);
	} else {
		return typename make_vector_type<T, N>::type(
			ls[N], make_vector_impl<T, (N - 1)>(ls, init_value));
	}
}

template <typename T, std::size_t N>
auto make_vector(const std::size_t (&ls)[N], T init_value) {
	std::vector<std::size_t> dimensions(N);
	for(int i = 0; i < N; i++) {
		dimensions[N - i - 1] = ls[i];
	}
	return make_vector_impl<T, N - 1>(dimensions, init_value);
}

template <typename T>
std::vector<T> make_vector(std::size_t size, T init_value) {
	return std::vector<T>(size, init_value);
}

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

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

	int r = count(ALL(s), 'R');
	int result = r;

	if(r == 2 && s[1] == 'S') {
		result = 1;
	}
	cout << result << endl;
	return 0;
}


Measured memory_bytes: 3544
import itertools

n = int(input())
names = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
for i in range(n):
    initial = input()[0]
    names[initial] = names.get(initial, 0) + 1

ans = 0
for a, b, c in itertools.combinations('MARCH', 3):
    ans += names[a] * names[b] * names[c]
print(ans)


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

int compare (const void * a, const void * b)
{
  return ( *(int*)a - *(int*)b );
}

int main(){
    int N,*L,i,sum=0;
    cin >> N;
    L = new int[2*N];
    for(i=0;i<2*N;i++){
        cin >> L[i];
    }
    qsort(L,2*N,sizeof(int),compare);
    for(i=0;i<2*N;i+=2){
        sum += L[i];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin >> s;
	set<string> v = { "KIHBR","KIHBRA","KIHBAR", "KIHBARA", "KIHABR",
		"KIHABRA", "KIHABAR", "KIHABARA", "AKIHBR", "AKIHBRA", "AKIHBAR", "AKIHBARA",
		"AKIHABR", "AKIHABRA", "AKIHABAR","AKIHABARA" };
	if (v.count(s))cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll = long long;
using P = pair<int,int>;
void Yes() {
    cout << "Yes" << endl;
}
void No() {
    cout << "No" << endl;
}
int main(void) {
    double pi = 3.1415926535;
    double r; cin >> r;
    printf("%.10f\n", 2*pi*r);
}


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

using Int = long long;
const char newl = '\n';

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}
template<typename T=int>
vector<T> read(size_t n){
  vector<T> ts(n);
  for(size_t i=0;i<n;i++) cin>>ts[i];
  return ts;
}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  string s;
  cin>>s;
  int n=s.size();
  vector<int> sm(n+1,0);
  for(int i=0;i<n;i++)
    sm[i+1]=sm[i]+(s[i]=='1'?1:-1);

  vector<int> mx(n+1);
  for(int i=n;i>=0;i--){
    mx[i]=sm[i];
    if(i+1<=n) chmax(mx[i],mx[i+1]);
  }

  int ans=n;
  for(int k=0;k<2;k++){
    int lim=mx[0]+k;
    int cur=0;
    int num=0;
    int low=0,hgh=0;
    for(int i=0;i<n;i++){
      if(s[i]=='1'){
        cur+=1;
        chmin(low,cur);
        chmax(hgh,cur);
        continue;
      }
      if(s[i]=='0'){
        cur-=1;
        chmin(low,cur);
        chmax(hgh,cur);
        continue;
      }
      assert(s[i]=='?');
      if(mx[i+1]+(num+1)*2<=lim){
        num++;
        cur+=1;
      }else{
        cur-=1;
      }
      chmin(low,cur);
      chmax(hgh,cur);
    }

    chmin(ans,hgh-low);
  }
  cout<<ans<<newl;
  return 0;
}


Measured memory_bytes: 12152
n, q = map(int,input().split())
s = input()
ruiseki = [0]*(n+1)
for i in range(n):
    if s[i:i+2] == 'AC':
        ac = 1
    else:
        ac = 0
    ruiseki[i+1] = ruiseki[i] + ac
ans_list = []
for i in range(q):
    l,r = map(int,input().split())
    ans_list.append(ruiseki[r-1]-ruiseki[l-1])
for i in range(q):
    print(ans_list[i])

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

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

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

    int N, M;
    cin >> N >> M;
    int A[N];
    map<ll, ll> m;
    m[0]++;

    ll sum = 0;
    rep(i, 0, N) {
        cin >> A[i];
        sum += A[i];
        m[sum % M]++;
    }

    ll rsl = 0;
    for(auto it = m.begin(); it != m.end(); it++) {
        rsl += (it->second * (it->second - 1)) / 2;
    }

    cout << rsl << endl;
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(n);
    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; i++) cin >> c[i];
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    vector<ll> v(n);
    for(int i = 0; i < n; i++)
    {
        int pos = upper_bound(c.begin(), c.end(), b[i]) - c.begin();
        v[i] = n - pos;
    }
    for(int i = n-2; i >= 0; i--)
    {
        v[i] += v[i+1];
    }
    ll ans = 0;
    for(int i = 0; i < n; i++)
    {
        int pos = upper_bound(b.begin(), b.end(), a[i]) - b.begin();
        ans += v[pos];
    }
    cout << ans << endl;
}


Measured memory_bytes: 2176
/*input
1700
*/

#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <math.h>
#include <iomanip>
#include <utility>
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;
using ll = long long;
using ld = long double;

ll MOD = 1000000007;
const int SINF = 1000000009;
const ll INF =  1000000000000000018;

#define sp          cout << " "
#define nl          cout << "\n"
#define inv(a)      powr((a), (MOD - 2))
#define all(c)      (c).begin(),(c).end()
#define rep(i,a,b)  for(ll i = (a); i < (b); i ++)
#define prec(n)     cout << fixed << setprecision(n)
#define PI          3.14159265358979323846264338327951
#define ifalse      ios_base::sync_with_stdio(false), cin.tie(NULL)

template<typename T> void toInt(string s, T &a) { istringstream(s) >> a; }
ll gcd(ll a, ll b) { ll t; while(a) { t = a; a = b%a; b = t; } return b; }
ll sub(ll a, ll b) { a -= b; a = (a + MOD) % MOD; return a; }
ll mul(ll a, ll b) { return ((a % MOD) * (b % MOD)) % MOD; }
ll add(ll a, ll b) { a += b; a %= MOD; return a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll powr(ll a, ll b) {
  ll x = 1LL;
  while(b) {
    if(b & 1) x = mul(x, a);
    a = mul(a, a), b >>= 1;
  }
  return x;
}

bool check(ll n)
{
  if(n == 1) return 0;
  if(n == 2 or n == 3) return 1;
  if(n%2 == 0 or n%3 == 0) return 0;
  for(ll i = 5; i*i <= n; i += 6) if(n%i == 0 or n % (i+2) == 0) return 0;
  return 1;
}

/*********************************START**********************************/
const int N = 100005;

int main()
{
  ifalse; 
  string s;
  cin >> s;
  // vector < int > v;
  // for(int i = 0; i < 4; i ++) {
  //   v.push_back(int(s[i] - '0'));
  // }
  map < int, int > mp;


  map < string, int > mp1, mp2;

  for(int i = 0; i <= 99; i ++) {
    string s1 = to_string(i);
    if(s1.length() == 1) {
      s1 = "0" + s1;
    }
    for(int j = 1; j <= 12; j ++) {
      string s2 = to_string(j);
      if(s2.length() == 1) {
        s2 = "0" + s2;
      }
      string s3 = s1 + s2;
      mp1[s3] = 1;
      string s4 = s2 + s1;
      mp2[s4] = 1;
    } 
  }
  // for(auto x: mp1) {
  //   cout << x.first, nl;
  // }
  if(mp1[s] == 1 and mp2[s] == 1) {
    cout << "AMBIGUOUS";
  }
  else if(mp1[s] == 1) {
    cout << "YYMM";
  }
  else if(mp2[s] == 1) {
    cout << "MMYY";
  }
  else {
    cout << "NA";
  }
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C;
  cin>>A>>B>>C;
  if(A<C&&B>C){
    cout<<"Yes"<<endl;
  }
  else if(A>C&&B<C){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define debug(a) cout << #a ": " << a << endl
using namespace std;
typedef long long ll;
const double PI = acos(-1.0);
int main(void){
    IOS;
    int R; cin >> R;
    cout << setprecision(10) << fixed << 2*PI*R << endl;
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll fact(ll x){
	if(x==0) return 1;
	return x * fact(x-1) % mod;
}

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

    ll N;
    cin >> N;
    vector<ll> x(N);
    REP(i, N) cin >> x[i];

    ll res = 0;
    ll tmp = 0;
    REP(i, N-1){
    	tmp += modinv(i+1, mod);
    	tmp %= mod;

    	res += (x[i+1]-x[i]) * tmp % mod;
    	res %= mod;
    }

    res *= fact(N-1);
    res %= mod;

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#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() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    char a,b,c,d,sign[3];
    cin>>a>>b>>c>>d;
    int num[4];
    num[0]=a-'0';
    num[1]=b-'0';
    num[2]=c-'0';
    num[3]=d-'0';
    for(int bit=0;bit<(1<<3);++bit){
        int sum=num[0];
        rep(i,3){
            if(bit&(1<<i)){
                sum+=num[i+1];
                sign[i]='+';
            }
            else{
                sum-=num[i+1];
                sign[i]='-';
            }
        }
        if(sum==7){
            rep(j,3){
                cout<<num[j]<<sign[j];
            }
            cout<<num[3]<<"=7"<<endl;
            break;
        }
    }


    return 0;
}

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

set<string> s;

int main()
{
	int n,ans=0;
	cin>>n;
	
	for (int i=1;i<=n;++i){
		string x;
		cin>>x;
		
		ans++;
		if (s.find(x)!=s.end())
			ans--;
		else
			s.insert(x);
	}
	
	cout<<ans<<endl;
}

Measured memory_bytes: 19228
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        out = new PrintWriter(new OutputStreamWriter(System.out));
        CF_Reader in = new CF_Reader();

        long X = in.intNext();
        solve(X);

        out.close();
    }

    static void solve(long X) {
        HashMap<Long, Long> seen = new HashMap<>();
        long toFive = 0;
        long i = 0;
        while (toFive <= Long.MAX_VALUE - 1) {
            toFive = i*i*i*i*i;
            seen.put(toFive, i);
            long diff = Math.abs(X - toFive);
            if (seen.containsKey(diff)) {
                long other = seen.get(diff);
                if (diff + toFive <= X) other *= -1;
                out.printf("%d %d\n", i, other);
                return;
            }
            i++;
        }
    }

    static class CF_Reader {
        BufferedReader br;
        StringTokenizer st;

        public CF_Reader() throws IOException {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine().trim());
            return st.nextToken();
        }

        long longNext() throws IOException {
            return Long.parseLong(next());
        }

        int intNext() throws IOException {
            return Integer.parseInt(next());
        }

        double doubleNext() throws IOException {
            return Double.parseDouble(next());
        }

        char charNext() throws IOException {
            return next().charAt(0);
        }

        public int[] nextIntArray(final int n) throws IOException {
            final int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = intNext();
            return a;
        }

        public long[] nextLongArray(final int n) throws IOException {
            final long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = longNext();
            return a;
        }

        String line() throws IOException {
            return br.readLine().trim();
        }
    }
}


Measured memory_bytes: 34344
N,M,K = map(int,input().split())

A = list(map(int,input().split()))
B = list(map(int,input().split()))

a_sum = [0 for i in range(N+1)]
for i in range(N):
    a_sum[i+1] = a_sum[i] + A[i]

b_sum = [0 for i in range(M+1)]
for i in range(M):
    b_sum[i+1] = b_sum[i] + B[i]

ans = 0

for i in range(N+1):
    t = a_sum[i]
    l = 0
    r = len(b_sum)
    while(l+1<r):
        c = (l+r)//2
        if t+b_sum[c]<=K:
            l = c
        else:
            r = c
    if a_sum[i]+b_sum[l]<=K:
        ans = max(ans,i+l)

print(ans)

Measured memory_bytes: 48912