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

struct Node {
	int key;
	Node *next, *prev;
};

Node *nil;	//?????????

//?????????
void init() {
	nil = (Node *) malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}
//key?????????????´¢????????´????????????
Node* listSearch(int key) {
	Node *cur = nil->next;
	while (cur != nil && cur->key != key) {
		cur = cur->next;
	}
	return cur;
}


//?????????????????§??????
void printList() {
	Node *cur = nil->next;
	int isf = 0;
	while (true) {
		if (cur == nil) {
			break;
		}
		if ((isf++) > 0)
			printf(" ");
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}

//????????????
void deleteNode(Node *t) {
	if (t == nil) {
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

//?????????????????????
void deleteFirst() {
	deleteNode(nil->next);
}

//????????????????????? ...
void deleteLast() {
	deleteNode(nil->prev);
}

//key????????????????????????(????????????????´¢??????1???
void deleteKey(int key) {
	deleteNode(listSearch(key));
}

//????????????
void insert(int key) {
	Node *x = (Node *) malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

int main() {
	int n;
	cin >> n;	//????????°
	init();		//????????????
	string tmp;	//??????
	int key;
	for (int i = 0; i < n; i++) {
		cin >> tmp;
		if (tmp[0] == 'i') {
			cin >>key;
			insert(key);
		}else if(tmp == ("delete")){
			cin >> key;
			deleteKey(key);
		} else if (tmp == ("deleteFirst")) {
			deleteFirst();
		} else {
			deleteLast();
		}
	}
	printList();
	return 0;
}

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

#define LL long long

int main(){
    char a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a==b&&c==d&&b!=d)cout<<"Yes"<<endl;
    else if(a==c&&b==d&&c!=d)cout<<"Yes"<<endl;
    else if(a==d&&b==c&&d!=b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ff first
#define dd second
#define mp make_pair
#define pb push_back
#define pp pair<int,int>
#define N 4007 // check
#define M 10000
#define K 76
#define ll long long
using namespace std;

int n,d,m;

vector<vector<int>> ile1,ile2;


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> d;
    double ans = (m-1)*(n-d)*2*(1.0/n)*(1.0/n);
    if(d == 0)ans/=2.0;
    cout << setprecision(21) << ans << endl;
}

Measured memory_bytes: 256
import math
import bisect
N = int(input())
a = [int(x) for x in input().split()]

a.sort()
upper=bisect.bisect_left(a,a[-1]/2)
lower=upper-1 if upper>0 else 0
b = a[lower] if abs(a[-1]/2-a[lower])<=abs(a[-1]/2-a[upper]) else a[upper]
print(a[-1],b)


Measured memory_bytes: 14428
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    n%=10
    if n in [2,4,5,7,9]
        println("hon")
    elseif n in [0,1,6,8]
        println("pon")
    else
        println("bon")
    end
end
main()

Measured memory_bytes: 163200
INF = 10e15
N, M = map(int, input().split())
LRC = [tuple(map(int, input().split())) for _ in range(M)]
LRC.sort()
# print(LRC)

dp = [INF] * N
dp[0] = 0

for l, r, c in LRC:
    l -= 1
    r -= 1
    # print(l, r, c)
    if dp[l] == INF:
        continue
    for i in range(r, l, -1):
        if dp[i] > dp[l] + c:
            dp[i] = dp[l] + c
        else:
            break

# print(dp)
if dp[-1] == INF:
    print(-1)
else:
    print(dp[-1])


Measured memory_bytes: 92120
// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 09/08/20 03:55:25
// -----------------------------------

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using ll = long long;

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

  int n,m; cin>>n>>m;
  vector<string> grid(n); for (auto& l:grid) cin>>l;

  atcoder::mf_graph<int> mfg(n*m+2);
  int qs = n*m, qg = n*m+1;
  vector<int> ei;
  constexpr int dir[4][2] = {
      {1, 0}, {0, 1},
      {-1, 0}, {0, -1},
  };
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (grid[i][j] == '#') continue;
      if ((i+j)%2) {
        mfg.add_edge(qs, i*m+j, 1);
        for (auto [dx, dy] : dir) {
          int x = i + dx, y = j + dy;
          if (x < 0 or x >= n or y < 0 or y >= m or
              grid[x][y] == '#')
            continue;
          ei.push_back(
              mfg.add_edge(i*m+j, x*m+y, 1)
          );
        }
      } else {
        mfg.add_edge(i*m+j, qg, 1);
      }
    }
  }
  int ans = mfg.flow(qs, qg);
  cout << ans << endl;
  for (auto e : ei) {
    auto [s, t, c, f] = mfg.get_edge(e);
    if (f == 0) continue;
    if (s > t) swap(s, t);
    if (s/m == t/m) {
      grid[s/m][s%m] = '>';
      grid[t/m][t%m] = '<';
    } else {
      grid[s/m][s%m] = 'v';
      grid[t/m][t%m] = '^';
    }
  }
  for (auto& l : grid)
    cout << l << endl;

  return 0;
}


Measured memory_bytes: 5292
#include <string>
#include <iostream>
#include <stack>
#include <queue> // priority_queue も入ってる
#include <set>   // 要素数は size() で取得 multisetもある
#include <map>
#include <array> // sizeはコンパイル時定数で固定
#include <vector>
#include <numeric>   // accumulate, gcd
#include <algorithm> // count_ifに必要
#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定
#include <tuple>
#include <utility> //pair
#include <cmath>

using namespace std;
// 問題が起こるまでintは使用禁止2020-04-13
using ll = long long;

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

template <class InputIterator, class T>
bool contains_itr(InputIterator iterator, const T &value)
{
    if (find(iterator.begin(), iterator.end(), value) == iterator.end())
        return false;
    else
        return true;
}

template <class T>
bool contains_set(set<T> st, const T &value)
{
    if (st.find(value) == st.end())
    {
        return false;
    }
    else
    {
        return true;
    }
}

template <class InputIterator>
auto sum(InputIterator iterator)
{
    return accumulate(iterator.begin(), iterator.end(), 0);
}

// endは排他的(exclusive)なので注意
vector<ll> range(ll begin, ll end)
{
    vector<ll> result;
    for (ll i = begin; i < end; ++i)
    {
        result.push_back(i);
    }
    return result;
}

// =========ここまでテンプレ============

int main()
{
    ll n;
    cin >> n;
    vector<ll> as(n);
    bool containsZero = false;
    rep(i, n)
    {
        cin >> as[i];
        if (as[i] == 0)
        {
            containsZero = true;
        }
    }
    if (containsZero)
    {
        cout << 0 << endl;
    }
    else
    {
        ll result = 1;
        rep(i, n)
        {
            if (result >= LLONG_MAX / as[i])
            {
                result = -1;
                break;
            }
            result *= as[i];
            if (result > 1000000000000000000 || result < 0)
            {
                result = -1;
                break;
            }
        }
        cout << result << endl;
    }
}


Measured memory_bytes: 3676
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.replace(/\n$/,"")).split("\n");
while(true){
   var NK=Arr.shift();
   if(NK=="0 0")break;
   var nk=NK.split(" ").map(Number);
   var S=(Arr.shift()).split(" ").map(Number);
   for(var i=0;i<nk[0];i++){
      var B=(Arr.shift()).split(" ").map(Number);
      B.forEach(function(v,index){S[index]-=v;});
   }
   var flag=S.every(function(v){return (v>=0);});
   console.log(flag?"Yes":"No");
}

