akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
//DEFINE and TYPEDEF--------------------------------------------------------------
// For actual content check from line 94

#define FORG(i,a,n) for(lld i=(lld)a;a<n?i<(lld)n:(lld)n<i;a<n?++i:--i) //for - general
#define FORZ(i,n) for(lld i=0;i<(lld)n;++i) //for - zero
#define FORGI(i,a,n,inc) for(lld i=(lld)a;a<n?i<(lld)n:(lld)n<i;a<n?i+=inc:i-=inc) //for - general incremental
#define FORZI(i,n,inc) for(lld i=0;i<(lld)n;i+=inc) //for - zero incremental
#define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define MEM(a,val) memset(a,val,sizeof(a));
 
#define all(m) m.begin(),m.end()
#define sz(m) (lld)m.size()
 
#define st first
#define nd second
#define pb push_back
#define DEC(x) fixed<<setprecision(x)
 
typedef long long int lld;
typedef unsigned long long int ulld;
 
//DEBUGGER------------------------------------------------------------------------
// #define DEBUG(x) cerr<<(#x)<<" is "<<(x)<<"\n" //to debug values of variables
#define DEBUGON
#define ZINDA cerr<<"\nIdhar-ich hai apun!!\n"; //to debug if code reached that point

#ifdef DEBUGON
	vector<string> vec_splitter(string s) 
	{
		for(char& c: s) c = c == ',' ?  ' ': c;
		stringstream ss; ss << s;
		vector<string> res;
		for(string z; ss >> z; res.push_back(z));
		return res;
	}

	void debug_out(
	vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx, __attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
	template <typename Head, typename... Tail>
		void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) 
		{
			if(idx > 0) cerr << ", "; 
			else cerr << "Line(" << LINE_NUM << "): ";
			stringstream ss; ss << H;
			cerr << args[idx] << " = " << ss.str();
			debug_out(args, idx + 1, LINE_NUM, T...);
		}

	#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__);
	#define DEBUG(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__);
#else
	#define debug(...) 320;
	#define DEBUG(...) 320;
#endif

lld power(lld b, lld e)
{
	assert(e>=0);
    if(e==0) return 1;
    if(e%2==1) return b*power(b*b,(e-1)/2);
    else return power(b*b,e/2);
}
 
lld power(lld b, lld e, lld m)
{
	assert(e>=0);
	if(e==0) return 1;
	if(e%2==1) return b*power(((b%m)*(b%m))%m,(e-1)/2,m)%m;
	else return power(((b%m)*(b%m))%m,e/2,m)%m;
}
 
int nDig(lld n)
{
	if(n<0) n*=-1;
	if(n==0) return 1;
    else return int(log10(n) + 1);
}

int lognk(lld n, lld k) // logk(n)
{
	assert(n>=0 and k>=0 and k!=1);
	if(n==0) return -1;
	else return lognk(n/k,k)+1;
}

#define endl '\n'
const long double pi = acos(-1);
constexpr int mod = 1e9+7; // 1000000007

//endl : changed to '\n', to flush comment that definition
//--------------------------------------------------------------------------------

void swagWaalaFunction()
{
	lld l,r,d;
	cin>>l>>r>>d;

	cout<<lld(r/d - l/d + (r%d==0 and l%d==0));
	return;
}

int main()
{
    SPEEDUP;
 	lld t=1;
 	//cin>>t;

 	#ifdef PRIMES
 		sieve();
 	#endif

 	#ifdef CHOOSE
 		nCrModInit();
 	#endif

 	while(t--)
 		swagWaalaFunction();
	
	// cerr<<"\n"<<timeKyaHorhaH; 	
 	return 0;
}

Measured memory_bytes: 3620
from math import factorial

N, K = map(int, input().split(" "))

l = [None]*2010
l[0] = 1
for i in range(1, 2010):
    l[i] = l[i-1]*i

for i in range(1, K+1):
    a = l[N-K+1] // l[i] // l[(N-K+1)-i]
    b = l[K-1] // l[i-1] // l[(K-1)-(i-1)]
    print(a*b % (10**9+7))

Measured memory_bytes: 5748
<?php
/*
    Problem URL : https://beta.atcoder.jp/contests/abc064/tasks/abc064_a

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */

// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%d %d %d", $r, $g, $b);

if (($r * 100 + $g * 10 + $b) % 4 == 0) {
    echo "YES\n";
} else {
    echo "NO\n";
}


Measured memory_bytes: 4604
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var ans = [];
  for(var i = 1; i <= n; i++){
    for(var j = i+1; j <= n; j++){
      if(n % 2 && i+j === n)continue;
      if(n % 2 === 0 && i+j === n+1)continue;
      ans.push(i+" "+j);
    }
  }
  console.log(ans.length);
  return ans.join("\n");
}

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

int N, u, v;
vector<int> G[101010];
vector<int> distA(101010, -1), distB(101010, -1);

