akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

string a[300000];
int b[300000];

int masu[35][35];
int rui[35][35];
signed main(){
    int n;
    cin >> n;
    REP(i,n){
        //cin >> a[i];
        //b[i] = (int)(a[i] * 10000000000 + eps);
        cin >> a[i];
        int f1 = -1;
        REP(j,a[i].size()){
            if(a[i][j] == '.') f1 = j;
        }
        if(f1==-1){
            b[i] = stoll(a[i]);
            b[i] *= 10000000000;
        }
        else{
            string nn = a[i].substr(0,f1) + a[i].substr(f1+1,a[i].size()-f1-1);
            b[i] = stoll(nn);
            REP(ttt,10-(a[i].size()-f1-1)){
                b[i] *= 10;
            }

        }
    }
    REP(i,n){
        //cout << b[i] << endl;
    }
    REP(i,n){
        int c2 = 0;
        int c5 = 0;
        while(b[i]%2==0 && c2<21){
            c2 ++;
            b[i]/=2;
        }
        while(b[i]%5==0&& c5<21){
            c5++;
            b[i]/=5;
        }
        masu[c2][c5] ++;
    }
    REP(i,21){
        REP(j,21){
            //rui[20-i][20-j] = rui[21-i][20-j] + rui[20-i][21-j] - rui[21-i][21-j] + masu[20-i][20-j];
        }
    }
    int ans = 0;
    REP(i,25){
        REP(j,25){
            REP(i2,25){
                REP(j2,25){
                    if(i+i2 >= 20 && j+j2 >= 20){
                        ans += masu[i][j] * masu[i2][j2];
                    }
                }
            }


            if(i>=10 && j>=10){
                //ans += masu[i][j] * (rui[20-i][20-j]-1);
            }
            else{
                //ans += masu[i][j] * rui[20-i][20-j];
            }         
        }
    }
    REP(i,25){
        REP(j,25){
            if(2 * i >=20 && 2*j>=20){
            ans -= masu[i][j];
        }

        }
        
    }
    cout <<ans/2 << endl;



    return 0;
}

Measured memory_bytes: 14496
#include <iostream>
#define MOD 1000000007
using namespace std;

int dp[101][4][4][4];

