akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>


using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;


//BDD,ZDD,kdtree, bdtree,bicalc, bolonoy, doloney, tree, chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu, heirokenshutu, topologicalsort, kyourenketuseibun

#define REP(i,a,b) for(int i = a; i < b; ++i)
#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")

ll N, K;
vector<ll> a;
vector<ll> ap;
vector<ll> am;
ll MOD = 1000000007;

ll mod(ll x) { return (x%MOD + MOD) % MOD; }
int main() {
	cin >> N >> K;
	a.resize(N);
	REP(i,0, N) {
		cin >> a[i];
		if (a[i] >= 0)ap.push_back(a[i]);
		else am.push_back(a[i]);
	}

	bool minus = false;
	int ccc = 0;
	while (ccc + 2 <= K && ccc + 2 <= am.size()) ccc += 2;
	if (ccc + ap.size() < K) minus = true;
	if (minus) {
		sort(a.begin(), a.end(), [](ll x, ll y) {return abs(x) < abs(y); });
		ll ret = 1;
		REP(i, 0, K) ret = mod(ret * a[i]);
		PRI(ret);
		return 0;
	}
	sort(ap.begin(), ap.end(), greater<ll>());
	sort(am.begin(), am.end(), less<ll>());
	vector<ll> pick(K);
	REP(i, 0, K) pick[i] = i < ap.size() ? ap[i] : 0;
	sort(pick.begin(), pick.end(), less<ll>());
	for (int i = 0; i + 1 < K && i + 1 < am.size(); i += 2) {
		if (pick[i] * pick[i + 1] < am[i] * am[i + 1]) {
			pick[i] = am[i];
			pick[i + 1] = am[i + 1];
		}
		else break;
	}
	ll ret = 1;
	REP(i, 0, K) ret = mod(ret * pick[i]);
	PRI(ret);
	return 0;
}




Measured memory_bytes: 7976
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
    string s;
    vector<string>word;
    cin >> s;
    int cnt = 0, slen = s.size();
    word.push_back(s.substr(0, 1));
    for (int i = 1; i < slen; i++) {
        if (slen - i == 2) {
            if (s[slen - 1] == s[slen - 2]) {
                if (word[cnt] == s.substr(slen - 2, 2)) {
                    word[cnt] = s.substr(slen - 4, 3);
                    word.push_back(s.substr(slen - 1, 1));
                    break;
                }
                else {
                    word.push_back(s.substr(slen - 2, 2));
                    break;
                }
            }
        }
        if (word[cnt] != (s.substr(i, 1))) {
            word.push_back(s.substr(i, 1));
            cnt++;
        }
        else if (slen - i >= 2) {
            word.push_back(s.substr(i, 2));
            i++;
            cnt++;
        }
    }
    cout << word.size()<< endl;
    return 0;
}


Measured memory_bytes: 11860
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <cassert>

using namespace std;

multiset<long long> s;

const int N = 1e5 + 7;
const long long INF = 1LL << 60;

int n, t, e;
long long pos[N], f[N];