signed main() {
  cin >> N >> u >> v;
  u--, v--;
  for (int i = 0; i < N - 1; i++) {
    int A, B;
    cin >> A >> B;
    A--, B--;
    G[A].push_back(B);
    G[B].push_back(A);
  }

  queue<int> que;

  que.push(u);
  while (!que.empty()) {
    int v = que.front();
    que.pop();
    for (int x : G[v]) {
      if (distA[x] != -1)
        continue;

      distA[x] = distA[v] + 1;
      que.push(x);
    }
  }

  que.push(v);
  while (!que.empty()) {
    int v = que.front();
    que.pop();
    for (int x : G[v]) {
      if (distB[x] != -1)
        continue;

      distB[x] = distB[v] + 1;
      que.push(x);
    }
  }

  bool flag = true;
  int ansP = 0, mx = 0, pre = 0;
  for (int i = 0; i < N; i++) {
    if (distA[i] < distB[i]) {
      if (mx < distB[i]) {
        mx = distB[i];
        pre = i;
        ansP = pre;
      }
      flag = false;
    }
  }

  if (flag) {
    cout << 1 << endl;
    return 0;
  }

  if (N == 2) {
    cout << 0 << endl;
    return 0;
  }

  cout << distB[ansP] << endl;
  return 0;
}

Measured memory_bytes: 8064
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//priority_queue<int,vector<int>, greater<int> > q2;

struct segtree {
public:
	const int SIZE = 1 << 18;
	VI seg, lazy;
	//seg:区間の合計値 lazy:区間に対して、加える値でまだ遅延しているもの

	segtree() :seg(SIZE * 2), lazy(SIZE * 2) {}
	void lazy_evaluate(int k, int l, int r) {
		if (lazy[k] != 0) {
			seg[k] += lazy[k];
			//区間[l,r)にすべて同じ値を追加することになっていて、
			//segには合計値が入っているので、加える値を足す
			if (r - l > 1) {
				lazy[k * 2 + 1] += lazy[k];
				lazy[k * 2 + 2] += lazy[k];
			}
			lazy[k] = 0;
		}
	}

	void update(int a, int b, int k, int l, int r, int x) {
		lazy_evaluate(k, l, r);
		if (r <= a || b <= l)return;
		if (a <= l && r <= b) {
			lazy[k] += x;
			lazy_evaluate(k, l, r);
		}
		else {
			update(a, b, k * 2 + 1, l, (l + r) / 2, x);
			update(a, b, k * 2 + 2, (l + r) / 2, r, x);
			seg[k] = seg[k * 2 + 1] + seg[k * 2 + 2];
		}
	}
	int query(int a, int b, int k, int l, int r) {
		lazy_evaluate(k, l, r);
		if (r <= a || b <= l)return 0;
		if (a <= l && r <= b)return seg[k];
		int x = query(a, b, k * 2 + 1, l, (l + r) / 2);
		int y = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return x + y;
	}

	void update(int a, int b, int x) { update(a, b, 0, 0, SIZE, x); }
	//update(a,b,x) := [a,b)を全てxを加える
	int query(int a, int b) { return query(a, b, 0, 0, SIZE); }
	//query(a,b) := [a,b)に対する合計値を求める

};

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

	int A, B, K;
	cin >> A >> B >> K;

	map<int, bool>mp;
	VI ans;
	FOR(i, A, min(B+1,A + K)) {
		if (!mp[i]) {
			ans.push_back(i);
			mp[i] = 1;
		}
	}

	for (int i = B; i > max(B - K,A-1); i--) {
		if (!mp[i]) {
			ans.push_back(i);
			mp[i] = 1;
		}
	}

	SORT(ans);
	REP(i, ans.size())cout << ans[i] << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
 
#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}
 
 
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;
 
LL dp[2010][16];
 
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
 
  int N, K;
  cin >> N >> K;
 
  VVL xs(10);
  REP(i,N){
	LL c, g;
	cin >> c >> g;
	xs[g-1].PB(c);
  }
  REP(i,10) RSORT(xs[i]);
 
  REP(g,10){
	REP(i,N){
	  maxi(dp[i][g+1], dp[i][g]);
	  LL acc = 0;
	  REP(j,SZ(xs[g])+1){
		if(i+j <= N) maxi(dp[i+j][g+1], dp[i][g] + acc + (j-1) * j);
		if(j < SZ(xs[g])) acc += xs[g][j];
	  }
	}
  }
  cout << dp[K][10] << endl;
 
  return 0;
}

Measured memory_bytes: 3468
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<set>
#include<math.h>
using namespace std;

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

#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)

long long INF=1e9;
const int mod=10007;
#define ll long long