int main(){
    int N,i,c0,c1,c2,c3,ans=0;
    cin >> N;
    for(c1=0;c1<4;c1++){
        for(c2=0;c2<4;c2++){
            for(c3=0;c3<4;c3++){
                if(c1==1 && c2==2 && c3==0) continue;
                if(c1==2 && c2==0 && c3==1) continue;
                if(c1==2 && c2==1 && c3==0) continue;
                dp[3][c1][c2][c3] = 1;
            }
        }
    }
    for(i=4;i<=N;i++){
        for(c0=0;c0<4;c0++){
            for(c1=0;c1<4;c1++){
                for(c2=0;c2<4;c2++){
                    if(c0==1 && c1==2 && c2==0) continue;
                    if(c0==2 && c1==0 && c2==1) continue;
                    if(c0==2 && c1==1 && c2==0) continue;
                    for(c3=0;c3<4;c3++){
                        if(c0==2 && c2==1 && c3==0) continue;
                        if(c0==2 && c1==1 && c3==0) continue;
                        dp[i][c0][c1][c2] += dp[i-1][c1][c2][c3];
                        dp[i][c0][c1][c2] %= MOD;
                    }
                }
            }
        }
    }
    for(c1=0;c1<4;c1++){
        for(c2=0;c2<4;c2++){
            for(c3=0;c3<4;c3++){
                ans += dp[N][c1][c2][c3];
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 1LL << 61;
const ll mod = 1000000007LL;
//const ll mod = 998244353LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,0,-1,0,1,1,-1,-1 }, dy[9] = { 0,0,1,0,-1,1,-1,1,-1 };
#define endl '\n'
#pragma endregion
#define MAX 222222





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



  cin >> n >> m;

  ll sum;
  rep(i, n) ans += m + i;

  rep(i, n) {
    sum = 0;
    rep(j, n) {
      if (i == j) continue;
      sum += m + j;
    }
    if (llabs(sum - ans) < mi) {
      mi = llabs(sum - ans);
      tmp = sum;
    }
  }

  cout << tmp << endl;

  

  return 0;
}

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

dp=[False]*(k+1)
for i in range(0,k+1):
    for j in a:
        if i>=j and  dp[i-j]==False:
            dp[i]=True 
            

print ("First" if dp[k] else "Second")

Measured memory_bytes: 3828
#include <bits/stdc++.h>
#define ri register
//#define int long long
#define E (n+1)
using namespace std; const int N=210;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
int res,X;
signed main()
{
    int n;
    string s;
    n=read();
    cin>>s;
    for(ri int i=0;i<n;i++)
    {
        if(s[i]=='I') X++, res=max(res,X);
        if(s[i]=='D') X--, res=max(res,X);
    }
    printf("%lld\n",res);
    return 0;
}

Measured memory_bytes: 3724
/*
ID: y1197771
PROG: test
LANG: C++
*/
#include<bits/stdc++.h>
#define pb push_back
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
#define dbg(x) cout << #x << " at line " << __LINE__ << " is: " << x << endl
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
const int maxn = 1e5 + 10;
int n;
int t[maxn];
int m;
void solve() {
    while(cin >> n) {
        int s = 0;
        for (int i = 1; i <= n; i++) {
                cin >> t[i]; s += t[i];
        }
        cin >> m;
        int x, y;
        while(m--) {
            cin >> x >> y;
            cout << s - t[x] + y << endl;
        }
    }
}
int main() {
   // freopen("test.in", "r", stdin);
    //freopen("test.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    solve();
    return 0;
}


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

int main() {
    //
    int num;
    long long a=0;
    cin >> num;

    vector<long long> vec(num);
    for (long long i = 0; i < num; i++){
        cin >> vec.at(i);
        a = a ^ vec.at(i);
    }

    for (long long i = 0; i < num; i++){
        cout << (a ^ vec.at(i)) << " ";
    }

    //
}


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

const int MOD = 1e9 + 7;

ll sum(ll l, ll r) { return (l + r) * (r - l + 1) / 2; }

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

  ll ans = 0;
  for(int i = k; i < n + 2; i++) {
    ll a = sum(0, i - 1);
    ll b = sum(n - i + 1, n);
    ans += b - a + 1;
  }

  cout << ans % MOD;
}


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


  struct Dice {
    int dice_1;
    int dice_2;
    int dice_3;
    int dice_4;
    int dice_5;
    int dice_6;
  };

  void direct(char c, struct Dice *d) {
    int tmp;

    switch(c) {
      case 'N':
        tmp = d->dice_1;
        d->dice_1 = d->dice_2;
        d->dice_2 = d->dice_6;
        d->dice_6 = d->dice_5;
        d->dice_5 = tmp;
        break;
      case 'W':
        tmp = d->dice_1;
        d->dice_1 = d->dice_3;
        d->dice_3 = d->dice_6;
        d->dice_6 = d->dice_4;
        d->dice_4 = tmp;
        break;
      case 'S':
        tmp = d->dice_1;
        d->dice_1 = d->dice_5;
        d->dice_5 = d->dice_6;
        d->dice_6 = d->dice_2;
        d->dice_2 = tmp;
        break;
      case 'E':
        tmp = d->dice_1;
        d->dice_1 = d->dice_4;
        d->dice_4 = d->dice_6;
        d->dice_6 = d->dice_3;
        d->dice_3 = tmp;
        break;
    }
    return;
  }

int main() {
  int n = 0, i, j;
  int a, b;
  struct Dice dice;
  scanf("%d%d", &dice.dice_1, &dice.dice_2);
  scanf("%d%d", &dice.dice_3, &dice.dice_4);
  scanf("%d%d\n", &dice.dice_5, &dice.dice_6);

  scanf("%d\n", &n);

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

    scanf("%d%d", &a, &b);
    // ??¨??¢??????????????????
    for (i = 0; i < 4; i++) {
      direct('N', &dice);
      if (dice.dice_2 == b)
        break;
    }
    if (dice.dice_2 != b) {
      direct('W', &dice);
      for (i = 0; i < 4; i++) {
        direct('N', &dice);
        if (dice.dice_2 == b)
          break;
      }
    }
    // ?????¢?????????
  for (i = 0; i < 4; i++) {
    direct('W', &dice);
      if (dice.dice_1 == a)
        break;
  }

  printf("%d\n", dice.dice_3);
}
  return 0;

}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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; }
using namespace std;