int main() {
	scanf("%d %d %d", &n, &e, &t);
	for (int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		pos[i] = x;
	}
	pos[0] = 0;
	f[0] = 0;
	long long min_v = INF;
	s.insert(f[0] - pos[0]);
	for (int i = 1, j = 0; i <= n; i++) {
		while (2 * pos[j + 1] + t < 2 * pos[i]) {
			min_v = min(min_v, f[j] - 2 * pos[j + 1] - pos[j]);
			if (s.size()) {
				s.erase(s.find(f[j] - pos[j]));
			}
			j++;
		}
		f[i] = min_v + 3 * pos[i];
		if (s.size()) {
			f[i] = min(f[i], *(s.begin()) + pos[i] + t);
		}
		s.insert(f[i] - pos[i]);
	}
	cout << f[n] + e - pos[n] << endl;
}

Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i,m,n) for(int i = m;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl;
#define Vecpr vector<pair<lli,lli>>
#define mod 1000000007;
int main() {
  lli A,B,C=0,D=0,E=0,F=0,G=0,H=0,N,M;
  cin >> N >> M;
  M-=1000*N;
  rep(i,0,N+1){
    rep(j,0,N-i+1){
    if(9000*i+4000*j==M){
      C=i;D=j;
      E=1;
      break;
    }
    }
  if(E)break;
  }
  if(E==0){
    C=-1;D=-1;N=-3;
  }
cout << C << " " << D << " " << N-(C+D) << endl;
}

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

#define ls(x) ch[x][0]
#define rs(x) ch[x][1]
#define rep(i , j , k) for(int i = j ; i <= k ; i ++)
#define Rep(i , j , k) for(int i = j ; i >= k ; i --)

using namespace std ;
using ll = long long ;
using pii = pair <int , int> ;
using vii = vector <int> ;

auto ot = [&]() { cerr << "ATS TXDY" << '\n' ; int ATS_nantf_txdy = true ; } ;
auto _ios = [&]() { ios :: sync_with_stdio(false) ; cin.tie(nullptr) ; cout.tie(nullptr) ; } ;

namespace stO_ATS_Orz {
  template < class T > void cmax(T & x , T y) { if(x > y) x = y ; }
  template < class T > void cmin(T & x , T y) { if(x < y) x = y ; }
  template < class T > void abs(T x) { if(x < 0) x = -x ; }
  int n , cnt = 0 ;
  void main() {
    cin >> n ;
    while(n - 100 >= 0) {
      n -= 100 ;
      cnt ++ ;
    }
    if(cnt * 5 >= n) {
      cout << '1' << '\n' ;
    }
    else {
      cout << '0' << '\n' ;
    }
  }
}
signed main() {
  _ios() ; ot() ;
  return stO_ATS_Orz :: main() , 0 ;
}

Measured memory_bytes: 256
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include<stack>

using namespace std;

int main(void) {
	int N = 0, M = 0, X = 0;
	int A[100] = { 0 };
	int a = 0, b = 0;

	scanf("%d%d%d", &N, &M, &X);
	for (int i = 0; i < M; i++) {
		int j = 0;
		scanf("%d", &j);
		if (j < X)
			a++;
		else
			b++;
	}

	printf("%d\n", a > b ? b : a);

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;




int main()
{

    int N,P;
    cin >> N >> P;
    vl A(N);
    in(N,A);
    ll sumA = 0;
    ll ans = 1;
    int a = 0;
    rep(i,N){
        sumA += A[i],ans *= 2;
        if(A[i]%2==0) a++;
    }
    
    if(a == N && P == 1) cout << 0 << endl;
    else if(N-a > 0) cout << ans/2 << endl;
    else cout << ans << endl;
    
    

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<deque>
#include<algorithm>
using namespace std;
int solve(){
    string S;
    string T;
    cin>>S;
    cin>>T;
    cout<<T<<S<<endl;
    return 0;
}

int main(){
    int T = 1;
    while(T--){
        int res = solve();
        // cout<<res<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N,M,C;
    int B[20];
    int cnt=0;
    int A[20];
    cin>>N>>M>>C;
    for(int i=0;i<M;i++) cin>>B[i];
    for(int i=0;i<N;i++){
        int sum=C;
        for(int j=0;j<M;j++){
            cin>>A[j];
            sum+=A[j]*B[j];
        }
        if(sum>0) cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}



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

ll n, q, sum;
map<ll, ll> nums;

int main(void) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i=0; i<n; ++i) {
        int a;
        cin >> a;
        sum+=a;
        nums[a]++;
    }
    cin >> q;
    while (q--) {
        int a, b;
        cin >> a >> b;
        if (nums.count(a)) {
            sum+=(b-a)*nums[a];
            nums[b]+=nums[a];
            nums[a]=0;
        }
        cout << sum << '\n';
    }
}


Measured memory_bytes: 8756
n=int(input())
alp=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
outnum=[]

i=0
while True:
    tmp=n % (26 ** (i+1))
    outnum.append(tmp // (26**i))
    if tmp == 0:
        tmp = 26 ** (i+1)
    n -= tmp
    if n == 0:
        break
    else:
        i += 1

outnum.reverse()
out=[]
for ou in outnum:
    out.append(alp[ou-1]) 
print("".join(out))


Measured memory_bytes: 9020
#include <iostream> // cout, endl, cin
#include <string>
using namespace std;

int main(){
    int N;
    cin>>N;
    string S;
    cin>>S;
    int num;
    char ans;
    num=0;
    for(int i=0;i<S.length();i++){
        num= (int)(S.at(i))+N;
        if(num<=90){
        ans=(char)(num);
        cout<<ans;
        }
        else{
            num= (int)(S.at(i))+N-26;
            ans=(char)(num);
            cout<<ans;
        }
    }
    cout<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	long long n, i, j, k, ans = 1, MOD = 1000000007;
	cin >> n;
	for (i = 1; i <= n; i++) ans = (ans * i) % MOD;
	cout << ans;

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) std::cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) std::cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) std::cout << x << endl;
#define println(x) std::cout << x << endl;
template<typename T>bool mins(T& x,const T&y){if(x>y){x=y;return true;}else return false;}
template<typename T>bool maxs(T& x,const T&y){if(x<y){x=y;return true;}else return false;}
const ll INF = 1e18;
using namespace std;
using namespace atcoder;
void Main()
{
    ll K;
    cin >> K;

    rep(i, K) cout << "ACL";
    cout << endl;
}
signed main(){ Main();return 0;}

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

int main() {
    int N; cin >> N;
    int b_tmp;
    vector<int> b;
    for (int i = 0; i < N; i++) {
        cin >> b_tmp;
        b.push_back(b_tmp);
    }
    vector<int> operate;
    bool is_continue = true, is_erase = false;
    while (is_continue) {
        is_erase = false;
        for (int i = b.size()-1; i >= 0; i--) {
            if (i+1 == b[i]) {
                operate.push_back(b[i]);
                b.erase(b.begin() + i);
                is_erase = true;
                break;
            }
        }
        if (b.size() == 0) is_continue = false;
        else if (is_erase == false) is_continue = false;
    }
    if (is_erase == false) cout << -1 << endl;
    else {
        for (int i = operate.size()-1; i >= 0; i--) {
            cout << operate[i] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var a, b, c int
	if _, err := fmt.Scan(&a, &b, &c); err != nil {
		panic(err)
	}

	ls := []int{a, b, c}
	sort.Ints(ls)

	fmt.Printf("%d %d %d\n", ls[0], ls[1], ls[2])
}



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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e18;
const int MOD = 1e9 + 7;

signed main(){
    int N; cin >> N;
    vector<int> b( N - 1 );
    REP( i, N - 1 ){
        cin >> b[i];
    }

    int ans = b[0] + b[N - 2];
    for( int i = N - 2; i >= 1; i-- ){
        ans += min( b[i], b[i - 1] );
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
a = gets.chomp.split('').map(&:to_s)
# p a

if a[0] == a[1] && a[1] != a[2] && a[2] == a[3]
    puts "Yes"
elsif a[0] == a[2] && a[1] != a[2] && a[1] == a[3]
    puts "Yes"
elsif a[0] == a[3] && a[1] != a[3] && a[2] == a[1]
    puts "Yes"
else
    puts "No"
end

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

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

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<pair<T, T>>& vp) {
	for (int i = 0; i < vp.size(); ++i) {
		s << "(" << vp[i].first << "," << vp[i].second << ")" << ( i+1 == vp.size() ? "" : ",\t" );
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//main code

int main(int argc, char const* argv[])
{
	int a,b;
	cin >> a >> b;
	int c = 1;
	for (int ans = 0;; ans++) {
		if (c >= b) {
			cout << ans << endl;
			return 0;
		}
		c += a-1;
	}
	return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_MONSTER_MAX	100000									// 最大魔物数
#define D_CNT_MAX		1000000000								// 最大回数

// 内部変数
static int si1HP[D_MONSTER_MAX];								// 魔物HP
static int siMCnt;												// 魔物数
static int siDmgA;												// ダメージ - A
static int siDmgB;												// ダメージ - B
static int siDmgD;												// ダメージ - A-B

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpT, *szpFpA;
#endif

// 最低回数取得
int
fGetMin(
)
{
	int i, liRet;

	// 最小回数
	int liSCnt = 0;

	// 最大回数
	int liECnt = 1;
	for (i = 0; i < siMCnt; i++) {
		int liCnt = (si1HP[i] + siDmgB - 1) / siDmgB;
		if (liECnt < liCnt) {
			liECnt = liCnt;
		}
	}

	while (1) {

		// 今回回数
		int liNCnt = (liSCnt + liECnt) / 2;

		// 全滅できるかチェック
		liRet = 0;
		int liDCnt = liNCnt;
		for (i = 0; i < siMCnt; i++) {

			// 残HP
			int liHP = si1HP[i] - siDmgB * liNCnt;
			if (liHP > 0) {
				liDCnt -= (liHP + siDmgD - 1) / siDmgD;
				if (liDCnt < 0) {
					liRet = -1;
					break;
				}
			}
		}

		// 次回範囲
		if (liRet == 0) {				// 今回OK
			liECnt = liNCnt - 1;
		}
		else {							// 今回NG
			liSCnt = liNCnt + 1;
		}

		// 次回範囲チェック
		if (liECnt - liSCnt >= 0) {
			continue;
		}

		// 最終結果
		if (liRet == 0) {				// 今回OK
			return liNCnt;
		}
		else {							// 今回NG
			return liNCnt + 1;
		}
	}

	return 0;
}

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	int i;
	char lc1Buf[1024], lc1Out[1024];

	// テストファイルオープン
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpT = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#endif

	// 魔物数・ダメージA・ダメージB取得
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
	fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
	sscanf(lc1Buf, "%d%d%d", &siMCnt, &siDmgA, &siDmgB);

	// ダメージ - A-B
	siDmgD = siDmgA - siDmgB;

	// 魔物HP取得
	for (i = 0; i < siMCnt; i++) {
#ifdef D_TEST
		fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
		fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
		sscanf(lc1Buf, "%d", &si1HP[i]);
	}

	// 最低回数取得
	int liMin = fGetMin();

	// 結果セット
	sprintf(lc1Out, "%d\n", liMin);

	// 結果表示
#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, lc1Out)) {
		siRes = -1;
	}
#else
	printf("%s", lc1Out);
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpT);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", piTNo);
	}
	else {
		printf("NG %d\n", piTNo);
	}
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}



Measured memory_bytes: 512
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

cnt = 0
for i in range(N):
  v = min(A[-i-1],B[-i-1])
  cnt += v
  A[-i-1] -= v
  B[-i-1] -= v
  w = min(A[-i-2],B[-i-1])
  cnt += w
  A[-i-2] -= w
  B[-i-1] -= w
    
print(cnt)

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

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

using namespace std;

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

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

  double res = (double) 2 * r * M_PI;

  cout << fixed << setprecision(10) << res << endl;

  return 0;
}


Measured memory_bytes: 3788
<?php
// C
fscanf(STDIN, '%d', $n);
$x = array_map('intval', explode(' ', trim(fgets(STDIN))));
$_x = $x;
asort($x);
sort($_x);
$cnt = 0;
foreach ($x as $i => $v) {
    $ans[$i] = intdiv($n, 2) > $cnt ? $_x[intdiv($n, 2)] : $_x[intdiv($n, 2) - 1];
    $cnt++;
}
ksort($ans);
echo implode(PHP_EOL, $ans);

Measured memory_bytes: 42612
#include<iostream>
#include <set>

using namespace std;

struct node {int parent; long count; long psum;};

struct node nd[200001];

long value(int ni) {
	long sum=nd[ni].count;

	if (ni == 1) return nd[ni].count;
	if (nd[nd[ni].parent].psum >= 0) return sum+nd[nd[ni].parent].psum;

	sum += value(nd[ni].parent);
	nd[ni].psum = sum;
	return sum;
}

int main()
{
    // 整数の入力
    int N, Q;
    cin >> N >> Q;

	int i, a, b;
	for (i=1; i<N; i++) {
		cin >> a >> b;
		nd[b].parent = a;
		nd[b].psum = -1;
		nd[a].psum = -1;
	}

	int p, x;
	for (i=1; i<=Q; i++) {
		cin >> p >> x;
		nd[p].count += x;
	}

    // 出力
	for (i=1; i<=N; i++) {
		cout << value(i) << " ";
	}
	cout << endl;
    return 0;
}


Measured memory_bytes: 7040
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	char b = sc.next().charAt(0);
		switch(b){
          case 'A':
          	System.out.println("T");
          	break;
          case 'T':
          	System.out.println("A");
          	break;
          case 'G':
          	System.out.println("C");
          	break;
          case 'C':
          	System.out.println("G");
          	break;
        }
    }
}

Measured memory_bytes: 35472
import sys


S = [s for s in input()]
A = [int(s) for s in S]

for i in range(1 << 3):
    b = format(i, f'03b')[::-1]
    t = A[0]
    u = S[0]
    for j in range(3):
        if b[j] == '1':
            t += A[j + 1]
            u += "+" + S[j + 1]
        else:
            t -= A[j + 1]
            u += "-" + S[j + 1]
    if t == 7:
        print(u + "=7")
        sys.exit()


Measured memory_bytes: 9164
#include "bits/stdc++.h"
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

int main() {
	
	int H, W; cin >> H >> W;
	map<char, int>mp;
	for (int i = 0; i < H; ++i) {
		string st; cin >> st;
		for (int j = 0; j < W; ++j) {
			mp[st[j]]++;
		}
	}
	bool ans = false;
	int odd_num = 0;
	int two_num = 0;
	for (auto m : mp) {
		if (m.second % 2) {
			odd_num++;

			m.second--;
		}
		if (m.second % 4) {
			two_num++;
		}
	}
	bool ok = false;
	if (H % 2 && W % 2) {
		if (odd_num == 1 && two_num <= H/2 + W/2)ok = true;
	}
	else if (H % 2 == 0 && W % 2==0) {
		if (odd_num == 0 && two_num == 0)ok = true;
	}
	else if (H % 2 == 0 && W % 2 == 1) {
		if (odd_num == 0 && two_num <= H / 2)ok = true;
	}
	else {
		if (odd_num == 0 && two_num <= W / 2)ok = true;
	}
	if (ok)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;

	//int H, W, D; cin >> H >> W >> D;
	
}

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

int main()
{
	int n, i;
	cin >> n;
	for (i = 1;i <= n;i++) {
		if (i % 3 == 0 || i % 10 == 3 || i/10%10==3 || i/100%10==3 || i/1000%10==3) {
			cout << " " << i;
		}
	}
	cout << endl;
    return 0;
}



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

int main (){
  int N , A , C;
  string Yes , No;
  cin >> N >> A;
  C = N % 500;
  if (C <= A){
    cout << "Yes" << endl;
  }
  if(C > A){
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define REP(i,n) for(int i=0;i<n;i++)
#define FORq(i, m, n) for(int i = m;i <= n;i++)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define PRINTD(n) printf("%d\n",n)
#define DEBUG printf("%s\n","debug")
using namespace std;
//////////////////////////////////////////////////////
int main() {
    long long S,C;
    scanf("%lld %lld",&S,&C);
    
    long long ans;
    ans = min(C/2,S);
    C = C - (2 * ans);
    S = S - ans;     

    ans = ans + (C / 4);
    
    printf("%lld\n",ans);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;
#define int LL

#define FILEIO(name) freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);

using namespace std;

char buf[1000000], *p1 = buf, *p2 = buf;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <class T> inline void read(T &n) {
  n = 0; RI ch = gc(), f;
  while ((ch < '0' && ch > '9') && (ch != '-')) ch = gc();
  f = (ch == '-' ? ch = gc(), -1 : 1);
  while (ch >= '0' && ch <= '9') n = n * 10 + (ch ^ 48), ch = gc();
  n *= f;
}

int const MAXN = 3005;
int n, mod;
int f[MAXN][MAXN], frac[MAXN], invfrac[MAXN];

inline int qpow(int a, int k, int mod) {
  int re = 1;
  for (; k; k >>= 1, a = a * a % mod)
    if (k & 1) re = re * a % mod;
  return re;
}
inline int C(int n, int m) { return frac[n] * invfrac[m] % mod * invfrac[n - m] % mod; }

void Init(int Max) {
  f[0][0] = 1;
  for (RI i = 1; i <= Max + 1; ++i) {
    f[i][0] = 0;
    for (RI j = 1; j <= i; ++j)
      f[i][j] = (f[i - 1][j] * j + f[i - 1][j - 1]) % mod;
  }
  frac[0] = 1;
  for (RI i = 1; i <= Max; ++i) frac[i] = frac[i - 1] * i % mod;
  invfrac[Max] = qpow(frac[Max], mod - 2, mod);
  for (RI i = Max; i; --i) invfrac[i - 1] = invfrac[i] * i % mod;
}

signed main() {

#ifdef LOCAL
  FILEIO("a");
#endif

  read(n), read(mod);
  Init(n);
  int ans = 0;
  for (RI i = 0; i <= n; ++i) {
    int sum = 0;
    int Two = qpow(2, qpow(2, n - i, mod - 1), mod);
    int TTwo = 1, Twoo = qpow(2, n - i, mod);
    for (RI j = 0; j <= i; ++j, TTwo = TTwo * Twoo % mod)
      sum = (sum + f[i + 1][j + 1] * Two % mod * TTwo % mod) % mod;
    ans = (ans + qpow(mod - 1, i, mod) * C(n, i) % mod * sum % mod) % mod;
  }
  printf("%lld\n", ans);

  cerr << (double)(clock()) / CLOCKS_PER_SEC * 1000 << "ms" << endl;

  return 0;
}

// created by Daniel yuan

Measured memory_bytes: 69120
#import <stdio.h>
int main() {
    char a,b,c,d,e, f, g,h,i,j,k,l,m, n, o,p,q,r,s;
    scanf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j,&k,&l,&m,&n,&o,&p,&q,&r,&s);
    printf("%c%c%c%c%c %c%c%c%c%c%c%c %c%c%c%c%c", a,b,c,d,e, g,h,i,j,k,l,m, o,p,q,r,s);
}


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

int tanri(int year, int money, int tesu, double rate){
  int rishi = 0;
  int tmp = money;
  for(int i = 0; i < year; i++){
    rishi += int(tmp * rate);
    tmp -= tesu;
  }
  return tmp + rishi;
}

int hukuri_calc(int year, int money, int tesu, double rate){
  int sum = money;
  for(int i = 0; i < year; i++){
    int rishi = int(sum * rate);
    sum += rishi - tesu;
  }

  return sum;
}

int main(){
  int m = 0;
  cin >> m;
  for(int i = 0; i < m; i++){
    int money = 0;
    int year = 0;
    int kind = 0;
    int hukuri = 0;
    double rate = 0.0;
    int tesu = 0;
    cin >> money >> year >> kind;

    vector<int> ans;
    for(int j = 0; j < kind; j++){
      cin >> hukuri >> rate >> tesu;
      int tmp = 0, tmp2 = 0;
      if(hukuri == 0){
        tmp = tanri(year, money, tesu, rate);
        //cout << "tanri = " << tmp << endl;
        ans.push_back(tmp);
      } 
      else{
        tmp2 = hukuri_calc(year, money, tesu, rate);
        //cout << "hukuri = " << tmp2 << endl;
        ans.push_back(tmp2);
      }
    }
    sort(ans.begin(), ans.end());
    cout << ans[ans.size() - 1] << endl;
    
  }
  return 0;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL<<60;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP2(i,m,n) for(int i=m;i<n;i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
static const double pi = 3.14159265358979323846;

int main(){
    string s,t;
    cin >> s>>t;
    int ans=0;
    REP(i,s.size()){
        if (s[i]!=t[i]){
            ans++;
        }

    }
    cout<<ans<<endl;

}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    
    map<int,priority_queue<int>> ma;
    priority_queue<int, vector<int>, greater<int>> q;
    
    REP(i,n)
    {
        int a, b;
        cin >> a >> b;
        q.push(b);
        ma[b].push(a);
    }

    int now = 0,top;

    while(!q.empty())
    {
        top = q.top();
        q.pop();
        while (!ma[top].empty())
        {
            now+=ma[top].top();
            ma[top].pop();
            if (now > top)
            {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 22900
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using ull = uint64_t;
using P = pair<int, int>;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

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

    string s, t;
    cin >> s >> t;
    int n = s.length();
    int ans = 0;
    for(int i = 0; i < n; ++i){
        if(s[i] != t[i])    ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3864
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

typedef struct {
	vector <int> to;

	int cost;
} edge;
int main( void ){
	int N, M; cin >> N >> M;
	vector <P> st( N ), ch( M );
	rep( i, 0, N ){
		int x, y; cin >> x >> y;
		st[i] = P{x, y};
	}
	rep( i, 0, M ){
		int x, y; cin >> x >> y;
		ch[i] = P{x, y};
	}
	for(auto s:st){
		int x = s.first, y = s.second;
		ll distance = INF;
		int index = 0;
		rep(i,0,M){
			if (abs(ch[i].first-x) + abs(ch[i].second - y) < distance){
				distance = abs(ch[i].first-x) + abs(ch[i].second - y);
				index = i+1;
			}
		}
		cout << index << endl;
	}
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (b%a == 0) cout << a + b << endl;
	else cout << b - a << endl;
	return 0;
}

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

int main(){

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

    int q;
    cin >> q;
    for(int i = 0; i < q; ++i){
        int b, e, t;
        cin >> b >> e >> t;
        swap_ranges(a.begin() + b, a.begin() + e, a.begin() + t);
    }

    for(int i = 0; i < a.size(); ++i){
        if(i){
            cout << " ";
        }
        cout << a[i];
    }
    cout << endl;

    return 0;
}


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

signed main(void)
{
	string s;
	map<char, long long> mp;
	long long ans;

	cin >> s;
	rep(i, s.size())
	{
		mp[s[i]]++; 
	}
	ans = 1;
	for(auto p : mp)
	{
		for(auto q : mp)
		{
			if (p.first >= q.first)
				continue;
			ans += p.second * q.second; 
		}
	}
	cout << ans << endl;
	return 0;
}


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

const int MAXN = 3000 + 10;

int n;
ll a[MAXN], f[MAXN][MAXN];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
    for (int l = n; l >= 1; --l) {
        for (int r = l; r <= n; ++r) {
            f[l][r] = max(a[l] - f[l + 1][r], a[r] - f[l][r - 1]);
        }
    }
    printf("%lld", f[1][n]);
    return 0;
}

Measured memory_bytes: 70016
#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <unordered_map>
#include <cmath>
#include <algorithm>

typedef long long ll;
typedef long double ld;

using namespace std;
int main()
{
  int r;
  cin >> r;
  cout << (int)pow(r, 2);
}


Measured memory_bytes: 3628
num_a, num_b = map(int, input().split(' '))

lesser = min(num_a, num_b)
greater = max(num_a, num_b)

distance = greater - lesser
if distance == 0:
    print(0)
elif distance % 2 == 0:
    print((lesser + greater) // 2)
else:
    print("IMPOSSIBLE")
exit(0)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
void solve(){
	int n, even = 0;
	ll a[100500];
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a[i];
		if(a[i] & 1){
			even++;
		}
	}
	if(even & 1){
		cout << "NO";
	}
	else
		cout << "YES";
}

int main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
	
	int tt = 1;
	while(tt--){
		solve();
	}
	
return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
static const int dx[4] = { 0, 1, 0, -1 };
static const int dy[4] = { 1, 0, -1, 0 };
static const char dir[4] = { 'u', 'r', 'd', 'l' };
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;
static const int MAX_T = 123456;
int N, C;
int imos[30][MAX_T]; // imos[i][j] := チャンネルiで時刻jに録画をする

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> N >> C;
    rep(i, N)
    {
        int a, b, c;
        cin >> a >> b >> c;
        --c;
        ++imos[c][a];
        --imos[c][b];
    }

    // imos法
    rep(i, C)
    {
        rep(j, MAX_T - 1)
        {
            imos[i][j + 1] += imos[i][j];
        }
    }
    rep(i, C)
    {
        rep(j, MAX_T - 1)
        {
            if (imos[i][j] == 0 && imos[i][j + 1] == 1) {
                ++imos[i][j]; // 録画を0.5秒早める
            }
        }
    }
    int ans = 0;
    rep(j, MAX_T)
    {
        int cnt = 0;
        rep(i, C)
        {
            if (imos[i][j]) {
                ++cnt;
            }
        }
        ans = max(ans, cnt);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 14720
import sys
import itertools 

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	N,K = MI()
	p = LI()
	for i in range(N):
		p[i] = (1+p[i])*(1/2)
	p=[0]+list(itertools.accumulate(p))
	ans = -1
	for i in range(K,N+1):
		s = p[i]-p[i-K]
		if(ans < s):ans=s
	print(ans)


main()

Measured memory_bytes: 84940
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  vector<vector<int>> vec(M,vector<int>(2));
  for(int i=0; i<M; i++){
    for(int j=0; j<2; j++){
      cin >> vec.at(i).at(j);
    }
  }
  vector<int> perx(N-1);
  for(int i=0; i<N-1; i++){
    perx.at(i) = i+2;
  }
  
  int cnt = 0;
  
  do{
    int exist = 0;
    vector<int> per(N);
    per.at(0) = 1;
    for(int i=0; i<N-1; i++){
      per.at(i+1) = perx.at(i);
    }
    for(int i=0; i<N-1; i++){
      int x = per.at(i);
      int y = per.at(i+1);
      for(int j=0; j<M; j++){
        if(vec.at(j).at(0) == x && vec.at(j).at(1) == y){
          exist++;
          break;
        }
        if(vec.at(j).at(0) == y && vec.at(j).at(1) == x){
          exist++;
          break;
        }
      }
    }
    if(exist == N-1){
      cnt++;
    }
    
  }
  while(next_permutation(perx.begin(),perx.end()));
  
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n),b(n),c(n);
  for(Int i=0;i<n;i++) cin>>a[i]>>b[i]>>c[i];

  Int x=0,y=0,z=0;
  for(Int i=0;i<n;i++){
    Int nx=a[i]+max(y,z);
    Int ny=b[i]+max(x,z);
    Int nz=c[i]+max(x,y);
    x=nx;
    y=ny;
    z=nz;
  }

  cout<<max({x,y,z})<<endl;
  return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

const int N = 1e5 + 5;

int n;
int arr[N];

int main()
{
  cin >> n;
  for(int i = 0 ; i < n ; i++)
    cin >> arr[i];
  int best = 0;
  for(int i = 0 ; i < n ; i++){
    int j = i + 1;
    while(j < n && arr[j] <= arr[j - 1])
      ++j;
    best = max(best, j - i - 1);
    i = j - 1;
  }
  cout << best << endl;
  return 0;
}


Measured memory_bytes: 640
local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local ior = io.input()
local n, q = ior:read("*n", "*n")
local s, t, x, d = {}, {}, {}, {}
for i = 1, n do
  s[i], t[i], x[i] = ior:read("*n", "*n", "*n")
end

local timelist = {}
local omitinfo = {}
for i = 1, q do
  local tmp = ior:read("*n")
  d[i] = tmp
  table.insert(timelist, tmp)
  local tmptbl = {}
  table.insert(omitinfo, tmptbl)
end
-- table.sort(timelist)

local function lower_bound(ary, x)
  if(x <= ary[1]) then return 1 end
  local num = #ary
  if(ary[num] < x) then return num + 1 end
  local min, max = 1, num
  while(1 < max - min) do
    local mid = mfl((min + max) / 2)
    if(ary[mid] < x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

local function upper_bound(ary, x)
  if(x < ary[1]) then return 1 end
  local num = #ary
  if(ary[num] <= x) then return num + 1 end
  local min, max = 1, num
  while(1 < max - min) do
    local mid = mfl((min + max) / 2)
    if(ary[mid] <= x) then
      min = mid
    else
      max = mid
    end
  end
  return max
end

for i = 1, n do
  -- [ngfrom, ngto]
  local ngfrom, ngto = s[i] - x[i], t[i] - x[i] - 1
  local real_ngfrom_pos_idx = lower_bound(timelist, ngfrom)
  local real_ngto_pos_idx = upper_bound(timelist, ngto) - 1
  -- print(i, ngfrom, ngto, real_ngfrom_pos_idx, real_ngto_pos_idx)
  if(real_ngfrom_pos_idx <= q and 1 <= real_ngto_pos_idx and real_ngfrom_pos_idx <= real_ngto_pos_idx) then
    table.insert(omitinfo[real_ngfrom_pos_idx], x[i])
    table.insert(omitinfo[real_ngto_pos_idx], -x[i])
  end
end
-- for i = 1, q do
--   print(i, "-- ", unpack(omitinfo[i]))
-- end
local cur_omit_list = {}
local cur_min_omit_x = -1
for i = 1, q do
  for j = 1, #omitinfo[i] do
    local val = omitinfo[i][j]
    if(0 < val) then
      cur_omit_list[val] = true
      if(cur_min_omit_x < 0 or val < cur_min_omit_x) then
        cur_min_omit_x = val
      end
    end
  end
  print(cur_min_omit_x)

  for j = 1, #omitinfo[i] do
    local val = omitinfo[i][j]
    if(val < 0) then
      cur_omit_list[-val] = nil
      if(cur_min_omit_x == -val) then
        cur_min_omit_x = -1
        for key, value in pairs(cur_omit_list) do
          if(cur_min_omit_x < 0 or key < cur_min_omit_x) then
            cur_min_omit_x = key
          end
        end
      end
    end
  end
end


Measured memory_bytes: 38388
until (a = gets.split.map(&:to_i)) == [0,0]
  a[0].times do |i|
    if (i % 2) == 0
      a[1].times do |j|
        if (j % 2) == 0
          print "#"
        elsif
          print "."
        end
      end
      puts
    elsif
      a[1].times do |j|
        if (j % 2) == 0
          print "."
        elsif
          print "#"
        end
      end
      puts
    end
  end
puts
end

Measured memory_bytes: 6104
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  string S;
  cin>>S;
  
  int ans=0;
  
  bool res=true;
  
  
  for(int i=0;i<S.size();i++){
    if(S[i]=='A'||S[i]=='C'||S[i]=='G'||S[i]=='T'){
      res=false;
    }
  }
  if(res){
    cout<<0<<endl;
  }
  else{
  for(int i=0;i<S.size();i++){
    int x=1;
    if(S[i]=='A'||S[i]=='C'||S[i]=='G'||S[i]=='T'){
      while(true){
        if(S[i+1]=='A'||S[i+1]=='C'||S[i+1]=='G'||S[i+1]=='T'){
          x++;
          i++;
        }
        else{
          break;
        }
      }
    }
    ans=max(ans,x);
  }
  
  cout<<ans<<endl;
  }
}

Measured memory_bytes: 3632
S=str(input())
ans=0
temp=0
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        temp+=1
        if i==len(S)-1:
            ans=max(ans,temp)
    else:
        ans=max(ans,temp)
        temp=0

print(ans)
    
    
    
    
    


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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 ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
    ll n,k;cin>>n>>k;
    if(k%2==1){
        if(n<k){
            cout<<0<<endl;
        }
        else{
            ll ans,m;
            m=n/k;
            ans=m*m*m;
            cout<<ans<<endl;
        }
    }
    else{
        if(2*n<k){
            cout<<0<<endl;
        }
        else if(n<k&&k<=2*n){
            cout<<1<<endl;
        }
        else{
            ll ans,m;
            m=n/k;
            ans=m*m*m;
            ll cnt=0;
            for(int i=1;i<=n;++i){
                if(i%k==k/2)cnt++;
            }
            ans+=cnt*cnt*cnt;
            cout<<ans<<endl;
        }
    }
}

Measured memory_bytes: 256
/*
    問題をよく読もう！
    論理的に考えよう！
    サンプルを確認しよう!
    絶対に諦めるな！
    工夫をしろ！
    配列は少し多めにとっておく

    Twitterは終わるまでログアウト！
    （間違えて解法をツイートしてはいけないから）

*/
//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include<cstring>
//namespace
using namespace std;
//繰り返し
#define REP(i, m, n) for(int i=(int)m; i<(int)n; ++i)
#define rep(i, n) REP(i, 0, n)
//イテレータ
#define all_range(C) begin(C), end(C)
//簡略化
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
typedef pair<string,int> pst;

const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
//最大最小
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) {if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) {if(a<b) a=b;}

//関数

//最大公約数を求める
ll my_gcd(ll x, ll y) {
  ll r;

  while(y!=0) {
    r = x%y;
    x = y;
    y = r;
  }

  return x;
}

//最小公約数を求める
ll my_lcm(ll x, ll y) {

  return (x*y)/my_gcd(x,y);
}

//xのy乗を求める ※参考：10^18乗まで
ll my_pow(ll x, ll y) {
  ll sum = 1;

  while(y>0) {
    sum *= x;
    --y;
  }

  return sum;
}

/*考えを書くスペース
  累乗和で解く

  ・総和を求める
  ・取り消すところの一つ先を見る
*/
//main.cpp----------------------------
#define max_n 10

int a, b, k;
int m[100];

int main() {
  cin >> a >> b >> k;

  int n = 0;
  for(int i=1; i<=a; ++i) {
    if(a%i==0&&b%i==0) {
        m[n] = i;
        ++n;
    }
  }

  cout << m[n-k] << endl;

  return 0;
}


Measured memory_bytes: 256
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
for i in range(M):
    s[i],c[i]=map(int,input().split())

A=["-1"]*N
for i in range(M):
    if A[s[i]-1]=="-1" or A[s[i]-1]==c[i]:
        A[s[i]-1]=c[i]
    else:
        print("-1")
        exit()

if N==3:
    if A[0]==0:
        print("-1")
        exit()
if N==2:
    if A[0]==0:
        print("-1")
        exit()

for i in range(N):
    if A[i]=="-1":
        A[i]=0

a=0
for i in range(N):
    a+=A[i]*10**(N-i-1)

if N==2 and a<10:
    a+=10
if N==3 and a<99:
    a+=100

print(a)

Measured memory_bytes: 3064
#[allow(unused_imports)]
use std::cmp;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    #[allow(unused_mut)]
    let mut s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  input! {
    w: usize,
    h: usize,
    ps: [i64; w],
    qs: [i64; h],
  }
  let mut edges: Vec<_> = ps.into_iter().map(|p| (p, true)).chain(qs.into_iter().map(|q| (q, false))).collect();
  edges.sort();
  let mut total = 0;
  let mut we = w as i64 + 1;
  let mut he = h as i64 + 1;
  for &(c, horizontal) in edges.iter() {
    if horizontal {
      total += he * c;
      we -= 1;
    } else {
      total += we * c;
      he -= 1;
    }
  }

  println!("{}", total);
}


Measured memory_bytes: 14588