Measured memory_bytes: 15840
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; i--)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(vec));
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>
struct edge { int to, cost; };
using P = pair<int, int>;
using PP = pair<P, int>;
using D = pair<double, double>;
const int mod2 = 998244353;
const int mod = (int)1e9 + 7, inf = (int)1e16;

int modpow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) {
			ans *= x;
			if (mod <= ans) ans %= mod;
		}
		x *= x;
		if (mod <= x) x %= mod;
		n >>= 1;
	}
	return ans;
}

int fact[1000000];
void f_init(int n) {
	if (1000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= n; ++i) {
		fact[i] *= fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
	return;
}

int comb(int n, int r) {
	if (n < r) return 0;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2);
	if (ans < 0) return ans + mod;
	return ans;
}

int perm(int n, int r) {
	if (n < r) return 0;
	if (n - r < r) r = n - r;
	int ans= fact[n] * modpow(fact[n - r], mod - 2) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

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

bool pri(int p) {
	for (int i = 2; i * i <= p; ++i) if (p % i == 0) return false;
	return p > 1;
}

map<int, int>factring(int n) {
	map<int, int>ans;
	for (int i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++ans[i];
		}
	}
	if (n != 1) ++ans[n];
	return ans;
}

P operator+(const P& a, const P& b) {
	return P(a.first + b.first, a.second + b.second);
}
P operator-(const P& a, const P& b) {
	return P(a.first - b.first, a.second - b.second);
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mst(a,b) memset(a,b,sizeof(a))
#define ALL(x) x.begin(),x.end()
#define pii pair<int,int>
#define eps 1e-3
#define debug(a) cout << #a": " << a << endl;
inline int lowbit(int x){ return x & -x; }
const int N = 3e5 + 10;
const int mod = (int) 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long LINF = (1LL << 62);
typedef long long LL;
typedef unsigned long long ULL;
const double PI = acos(-1.0);
using namespace std;

//char buf[100000],*p1=buf,*p2=buf;
//inline char nc(){
//  return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
//inline bool read(int & x){
//  char c=nc();x=0;
//  if(c==EOF) return false;
//  bool flag = false;
//  for(;!isdigit(c);c=nc()) flag = true;
//  for(;isdigit(c);x=x*10+c-'0',c=nc());
//  if(flag) x *= -1;
//  return true;
//}
//inline bool readL(LL & x){
//  char c=nc();x=0;
//  if(c==EOF) return false;
//  bool flag = false;
//  for(;!isdigit(c);c=nc()) flag = true;
//  for(;isdigit(c);x=x*10+c-'0',c=nc());
//  if(flag) x *= -1;
//  return true;
//}
//LL q_pow(LL base, LL b){LL res=1;for(base%=mod;b;b>>=1,base=base*base%mod)if(b&1){res=res*base%mod;}return res;}



int main(){
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
//    freopen("out.txt","w",stdout);
#endif
  int n, m;
  scanf("%d%d", &n, &m);

  int ans = 0;
  for(int i = 1; i * i <= m; i++) {
    if(m % i == 0) {
      int tmp = m / i;
      if(1LL * i * n <= 1LL * m) ans = max(ans, i);
      if(1LL * tmp * n <= 1LL * m) ans = max(ans, tmp);
    }
  }

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


Measured memory_bytes: 256
#include<stdio.h>
#include<climits>
#define FOR(i,ii,n) for(int i=ii; i<N; i++)
#include <iostream>
#include <cstdlib>

int main(){
	int N;
	scanf("%d", &N);
	long long M[N][N];
	FOR(i,0,N){
		FOR(j,0,N){
			scanf("%lld", &M[i][j]);
		}
	}

	long long sum = 0;
	FOR(i,0,N){
		FOR(j,i+1,N){
			long long min = LLONG_MAX;
			FOR(k,0,N){
				if(i != k && j != k){
					long long tmp = M[i][k] + M[k][j];
					if(min > tmp)
						min = tmp;
				}
			}
			if(M[i][j] < min)
				sum += M[i][j];
			else if(M[i][j] > min){
				printf("-1");
				std::exit(0);
			}
		}
	}
	printf("%lld", sum);
}

Measured memory_bytes: 896
//Bismillahir Rahmanir Raheem
//#include<bits/stdc++.h>
#include<iostream>
#include<numeric>
#include<iomanip>
#include<stdlib.h>
#include<queue>
#include<map>
#include<unordered_map>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string>
#include<sstream>
#include<string.h>
#include<deque>
#include<set>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
typedef vector<int> vi;
typedef vector<pair<int,int> > vii;
typedef pair<int, int> pii;
#define FF first
#define SS second
#define MP make_pair
#define mxN (int)2e5 + 2
#define sz(n) (int)(n).size()
#define fasterIO ios::sync_with_stdio(0); cin.tie(0);
ll gcd(ll a, ll b)
{
    if(b == 0LL) return a;
    return gcd(b, a % b);
}
ll bigmod(ll a, ll b, ll mod)
{
    if(b == 0LL) return 1LL;
    ll sq = bigmod(a, b/2LL, mod);
    sq = (sq * sq) % mod;
    if(b&1LL) return (sq * (a%mod)) % mod;
    return sq;
}
vi primes;
vi sieve(const int n)
{
    vi primes(n+1, 0);
    primes[1] = 1;
	for (int p = 2; p*p <= n; p++)
    {
        if (!primes[p])
        {
            for(int i = p*p; i <= n; i += p)
                primes[i] = p;
        }
    }
  	for(int i = 2; i <= n; i++)
        if(!primes[i]) primes[i] = i;
    return primes;
}
map<int, int> getDivs(int x)
{
    map<int, int> divs;
    while(x > 1)
    {
        int div = primes[x];
        int cnt = 0;
        while(x%div == 0){
            x /= div;
            cnt++;
        }
        divs[div] = cnt;
    }
    return divs;
}
#define SIZE 15000005
#define INF 1000000000
#define MOD 1000000007LL
ll dp[2010];

ll f(int s)
{
    if(s == 0) return 1;
    if(dp[s] != -1) return dp[s];
    ll ans = 0;
    for(int i = 3; i <= s; i++)
    {
        if(s - i >= 0){
            ans = (ans%MOD + f(s-i)) % MOD;
        }
    }
    return dp[s] = (ans % MOD);
}

void solve()
{
    memset(dp, -1, sizeof(dp));
    int s;
    cin >> s;
    cout << f(s) << endl;
}
int main()
{
    int t = 1;
    //cin >> t;
    while(t--)
        solve();
    return 0;
}



Measured memory_bytes: 3176
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    long double l;
    cin >> l;
    l /= 3.0;
    cout << fixed << setprecision(20) << l * l * l << endl;
}

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

typedef unsigned long long ull;

int main(){
  ull N, A, B;
  cin >> N >> A >> B;
  
  ull ans=0;
  ull X=N/(A+B);
  ull Y=N%(A+B);
  ans+=A*X+min(Y,A);
  cout<<ans<<endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main() {

	int N, M;
	cin >> N >> M;

	vector<float> A(N);
	for (int i=0;i<N;++i)
	{
		cin >> A[i];
	}

	sort(A.begin(), A.end(), greater<int>());

	float S = accumulate(A.begin(), A.end(), 0);

	float C;
	C = S / (4 * M);

	for (int i = 0; i < M; ++i)
	{
		if (A[i] < C) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}

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

k = 0
for i in range(n):
    k += a[i]

num = float('inf')
ans = 0
for i in range(n-1, -1, -1):
    if num >= abs(k - a[i] * n):
        num = abs(k - a[i] * n)
        ans = i

print(ans)

Measured memory_bytes: 3064
/* -> Written by <-
   -----------
  |K_A_Z_A_M_A|
  |___________|
  |    ___    |
  |   (^_^)   |
  |  /( | )\  |
  |____|_|____|
    H O A N G
*/

// i hope i get better

// Task name:
#define Task ""
using namespace std;

// Include
#include <bits/stdc++.h>

// Define
#define reset(x, value) memset((x), (value) ,sizeof((x)))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i < (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define nl "\n"
#define bit(x,i) (x >> i) & 1
#define all(x) (x).begin(), (x).end()
#define optimize(x) (x).resize(unique(all(x)) - (x).begin())
#define Inpf freopen(Task".inp","r",stdin)
#define Outf freopen(Task".out","w",stdout)
#define fasterIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

// typedef
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vii;
typedef vector<ll> vll;

const int base = 131;
const int MOD = 1e9 + 7;
const ll MM = 1ll * MOD * MOD;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;

template <class T> inline void Gmax(T &x,T y)
{
    x = max((x), (y));
}
template <class T> inline void Gmin(T &x,T y)
{
    x = min((x), (y));
}

// --------------------------------------------------------------------
const int maxn = 1e5 + 5;
// --------------------------------------------------------------------

void Solve()
{
    string s, t;
    cin >> s >> t;
    if (t.size() != s.size() + 1)
    {
        cout << "No";
        return;
    }
    if (t.substr(0, s.size()) == s)
    {
        cout << "Yes";
    }
    else cout << "No";
}

int main()
{

    fasterIO;
    int test = 1;
//    cin >> test;
    while (test --)
        Solve();

    // Did you check with the special test case n = 0, n = 1??
}

// Goodbye, see u again


Measured memory_bytes: 3656
#include"bits/stdc++.h"
#include<unordered_set>
#include<unordered_map>
#include<random>
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

int N;
vector<int> chi[200000];

signed main(){
    cin >> N;
    rep(i, N-1){
        int a;
        cin >> a;
        a--;
        chi[a].pb(i);
    }
    rep(i, N){
        cout << chi[i].size() << endl;
    }
}

Measured memory_bytes: 14432
#include<stdio.h>
#define N 10000
#define Q 500

int find(int ,int *,int );

int main(){
  int x,y,s[N],t[Q],u[Q],i,j,k=0,l=0,a;

  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&y);
  for(i=0;i<y;i++){
    scanf("%d",&t[i]);
  }
  for(i=0;i<x;i++){
    for(j=0;j<y;j++){
      if(s[i]==t[j]){
	a=s[i];
	if((find(a,u,k))==0)continue;
	else {  
	  u[k]=s[i];
	  k++;
	}
	
      }
    }
  }
  printf("%d\n",k);
  return 0;
}
int find(int a,int *u,int k){
  int i;
  for(i=0;i<k;i++){
    if(a==u[i])return 0;
  }
  return 1;
}

  



Measured memory_bytes: 2048
#include <iostream>
using namespace std;
void ABC80(void);
void ABC81(void);
void ABC83(void);
void ABC85(void);
void ABC86(void);
void ABC87(void);
void ABC88(void);
void ABC89(void);

int main(void){
    ABC87();
}

void ABC87(){
    int x,a,b;
    cin>>x>>a>>b;
    cout<<(x-a)%b<<endl;
}

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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int a,b;
string s;

main() {
    cin >> a >> b >> s;
    rep(i,a+b) {
        if (i==a) {
            if (s[i] != '-') {
                ct("No")
                return 0;
            }
        } else {
            if (s[i] < '0' || s[i] > '9') {
                ct("No")
                return 0;
            }
        }
    }
    ct("Yes")
}






Measured memory_bytes: 256
#include <iostream>

using namespace std;

typedef long long ll;

int main(int argc, char *argv[])
{
	int N;
	int H[100005];

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}
	string ans = "Yes";

	for (int i = N - 1; i >= 1; i--) {
		if (H[i - 1] - H[i] <= 1) {
			if (H[i - 1] - H[i] == 1) {
				H[i - 1]--;
			}
		} else {
			ans = "No";
			break;
		}
	}

	cout << ans << endl;
	return 0;
}

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

string S;

int main() {
	cin >> S;

	char c = '1';
	int cnt = 0;
	int cnt2 = 0;
	for( int i = 0; i < S.size(); i++ ) {
		if( S[i] == c ) {
			cnt++;
		}
		else {
			cnt2++;
		}
		if( c == '0' ) {
			c = '1';
		}
		else {
			c = '0';
		}
	}
	int ans = min( cnt, cnt2 );

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main() {
  int H, A;
  cin >> H >> A;
  
  if (H % A == 0) {
    cout << H / A << endl;
  }
  
  else if (H % A != 0) {
    cout << (H / A) + 1 << endl;
  }

}


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

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



int main(){
  ll n,m;
  cin >> n >> m;

  map<ll,ll> mp;
  rep(i,n){
    ll a,b;
    cin >> a >> b;
    mp[a] += b;
  }

  ll ans = 0;
  for(auto it : mp){
    ll c = it.first;
    ll b = it.second;

    if(b>=m){
      b = m;
      ans += c*m;
      cout << ans << endl;
      break;
    }else{
      m-=b;
      ans += c*b;
    }
  }


  return 0;
} 



Measured memory_bytes: 6528
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 100000+5;
const int dx[] = {-1,1,0,0,-1,-1,1,1};
const int dy[] = {0,0,-1,1,-1,1,-1,1};
using namespace std;

LL a[N];
int main() {
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);

    LL ans1=0,sum1=0;
    LL ans2=0,sum2=0;
    if(a[1]>0){
        sum1=a[1];
        sum2=-1;
        ans2=a[1]+1;
    }
    else if(a[1]==0){
        sum1=1;
        ans1=1;
        sum2=-1;
        ans2=1;
    }
    else{
        sum1=1;
        sum2=a[1];
        ans1=llabs(a[1])+1;
    }

    for(int i=2;i<=n;i++){
		if(sum1>0){
			if(a[i]+sum1<0)
                sum1+=a[i];
			else{
				ans1+=a[i]+sum1+1;
				sum1=-1;
			}
		}
		else{
			if(a[i]+sum1>0)
                sum1+=a[i];
			else{
				ans1+=llabs(sum1+a[i])+1;
				sum1=1;
			}
		}
	}
	if(sum1==0)
		ans1++;

    for(int i=2;i<=n;i++){
        if(sum2>0){
            if(a[i]+sum2<0)
                sum2+=a[i];
			else{
				ans2+=a[i]+sum2+1;
				sum2=-1;
			}
        }
        else {
            if(a[i]+sum2>0)
                sum2+=a[i];
            else{
				ans2+=llabs(sum2+a[i])+1;
				sum2=1;
			}
        }
    }
    if(sum2==0)
        ans2++;



    LL res=min(ans1,ans2);
    printf("%lld\n",res);
    return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<cstring>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
const int N=1000100,P=1e9+7;
int n,s[8][2]={1,2,3,4,5,6,3,3,1,7,1,2,2,2,4,4},f[N][8];
char t[N];
int main(){
	//freopen("1.in","r",stdin);
	scanf("%s",t+1);n=strlen(t+1);
	f[0][0]=1;
	FOR(i,1,n)FOR(j,0,7){
		if(t[i]^49) (f[i][s[j][1]]+=f[i-1][j])%=P;
		if(t[i]^48) (f[i][s[j][0]]+=f[i-1][j])%=P;
	}
	cout<<(f[n][1]+f[n][3])%P<<'\n';
}

Measured memory_bytes: 11904
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> arr;
typedef vector<arr> matrix;
typedef vector<ll> longarr;
typedef vector<longarr> longmat;
typedef map<int, arr> graph;
typedef vector<char> chararr;
typedef vector<chararr> charmat;
typedef pair<int, int> fraction;
ll MOD = 1000000007;
int n, k;


int main() {

	int n, k;
	cin >> n >> k;
	vector<bool> dp(k + 1, false);
	vector<int> move(n, 0);
	for (int i = 0; i < n; ++i)
	{
		cin >> move[i];
	}
	for (auto x : move)
	{dp[x] = true;}

	for (int i = 0; i <= k; ++i) {
		if (!dp[i]) {
			for (auto x : move) {
				if ((i - x) >= 0 && !dp[i - x]) {dp[i] = true; break;}
			}
		}
	}
	cout << (dp[k] ? "First" : "Second");

}

Measured memory_bytes: 3640
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		System.out.println(a-b<c?(c-a+b):0);
	}

}