int main(){
    Init();
    ll n, d; cin >> n >> d;
    ll ans = 0;
    rep(i, n){
        ll x, y; cin >> x >> y;
        if(sqrt(x*x+y*y) <= d) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3696
#include<bits/stdc++.h>
#define ll long long
const double PI= 3.141592653589793238;
using namespace std;
void solve()
{
	double r;cin>>r;
	
	double ans=2*PI*r;
	printf("%.16f",ans);

}
int main()
{
	//int t;cin>>t;
	//while(t--)
	solve();
}


Measured memory_bytes: 3788
#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() {
  int N;
  vector<int> c(4, 0);

  cin >> N;
  rep(i, N) {
    string s;
    cin >> s;
    if (s == "AC") c[0]++;
    if (s == "WA") c[1]++;
    if (s == "TLE") c[2]++;
    if (s == "RE") c[3]++;
  }

  cout << "AC x " << c[0] << endl;
  cout << "WA x " << c[1] << endl;
  cout << "TLE x " << c[2] << endl;
  cout << "RE x " << c[3] << endl;
  return 0;
}


Measured memory_bytes: 3624
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (n == 0) {
            System.out.println(0);
            return;
        }
        String ans = "";
        while (n != 0) {
            if (n % 2 != 0) {
                n--;
                ans = "1" + ans;
            } else {
                ans = "0" + ans;
            }
            n /= -2;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 2e5 + 5;
const ll LINF = 1e18 + 5;
constexpr int mod = 1e9 + 7, two = (mod+1)>>1;
int n, sz[N], f[N];
vector <int> G[N];
ll p[N], ans;
ll powmod(ll a,ll b) 
{
	ll ans = 1;
	while(b)
	{
		if(b&1) ans = ans*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return ans;
}
ll inv(ll a) 
{
	a %= mod;
	if(a<0) a += mod;
	ll b = mod, u = 0, v = 1;
	while(a) 
	{
		ll t = b / a;
		b -= a * t;
		swap(a, b);
		u -= v * t;
		swap(u, v);
	}
	if(u<0) u += mod;
	return u;
}
void dfs(int u, int fa)
{
	sz[u] = 1;
	f[u] = fa;
	int sub = 0;
	for(int v : G[u])
	{
		if(v==fa) continue;
		dfs(v, u);
		sz[u] += sz[v];
		sub++;
	}
	p[u] = inv(powmod(2, sz[u]));
}
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n;
 	for(int i=1; i<n; i++)
 	{
 		int u, v;
 		cin >> u >> v;
 		G[u].pb(v); G[v].pb(u);
 	}
 	dfs(1, 0);
 	for(int u=1; u<=n; u++)
 	{
 		if(sz(G[u])<=1) continue;;
		ll cur = 1;
		ll tmp = p[f[u]];
		p[f[u]] = inv(powmod(2, n-sz[u]));
		for(int v : G[u]) cur = cur*p[v]%mod;
		ll res = cur;
		for(int v : G[u])
		{
			ll tmp = cur*inv(p[v])%mod*(1-p[v]+mod)%mod;
			res = (res + tmp)%mod;
		}
		res = (1 - res + mod)%mod;
		res = res*two%mod;
		p[f[u]] = tmp;
		ans = (ans + res)%mod;
	}
	ans = (ans + mod)%mod;
 	cout << ans;
	return 0;
}


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

using namespace std;

long long pembagi, dummy, N;

int main ()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    pembagi = 0;
    dummy = N;
    while (dummy > 0)
    {
        pembagi = pembagi + dummy%10;
        dummy = dummy/10;
    }
    if (N%pembagi == 0)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}

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

using namespace __gnu_pbds;
using namespace std;

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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;

int n;
int h, w;

pii prze;

vi wek[nax];

void ans(int v)
{
	printf("%d\n", v);
	exit(0);
}

int main()
{
	scanf("%d%d%d", &h, &w, &n);
	for (int i=1; i<=n; i++)
	{
		int x, y;
		scanf("%d%d", &x, &y);
		wek[x].push_back(y);
	}
	int d=1;
	for (int i=1; i<h; i++)
	{
		for (int j : wek[i+1])
			if (j<=d)
				ans(i);
		int czy=(d==h);
		for (int j : wek[i+1])
			if (j==d+1)
				czy=1;
		if (!czy)
			d++;
	}
	ans(h);
	return 0;
}


Measured memory_bytes: 30080
#include<bits/stdc++.h>
using namespace std;
#define int long long

const int mod = 1e9+7;

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int n;
    cin>>n;
    int a[n];
    for (int i=0; i<n; i++) cin>>a[i];

    sort(a, a+n);
    vector<int> v;
    for (int i=0; i<n-1; i++){
        v.push_back(a[i]);
        v.push_back(a[i]);
    }
    v.push_back(a[n-1]);

    int ans = 0;
    for (int i=v.size()-1; i>=v.size()-(n-1); i--){
        ans += v[i];
    }

    cout<<ans<<endl;

    return 0 ;
}


Measured memory_bytes: 8876
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		String s = sc.next();
		int[] acArray = getAcCount(s,n);
		for(int i = 0;i < q; i++) {
			int start = sc.nextInt();
			int end = sc.nextInt();
			System.out.println(acArray[end]-acArray[start]);
		}
	}

	private static int[] getAcCount(String input,int n) {
		int[] acArray = new int[n +1];
		String[] inputArray = input.split("");
		int acCount = 0;
		for(int i=0;i < inputArray.length;i++) {
			if(!inputArray[i].equals("A")) {
				acArray[i+1] = acCount;
				continue;
			}else {
				if(i == inputArray.length-1) {
					acArray[i+1] = acCount;
					break;
				}
				if(inputArray[i+1].equals("C")) {
					acArray[i+1] = acCount;
					acCount++;
					acArray[i+2] = acCount;
				}else {
					acArray[i+1] = acCount;
				}
			}
		}

		return acArray;
	}

}

Measured memory_bytes: 69928
#include<stdio.h>