int main(){
    int n;
    cin>>n;
    vector<int>l(n);
    rep(i,n){
        cin>>l[i];
    }
    int ans=0;
    sort(l.begin(),l.end());
    for(int i=n-1;i>=2;i--){
        for(int j=i-1;j>=1;j--){
            for(int k=j-1;k>=0;k--){
                if(!(l[j]+l[k]>l[i])){
                    break;
                }else if(!((l[j]-l[k])<l[i])){
                    break;
                }else{
                    ans++;
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#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()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;
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;}

set<ll> st;
vector<ll> l;
void dfs(string s){
  st.insert(stoll(s));
    if(s.size()>=10) return;
    char x = s.back();
    dfs(s+x);
    if(x=='0'){
      dfs(s+'1');
    }
    else if(x=='9'){
      dfs(s+'8');
    }
    else{
      dfs(s+char(x-1));
      dfs(s+char(x+1));
    }

}

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

  rep(i,10){
    dfs(to_string(i));
  }
  for(auto s:st){
    l.pb(s);
  }
  sort(all(l));

  cout << l[K] << endl;
  return 0;
}


Measured memory_bytes: 12788
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
using namespace std;

using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<vector<ll>> dp(n, vector<ll>(n, LLONG_MAX));
  vector<ll> prefix(n);
  prefix[0] = a[0];
  for (int i = 1; i < n; ++i) {
    prefix[i] = prefix[i-1] + a[i];
  }
  for (int l = n-1; l >= 0; --l) {
    dp[l][l] = 0;
    for (int r = l + 1; r < n; ++r) {
      for (int i = l; i < r; ++i) {
        dp[l][r] = min(dp[l][r], dp[l][i] + dp[i+1][r] + prefix[r] - (l > 0 ? prefix[l-1]: 0));
      }
    }
  }
  cout << dp[0][n-1] << '\n';

  return 0;
}


Measured memory_bytes: 4900
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
//#include <numeric>
#pragma warning(disable:4996) 

typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define LINF3 1000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

char str[205];

bool func(ll a, ll b)
{
    int i;
    int cnt = 0;
    for (i = 0; i < 62; i++) {
        if (b & ((ll)1 << i)) {
            if (a & ((ll)1 << i)) {
                return true;
            }
            break;
        }
    }
    return false;
}

void solve()
{
    int n;
    scanf("%d", &n);
    vector<ll> a(n);
    int i, j;
    for (i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
    }
    scanf("%s", str);

    for (i = n-1; i >= 0; i--) {
        if (str[i] == '1') {
            if (a[i]) {
                printf("1\n"); return;
            }
        }
        else {
            for (j = 0; j < i; j++) {
                if (func(a[j], a[i])) {
                    a[j] ^= a[i];
                }
            }
        }
    }
    printf("0\n");
    return;
}


int main(int argc, char* argv[])
{
#if 0
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 3136
#[allow(unused_imports)]
use {
    proconio::{fastout, input, marker::*},
    std::ops::*,
    std::cmp::*,
    std::collections::*,
};

#[fastout]
fn main() {
    input! {
        d: usize,
        t: usize,
        s: usize,
    }
    if t*s >= d {
        println!("{}", "Yes");
    } else {
        println!("{}", "No");
    }
}


Measured memory_bytes: 2200
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    string s, t; cin >> s >> t;
    int ans = 0;
    rep(i,3){
        if(s[i]==t[i]) ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 384
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		int[] d = new int[n];
		for (int i = 0; i < n; i++) {
			d[i] = sc.nextInt();
		}
		if (d[0] != 0) {
			System.out.println(0);
			return;
		}
		long[] sum = new long[n];
		for (int i = 0; i < n; i++) {
			sum[d[i]]++;
		}
		if (sum[0] > 1) {
			System.out.println(0);
			return;
		}
		int max = -1;
		for (int i = n - 1; i >= 0; i--) {
			if (sum[i] != 0) {
				max = i;
				break;
			}
		}
		long ans = 1;
		long mod = 998244353;
		for (int i = 1; i <= max; i++) {
			for (int j = 0; j < sum[i]; j++) {
				ans *= sum[i - 1];
				ans %= mod;
			}
		}
		System.out.println(ans);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}
	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}
	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
		return hasNextByte();
	}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || Integer.MAX_VALUE < nl) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


Measured memory_bytes: 22692
N, M = map(int,input().split())
L = []
R = []
for i in range(M):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)
if max(L) > min(R):
  print(0)
else:
  print(min(R) - max(L) + 1)

Measured memory_bytes: 10996
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    int n; cin >> n;
    ll sum = 0;
    rep(i, n){
        sum += i+1;
    }
    cout << sum << endl;
    return 0;
}


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

int  main()
{
	long n, T;
	cin >> n >> T;
	vector<long> t(n);
	rep(i, n)
		cin >> t[i];

	long sum = 0;
	rep1(i, n)
	{
		if (labs(t[i-1] - t[i]) <= T)
			sum += labs(t[i-1] - t[i]);
		else
			sum += T;
	}
	sum += T;
	cout << sum << endl;
	return (0);
}

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