Measured memory_bytes: 21972
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include<string.h>

int selectionSort(int R[], int N);

void swap(int *a, int *b);

int main(void) {

	int N;
	scanf("%d\n", &N);//半角スペースで区切ることができる。

	int R[100];

	int t,k,x;
	for (t = 0; t < N ; t++) {
		scanf("%d", &R[t]);
	}
	
	x = selectionSort(R, N);
	
	for (k = 0; k < N; k++) {
        if(k > 0){printf(" ");}
	printf("%d", R[k]);
	}
	printf("\n%d\n",x);

	return 0;
	
	}

int selectionSort(int R[],int N) {
	int i,j,minj;
	int count = 0;
	for (i = 0; i < N-1; i++) {
		minj = i;
		for (j = i; j < N; j++) {
			if (R[j] < R[minj]) {
				minj = j;
			}
		}
		swap(&R[i], &R[minj]);
		if (i != minj) {
			count++;
		}
	}
	return count;
}

void swap(int *a, int *b) {
	int k;
	k = *a;
	*a = *b;
	*b = k;
}


Measured memory_bytes: 2044
function main(input: String) {
    if (input.charAt(0) === 'S') {
        if (input.charAt(1) === 'S') {
            if (input.charAt(2) === 'S') {
                console.log('0');
            } else {
                console.log('1');
            }
        } else {
            if (input.charAt(2) === 'S') {
                console.log('1');
            } else {
                console.log('2');
            }
        }
    } else {
        if (input.charAt(1) === 'S') {
            if (input.charAt(2) === 'S') {
                console.log('1');
            } else {
                console.log('1');
            }
        } else {
            if (input.charAt(2) === 'S') {
                console.log('2');
            } else {
                console.log('3');
            }
        }
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29624
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7;

vector<int> A;
int N;

int main() {
	cin >> N;
	A.resize(N);
	for (int n = 0; n < N; n++)cin >> A[n];
	long long ans = A[0];
	for (int n = 1; n < N; n++) {
		if (A[n] > A[n - 1])ans += A[n] - A[n - 1];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

//for loop関係
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

//略記
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

//定数
const int INF = 1<<30;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

//Degree <-> Radian
double toRad(double d){ double rad; rad=d*PI/180; return rad; }
double toDegree(double rad){ double d; d=rad*180/PI; return d; }
//The least common multiple : lcm
ll lcm(int a,int b){ return a*b/__gcd(a,b); }
//素数判定
bool isPrime(int n){
    int i; 
    if(n<2) return 0;
    else if(n==2) return 1;
    if(n%2==0) return 0;
    for(i=3;i*i<=n;i+=2) if(n%i==0) return 0;
    return 1;
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    string s2=s;
    reverse(all(s2));
    int count=0;
    int n=s.size();
    int i=0;
    rep(i,0,n){
        if(s[i]!=s2[i]){
            count++;
        }
    }
    cout << count/2 ENDL;
    
    return 0;
}

Measured memory_bytes: 3592
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,n-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);

int gcd(int a, int b) {
	if(!a&b) return 0;
	else {
		int c;
		while(a != 0) {
			c = a; a = b%a, b = c;
		}
		return b;
	}
}

int lcm(int a, int b) {
	if(!a&b) return 0;
	else return (a/gcd(a, b)*b);
}

int main() {
	int a, b;

	while(cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;
ll MOD = 1e9+7;

using namespace std;

int p[100001];

int main()
{
	int n;
	int ans=0;
	
	cin>>n;
	for(int i=1;i<n+1;i++)
		cin>>p[i];
	
	for(int i=1;i<n+1;i++)
	{
		if(p[i]==i)
		{
			ans++;
			int t=p[i+1];
			p[i+1]=p[i];
			p[i]=t;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int eps = 1e-8;
typedef long double LD;
typedef pair<int, int> pii;
#define lop(i,a,b) for(register int i = (a); i <= (b); ++i)
#define dlop(i,a,b) for(register int i = (a); i >= (b); --i)
#define bl(i) for(int i = head[u]; i; i = G[i].next)
//char buf[50<<20], *p1=buf;
//#define getchar() (*p1++)
#define MP make_pair
template<class T> void read(T & x){
  register int c = getchar(), f = 1; x = 0;
  while(!isdigit(c)){if (c == '-') f = -1; c = getchar();}
  while(isdigit(c)) x = x*10+(c&15), c = getchar();
  x *= f;
}
int n, m, s;
int main(void){
  read(n), read(m), read(s);
  //fread(buf,1,50<<20,stdin);
  if (n + m >= s) puts("Yes");else {
    puts("No");
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	ll n;
	cin >> n;
	ll a[n], b[n];
	zep(i, 0, n){cin >> a[i];}
	zep(i, 0, n){cin >> b[i];}
	ll cnta = 0;
	ll cntb = 0;
	zep(i, 0, n){
		if(a[i] > b[i]){
			cntb += a[i]-b[i];
		}
		else{
			cnta += (b[i]-a[i]+1)/2;
			cntb += (b[i]-a[i])%2;
		}
	}
	//print(cnta)
	//print(cntb)
	if(cnta >= cntb){
		print("Yes")
	}
	else{
		print("No")
	}
	return 0;
}

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

int main() {
  int N, z;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    z += y - x + 1;
  }
  
  cout << z;
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int,input().split()))
ans = 10**20

for i in[-1,1]:
    ansi,sum = 0,0
    for a in A:
        sum += a
        if sum*i <= 0:
            ansi +=abs(sum-i)
            sum = i
        i *= -1
    ans = min(ans,ansi)
print(ans)


Measured memory_bytes: 14332
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vvd= vector<vd>;
using vc= vector<char>;
using vb= vector<bool>;
using vl= vector<ll>;
#define rep(i,x,n) for(int i=x; i<n; i++)
#define all(x) x.begin(), x.end()

int main(){
  string s;
  cin >> s;
  s[5]=' ';
  s[13]=' ';
  cout << s;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int val;

	//
	int second, minute, hour;


	//標準入力
	cin >> val;

	//時間を算出
	hour = val / 3600;

	//valから時間分の秒数を引く
	val = val - hour * 3600;

	//valから分を引く
	minute = val / 60;

	//valから分数分の秒数を引く
	second = val - minute * 60;

	//出力
	cout << to_string(hour) + ":" + to_string(minute) + ":" + to_string(second) << endl;
 
	return 0;
    
}


Measured memory_bytes: 3280
# ABC 157 C
list_s=[]
list_c=[]
Flag=0
N,M= map(int,input().split())

for i in range(M):
    s,c= map(int,input().split())
    list_s.append(s)
    list_c.append(c)
    if s in list_s:
        x=list_s.index(s)
        n=list_c[x]

        if n!=c:
            Flag=1

if 1 in list_s:
    in1=list_s.index(1)
    n1=list_c[in1]
    if n1==0:
        Flag=1
else :
    n1=1

if 2 in list_s:
    in2=list_s.index(2)
    n2=list_c[in2]
else :
    n2=0

if 3 in list_s:
    in3=list_s.index(3)
    n3=list_c[in3]
else :
    n3=0

if N==1 and n1==0:
    Flag=0
    
if Flag==0:
    if N==1:
        if M==0:
            print(0)
        else:
            print(n1)
    if N==2:
        print(10*n1+n2)
    if N==3:
        print(100*n1+10*n2+n3)
else :
    print(-1)


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

int main() {
  int n, a, b;
  cin >> n >> a >> b;

  if (n * a < b) {
    cout << n * a << endl;
  }
  else if (n * a > b) {
    cout << b << endl;
  }
  else {
    cout << b << endl;
  }
}


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


#define rep(i,n) for(int i = 0;i<n;i++)
#define _GLIBCXX_DEBUG
using ll = long long; 
using namespace std;




int main() {
	ll n,k;
	cin>>n>>k;
	ll a = n%k;
	ll ans = min(a,k-a);
	cout<<ans<<endl;
}


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

#define N 200005

int n, q;
char s[N], t[N][2];

inline bool check(int x, int opt) {
    for (int i = 1; i <= q; ++i) {
        if (t[i][0] == s[x])
            x += (t[i][1] == 'L') ? -1 : 1;
    }
    return opt == 0 ? (x == 0) : (x == n + 1);
}

inline int Get(int x) {
    int l = 1, r = n, res = (x == 0) ? 0 : n;
    while (l <= r) {
        int mid = (l + r) >> 1;
        //if (x == 1 && mid == 6) cout << check(mid, x) << res << endl;
        if (check(mid, x)) x == 0 ? (l = (res = mid) + 1) : (r = res = (mid) - 1);
        else x == 0 ? (r = mid - 1) : (l = mid + 1);
    }
    return res;
}

int main() {
//    freopen("work.in", "r", stdin);
//    freopen("work.out", "w", stdout);
    cin >> n >> q;
    scanf("%s", s + 1);
    for (int i = 1; i <= q; ++i)
        scanf("\n%c %c", &t[i][0], &t[i][1]);
    int a = Get(0), b = Get(1);
    //cout << a << " " << b << endl;
    cout << b - a << endl;
    return 0;
}


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

int main() {
	int n, x;
	cin >> n >> x;
	vector<int> nec(n);
	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> nec.at(i);
		sum += nec.at(i);
	}
	int rest = x - sum;
	int min = nec.at(0);
	for (int i = 1; i < n; i++) {
		if (min > nec.at(i)) {
			min=nec.at(i);
		}
	}
	int max = rest / min;
	std::cout << n + max << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a,b,d,r;
	
	double f;
	
	scanf("%d %d/n",&a,&b);
	
	d=a/b;
	r=a%b;
	f=(double)a/(double)b;
	
	printf("%d %d %f\n",d,r,f);
	
	return 0;
}

Measured memory_bytes: 636
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <set>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define MP make_pair
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define IFOR(v,it) for(VI::iterator it=(v).begin();it!=(v).end();++it)


int main() {
  int P, Q, R;
  cin >> P >> Q >> R;

  vector<int> v;
  v.PB(P);
  v.PB(Q);
  v.PB(R);
  SORT(v);
  cout << v[0] + v[1] << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;
typedef vector<vector<ll>> matrix;//matrix A(n, vl(m)); //n*m行列
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sortup(V) sort(V.begin(), V.end())
#define sortdown(V) sort(V.rbegin(), V.rend())
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 INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007 //998244353


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

    // solution comes here

    string S;
    cin >> S;
    
    ll l=0, r=S.size()-1, ans=0;
    while(l<r){
        if(S[l] != S[r]) ans++;
        l++;
        r--;
    }

    cout << ans << nl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}
 
void solve(){
 
 
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();

    ld r;cin>>r;
    cout<<setprecision(12);
    cout<<2*r*3.14159265359;

	return 0;
}
 



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

int row[8],col[8],dpos[15],dneg[15];

bool X[8][8];

void init(){
  for (int i = 0; i < 8; i++) {
    row[i] = col[i] = 1;
  }
  for (int i = 0; i < 15; i++) {
    dpos[i] = dneg[i] = 15;
  }
}

void printBoard(){
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      if(X[i][j]){
        if(row[i] != j) return;
      }
    }
  }
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      cout <<((row[i] == j) ? "Q" : ".");
    }
    cout << endl;
  }
}

void recursive(int i){
  if (i == 8){
    printBoard(); return;
  }

  for (int j = 0; j < 8; j++) {
    if(col[j] == -1 || dpos[i+j] == -1 || dneg[i-j+7] == -1) continue;
    row[i] = j;
    col[j] = dpos[i+j] = dneg[i-j+7] = -1;
    recursive(i+1);
    col[j] = dpos[i+j] = dneg[i-j+7] = 1;
  }
}
int main() {
  init();

  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      X[i][j] = false;
    }
  }
  int k; cin >> k;
  for (int i = 0; i < k; i++) {
    int r,c; cin >> r >> c;
    X[r][c] = true;
  }

  recursive(0);

  return 0;
}