int main(void)
{
  int A,B,S,h,fh,th;

  while(1)
    {
      h=0;
      fh=0;
      th=0;
      scanf("%d%d",&A,&B);
      if(A==0 && B==0)break;
      
      S=B-A;

      if(S>=1000)
	{
	  while(S>=1000)
	    {
	      S=S-1000;
	      th++;
	    }
	}

      if(S>=500)
	{
	  while(S>=500)
	    {
	      S=S-500;
	      fh++;
	    }
	}

      if(S>=100)
	{
	  while(S>0)
	    {
	      S=S-100;
	      h++;
	    }
	}
      printf("%d %d %d\n",h,fh,th);
    }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
 
void solve()
{
  int n;
    cin>>n;
  double dp[n+1][n+1];
  double prob[n];
    for(int i=0;i<n;i++)
        cin>>prob[i];
  
  dp[0][0]=1;
  for(int i=1;i<=n;i++)
  {
    dp[i][0]=(1-prob[i-1])*dp[i-1][0];
    dp[0][i]=0;
  }
  
  for(int i=1;i<=n;i++)
    for(int j=1;j<=i;j++)
    {
       dp[i][j]=prob[i-1]*(dp[i-1][j-1]);
       dp[i][j]+=(1-prob[i-1])*(dp[i-1][j]);
       
    }
  double ans=0;
  for(int i=n/2+1;i<=n;i++)
    ans+=dp[n][i];
    
    //ans=ceil(ans*1000000000.0)/1000000000.0;
    cout<<setprecision(9);
    cout<<ans<<endl;
    
// printf("%.9f\n", ans);
 
 
 
}
 
int32_t main()
{
    
    int t;
    // cin>>t;
    t=1;
    while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 50004
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace AtcoderTemplateForCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var w = int.Parse(Console.ReadLine());
            var ansList = new List<char>();
            for (int i = 0; i < s.Length; i++)
            {
                if (i % w == 0)
                {
                    Console.Write(s[i]);
                }
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rec register char
#define rel register ll
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
  re0 x=0,f=1;rec c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
inline void read(rel &x){
  x=0;re0 f=1;rec c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  x=f?x:-x;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return pc(48);
  if (x<0) x=-x,pc('-');
  re0 bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  }
inline char fuhao(){
  rec c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
int sq[9999];
int main(){
for (re0 i=0;i<9999;++i) sq[i]=i*i;
int a=read(),b=read(),p=0;
for (int t=b;t;t/=10) ++p;
for (;p--;a*=10);
puts(*lower_bound(sq,sq+9999,a+=b)==a?"Yes":"No");
}

Measured memory_bytes: 256
#include <memory>
#include <map>
#include <cassert>
#include <array>
#include <iterator>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <string>
#include <array>
#include <numeric>

class Solution {
public:

    std::vector<std::vector<int>> v;
    std::vector<bool> visited;
    void dfs (int k, int steps)
    {
      visited[k] = true;
      if (steps == 2)
        return;

      for (auto next : v[k])
        if (!visited[next])
          dfs(next, steps + 1);
    }

    void solve(std::istream& in, std::ostream& out) {
      long long k;
      in >> k;
      auto base = k / 50;
      std::array<long long, 50> v;
      v.fill (49 + base);
      for (int i = 0; i < 50; ++i)
      {
        if (i < k % 50)
          v[i] += 50 - (k % 50) + 1;
        else
          v[i] -= k % 50;
      }
      out << "50\n";
      for (auto x : v)
        out << x << ' ';
      out << '\n';
      /*
      int j = 0;
      while (true)
        {
          auto it = std::max_element(v.begin (), v.end ());
          if (*it < 50)
            break;
          ++j;
          (*it) -= 50;
          for (auto i = v.begin (); i != v.end (); ++i)
            {
              if (i != it)
                (*i) += 1;
            }
        }
      out << j << '\n';
      */
    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}

#include <iostream>

int main ()
{
  solve (std::cin, std::cout);
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#define ms(a, x) memset(a, x, sizeof(a))
#define fore(i, a, n) for (long long i = a; i < n; i++)
#define ford(i, a, n) for (long long i = n - 1; i >= a; i--)
#define si(a) scanf("%d", &a)
#define sl(a) scanf("%lld", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sll(a, b) scanf("%lld%lld", &a, &b)
#define slll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)
#define debug(a) cout << a << endl
#define pr(a) printf("%d ", a)
#define endl '\n'
#define pi acos(-1.0)
#define tr t[root]
#define lson t[root << 1]
#define rson t[root << 1 | 1]
#define IO ios::sync_with_stdio(false), cin.tie(0)
#define ull unsigned long long
#define py puts("Yes")
#define pn puts("No")
#define pY puts("YES")
#define pN puts("NO")
#define re(i, a, b) for (int i = a; i <= b; ++i)
#define de(i, a, b) for (int i = a; i >= b; --i)
const double eps = 1e-8;
inline int sgn(const double &x) { return x < -eps ? -1 : x > eps; }
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
const ll mode = 192600817;
template <class T>
inline void cmin(T &a, T b) { ((a > b) && (a = b)); }
template <class T>
inline void cmax(T &a, T b) { ((a < b) && (a = b)); }
int main()
{
  int k, a, b;
  siii(k, a, b);
  for (int i = a; i <= b; ++i)
  {
    if (i % k == 0)
    {
      puts("OK");
      return 0;
    }
  }
  puts("NG");
}

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

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

    if (((N[0]==N[1]) && (N[0]==N[2])) || ((N[1]==N[2] && (N[1]==N[3])))) cout << "Yes" << endl;
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define endl "\n"
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int day,n;
	cin>>day>>n;
	int sum=0;
	for(int i=0,a;i<n;++i){
		cin>>a;
		sum+=a;
	}
	if(sum>day){
		cout<<"-1";
	}
	else{
		cout<<day-sum;
	}
}


Measured memory_bytes: 3664
import sys
import copy


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    wn, wm = list(map(int, readline().split()))
    inf = 10 ** 13
    wl = [[inf] * wn for _ in range(wn)]
    for i in range(wn):
        wl[i][i] = 0

    for i in range(wm):
        wa, wb, wc = list(map(int, input().rstrip('\n').split()))
        wl[wa - 1][wb - 1] = wc
        wl[wb - 1][wa - 1] = wc

    cwl = copy.deepcopy(wl)
    for i in range(wn):
        for j in range(wn):
            for k in range(wn):
                wl[j][k] = min(wl[j][k], wl[j][i] + wl[i][k])
    cnt = 0
    for i in range(wn):
        for j in range(wn):
            if cwl[i][j] != 10 ** 13 and cwl[i][j] != wl[i][j]:
                cnt += 1
    print(cnt // 2)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 43608
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {

    int n,k;
    cin>>n>>k;
    vector<int> v(n);
    // ll sum=0;

    rep(i,n){
        cin>>v[i];
        //sum+=v[i];
    }

    int ans=-INF;
    int lim=min(n,k);
    for(int l=0;l<=lim;l++){
        for(int r=0;r<=lim-l;r++){

            vector<int> te;
            int sum=0;

            for(int i=0;i<l;i++){
                sum+=v[i];
                if(v[i]<0) {
                    te.push_back(v[i]);
                }
            }
            for(int i=0;i<r;i++){
                sum+=v[n-i-1];
                if(v[n-i-1]<0) {
                    te.push_back(v[n - i - 1]);
                }
            }

            int a=k-(l+r);
            int b=te.size();
            sort(te.begin(),te.end());
            if(min(a,b)!=0) {
                for (int tt = 0; tt < min(a, b); tt++) {
                    if (te[tt] < 0) {

                        sum -= te[tt];

                        if (ans < sum) {
                            ans = sum;
                        }

                    } else { break; }
                    //cout<<l<<" "<<r<<" "<<sum<<endl;

                }
            }else {
                if (ans < sum) {
                    ans = sum;
                }
            }




        }
    }

    cout<<ans<<endl;



    return 0;
}


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

int main(){
  int n,m; cin >>n >>m; int sum=0;
  vector<int>v(n); vector<int>s(n,1);
  for(int i=0; i<n; i++) cin >>v[i];
  for(int i=0; i<m; i++)
  {
    int a,b; cin >>a >>b;
    if(v[a-1]==v[b-1]){s[a-1]=0; s[b-1]=0;}
    else if(v[a-1]<v[b-1]) s[a-1]=0;
    else s[b-1]=0;
  }
  for(int i=0; i<n; i++) sum+=s[i];
  cout <<sum;
return 0;}

Measured memory_bytes: 4052
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int a[505][505];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	int h, w;
	cin >> h >> w;
	rep(i, h) rep(j, w) cin >> a[i][j];
	vector<vi> moves;
	vi gd(h, 0);
	rep(i, h){
		int cr = 0;
		rep(j, w){
			if(!cr){
				if(a[i][j] & 1) cr = 1;					
			}
			else{
				moves.pb({i, j - 1, i, j});
				if(a[i][j] & 1) cr = 0;
			}
		}
		if(cr) gd[i] = 1;
	}
	int cr1 = 0;
	rep(i, h){
		if(!cr1){
			if(gd[i]) cr1 = 1;
		}
		else{
			moves.pb({i - 1, w - 1, i, w - 1});
			if(gd[i] & 1) cr1 = 0;
		}
	}
	cout << moves.size() << endl;
	rep(i, moves.size()){
		rep(j, moves[i].size()){
			cout << moves[i][j] + 1;
			if(j == (moves[i].size() - 1)) cout << endl;
			else cout << " ";
		}
	}
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 10032
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7,N=6e5+5;
int ksm(int b,int n){
	int res=1;
	while(n){
		if(n&1) res=res*b%mod;
		b=b*b%mod; n>>=1;
	}
	return res;
}
int fac[N],inv[N];
void init(int n){
	fac[0]=1;
	for(int i=1;i<=n;++i)
		fac[i]=fac[i-1]*i%mod;
	inv[n]=ksm(fac[n],mod-2);
	for(int i=n-1;i>=0;--i)
		inv[i]=(i+1)*inv[i+1]%mod;
}
int C(int n,int m){
	if(n<m) return 0;
	return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
int n,m;
int calc(int S,int x){
	if(S<0) return 0;
	long long res=0,tmp;
	for(int i=0,T=0;i<=n-m && T<=S;++i,T+=x){
		tmp=C(n-m,i)*C(S-T+n,n)%mod;
		if(i&1) res=(res+mod-tmp)%mod;
		else res=(res+tmp)%mod;
	}
	return res*C(n,m)%mod;
}
int solve(int S){
	int res=0;
	for(int x=1;x<=S;++x)
		res+=calc(S-m*x,x)-calc(S-m*(x+1),x),
		res=(res+mod)%mod;
	int ans=C(S+n,n);
	ans=(ans-res+mod)%mod;
	return ans;
}
signed main(){
	cin>>n>>m;
	init(6e5);
	int L,R;
	cin>>L>>R;
	int ans=solve(R)-solve(L-1);
	ans=(ans+mod)%mod;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 13016
#include <bits/stdc++.h>
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
*/#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")    
using namespace std;
/*namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using Real = mp::number<mp::cpp_dec_float<1024>>;
*/#define lli long long int
#define uli unsigned long long int
#define INF 999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(50) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 10000000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,H,W,M,K,L,R,N,num=0,sum=0,flag=0;string S,T;
  cin >> N >> M >> K;
  Vec(P,lli,N,0);
  Vec(Q,lli,M,0);
  rep(i,0,N)cin >> P[i];
  rep(i,0,M)cin >> Q[i];
  Vec(Rp,lli,N+1,0);
  Vec(Rq,lli,M+1,0);
  rep(i,1,N+1)Rp[i]=Rp[i-1]+P[i-1];
  rep(i,1,M+1)Rq[i]=Rq[i-1]+Q[i-1];
  rep(i,0,N+1){
    int ok=-1,ng=M+1;
    while(ng-ok>1){
      int mid=(ok+ng)/2;
      if(Rp[i]+Rq[mid]>K)ng=mid;
      else ok=mid;
    }
    if(ok!=-1)chmax(sum,i+ok);
  }
  Out(sum);
}

Measured memory_bytes: 9536
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define int long long
const int N = 5002;
const int INF = 1e15 + 239;

int n;
int cost[N];
int val[N][N];

void add(int i1, int i2, int j1, int j2, int x) {
	val[i1][j1] += x;
	val[i2][j1] -= x;
	val[i1][j2] -= x;
	val[i2][j2] += x;
	// for (int i = i1; i < i2; i++) {
	// 	for (int j = j1; j < j2; j++) {
	// 		val[i][j] += x;
	// 	}
	// }
} 

void resolve() {
	auto gv = [&](int i, int j) {
		if (i < 0 || j < 0) return (int)0;
		return val[i][j];
	};
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			val[i][j] += gv(i - 1, j) + gv(i, j - 1) - gv(i - 1, j - 1);
		}
	}
	cerr << "resolved" << endl;
}

void apply(vector<int> a) {
	vector<int> l(n);
	vector<int> r(n);
	{
		vector<int> st;
		for (int i = 0; i < n; i++) {
			while (!st.empty() && a[st.back()] <= a[i]) {
				st.pop_back();
			}
			if (st.empty()) {
				l[i] = -1;
			} else {
				l[i] = st.back();
			}
			st.push_back(i);
		}
	}
	{
		vector<int> st;
		for (int i = n - 1; i >= 0; i--) {
			while (!st.empty() && a[st.back()] < a[i]) {
				st.pop_back();
			}
			if (st.empty()) {
				r[i] = n;
			} else {
				r[i] = st.back();
			}
			st.push_back(i);
		}
	}
	for (int i = 0; i < n; i++) {
		add(l[i] + 1, i + 1, i, r[i], a[i]);
	}
}
	
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);	

	int m;
	cin >> n >> m;
	for (int i = 0; i + 1 < n; i++) {
		cin >> cost[i];
	}
	vector<vector<int>> a(m);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			int x;
			cin >> x;
			a[j].push_back(x);
		}
	}
	for (int i = 0; i < m; i++) {
		apply(a[i]);
	}
	resolve();
	int ans = -INF;
	for (int i = 0; i < n; i++) {
		int cs = 0;
		for (int j = i; j < n; j++) {
			ans = max(ans, val[i][j] - cs);
			if (j + 1 < n) {
				cs += cost[j];
			}
		}
	}
	// cerr << val[0][n - 1] << endl;
	cout << ans << endl;
}

Measured memory_bytes: 206464
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    vector<vector<ll>> a(3, vector<ll>(3));
    rep(i, 3) rep(j, 3) cin >> a[i][j];
    ll n;
    cin >> n;
    set<ll> s;
    rep(i, n) {
        ll b;
        cin >> b;
        s.insert(b);
    }
    rep(i, 3) {
        if ((s.count(a[i][0]) > 0) && (s.count(a[i][1]) > 0) && (s.count(a[i][2]) > 0)) {
            cout << "Yes" << endl;
            return 0;
        }
        if ((s.count(a[0][i]) > 0) && (s.count(a[1][i]) > 0) && (s.count(a[2][i]) > 0)) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    if ((s.count(a[0][0]) > 0) && (s.count(a[1][1]) > 0) && (s.count(a[2][2]) > 0)) {
        cout << "Yes" << endl;
        return 0;
    }
    if ((s.count(a[2][0]) > 0) && (s.count(a[1][1]) > 0) && (s.count(a[0][2]) > 0)) {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int A, B, C;
  cin >> A >> B >> C;
  if (A < B)
  {
    if(A < C && B > C){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    if(A > C && B < C){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using static Assistant.Input;
using static Assistant.Debug;
using System.Linq;
using Assistant;

namespace ABC125C
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt;
            var A = ReadInts;

            int countMinus = 0;
            for (int i = 0; i < N; i++)
            {
                if (A[i] < 0) countMinus++;
            }

            long ans = 0;
            for (int i = 0; i < N; i++)
            {
                ans += Math.Abs(A[i]);
            }
            if (countMinus % 2 == 1)
            {
                int min = A.Min(x => Math.Abs(x));
                ans -= 2 * min;
            }

            Console.WriteLine(ans);
        }


    }


}

namespace Assistant
{
    static class Input
    {
        static List<string> line = new List<string>();
        static int index = 0;
        static String ReadNext()
        {
            if (line.Count <= index) line.AddRange(Console.ReadLine().Split());
            return line[index++];
        }
        public static int ReadInt => int.Parse(ReadNext());
        public static long ReadLong => long.Parse(ReadNext());
        public static int[] ReadInts => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static long[] NextLongs => Console.ReadLine().Split().Select(long.Parse).ToArray();
    }

    static class Debug
    {
        static public void Draw2D(int[,] map, int mode = 1)
        {
#if DEBUG
            int W = map.GetLength(0);
            int H = map.GetLength(1);

            int[,] map2 = new int[W + 1, H + 1];
            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (i == 0 && j == 0) map2[i, j] = 0;
                    else if (i == 0) map2[i, j] = j - 1;
                    else if (j == 0) map2[i, j] = i - 1;
                    else map2[i, j] = map[i - 1, j - 1];
                }
            }

            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (mode == 0) Console.Write(map2[i, j] % 10);
                    if (mode == 1) Console.Write(map2[i, j] + " ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
#endif
        }

        static void Draw1D(int[] array, int mode = 0)
        {
#if DEBUG
            Console.WriteLine(string.Join(" ", array));
#endif
        }
    }
}


Measured memory_bytes: 28508
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = scan.nextInt();
        }
        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0 && a[i] % 2 == 1) {
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 35928
N = gets.to_i

def judge(n)
  sqrt_N = Math.sqrt(n).to_i
  ret = 0
  (3..sqrt_N).step(2).each do |i|
    ret += 1 if n % i == 0
  end
  ret == 3
end

a = 0
(1..N).step(2).each do |n|
  if judge(n)
    a += 1
  end
end

puts a

Measured memory_bytes: 1788
#include <cstdio>
using namespace std;

int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	int maxMod = 1;
	if(n == 1){
		printf("%d\n",m);
		return 0;
	}
	for(int mod = 2; mod <= m ; mod++){
		int x = m - mod * (n-1);
		if( x >= mod){
			if(x % mod == 0) maxMod = mod;
		}else break;
	}
	printf("%d\n",maxMod);
  return 0;
}


