akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define popb(a) pop_back(a)
#define debug(x) cout<<#x<<": "<<x<<endl
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define PI 3.14159265358979
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
 
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
int main(){
  ll n,b[200005]={};
  cin>>n;
  rep(i,0,n){
    cin>>b[i];
  }
  if(n%2==0){
    for(ll i=n-1; i>0; i--){
      if(i!=n-1&&i%2==1)cout<<" ";
      if(i%2==1)cout<<b[i];
    }
    cout<<" ";
    for(ll i=0; i<n; i++){
      if(i%2==0)cout<<b[i];
      if(i!=n-1&&i%2==0)cout<<" ";
    }
    cout<<endl;
  }else{
    for(ll i=n-1; i>=0; i--){
      if(i!=n-1&&i%2==0)cout<<" ";
      if(i%2==0)cout<<b[i];
    }
    cout<<" ";
    for(ll i=0; i<n; i++){
      if(i%2==1)cout<<b[i];
      if(i!=n-1&&i%2==1)cout<<" ";
    }
    cout<<endl;
  }
}

Measured memory_bytes: 3712
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());

        for(int i=n; i<=999; i++) {
            var v1 = i / 100;
            var v2 = i / 10 % 10;
            var v3 = i % 10;
            if (v1 != v2) continue;
            if (v1 != v3) continue;
            if (v2 != v3) continue;
            return i;
        }

        return 0;
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin >> N >> M;
    vector<vector<int>> cards(M, vector<int>(2));
    for(int i = 0; i < M; i++){
        for(int j = 0; j < 2; j++){
            cin >> cards[i][j];
        }
    }
    int p = cards[0][1],q = cards[0][0];
    for(int i = 1; i < M; i++){
        if(cards[i][0] > q)
        q = cards[i][0];
        if(cards[i][1] < p)
        p = cards[i][1];
    }
    if(p - q + 1 <= 0)
    cout << 0 << endl;
    if(p - q + 1 > 0)
    cout << p - q + 1 << endl;
}

Measured memory_bytes: 5760
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stdio.h>
#include <fstream>
#include <cmath>
#include <stdlib.h>
#include <iomanip>
#include <algorithm>
#include <limits.h>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false);
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef pair<double,double> pdd;
typedef long long ll;
const int maxn = 1e6 + 10;
ll N,a[maxn];