#define ll long long int
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define loop(i,x,n) for(int i=x;i<n;i++)
#define arr 1000005
#define F first
#define S second
#define pii pair<int,int>

const int modu=1e9+7;
ll mod(ll n){
    return (n%modu);
}

bool cmp(ll a,ll b){
    return a>b;
}

int main() {
    FIO
    ll r;
    cin>>r;
    float x=2*r;
    x=x*3.14;
    cout<<x;
	return 0;
}


Measured memory_bytes: 3264
// ----- In the name of ALLAH, the Most Gracious, the Most Merciful -----

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

#define NINJA ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define dloop(i,n) for(int i=n-1;i>=0;i--)
#define iii tuple<int,int,int>
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define int long long
#define ld long double
#define pb push_back
#define endl "\n"
#define setbits __builtin_popcountll
#define mp map<int,int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007
#define inf (int)1e18

int32_t main(){
	NINJA;

	int n; cin >> n;
	if(n>=30) cout << "Yes" << endl;
	else cout << "No" << endl; 
	
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <iomanip>
#include <cstdlib>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) cin >> p[i];
    int cnt = 0;
    for (int i = 0; i < n - 2; i++) {
        if (p[i] < p[i + 1] && p[i + 1] < p[i + 2]) {
            cnt++;
        }
        else if (p[i] > p[i + 1] && p[i + 1] > p[i + 2]) {
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

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

int main(void){
    string s;
    cin >> s;
    int count = 0;
    int ans = 0;
    int start, end;
    int j;
    for(int i = 0; i < s.length(); i++){
        if(s[i] == 'A'){
            j = s.length()-1;
           while(s[j] != 'Z')
                j--;
            ans = max(ans, j-i+1);
            }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]


#合計が偶数or奇数のどちらかだけしかできない
if N != 1:
    a = abs(XY[0][0]) + abs(XY[0][1])
    flag = (XY[0][0] + XY[0][1])%2
for i in range(N-1):
    b = abs(XY[i+1][0]) + abs(XY[i+1][1])
    a = max(a, b)
    if flag != (XY[i+1][0] + XY[i+1][1])%2:
        print (-1)
        exit()

#必要な桁数の確認
m = 0
while a > 1:
    m += 1
    a = a//2

#腕の長さを求める
d = []
for i in range(m+3, -1, -1):
    d += [2 ** i]

if flag == 0: #偶数の場合一つずらすための1を加える
    print (len(d) + 1)
    print (' '.join(map(str, [1] + d)))
else: #奇数の場合そのまま出力
    print (len(d))
    print (' '.join(map(str, d)))
#ここまでで、腕の長さが決定
#これ以降で各X, Yに対する答えを見つける。

def string(X, Y): #あるXYに対して動かし方を返す
    if (abs(X) + abs(Y))%2 == 0: #偶数のとき
        ans = 'R'
        x = X - 1
        y = Y
    else:
        x, y = X, Y
        ans = str()
    for i in d:
        if abs(x - i) + abs(y) < i:
            ans += 'R'
            x = x - i
        elif abs(x + i) + abs(y) < i:
            ans += 'L'
            x = x + i
        elif abs(x) + abs(y - i) < i:
            ans += 'U'
            y = y - i
        elif abs(x) + abs(y + i) < i:
            ans += 'D'
            y = y + i
    return ans

for i in XY:
    print (string(i[0], i[1]))
# print (string(XY[0][0], XY[0][1]))
# print (string(XY[1][0], XY[1][1]))
# print (string(XY[2][0], XY[2][1]))
# print (string(XY[3][0], XY[3][1]))

Measured memory_bytes: 3444
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef pair<int , int> pp;
#define X first
#define Y second
typedef long long int ll;
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
const int N = 1e6 + 1;
const ll K = 1e9 + 7;
int main() {
	ll a, b;
	cin >> a >> b;
	cout << a*b;
}

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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

template <typename T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T, size_t size> void fill(T (&ary)[size], const T& val){
    fill_n((T*)ary, size, val);
}

void solve() {
    //const i64 mod = 1'000'000'007;

    i64 N,M;
    cin >> N >> M;

    vector<vector<i64>> s(M);
    rep(i,0,M){
        i64 k;
        cin >> k;
        s[i].resize(k);
        rep(j,0,k){
            cin >> s[i][j];
            --s[i][j];
        }
    }

    vector<i64> p(M);
    rep(i,0,M){
        cin >> p[i];
    }

    i64 ans=0;
    rep(i,0,1<<N){
        bool ok=true;
        rep(j,0,M){
            i64 cnt=0;
            for(auto k:s[j]){
                if(i&(1<<k)) ++cnt;
            }
            if(cnt%2!=p[j]){
                ok=false;
                break;
            }
        }
        if(ok) ++ans;
    }

    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;



public class Main{
	
	//最大公約数・最小公倍数（セットで使う）
	public static long gcm(long a, long b) {
		long result = a;
		long k = 0;
		long n = b;
		do {
			k = result % n;
			result = n;
			n = k;
		} while(k != 0);
		return result;
	}
	
	public static long lcm(long a, long b) {
		long g;
		g = gcm(a, b);
		return a/g*b;
	}
	
	static long gcd (long a, long b) {
		long temp;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		return b;
	}
	
	//等差数列
	static long tousasum(int n) {
		return (long)n*((long)n+1)/2;
	}



	//素数判定
	static boolean isPrime (int n) {
		if (n==2) return true;
		if (n<2 || n%2==0) return false;
		double d = Math.sqrt(n);
		for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
		return true;
	}


	//倍数判定（10進数以外のときに有用）
	static boolean isMultiple (String s, int base, int m) {
		int temp = 0;
		for (int i=0; i<s.length(); i++) {
			temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
		}
		if (temp==0) {return true;}
		return false;
	}


	//階乗
	static long factorial (int i) {
		if (i==1) {return 1;}
		else {return i*factorial(i-1);}
	}


	//進数変換
	static String toNbase (String sm, int m, int n) {
		return Long.toString(Long.parseLong(sm,m),n);
	}
	
	public static final long gcd_n(long[] param) {
	    final int len = param.length;
	    long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
	    for (int i = 1; i < len - 1; i++) {
	        g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
	    }
	    return g;
	}
	
	public static long lcm_n(long[] numbers) {
		long l;
		l = numbers[0];
		for (int i = 1; i < numbers.length; i++) {
			l = lcm(l, numbers[i]);
		}
		return l;
	}
	
	
 public static void main(String[] args) {
	 Scanner sc=new Scanner(System.in);
	 int A=sc.nextInt();
	 int B=sc.nextInt();
	 int sum=1;
	 int count = 0;
	 while(sum<B) {
		 sum-=1;
		 sum+=A;
		 count+=1;
	 }
	 
 
	 System.out.println(count);
	 
	 
	 
	 
	
	 
	 
	 
 }
	


}



Measured memory_bytes: 22996
#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 rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

struct mint {
    const int mod = 1e9 + 7;
    long long x;
    
    mint (long long x = 0) : x((x % mod + mod) % mod) {
        
    }
    
    mint& operator=(const long long a) {
        x = a % mod;
        return *this;
    }
    
    mint& operator=(const mint a) {
        x = a.x % mod;
        return *this;
    }
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    
    mint& operator-=(const mint a) {
        if ((x += (mod - a.x)) >= mod) x -= mod;
        return *this;
    }
    
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    mint inv() const {
        return pow(mod - 2);
    }
    
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    const ll inf = LONG_LONG_MIN / 2 + 1;
    ll n, k;
    cin >> n >> k;
    vector<vector<ll>> g(n);
    rep(i, n - 1) {
        ll a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    queue<pair<ll, ll>> q;
    q.push(make_pair(0, 0));
    vector<ll> dp(n, inf);
    dp[0] = k;
    while(!q.empty()) {
        pair<ll, ll> p = q.front(); q.pop();
        ll base = (p.second == 0) ? k - 1 : k - 2;
        for(auto v : g[p.first]) {
            if (dp[v] != inf) continue;
            dp[v] = base;
            base--;
            q.push(make_pair(v, p.second + 1));
        }
    }
    mint ans = 1;
    rep(i, n) ans *= dp[i];
    cout << ans.x << endl;
    return 0;
}


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

#define all(x) (x).begin(), (x).end()
#define sz(x) static_cast<int>((x).size())

using LL = long long;
template<class T, size_t D>
struct vec : vector<vec<T, D - 1>> {
  template<class... Args>
  vec(size_t n = 0, Args... args)
    : vector<vec<T, D - 1>>(n, vec<T, D - 1>(args...)) {}
};
template<class T>
struct vec<T, 1> : vector<T> {
  template<class... Args>
  vec(Args... args)
    : vector<T>(args...) {}
};

template<class T>
inline bool asMn(T& a, const T& b) { return a > b ? a = b, true : false; }
template<class T>
inline bool asMx(T& a, const T& b) { return a < b ? a = b, true : false; }
inline int nex(int i, int n) { return i == n - 1 ? 0 : i + 1; }
inline int pre(int i, int n) { return !i ? n - 1 : i - 1; }

const LL LL_INF = 1e18;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

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

  int n, m; cin >> n >> m;
  vec<int, 2> adjMatrix(n, n, -1);
  while (m--) {
    int u, v, w; cin >> u >> v >> w; --u; --v;
    adjMatrix[u][v] = adjMatrix[v][u] = w;
  }

  vec<LL, 1> f(1 << n);
  for (int mask = 0; mask < 1 << n; ++mask) {
    for (int u = 0; u < n; ++u) {
      for (int v = u + 1; v < n; ++v) {
        if (~adjMatrix[u][v] && (mask >> u & 1) != (mask >> v & 1)) {
          f[mask] += adjMatrix[u][v];
        }
      }
    }
  }

  vec<LL, 2> g(1 << n, n, LL_INF);
  for (int mask = 0; mask + 1 < 1 << n; ++mask) {
    if (mask & 1) {
      asMn(g[mask][0], f[mask]);
    }
  }

  for (int mask = 0; mask < 1 << n; ++mask) {
    for (int cur = mask, u; u = __lg(cur), cur; cur ^= 1 << u) {
      if (g[mask][u] < LL_INF) {
        for (int mask2 = (~mask) & ((1 << n) - 1), subMask = mask2; subMask; subMask = (subMask - 1) & mask2) {
          for (int cur2 = subMask, v; v = __lg(cur2), cur2; cur2 ^= 1 << v) {
            if (~adjMatrix[u][v]) {
              asMn(g[mask | subMask][v], g[mask][u] + f[subMask] - (adjMatrix[u][v] << 1));
            }
          }
        }
      }
    }
  }

  cout << (g[(1 << n) - 1][n - 1] >> 1) << '\n';

  return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;

#define PB push_back
#define MP make_pair

#define FOR(prom, a, b) for(int prom = (a); prom < (b); prom++)
#define FORDE(prom, a, b) for(int prom = (a); prom >= (b); prom--)
#define R1(a) do{scanf("%d", &(a));}while(0)
#define R2(a, b) do{scanf("%d%d", &(a), &(b));}while(0)
#define R3(a, b, c) do{scanf("%d%d%d", &(a), &(b), &(c));}while(0)
#define SV(vec) do{int __sv;scanf("%d", &(__sv));vec.PB(__sv);}while(0)
#define ALL(vec) (vec).begin(), (vec).end()
#define MM(co, cim) memset((co), (cim), sizeof((co)))
#define DEB(x) cerr << ">>> " << #x << " : " << x << endl;
#define INF   1000000007
#define INFLL 1000000000000000007LL

ll x, cx;
int res;

int main ()
{
  scanf("%lld", &x);
  cx = 100;
  res = 0;
  while (cx < x)
  {
    ++res;
    cx += cx / 100;
  }
  printf("%d\n", res);
  
  return 0;
}


Measured memory_bytes: 3868
#include<stdio.h>

int main(void){

	int a, b, n, m;

	while (1) {
		scanf("%d %d", &a, &b);
		if ((a == 0) && (b == 0))
		{
			break;
		}
		else
		{
			for (m = 1; m <= a; m++)
			{
				for (n = 1; n <= b; n++)
				{
					if (m % 2 == 1)
					{
						if (n % 2 == 1)
						{
							printf("#");
						}
						else
						{
							printf(".");
						}
					}
					else
					{
						if (n % 2 == 0)
						{
							printf("#");
						}
						else
						{
							printf(".");
						}
					}
				}
				printf("\n");
			}
		}
		printf("\n");
	}
	
	return 0;
}

Measured memory_bytes: 1820
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type_a,class Type_b> bool chmax(Type_a &a,const Type_b &b){if(a<b){a=b;return true;}return false;}
template<class Type_a,class Type_b> bool chmin(Type_a &a,const Type_b &b){if(a>b){a=b;return true;}return false;}
template<class Type> Type igcd(Type x,Type y){return (y==0)?x:igcd(y,x%y);}
template<class Type> Type ilcm(Type x,Type y){return x/igcd(x,y)*y;}
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	int n,r;
	cin>>n>>r;
	
	if(n>=10){
		cout<<r<<endl;
		return 0;
	}
	
	cout<<r+100*(10-n)<<endl;
}

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

using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int mo2 = 998244353;
constexpr int  mod = mo;
constexpr int inf = 1<<30;

int main(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(auto &&a : v) cin>>a;
    double sum = 0.0;
    for(int i=0;i<n;++i){
        sum += 1.0/v[i];
    }
    cout << fixed;
    cout << setprecision(10);
    cout << 1.0/sum << endl;
    return 0;
}



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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); 
	
	string s;
	cin >> s;
	int ans = 0, gg = 0, pp = 0;
	for(int i = 0; i < s.size(); i++) {
		if(s[i] == 'g') {
			if(gg > pp) {
				ans++;
				pp++;
			} else {
				gg++;
			}
		} else {
			if(gg > pp) {
				pp++;
			} else {
				gg++;
				ans--;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
using namespace std;
int a[55];
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
    int n,k;
    int ans=0;
    cin>>n>>k;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n,cmp);
    for(int i=0;i<k;i++)
    {
        ans+=a[i];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

public class Program{
    public static void Main(){
        var N = long.Parse(ReadLine());
        var line = ReadLine().Split(' ');
        var count = 0;
        for(int i=0;i<N-1;i++){
            if(line[i+1]==line[i]){
              count++;
              line[i+1] = "nil";
            } 
        }
        WriteLine(count);
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>
#include <numeric>
using lint = long long;

std::vector<lint> level_n, p_n;

lint eat_p(lint x, lint n)
{
    if (x == 0)
    {
        return 0;
    }
    if (n == 0)
    {
        return 1;
    }
    if (x == 1)
    {
        return 0;
    }
    if (x <= level_n[n - 1] + 1)
    {
        return eat_p(x - 1, n - 1);
    }
    else if (x == level_n[n - 1] + 2)
    {
        return p_n[n - 1] + 1;
    }
    else if (x == level_n[n])
    {
        return p_n[n];
    }
    else
    {
        return p_n[n - 1] + 1 + eat_p(x - level_n[n - 1] - 2, n - 1);
    }
}

int main()
{
    lint n, x;

    for (int i = 0; i < 51; ++i)
    {
        level_n.push_back(pow(2, i + 2) - 3);
        p_n.push_back(pow(2, i + 1) - 1);
    }

    scanf("%lld", &n);
    scanf("%lld", &x);

    printf("%lld", eat_p(x, n));

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int N,C,p,a=0;
    cin>>N>>C;
    for (int i=0; i<C; i++){
    cin>>p;
    a+=p;
    
    }
    if (a%(N+1)==0){
        cout<<a/(N+1)<<endl;
    }else if (a%(N+1)>0){
        cout<<a/(N+1)+1<<endl;
    }
    
}
    


Measured memory_bytes: 3120
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AnandOza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ATakahashikunTheStrider solver = new ATakahashikunTheStrider();
        solver.solve(1, in, out);
        out.close();
    }

    static class ATakahashikunTheStrider {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int x = in.nextInt();
            int y = 360;

            int g = NumberTheory.gcd(x, y);

            y /= g;

            out.println(y);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class NumberTheory {
        public static int gcd(int a, int b) {
            a = Math.abs(a);
            b = Math.abs(b);
            int c;
            while (a != 0) {
                c = a;
                a = b % a;
                b = c;
            }
            return b;
        }

    }
}



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

using namespace std;

typedef long long ll;

const int maxn = 2e5 + 3;
const int maxB = 8000 + 10;
const int mod = 1e9 + 7;
int B = 2000;
int x[maxn], y[maxn];
int fac[maxB], rev[maxB], dp[maxB][maxB];

int power(int a, int b){
	if (b == 0)
		return 1;
	int ret = power(a, b / 2);
	ret = 1ll * ret * ret % mod;
	if (b & 1)
		ret = 1ll * ret * a % mod;
	return ret;
}

int Choose(int n, int r){
	return 1ll * fac[n] * rev[r] % mod * rev[n - r] % mod;
}

int main(){
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> x[i] >> y[i];
	fac[0] = 1;
	for (int i = 1; i <= 4 * B; i++)
		fac[i] = 1ll * fac[i - 1] * i % mod;
	rev[4 * B] = power(fac[4 * B], mod - 2);
	for (int i = 4 * B - 1; i >= 0; i--)
		rev[i] = 1ll * rev[i + 1] * (i + 1) % mod;
	
	for (int i = 0; i < n; i++)
		dp[-x[i] + B][-y[i] + B] ++;
	
	for (int i = 0; i <= 2 * B; i++){
		for (int j = 0; j <= 2 * B; j++){
			if (i > 0)
				dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
			if (j > 0)
				dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
		}
	}
	int answer = 0;
	for (int i = 0; i < n; i++){
		answer = (answer + dp[x[i] + B][y[i] + B]) % mod;
		answer = (answer - Choose(2 * (x[i] + y[i]), 2 * x[i]) + mod) % mod;
	}
	cout << 1ll * answer * power(2, mod - 2) % mod << endl;
}


Measured memory_bytes: 128896
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)
def y(f):
    if f:
        print('Yes')
    else:
        print('No')
def Y(f):
    if f:
        print('YES')
    else:
        print('NO')
def Z(f):
    if f:
        print('Yay!')
    else:
        print(':(')
def ispow(n):
    if int(n**.5)**2==n:
        return True
    return False

s = set(list(map(int,input().split())))
y(len(s) == 2)


Measured memory_bytes: 5068
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| min!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(z) = it.next() {
            Some(it.fold(z, |x, y| max!(x, y)))
        } else {
            None
        }
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let mut xs: Vec<usize> = (0..n+1).map(|_| sc.cin()).collect();
    let mut ys: Vec<usize> = (0..n).map(|_| sc.cin()).collect();
    let mut ans = 0;
    for i in 0..n {
        let dy = min!(xs[i], ys[i]);
        xs[i] -= dy;
        ys[i] -= dy;
        ans += dy;
        let dy = min!(xs[i+1], ys[i]);
        xs[i+1] -= dy;
        ans += dy;
    }
    put!(ans);
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


Measured memory_bytes: 12272
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] height =new long[N];
		long con = 0;

		for (int i = 0; i < N; i++) {
			height[i] = sc.nextLong();
		}

		for (int i = 1; i < N; i++) {
			if (height[i-1] > height[i]) {
				long let =height[i-1] - height[i];
				height[i] += let;
				con += let;
			}
		}

		System.out.println(con);


	}

}

Measured memory_bytes: 61060
#include<bits/stdc++.h>
#define ll long long
#define maxint 2147483647//10^13-1
#define maxll 9223372036854775807//10^64
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	n = pow(n,3);
	cout<<n;
	return 0;
}


Measured memory_bytes: 512
import sys

N = int(input())
a = list(map(float, input().split()))

ave = sum(a)/N

mini = float("inf")
ans = 0
for i,_a in enumerate(a):
	d = ave - _a
	d = abs(d)
	if d == 0:
		print(i)
		sys.exit()
	if mini > d:
		mini = d
		ans = i
print(ans)

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

int main() {
	string s,t;
	int sizes;
	cin>>s>>t;
	sizes=s.size();
	t=t.erase(sizes);
	if(s==t){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
return 0;
}

Measured memory_bytes: 3596
import java.util.Scanner;

//Aizu Buried Treasure
public class Main{

	int INF = 1<<29;
	int w, h, f, m, o;
	int[][] a;
	int[][][] dp, mem;
	
	int get(int H, int S, int p, int rest){
		if(rest<=1||p<0||w<=p)return INF;
		if(mem[S][p][rest]!=INF)return mem[S][p][rest];
		int res = INF;
		if(p-1>=0){
			int np = p-1, ns = S|(1<<np), nr = rest-1, c = 0;
			if(((S>>np)&1)==0){
				if(a[H][np]>0)nr = Math.min(m, nr+a[H][np]);
				else c+=-a[H][np];
			}
			res = Math.min(res, c+get(H, ns, np, nr));
		}
		if(p+1<w){
			int np = p+1, ns = S|(1<<np), nr = rest-1, c = 0;
			if(((S>>np)&1)==0){
				if(a[H][np]>0)nr = Math.min(m, nr+a[H][np]);
				else c+=-a[H][np];
			}
			res = Math.min(res, c+get(H, ns, np, nr));
		}
		int np = p, ns = 1<<p, nr = rest-1, c = 0;
		if(a[H+1][np]>0)nr = Math.min(m, nr+a[H+1][np]);
		else c+=-a[H+1][np];
		res = Math.min(res, c+dp[ns][p][nr]);
		return mem[S][p][rest] = res;
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		int INF = 1<<29;
		for(;;){
			w = sc.nextInt(); h = sc.nextInt();
			if((w|h)==0)break;
			f = sc.nextInt(); m = sc.nextInt(); o = sc.nextInt();
			a = new int[h][w];
			for(int i=0;i<h;i++)for(int j=0;j<w;j++)a[i][j]=sc.nextInt();
			dp = new int[1<<w][w][m+1];
			for(int i=0;i<1<<w;i++)for(int j=0;j<w;j++)for(int k=0;k<=m;k++)dp[i][j][k]=k==0?INF:0;
			for(int H=h-2;H>=0;H--){
				mem = new int[1<<w][w][m+1];
				for(int i=0;i<1<<w;i++)for(int j=0;j<w;j++)for(int k=0;k<=m;k++)mem[i][j][k]=INF;
				for(int j=0;j<w;j++)for(int k=0;k<=m;k++)get(H, (1<<j), j, k);
				dp = mem;
			}
			int res = INF;
			for(int j=0;j<w;j++)if(o-1>0){
				if(a[0][j]>0)res = Math.min(res, dp[1<<j][j][Math.min(m, o-1+a[0][j])]);
				else res = Math.min(res, -a[0][j]+dp[1<<j][j][o-1]);
			}
			System.out.println(f<res?"NA":res);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 0
#include <stdio.h>
#include <math.h>

#define MAX 1000000

int main(void)
{
  int prime[MAX];
  int n, ans;
  int i, j;

  for ( i = 0; i < MAX; i++ ) prime[i] = 1;

  prime[0] = 0;
  prime[1] = 0;

  for ( i = 2; i < sqrt((double)MAX) + 1; i++ ) {
    if ( prime[i] ) {
      for ( j = i*2; j <= MAX; j += i ) {
	prime[j] = 0;
      }
    }
  }

  while ( scanf("%d", &n) != EOF ) {
    ans = 0;
    for ( i = 2; i <= n; i++ ) {
      ans += prime[i];
    }

    printf("%d\n", ans);
  }

  return 0;
}

Measured memory_bytes: 4500