Measured memory_bytes: 3128
#include <iostream>
#include <cfloat>
#include <iomanip>
using namespace std;

double kitaichi(int n) {
  int goukei;
  goukei = n * (n+1) / 2;
  double a;
  a = (double)goukei / (double)n;
  return a;
}

int main(){
  int N, K;
  cin >> N >> K;
  int p[N+100];
  double kitai[N+100];
  for(int i=0;i<N;++i) {
    cin >> p[i];
    kitai[i] = kitaichi(p[i]);
  }
  double hako = 0;
  for(int j=0;j<K;++j) hako += kitai[j];
  double max = hako;
  for(int k=0;k<(N-K);++k) {
    hako = hako - kitai[k] + kitai[k+K];
    if(max < hako) max = hako;
  }
  cout << fixed << setprecision(15) << max;
}


Measured memory_bytes: 2560
#include <iostream>
#include <cmath>
#define LL long long
using namespace std;
int main() {
	LL n, p, ans;
	cin >> n >> p;
	bool flag = true;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		if (x % 2 == 1)flag = false;
	}
	if (flag)ans = p == 0 ? (LL)pow(2, n) : 0;
	else ans = (LL)pow(2, n - 1);
	cout << ans << endl;
}

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

int main(){

  int n;
  int a[5];

  cin >> n;

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

  if(n == 2){
    for(int i=1;i<=a[1]/2;i++){
      if(a[0] % i == 0 && a[1] % i == 0) printf("%d\n",i);
    }
  }

  if(n == 3){
    for(int i=1;i<=a[2]/2;i++){
      if(a[0] % i == 0 && a[1] % i == 0 && a[2] % i == 0) printf("%d\n",i);
    }
  }

}

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