Measured memory_bytes: 128
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;

#define INIT std::cin.tie(0);std::ios::sync_with_stdio(false);
#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define ASC(t) [](t& x, t& y){ return x < y; }
#define DESC(t) [](t& x, t& y){ return x > y; }
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

#define IN(a, x, b) (a<=x && x<b)
template<class T> inline T CHMAX(T& x, const T y){return x=(x<y)?y:x;}
template<class T> inline T CHMIN(T& x, const T y){return x=(x>y)?y:x;}
#define OUT(dist) std::cout<<(dist);
#define WS std::cout<<" ";
#define NL std::cout<<"\n"

using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;

V<long double> p;

int main(){
    INIT;
    p.resize(1001);
    p[0] = 1;
    FOR(i,1,1001) p[i] = p[i-1]*2;

    long double n, k;
    cin >> n >> k;

    long double ans = 0.0;
    FOR(i,1,n+1) {
        auto itr = lower_bound(ALL(p), (long double)k/i);
        ans += ((long double)1. / *itr);
    }
    ans *= ((long double)1. / (long double)n);
    std::cout << std::setprecision(20) << ans << "\n";
}

Measured memory_bytes: 256
H,W = map(int, input().split())
List = []
for i in range(H):
    List.append([a for a in input()])
i = 0
j = 0
while i < len(List):
    if List[i].count("#") == 0:
        del List[i]
        i -= 1
    i += 1