int main(){
    FAST_IO
    cin>>N;
    for(int i = 1; i <= N; i++) cin>>a[i];
    int l = 1,r = 1;
    ll now = 0,k = 0,cnt = 0,ans = 0;
    while(l <= N + 1&& r <= N + 1){
        if(now == k){
            now += a[r];
            k ^= a[r];
            ans += cnt;
            cnt++;
            r++;
        }
        else{
            now -= a[l];
            k ^= a[l];
            cnt--;
            l++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include <algorithm>  // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>     // bitset
#include <cctype>     // isupper, islower, isdigit, toupper, tolower
#include <cstdint>    // int64_t, int*_t
#include <cstdio>     // printf
#include <deque>      // deque
#include <iomanip>    // fixed, setprecision
#include <iostream>   // cout, endl, cin
#include <map>        // map
#include <numeric>    // accumulate
#include <queue>      // queue, priority_queue
#include <set>        // set
#include <stack>      // stack
#include <string>     // string, to_string, stoi
#include <tuple>      // tuple, make_tuple
#include <unordered_map>  // unordered_map
#include <unordered_set>  // unordered_set
#include <utility>        // pair, make_pair
#include <vector>         // vector
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main() {
  ll N, T, mc = 1001, c, t;
  cin >> N >> T;
  for (int i = 0; i < N; i++) {
    cin >> c >> t;
    if (t <= T) mc = min(mc, c);
  }
  cout << (mc == 1001 ? "TLE" : to_string(mc)) << endl;
}


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

int main() {
  	int a,b,h,m;
  	double angj,angf,angsa,ans;
  
  	cin >> a >> b >> h >> m;
	
  	angj = 360.0/12*h + (360.0/12)/60*m;
  	angf = 360.0/60*m;
  	if (angj==angf)
      	ans=abs(b-a);
  	else
    {
       	angsa=abs(angj-angf);
		if (angsa==180)
          	ans=a+b;
      	else
        {
          	if (angsa>180)
	          	angsa=360-angsa;
          
	      	ans=sqrt((double)a*a+(double)b*b-2.0*a*b*cos(M_PI / 180 * angsa));
        }
    }
  	cout << fixed << setprecision(20) << ans << endl;
}


Measured memory_bytes: 4180
N = int(input())
input_line = input()
Line = input_line.split()
Line1 = [int(s) for s in Line]
input_line = input()
Line = input_line.split()
Line2 = [int(s) for s in Line]

point = 9999
max_candy = 0

for i in range(N):
    on_candy = sum(Line1[0:i+1]) + sum(Line2[i:N])
    # print(sum(Line1[0:i+1]),sum(Line2[i:N]))
    if max_candy < on_candy:
        max_candy = on_candy
        point = i
        
print(max_candy)

Measured memory_bytes: 3064
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{ 
    static void Main(string[]args)
    {
        Magatro m = new Magatro();
        m.Scan();
        m.Solve();
    }
}

public class Scanner
{
    private StreamReader Sr;
    private string[] S;
    private int Index;

    private const char Separator=' ';

    public Scanner()
    {
        Index = 0;
        S = new string[0];
        Sr = new StreamReader(Console.OpenStandardInput());
    }

    private string[] Line()
    {
        return Sr.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public string[] StringArray(int index = 0)
    {
        Index = S.Length;
        return S.Skip(index).ToArray();
    }
    public int[] IntArray(int index = 0)
    {
        return StringArray(index).Select(int.Parse).ToArray();
    }

    public bool ScanToEnd(ref string s)
    {
        if (Sr.EndOfStream)
        {
            return false;
        }
        else
        {
            s = Sr.ReadLine();
            return true;
        }
    }
}

public class Magatro
{
    private int N;

    private int[][] array;
    int Mod = 1000000007;

    public void Scan()
    {
        Scanner sc = new Scanner();
        N = sc.NextInt();
    }

    public void Solve()
    {
        if (N == 1)
        {
            Console.WriteLine(1);
            return;
        }
        array = new int[N + 1][];
        // for (int i = 0; i <= N; i++)
        //  {
        //     array[i] = new int[N+1];
        // }
        array[2] = new int[N + 1];
        array[2][2]++;
        for (int i = 3; i <= N; i++)
        {
            int cp = i;
            int loop = (int)Math.Sqrt(cp);
            bool flag = false;
            for (int j = 2; j <= loop+1; j++)
            {
                if (cp % j == 0)
                {
                    int s = cp / j;
                    array[i] = array[s].ToArray();
                    array[i][j]++;
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                array[i] = new int[N + 1];
                array[i][i]++;
            }
        }
        int[] cnt = new int[1001];
        for(int i = 2; i <= N; i++)
        {
            for(int j = 0; j <= N; j++)
            {
                cnt[j] += array[i][j];
            }
        }
        long ans = 1;
        for(int i = 0; i <= N; i++)
        {
            ans =(ans* (cnt[i] + 1))%Mod;
        }
        Console.WriteLine(ans);
    }
}



Measured memory_bytes: 6744
#include<stdio.h>
int main(void)
{
	int n,a[10000],i,cnt,flg;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	cnt=0;
	flg=0;
	while(1){
		for(i=0;i<n;i++){
			if(a[i]%2!=0){
				flg=1;
				break;	
			}
		}
		if(flg==1){
			break;
		}
		for(i=0;i<n;i++){
			a[i]/=2;
		}
		cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}


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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void solve() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a[0] << b[1] << c[2] << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


Measured memory_bytes: 3636
#include<stdio.h>
#include<stdlib.h>

typedef struct{
  int parent,left,right;
}Node;

void depth(int,int,Node *,int *);

int main(){
 
	int n, *D, *H;
	int i,j,d,c,v,root,left,right;
	Node *T;
 
	scanf("%d",&n);
	
	T=(Node *)malloc(sizeof(Node)*n);
	D=(int *)malloc(sizeof(int)*n);
	H=(int *)malloc(sizeof(int)*n);
    for(i = 0; i<n; i++){
      T[i].parent = T[i].left = T[i].right =-1;
    }
     
    for(i=0; i<n; i++){
      scanf("%d %d",&v,&d);
      for(j=0; j<d; j++){
    scanf("%d",&c);
    if(j==0)
      T[v].left = c;
    else
      T[left].right = c;
    left = c;
    T[c].parent = v;
      }
    }
 
    for(i=0; i<n; i++){
      if(T[i].parent==-1) root = i;
    }
 
    depth(root,0,T,D);
    
 
    for(i=0; i<n; i++){
    	
	printf("node %d: ",i);
	printf("parent = %d, ", T[i].parent);
 	printf("depth = %d, ",D[i]);
 
 	if(T[i].parent==-1){
    printf("root, ");
  	}
  	else if(T[i].left==-1){
    	printf("leaf, ");
  	}
  	else{
    	printf("internal node, ");
  	}
 
  	printf("[");
 
  	for(j=0, c=T[i].left; c!=-1; j++,c=T[c].right){
    	if(j)
      	printf(", ");
    printf("%d",c);
  	}
  	printf("]\n");
}
 
    return 0;
}

void depth(int u, int d,Node *T,int *D){
  D[u] = d;
 
  if(T[u].right != -1) depth(T[u].right, d,T,D);
  if(T[u].left != -1) depth(T[u].left, d+1,T,D);
}

Measured memory_bytes: 6868
N, K = map(int, input().split())
A = list(map(int, input().split()))
line = {}
for i in range(N):
  line[i+1] = A[i]

dp = [[0]*(N+1) for _ in range(71)]
for i in range(1, N+1):
  dp[0][i] = line[i]

for i in range(70):
  for j in range(1, N+1):
    dp[i+1][j] = dp[i][dp[i][j]]

for i in range(1, N+1):
  now = i 
  for j in range(70):
    # Kを2ビットに変換し、1のところだけ行う
    if (K&(1<<j)) != 0:
      now = dp[j][now]

  print(now)
  exit()

Measured memory_bytes: 192904
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

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

signed main() {
  init();
  string S;
  cin >> S;
  SORT(S);
  if (S == "abc") {
    COUT("Yes");
  } else {
    COUT("No");
  }
  return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef map<int,int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define arep(i,v) for(auto i : v)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define fi first
#define se second
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template <class T> inline void dump(T &v){irep(i, v){cout<<*i<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
constexpr ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
constexpr double EPS = 1e-9;


int main() {
    
    int n,k;
    cin>>n>>k;
    vi v(n);
    rep(i,n)cin>>v[i];
    int ans=-INF;
    for(int l=0;l<=k;l++){
        for(int r=0;r<=k;r++){
            if(l+r>n||l+r>k)continue;
            int rest=k-l-r;
            vi w;
            int sum=0;
            for(int i=0;i<l;i++){
                w.pb(v[i]);
                sum+=v[i];
            }
            for(int i=0;i<r;i++){
                w.pb(v[n-i-1]);
                sum+=v[n-1-i];
            }
            Sort(w);
            for(int i=0;i<rest&&i<w.size();i++){
                if(w[i]>0)break;
                sum-=w[i];
            }
            chmax(ans,sum);
        }
    }
    fin(max(ans,0));
}








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

int main(){
    string ans;

    char c;

    for(int i = 0; i < 3; ++i){
        for(int j = 0; j < 3; ++j){
            cin >> c;
            if((i == 0 && j == 0) || (i == 1 && j == 1) || (i == 2 && j == 2)){
                ans += c;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
//conversion
//------------------------------------------
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();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
//container util
//------------------------------------------

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define VECMAX(x) *max_element(ALL(x))
#define VECMIN(x) *min_element(ALL(x))
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define MULTIPLE(i,n,k) for(int i = (k) ; i<(n) ; i+=k+1)//倍数ループ
//constant
//------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;






#define SIZEOF(x) sizeof(x)/sizeof(x[0])




int main(){
    LL n , k; LL dp[100100]; LL h[100100];

    cin >> n >> k;
    FOR(i,1,n+1)cin >> h[i];
    FOR(i,2,n+1){
        dp[i] = dp[i-1]+abs(h[i] - h[i-1]);
        FOR(j , 2 , k+1){
            if(i > j)dp[i] = min(dp[i] , dp[i-j] + abs(h[i]-h[i-j]));
        }
        
    }
    cout << dp[n];






    return 0;

}


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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, a;
    cin >> n;
    set<int> s;
    
    rep(i, n) {
        cin >> a;
        
        if (s.count(a)) {
            s.erase(a);
        }
        else {
            s.insert(a);
        }
    }
    
    cout << sz(s) << endl;
    return 0;
}


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

#define INF 10e8

int N;
int ans[50];

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < 26; i++)
    {
        ans[i] = INF;
    }
    for(int i= 0; i < N; i++)
    {
        int mem[50] = {0};
        char S[100] = {0};
        scanf("%s",S);
        for(int j = 0; j < strlen(S); j++)
        {
            mem[S[j] - 'a']++;
        }
        for(int i = 0; i < 26; i++)
        {
            ans[i] = min(ans[i],mem[i]);
        }
    }
    for(int i = 0; i < 26; i++)
    {
        for(int j = 0; j < ans[i]; j++)
        {
            printf("%c",'a' + i);
        }
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
typedef pair<string,ll> si;
typedef pair<ii,ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
#define sort(a) sort(a.begin(),a.end());
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define mp make_pair
#define F first
#define S second
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define nl "\n"
#define TC cin>>t;while(t--)
const int MOD = 1e9+7;
const ld PI = 3.1415926535898;
const ll LLMAX = LLONG_MAX;
 
int main()
{
	int r;
	cin>>r;
	ld a=PI*2*r;
	cout<<a;
}

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

typedef pair<int,int> P;
char grid[10][10];
int step[10][10];
int h, w;
int dx[4] = {1, 0};
int dy[4] = {0, 1};
bool Check()
{
    int cnt = 0;
    for(int i = 1; i <= h; ++i)
        for(int j = 1; j <= w; ++j)
            if(grid[i][j] == '#')
                ++cnt;
    memset(step, -1, sizeof(step));
    step[1][1] = 1;
    queue<P> que;
    que.push({1, 1});
    while(!que.empty())
    {
        P now = que.front();
        que.pop();
        if(step[now.first][now.second] == cnt)
            return true;
        for(int i = 0; i < 2;++i)
        {
            int nx = now.first + dx[i];
            int ny = now.second + dy[i];
            if(grid[nx][ny] == '#')
            {
                que.push({nx, ny});
                step[nx][ny] = step[now.first][now.second] + 1;
            }
        }
    }
    return false;
}
int main()
{
    scanf("%d%d", &h, &w);
    for(int i = 1; i <= h; ++i)
        scanf("%s", grid[i] + 1);
    if(Check())
        puts("Possible");
    else
        puts("Impossible");
    return 0;
}


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

struct init{
	init(){
		cin.tie(0); ios::sync_with_stdio(false);
	}
}________init;
int main() {

#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	int W, H,N;
	while (cin >> W >> H >> N){
		int  res = 0;
		int a = 1, b = 1;
		while (N--){
			int p;
			cin >> p;
			if (p == 0)a++;
			else b++;
			if (a == W || a == W + H - 1)continue;
			if (a < W){
				res += (a == b);
			}
			else if (a < W + H - 1){
				res += (a == b + 2);
			}
			else res += (a == b +4);
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 3160
#include<iostream>
using namespace std;
#include <vector>
#define COT_NUM 26
#define re(i,n) for(int i = 0; i < n; i++)

int main() {
	int l, r, d;
	cin >> l >> r >> d;
	int ll = l / d;
	int rr = r / d;
	if (l % d) 	cout << rr - ll << endl;
	else cout << rr - ll + 1 << endl;


	return 0;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const LL INF = 0x3f3f3f3f3f3f3f3fLL;
const int SIZEN = 310;
int N,M,L;
LL dis[SIZEN][SIZEN] = {0};
LL connected[SIZEN][SIZEN] = {0};
int main(){
    scanf("%d%d%d",&N,&M,&L);
    for(int i = 1;i <= N;i++){
        for(int j = 1;j <= N;j++)connected[i][j] = dis[i][j] = INF;
    }
    for(int i =1 ;i <= M;i++){
        int x,y,c;
        scanf("%d%d%d",&x,&y,&c);
        dis[x][y] = dis[y][x] = c;
    }
    for(int i = 1;i <= N;i++)dis[i][i] = 0;
    for(int k = 1;k <= N;k++){
        for(int i = 1;i <= N;i++)if(k!=i)
            for(int j = 1;j <= N;j++)if(k!=j && j!=i)dis[i][j] = min(dis[i][j],(dis[i][k]+dis[k][j]));
    }
    for(int i = 1;i <= N;i++){
        for(int j = 1;j <= N;j++){
            if(dis[i][j] <= L)connected[i][j] = 1;
        }
    }
    // for(int i = 1;i <= N;i++){
    //     printf("i= %d:",i);
    //     for(int j = 1;j <= N;j++)printf("%lld ",connected[i][j]);
    //     printf("\n");
    // }
    for(int k = 1;k <= N;k++){
        for(int i = 1;i <= N;i++)
            for(int j = 1;j <= N;j++)connected[i][j] = min(connected[i][j],connected[i][k] + connected[k][j]);
    }
    int Q;
    scanf("%d",&Q);
    while(Q--){
        int x,y;scanf("%d%d",&x,&y);
        if(connected[x][y] == INF)puts("-1");
        else{
            printf("%lld\n",connected[x][y] - 1);
        }
    }
    return 0;
}

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

int s1[2000], s2[2000];
int main() {
	int n, m;
	while (scanf("%d%d", &n, &m), n) {
		rep(i, n)scanf("%d", &s1[i + 1]);
		rep(i, m)scanf("%d", &s2[i + 1]);
		for (int i = 1; i <= n; i++)s1[i] += s1[i - 1];
		for (int i = 1; i <= m; i++)s2[i] += s2[i - 1];
		int cnt = 0;
		map<int, int>mp1, mp2;
		rep(i, n + 1)rep(j, i)mp1[s1[i] - s1[j]]++;
		rep(i, m + 1)rep(j, i)mp2[s2[i] - s2[j]]++;
		for (auto p : mp1) {
			cnt += p.second*mp2[p.first];
		}
		printf("%d\n", cnt);
	}
}

Measured memory_bytes: 34428
import sys, bisect, math, itertools, string, queue, copy
#import numpy as np
#import scipy
from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()
q = int(input())
ql = [input().split() for i in range(q)]

ans = deque(s)
isrev=False
for i in range(q):
  if ql[i][0] == '1':
    isrev = not isrev
    continue
  if (ql[i][1] == '2') == isrev:
    ans.appendleft(ql[i][2])
  else:
    ans.append(ql[i][2])

if isrev:
  ans.reverse()

s = ''.join(ans)

print(s)


Measured memory_bytes: 48448
#include<bits/stdc++.h>
using namespace std;
bool palindrome(string s)
{
    for(int i=0; i<s.size()/2; ++i)
    {
        if(s[i]!=s[s.size()-i-1])
            return false;
    }
    return true;
}
int main()
{
    string s;
    cin>>s;
    if(palindrome(s))
    {
        int N=s.size();
        int a=(N-1)/2;
        string sub1=s.substr(0,a);
        if(palindrome(sub1))
        {
            int b=(N+3)/2;
            string sub2=s.substr(b-1);
            if(palindrome(sub2))
            {
                cout<<"Yes"<<endl;
                return 0;
            }
            else
            {
                cout<<"No"<<endl;
                return 0;
            }
        }
        else
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    else
    {
        cout<<"No"<<endl;
        return 0;
    }
}


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

using namespace std;

const int mod = 1e9 + 7;
int n, x, y, z, orgmask;
int dp[45][(1 << 18)][3];

int main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n >> x >> y >> z;
    orgmask = (1 << z) | (1 << (y + z)) | (1 << (x + y + z));
    dp[0][1][0] = 1;
    for(int i = 0; i < n; i++){
        for(int mask = 0; mask < (1 << 18); mask++){
            for(int k = 0; k < 2; k++){
                if(dp[i][mask][k] == 0) continue;
                for(int j = 1; j <= 10; j++){
                    int org = mask;
                    org = (mask << j);
                    org &= ((1 << 18) - 1);
                    org |= (1 << 0);
                    if((org & orgmask) == orgmask){
                        if(k == 0){
                            dp[i + 1][org][1] = (1ll * dp[i + 1][org][1] + (1ll * dp[i][mask][k]) % mod) % mod;
                            dp[i + 1][org][1] %= mod;
                        }
                        else{
                            dp[i + 1][org][k] = (1ll * dp[i + 1][org][k] + (1ll * dp[i][mask][k]) % mod) % mod;
                            dp[i + 1][org][k] %= mod;
                        }
                    }
                    else{
                        dp[i + 1][org][k] = (1ll * dp[i + 1][org][k] + (1ll * dp[i][mask][k]) % mod) % mod;
                        dp[i + 1][org][k] %= mod;
                    }
                }
            }
        }
    }
    int ans = 0;
    for(int mask = 0; mask < (1 << 18); mask++){
            ans = (1ll * ans + 1ll * dp[n][mask][1]) % mod;
            ans %= mod;
    }
    cout << ans << "\n";
}


Measured memory_bytes: 123136
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))



int main() {
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    //cout<<a[2];
    if((3*a[2]-a[0]+a[1]+a[2])%2==0){
        cout<<(3*a[2]-(a[0]+a[1]+a[2]))/2<<endl;
    }
    else{
        cout<<((3*(a[2]+1))-(a[0]+a[1]+a[2]))/2<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
using System;

namespace Sample101
{
    class Program
    {
        static void Main(string[] args)
        {
            int A500 = int.Parse(Console.ReadLine());
            int B100 = int.Parse(Console.ReadLine());
            int C50 = int.Parse(Console.ReadLine());
            int X = int.Parse(Console.ReadLine());
            int result = 0;
            for (int a = 0; a <= A500; ++a)
            {
                for (int b = 0; b <= B100; ++b)
                {
                    for (int c = 0; c <= C50; ++c)
                    {
                        int total = 500 * a + 100 * b + 50 * c;
                        if (total == X)
                        {
                            ++result;
                        }
                    }
                }
            }
            Console.WriteLine(result);
        }
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
/*-*/

int main() {
	int n;
	std::cin >> n;
	std::vector<lnt> l(n);
	rep(i,n) std::cin >> l[i];
	lnt ans=0;
	for(int i=0;i<n;i++) {
		for(int j=i+1;j<n;j++) {
			for(int k=j+1;k<n;k++) {
				lnt a,b,c;
				a=l[i]; b=l[j]; c=l[k];
				if(a==b||b==c||c==a) continue;
				if(a+b>c&&a+c>b&&b+c>a) ans++;
			}
		}
	}
	print(ans);
}


Measured memory_bytes: 3656
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

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

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  
  ll n,m; cin >> n >> m;
  vl h(n);
  
  rep(i,n) cin >> h[i];
  
  vector<bool> flag(n,true);
  rep(i,m){
    ll a,b; cin >> a >> b;
    a--; b--;
    
    if(h[a] > h[b]){
      flag[b] = false;
    }
    else if(h[a] < h[b]){
      flag[a] = false;
    }
    else{
      flag[a] = false;
      flag[b] = false;
    }
  }
  
  ll cnt = 0;
  
  rep(i,n){
    if(flag[i]) cnt++;
  }
  
  cout << cnt << endl;
  
  
}

Measured memory_bytes: 4060
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MAXN = 1e5+10;
const int MAXM = 1e5+10;

ll n, m;
ll p[MAXM], y[MAXM];
vector<P> prefs[MAXN];
char ids[MAXN][13];

void solve() {
  for (int i=0;i<m;i++) {
    prefs[p[i]].push_back(P(y[i], i));
  }
  for (int i=0;i<n;i++) {
    sort(prefs[i].begin(), prefs[i].end());
    for (int j=0;j<prefs[i].size();j++) {
      P& tmp = prefs[i][j];
      sprintf(ids[tmp.second], "%06d%06d", i + 1, j + 1);
    }
  }
  for (int i=0;i<m;i++) {
    cout << ids[i] << endl;
  }
}

int main() {
  cin >> n >> m;
  for (int i=0;i<m;i++) {
    cin >> p[i] >> y[i];
    p[i]--;
  }
  solve();
}


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

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (
		(a != 1 && b != 1 && c != 1 && d != 1) ||
		(a != 9 && b != 9 && c != 9 && d != 9) ||
		(a != 7 && b != 7 && c != 7 && d != 7) ||
		(a != 4 && b != 4 && c != 4 && d != 4)) {
		cout << "NO";
	}
	else {
		cout << "YES";
	}
	return 0;
}

Measured memory_bytes: 256
//package com.company;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 21716
#include <iostream>
#include <map>
#define ll long long
using namespace std;

ll mod=1000000007, beki3[80], ans=0;
map<ll, ll> mp;

void solve(){
	auto itr=mp.end();
	--itr;
	ll n=itr->first, m=itr->second;
	if(n==0) ans=(ans+m)%mod;
	else if(n>0){
		int d=61;
		while(!(n&((ll) 1<<d))) --d;
		ll x=((ll) 1<<d);
		ans=(ans+(beki3[d]*m)%mod)%mod;
		mp[n-x]=(mp[n-x]+m)%mod;
		mp[x*2-n-3]=(mp[x*2-n-3]+mod-m)%mod;
	}
	mp.erase(itr);
}

int main() {
	ll N;
	cin >> N;
	beki3[0]=1;
	for(int i=1; i<80; ++i) beki3[i]=(beki3[i-1]*3)%mod;
	mp[N]=1;
	while(mp.size()>0) solve();
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#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() {
	ll n; cin >> n;
    ll a, b; cin >> a >> b;
    ll count = 0, total = a + b;
    ll alt = n, ans = 0;
    count = alt / total;
    ans = count * a;
    ll rest = n % total;
    ans += min(rest, a);
    cout << ans << endl;
    
    return 0;
    
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define lli long long int
#define min(x,y) (x < y)? x : y

using namespace std;

const lli inf = 1000000000;

lli dij(lli cost[101][101], int n, int s, int t)
{
	lli d[101];
	bool vis[101];
	
	fill(vis, vis+(n+1), false);
	fill(d, d+(n+1), inf);
	d[s] = 0;
	
	while(1){
		int v = -1;
		for(int i = 1; i <= n; i++){
			if(!vis[i] && (v == -1 || d[i] < d[v])){
				v = i;
			}
		}
		if(v == -1){
			break;
		}
		vis[v] = true;
		for(int i = 1; i <= n; i++){
			d[i] = min(d[i], d[v]+cost[v][i]);
		}
	}
	
	return d[t];
}

int main()
{
	int n, m, s, t;
	lli a[101][101], u;
	
	while(1){
		cin >> n >> m;
		if(n == 0 && m == 0){
			break;
		}
		fill(&a[1][1], &a[n][n], inf);
		for(int i = 1; i <= n; i++){
			a[i][i] = 0;
		}
		
		while(m--){
			cin >> s;
			if(s == 1){
				cin >> s >> t >> u;
				if(a[s][t] > u){
					a[s][t] = a[t][s] = u;
				}
			} else {
				cin >> s >> t;
				u = dij(a, n, s, t);
				if(u >= inf){
					u = -1;
				}
				cout << u << endl;
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 944
# coding: utf-8
# Your code here!

SIZE=200000; MOD=10**9+7 #ここを変更する

inv = [0]*(SIZE+1)# inv[j] = j^{-1} mod MOD
fac = [0]*(SIZE+1)# fac[j] = j! mod MOD
finv = [0]*(SIZE+1)# finv[j] = (j!)^{-1} mod MOD
inv[1] = 1
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
for i in range(2,SIZE+1):
    inv[i] = MOD -(MOD//i)*inv[MOD%i]%MOD
    fac[i] = fac[i-1]*i%MOD
    finv[i]= finv[i-1]*inv[i]%MOD

def choose(n,r): # nCk mod MOD の計算
    if 0 <= r <= n:
        return (fac[n]*finv[r]%MOD)*finv[n-r]%MOD
    else:
        return 0

n,pa,pb,pc = [int(i) for i in input().split()]

ans = 0
for b in range(n):
    ans += (n+b)*(pow(100,n+b,MOD)*pow(inv[100-pc],n+b,MOD))%MOD *pow(pa,n,MOD)%MOD *pow(pb,b,MOD)%MOD *choose(n-1+b,b)%MOD * inv[pb+pa]%MOD * pow(inv[100],n-1+b,MOD)%MOD
    ans %= MOD
    

for b in range(n):
    ans += (n+b)*(pow(100,n+b,MOD)*pow(inv[100-pc],n+b,MOD))%MOD *pow(pa,b,MOD)%MOD *pow(pb,n,MOD)%MOD *choose(n-1+b,b)%MOD * inv[pb+pa]%MOD * pow(inv[100],n-1+b,MOD)%MOD
    ans %= MOD

print(ans)













Measured memory_bytes: 47724
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)
#define Graph vector<vecctor<ll>>
#define pairs vector<pair<ll,ll>>
#define pb push_back


using namespace std;
using ll = long long;

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



int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int a[10] = {0,0,1,2,1,1,0,1,0,1};
    string b[3] = {"pon","hon","bon"};

    cout << b[a[n%10]] << endl;

    



    return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define foreach(c,itr) for(auto itr = c.begin(); itr!= c.end(); itr++)
#define pb push_back
using namespace std;
using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int> ;
using vi = vector<int>;
using vll = vector<ll>;

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

   int a, b , c, d;
   cin >> a >> b >> c >> d;

   if(abs(c-a) <= d) { 
      cout << "Yes" << endl; 
      return 0;}
   else if(abs(b-a) <= d && abs(c-b) <= d) {
      cout << "Yes" << endl; 
      return 0; 
   }
   else {
      cout << "No" << endl; 
      return 0;
   }


   return 0;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(" ").map(String::toInt)
    val x = readLine()!!.split(" ").map(String::toInt).sorted()
    val d = mutableListOf<Int>()
    (1 until m).forEach { d.add(x[it] - x[it - 1]) }
    d.sort()
    println(d.filterIndexed { index, i -> index < m - n }.sum())
}

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


int main() {
  int A,B,C,K;
  cin>>A>>B>>C>>K;
  
  int res=0;
  while(B<=A){
    B*=2; res+=1;
    if(res>K){cout<<"No"<<endl; return 0;}
  }
  while(C<=B){
    C*=2; res+=1;
    if(res>K){cout<<"No"<<endl; return 0;}
  }
  cout<<"Yes"<<endl;
}


Measured memory_bytes: 3616
#pragma comment(linker, "/STACK:64000000")
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <sstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair < int, int >
#define pll pair < long long, long long>
#define ull unsigned long long
#define y1 stupid_cmath
#define left stupid_left
#define right stupid_right
#define vi vector <int>
#define sz(a) (int)a.size()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x))

const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);

int n, m;
vector<int> g[100100];
deque<int> path;
int used[100100];
int it[100100];

int find_next(int v) {
    while (it[v] < sz(g[v])) {
        int cur = g[v][it[v]];
        if (used[cur]) it[v]++;
        else return cur;
    }
    return -1;
}

void add() {
    int x = path.back();
    while (true) {
        int y = find_next(x);
        if (y == -1) break;
        path.pb(y);
        used[y] = 1;
        x = y;
    }
}

int main(){

    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        x--; y--;
        if (i == 0) {
            path.clear();
            path.pb(x);
            path.pb(y);
            used[x] = used[y] = 1;
        }
        g[x].pb(y);
        g[y].pb(x);
    }

    add();
    reverse(all(path));
    add();

    printf("%d\n", sz(path));
    for (int i = 0; i < sz(path); i++) {
        if (i) printf(" ");
        printf("%d", path[i] + 1);
    }
    printf("\n");

    return 0;
}


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

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

#define LOG(variable) cout << #variable":\t" << (variable) << endl
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cout << (i) << ":\t" << (container)[(i)] << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, n, r) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const { return pow(MOD-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
template<typename T = int>
T in() {T a; cin >> a; return a;}
/***** MAIN *****/
signed main() {
  string s; cin >> s;
  string t; cin >> t;
  REP(i,s.size()) {
    if(s[i] != t[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if(s.size()+1 == t.size()) {
    cout << "Yes" << endl;

  } else {
    cout << "No" << endl;
  }
  return 0;
}
/***** MAIN *****/


Measured memory_bytes: 3628
package main

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

func main() {
	N := nextInt64()
	n := N

	if N == 1 {
		fmt.Println(0)
		return
	}

	c := 0
	primes := make(map[int64]int, 0)

	for i := int64(2); i*i <= N; i++ {
		c1 := 0
		for n%i == 0 {
			c1++
			n /= i
		}
		primes[i] = c1
	}
	if n != 1 {
		primes[N] = 1
	}

	for _, e := range primes {
		for x := 1; x <= e; x++ {
			c++
			e -= x
		}
	}
	fmt.Println(c)
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 81776
n,m = map(int, input().split())
a = set([int(input()) for _ in range(m)])

nums = [0]*(n+1)
nums[0] = 1
if 1 not in a: nums[1] = 1

for i in range(2,n+1):
  if i not in a: nums[i] = nums[i-1] + nums[i-2]
print(nums[n]%(10**9+7))

Measured memory_bytes: 465692