#define N 200123
#define mod 1000000007

int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    string s, t;
    int lastidx = 0;
    long long ans = 0;
    cin >> s >> t;
    
    vector<int> v[26];
    int n = (int)s.size();
    int m = (int)t.size();

    for(int i = 0 ; i < n ; i++)
    	v[(int)s[i]-'a'].push_back(i+1);
    

    lastidx = 0;

    for(int i = 0 ; i < m ; i++){
    	int c = (int)t[i]-'a';
    	if(v[c].empty()){
    		cout << -1 << endl;
    		return 0;
    	} else {
    		int loc = (int)(lower_bound(v[c].begin(), v[c].end(), lastidx+1)-v[c].begin());
    		if(loc == (int)v[c].size()){
    			loc = 0;
    			ans += (long long)(v[c][loc] + n-lastidx);
    		} else {
    			ans += (long long)(v[c][loc] - lastidx);
    		}
    		lastidx = v[c][loc];
    	}
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1228
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#ALDS1_2_A

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

count = 0
flag = True
while flag:
    flag = False
    for i in range(len(A)-1, 0, -1):
        if A[i] < A[i-1]:
            A[i], A[i-1] = A[i-1], A[i]
            count += 1
            flag = True

print(" ".join(list(map(str, A))))
print(count)


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

int main() {
  string s;
  cin >> s;
  if (s[0] != s[1] || s[0] != s[2] || s[1] != s[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

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

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

string A[105];
ll C[30];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll H, W;
    cin >> H >> W;
    memset(C, 0, sizeof(C));
    REP(i, H) {
        cin >> A[i];
    }
    REP(i, H) {
        REP(j, W) {
            C[A[i][j] - 'a']++;
        }
    }

    bool success = true;
    REP(h, (H + 1) / 2) {
        REP(w, (W + 1) / 2) {
            ll s = 1;
            if (H - h - 1 != h)
                s *= 2;
            if (W - w - 1 != w)
                s *= 2;

            ll index = -1;
            REP(n, 27) {
                if (C[n] < s)
                    continue;

                if (index < 0 || C[index] > C[n])
                    index = n;
            }

            if (index < 0)
                success = false;
            C[index] -= s;
        }
    }

    if (success)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
use std::io;
fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).unwrap();
    let n = buf.trim().parse::<i32>().unwrap();
    buf.clear();
    stdin.read_line(&mut buf).unwrap();
    let a = buf.trim().parse::<i32>().unwrap();
    if n % 500 <= a {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
int main(void)
{
	long long int a, b, tmp;
	while(1){
	int i=1,r;
	scanf("%lld %lld", &a, &b);
	if(a == 0&&b == 0) break;
	if(a<b)
	{
		tmp=a;
		a=b;
		b=tmp;
	}
	r = a%b;
	while(r != 0){
		a=b;
		b=r;
		r=a%b;
		i++;
	}
	printf("%lld %d\n", b, i);
}
	return 0;
}


Measured memory_bytes: 2040
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int sum(int);
int main() {
	int n;
	for (; ~fscanf(stdin, "%d", &n), n != 0;fprintf(stdout, "%d\n",sum(n)));
	return 0;
}

int sum(int n){
	int i, j,s=0,c=0;
	for (i = 1; i < (n / 2) + 1; i++) 
		for (j = i, s = 0; s < n; j++) {
			s += j; if (s == n)c++;
		}
	return c;
}

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

int main(){
	char b,d;
	cin>>b;
	if(b=='A'){
		d='T';
	}
	if(b=='T'){
		d='A';
	}
	if(b=='G'){
		d='C';
	}
	if(b=='C'){
		d='G';
	}
	cout<<d<<endl;	
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

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

    cout << accumulate(l.begin(), l.begin()+k, 0) << endl;
}

Measured memory_bytes: 256
N, C = map(int, input().split())
D = [list(map(int, input().split())) for _ in range(C)]
grid = [list(map(int, input().split())) for _ in range(N)]

def main():
    state = [[0 for _ in range(C)] for _ in range(3)]
    for c in range(C):
        for w in range(N):
            for h in range(N):
                cost = D[grid[h][w]-1][c]
                state[(h+w)%3][c] += cost

    for c1 in range(C):
        for c2 in range(C):
            if c1 == c2:
                continue
            for c3 in range(C):
                if c3 == c1 or c3 == c2:
                    continue
                cost = state[0][c1] + state[1][c2] + state[2][c3]
                if c1 == 0 and c2 == 1 and c3 == 2:
                    ans = cost
                    continue
                ans = min(cost, ans)
    print(ans)

if __name__ == "__main__":
    main()

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

int main() {
  int n = 0;
  int count = 1;
  cin >> n;
  vector <string> v(n);
  for(int i = 0; i < n; i++){
    cin >> v[i];
  }
  sort(v.begin(),v.end());
  for(int i = 1; i < n; i++){
    if(v[i] != v[i-1]){
      count++;
    }
  }
  cout << count;
}

Measured memory_bytes: 9452