while j < len(List[0]):
    c = 0
    for k in range(len(List)):
        if List[k][j] == ".":
            c += 1
    if c == len(List):
        for k in range(len(List)):
            List[k] = List[k][:j] + List[k][j+1:]
        j -= 1
    j += 1

for l in range(len(List)):
    print("".join(List[l]))

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

using namespace std;

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

  int h, w;
  cin >> h >> w;
  if (h == 1 or w == 1) {
    cout << 1;
    return 0;
  }
  cout << (1ll * h * w + 1) / 2;

  return 0;
}


Measured memory_bytes: 256
S = gets.split('').map(&:to_s)

a = (S[0] + S[1]).to_i
b = (S[2] + S[3]).to_i

isMMYY = false
isYYMM = false
if 1 <= a && a <= 12
  isMMYY = true
end
if 1 <= b && b <= 12
  isYYMM = true
end

if isMMYY && isYYMM
  puts 'AMBIGUOUS'
elsif isMMYY
  puts 'MMYY'
elsif isYYMM
  puts 'YYMM'
else
  puts 'NA'
end

Measured memory_bytes: 1788
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long money = 100;
		int y = 0;
		while(x > money) {
			money = money + money / 100;
			y++;
		}
		System.out.println(y);
	}
}


Measured memory_bytes: 35664
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll>Q;


int main(void){
    ll n;
    cin>>n;
    vector<ll>c(n);
    for(int i=0;i<n;i++)cin>>c[i];
    sort(c.begin(),c.end());
    ll ans = 1;
    for(ll i=0;i<2*n-2;i++){
        ans = ans*2;
        ans = ans%N;
    }
    ll ans2 = 0;
    for(ll i=1;i<=n;i++){
        ll tmp1 = (n-i+2)*c[i-1];
        ans2 = (ans2+tmp1)%N;
    }
    ans = (ans*ans2)%N;
    cout<<(N+ans)%N<<endl;
    return 0;
}

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

using namespace std;
typedef long long int ll;

void solve()
{
	int n;
	cin >> n;
	ll a[n];
	for(int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	int CNT = 0;
	map <int,int> mp1;
	for(int i = 0; i <n; i++)
	{
		for(int j = i + 1; j < n; j++)
		{
			for(int k = j  +1; k < n; k++)
			{
				if(a[i] + a[j] > a[k] && a[i]  + a[k] > a[j] && a[j] + a[k] > a[i])
				{
					if(a[i] != a[j] && a[k] != a[j] && a[i] != a[k])
					{
						CNT++;
					mp1[a[i]] = 1;
					mp1[a[j]] = 1;
					mp1[a[k]] = 1;
					}
					
				}
			}
		}
	}
		cout << CNT << "\n";
}

int main()
{
	cin.sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
//	cin >> t;
	while(t--)
	{
		solve();
	}
	return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define alint(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	while(1){
		int l,sum=0,ans=0;
		cin>>l;
		if(l==0) break;
		vi m(12),n(12);
		rep(i,0,12){
			cin>>m[i]>>n[i];
		}
		rep(i,0,12){
			sum+=m[i]-n[i];
			if(sum>=l){
				ans=i+1;
				break;
			}
		}
		if(ans==0) o("NA");
		else o(ans);
	}
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define ss(x) scanf("%s",x)
#define ll long long
#define mod 1000000007
#define bitcount    __builtin_popcountll
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define pi pair<int,int>
int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    int n,i,j,k,a,b;
    sd(n);
    sd(a);
    sd(b);
    if(n==1)
    {
    	if(a==b)
    		printf("1");
    	else
    		printf("0");
    }
    else if(n==2)
    {
    	if(a==b)
    		printf("1");
    	else
    		printf("2");
    }
    else
    {
    	if(a>b)
    	{
    		printf("0");
    		return 0;
    	}
    	n-=2;
    	printf("%lld\n",1ll*n*(b-a)+1);
    }
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;

#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define EB(x) emplace_back(x)
#define DEBUG(x) cout << (#x) << ": " << (x) << endl
#define DEBUG_VEC(v)                \
    cerr << #v << ": ";             \
    REP(__i, (v).size())            \
        cerr << ((v)[__i]) << ", "; \
    cerr << endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main()
{
    ios::sync_with_stdio(false);
    int X, A;
    cin >> X >> A;
    if (X < A) cout << 0 << endl;
    else cout << 10 << endl;

    return 0;
}


Measured memory_bytes: 256