akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

ll x[100010], v[100010], a[100010], b[100010];

int main() {
    int n, i;
    ll c, ans = 0;
    cin >> n >> c;
    
    x[0] = 0;  v[0] = 0;
    for(i = 1; i <= n; i++) {
        cin >> x[i] >> v[i];
    } 
    x[n+1] = c;  v[n+1] = 0;
    
    for(i = 1; i <= n; i++) {
        a[i] = a[i-1] + v[i] - (x[i] - x[i-1]);
    }
    for(i = 1; i <= n; i++) {
        a[i] = max(a[i], a[i-1]);
    } 
    
    for(i = n; i >= 1; i--) {
        b[i] = b[i+1] + v[i] - (x[i+1] - x[i]);
    }  
    for(i = n; i >= 1; i--) {
        b[i] = max(b[i], b[i+1]);
    } 
    
    for(i = 1; i <= n; i++) {
        ans = max(ans, a[i]);
        ans = max(ans, a[i] - x[i] + b[i+1]);
        ans = max(ans, b[i]);
        ans = max(ans, b[i] - (c - x[i]) + a[i-1]);
    }
    
    cout << ans << endl;
    return 0;
}

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

bool isPalindrome(string s){
    string aux(s.rbegin(), s.rend());
    return aux==s;
}

bool first(string s){
    int n=s.size();
    string x;
    string y;
    for(int i=0; i<(n-1)/2; i++){
        x+=s[i];
    }
    string aux(s.rbegin(), s.rend());
    for(int i=0; i<(n-1)/2; i++){
        y+=aux[i];
    }
    return isPalindrome(x) && isPalindrome(y);
}
int main(){
    string s; cin>>s;
    if(isPalindrome(s) && first(s))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
    char a[3]; 
  	for(int i=0;i<3;i++){
    if(0==scanf("%c",&a[i])) printf("error");
    }
    if(a[0]==a[2])printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(){
  int n,v=1<<16;
  cin>>n;
  int h[n],w[n],dp[v],used[v];
  for(int i=0;i<n;i++) cin>>h[i]>>w[i];
  string s[4],c="RGB";;
  for(int i=0;i<4;i++) cin>>s[i];
  memset(dp,-1,sizeof(dp));
  memset(used,0,sizeof(used));
  queue<P> q;
  q.push(P(0,0));
  while(!q.empty()){
    int bit=q.front().first,d=q.front().second;
    q.pop();
    if(~dp[bit]) continue;
    dp[bit]=d;
    for(int i=0;i<n;i++)
      for(int j=-h[i]+1;j<4;j++)
	for(int k=-w[i]+1;k<4;k++)
	  for(int l=0;l<3;l++){
	    int z=bit;
	    for(int a=max(0,-j);a<min(h[i],4-j);a++){
	      for(int b=max(0,-k);b<min(w[i],4-k);b++){
		int y=j+a,x=k+b;
		if(s[y][x]==c[l]) z|=1<<(y*4+x);
		else z&=v-1-(1<<(y*4+x));
	      }
	    }
	    if(dp[z]<0&&!used[z]) q.push(P(z,d+1)),used[z]=1;
	  }
  }
  cout<<dp[v-1]<<endl;
  return 0;
}

Measured memory_bytes: 3832
import java.io.*;
import java.util.*;
public class Main
{
	final long inf=(long)(1e18+1);
	private void solve()throws IOException
	{
		int n=nextInt();
		int a[]=new int[n+1];
		char op[]=new char[n+1];
		for(int i=1;i<=n;i++)
		{
			if(i==1)
				op[i]='+';
			else
				op[i]=nextToken().charAt(0);
			a[i]=nextInt();
		}
		//dp[i][j] is the max value of expr[1..i] such that there are j parenthesis enclosing a[i]
		long dp[][]=new long[n+1][3];
		for(int i=0;i<=n;i++)
			Arrays.fill(dp[i],-inf);	
		dp[0][0]=0;
		for(int i=1;i<=n;i++)
			for(int j=0;j<=2;j++)
			{
				if(op[i]=='-')
				{
					if(j==0)
						continue;
					for(int k=j-1;k<=2;k++)
						dp[i][j]=Math.max(dp[i][j],dp[i-1][k]+(j%2==0?a[i]:-a[i]));
				}
				else
				{
					for(int k=j;k<=2;k++)
						dp[i][j]=Math.max(dp[i][j],dp[i-1][k]+(j%2==0?a[i]:-a[i]));
				}
			}
		long ans=-inf;
		for(int j=0;j<=2;j++)
			ans=Math.max(ans,dp[n][j]);
		out.println(ans);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();
		
		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 44864
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        static void Main(string[] args)
        {

            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            //var p = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int M = int.Parse(Console.ReadLine());
            Console.WriteLine(48 - M);

            //Console.Out.Flush();

        }
    }



    public class Calculation
    {

    }

    public class Graph
    {

    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
const int INF = 5e18 + 7;
int a, b, c, d;
map <int, int> dp;

vector <int> v = {2, 3, 5};
vector <int> cost;

int solve(int n) {
    if (dp.find(n) != dp.end())
        return dp[n];

    if (n == 0)
        return 0;

    int &ans= dp[n];
    ans = INF;
    if (d <= INF/n)
        ans = min(ans, n * d);
    for (int i = 0; i < v.size(); ++i) {
        int e = v[i];

        {
        int to = (n/e)*e;
        if (to == n)
            ans = min(ans, cost[i] + solve(n/e));
        else
            ans = min(ans, abs(n - to) * d +  cost[i] + solve(to/e));
        }

        {
        int to = ((n + e - 1) / e)*e;
        if (to == n)
            ans = min(ans, cost[i] + solve(n/e));
        else
            ans = min(ans, abs(n - to) * d + cost[i] + solve(to/e));
        }   
    }

    //cout << n << ' ' << ans << endl;

    return ans;    
}   
void solve() {
    int n;
    cin >> n >> a >> b >> c >> d;
    cost = {a, b, c};
    dp.clear();
    cout << solve(n) << endl;
}   
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    int t;
    cin >> t;
    while (t--)
        solve();

    #ifdef HOME
    cout << Time << endl;
    #endif
}

Measured memory_bytes: 4480
n = int(input()) # the num of monster
 
ls = list(map(int, input().split()))
n = len(ls)

def gcd(a,b):
  while b != 0:
    a,b = b, a % b
  return a

ans = gcd(ls[0], ls[1])
 
for i in range(n):
    ans = gcd(ans, ls[i])
    
print(ans)

  

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

#define ipr pair<int, int>
#define pb push_back
#define ff first
#define ss second
#define fr(i, j, k) for (int i = j; i < k; i++)
#define rf(i, j, k) for (int i = j; i >= k; i--)
#define ll unsigned long long
#define int long long
#define ld long double
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
#define cnt_ones(x) __builtin_popcountll(x)

#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

const int Maxn = (int)1e5+1;
const ld pi = acos(-1);
const int mod = (int)1e9 + 7;
const int inf = (int)1e18;

template <class T>
ostream &operator<<(ostream &out, vector<T> &A) {
    fr(i, 0, (int)A.size()) out << A[i] << " ";
    return out;
}

vector<int> color(Maxn, -1);
vector<int> freq(Maxn, 0);
vector<int> col_number(Maxn, 0);
vector<bool> vis(Maxn, false);
vector<vector<int> > g(Maxn);
int cnt = 1;

void dfs(int root) {
    if (vis[root]) return;
    vis[root] = true;
    color[root] = cnt;
    for (auto child : g[root]) dfs(child);
}

int32_t main() {IOS
    int n,m,k;  cin>>n>>m>>k;
    
    fr(i,0,m){
        int u,v;    cin>>u>>v;
        u--;    v--;
        g[u].pb(v);
        g[v].pb(u);
    }

    fr(i,0,n){
        if(!vis[i]){
            dfs(i);
        }
        cnt++;
    }

    //No of elements in each connected component.
    fr(i,0,n)   col_number[color[i]]++;

    //No of connected components for every index which donot have friendship.
    fr(i,0,n)   freq[i] = col_number[color[i]] - g[i].size() - 1;

    while(k--){
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        if(color[u] == color[v]){
            freq[u]--;
            freq[v]--;
        }
    }
    fr(i,0,n)   cout << freq[i] << " ";
    return 0;
}


Measured memory_bytes: 12112
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int>ii;
typedef vector<ii>vii;
#define forn(i,n) for(ll i=0;i<n;i++)
#define wez(n) ll (n); cin>>(n);
#define w(t) while(t--)
#define setmax(a,b) (a)=max((a),(b))
#define setmin(a,b) (a)=min((a),(b))
#define pb push_back
#define mp make_pair
#define pie 3.1415926535897;
#define inf 1000000000;
#define outa(a,e) forn(i,e) cout << a[i] << (i==e-1?'\n':' ')
#define oute(n) cout<<n<<"\n"
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll l,r;
    cin>>l>>r;
    if(l/2019!=r/2019)cout<<"0"<<endl;
    else{
        ll ans=INT_MAX;
        for(ll i=l;i<r;i++){
            for(ll j=l+1;j<=r;j++){
                setmin(ans,(i*j)%2019);
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
// Code for A - Kyu in AtCoder
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define FOR(i,x,y) for(ll i=x;i<(ll)(y);i++)

#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

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

  int y;
  if (x >= 1800) {
    y = 1;
  } else if (x >= 1600) {
    y = 2;
  } else if (x >= 1400) {
    y = 3;
  } else if (x >= 1200) {
    y = 4;
  } else if (x >= 1000) {
    y = 5;
  } else if (x >= 800) {
    y = 6;
  } else if (x >= 600) {
    y = 7;
  } else if (x >= 400) {
    y = 8;
  }

  cout << y << endl;
  return 0;
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <climits>
#include <iomanip>
#include <string.h>
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
#define debug2(x, y) cout << #x << " : " << x  << ", " << #y << " : " << y << endl;
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);
typedef long long ll;
using namespace std;


int main()
{
	int n, k;
	cin >> n >> k;
	
	vector <int> cost(n);
	for(int i = 0; i < n; i ++)
		cin >> cost[i];
		
	vector <int> dp(n, INT_MAX);
	dp[0] = 0;
	for(int i = 1; i < n; i ++)
	{
		for(int j = 1; j <= k; j ++)
		{
			if(i >= j)
				dp[i] = min(dp[i], dp[i - j] + abs(cost[i] - cost[i - j])); 
		}
	}
	cout << dp[n -  1] << endl;
}	


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

#define PI M_PI

int main(void) {

  double r, square, circum;

  scanf("%lf", &r);

  square = r * r * PI;
  circum = r * PI * 2;

  printf("%lf %lf\n", square, circum);

  return 0;
}



Measured memory_bytes: 2064
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
   	int b = sc.nextInt();
	int c = sc.nextInt();
    int d = sc.nextInt();
    if (a >= d){
      System.out.println(d);
    } else if (a + b >= d){
      System.out.println(a);
    } else {
      int num=a-(d-a-b);
      System.out.println(num);
    }
  }
}

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

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
#define rep2(i, startValue, N) for (int i = (int)(startValue); i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);
#define ll long long
#define ld long double

//
int main(){
  int n;
  cin >> n;
  vector<int> rt(n, 0);
  rep(i, n) {
    cin >> rt[i];
  }
  int minv = rt[0], maxv = INT_MIN;
  rep2(i, 1, n) {
    maxv = max(maxv, rt[i]-minv);
    minv = min(minv, rt[i]);
  }
  cout << maxv << endl;
  return 0;
}



Measured memory_bytes: 3544
//****************************//
/**********  main *************/
//****************************//
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>

using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i, n) for (i = 0; i < n; i++)
#define FOR(i, a, b) for (i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())

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

int main()
{

    std::cin.tie(0);

    int Z;
    cin >> Z;
    int sum=0;
    int tmp;
    int i,j,k;

    for (i = 1; i <= Z; i++){
        for (j = 1; j <= Z; j++){
            for (k = 1; k <= Z; k++){
                sum = sum + gcd(gcd(i,j),k);
            }
        }
    }

    cout<< sum << endl;

    return 0;
}

//gcd(gcd(s, t), u)

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

#define int long long

using namespace std;



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

    int N, X, T;
    cin >> N >> X >> T;

    cout << ((N-1)/X + 1)*T << '\n';

    return 0;
}

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

#define FOR(k,m,n) for(int(k)=(m);(k)<(n);(k)++)
#define REP(k,n) FOR((k),0,(n))


int main() {
    int N, M;
    cin >> N >> M;

    vector<vector<int>> bss(10000);
    REP(i, N) {
        int a, b;
        cin >> a >> b;
        if (a >= bss.size()) {
            bss.resize(a + 1);
        }
        bss[a].push_back(b);
    }

    priority_queue<int> queue;

    int sumB = 0;
    for (int i = M - 1; i >= 0; --i) {
        int restA = M - i;
        auto& bs = bss[restA];
        for (const auto& b : bs) {
            queue.push(b);
        }
        if (!queue.empty()) {
            auto& b = queue.top();
            sumB += b;
            queue.pop();
        }
    }

    printf("%d\n", sumB);

    return 0;
}

/*
 * Local Variables:
 * compile-command: "CXXFLAGS='-std=c++14' make main"
 * End:
 */


Measured memory_bytes: 7312
//
//  main.cpp
//  ICPC2011C
//
//  Created by aki33524 on 2014/07/02.
//  Copyright (c) 2014年 aki33524. All rights reserved.
//

#include <iostream>
#include <algorithm>
using namespace std;

int H, W, C;
int field[8][8];
int dh[] = {0, 0, 1, -1};
int dw[] = {1, -1, 0, 0};

void dfs2(int h, int w, int pc, int nc){
    field[h][w] = nc;
    
    for(int i=0; i<4; i++){
        int nh = h + dh[i];
        int nw = w + dw[i];
        if(0<=nh&&nh<H && 0<=nw&&nw<W && field[nh][nw]==pc && field[nh][nw]!=nc){
            dfs2(nh, nw, pc, nc);
        }
    }
}


int dfs(int deepth, int changes[]){
    int res;
    int tfield[8][8];
    
    //memcopyで
    for(int h=0; h<H; h++){
        for(int w=0; w<W; w++){
            tfield[h][w] = field[h][w];
        }
    }
    
    dfs2(0, 0, field[0][0], changes[deepth]);
    
    if(deepth < 5){
        res = dfs(deepth+1, changes);
    }else{
        res = 0;
        for(int h=0; h<H; h++){
            for(int w=0; w<W; w++){
                if(field[h][w] == changes[deepth]){
                    res ++;
                }
            }
        }
    }
    
    for(int h=0; h<H; h++){
        for(int w=0; w<W; w++){
            field[h][w] = tfield[h][w];
        }
    }
    
    return res;
}

void solve(){
    int ans = 0;
    for(int i1=1; i1<=6; i1++){
        for(int i2=1; i2<=6; i2++){
            for(int i3=1; i3<=6; i3++){
                for(int i4=1; i4<=6; i4++){
                    int i5 = C;
                    int chnges[] = {i1, i2, i3, i4, i5};
                    ans = max(ans, dfs(0, chnges));
                }
            }
        }
    }
    cout << ans << endl;
}

int main(int argc, const char * argv[])
{
    while(cin >>H>>W>>C, H|W|C){
        for(int h=0; h<H; h++){
            for(int w=0; w<W; w++){
                cin >> field[h][w];
            }
        }
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<set>
#include<utility>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long long> d(n);
  for(int i = 0; i < n; i++) cin >> d[i];
  int m;
  cin >> m;
  vector<long long> t(m);
  for(int i = 0; i < m; i++) cin >> t[i];
  sort(d.begin(), d.end());
  sort(t.begin(), t.end());

  int di = 0;
  for(int i = 0; i < m; i++) {
    if(di >= n) {
      cout << "NO" << endl;
      return 0;
    }
    if(d[di] == t[i]) {
      di++;
      continue;
    } else if(d[di] < t[i]) {
      di++;
      i--;
      continue;
    } else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;

  return 0;
}


Measured memory_bytes: 3328
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	#define int  long long int
	#define pb push_back
	#define fe first
	#define lb lower_bound 
	#define ub upper_bound
	#define pii pair<pair<int,int>,pair<int,int> >
	#define se second
	#define endl "\n"
	#define pi pair<int, int>
	#define mi          map<int,int>
	#define mii         map<pi,int>
	#define vi vector<int> 
	#define vvi vector<vi>
	#define bs   binary_search
	#define rep(i,a,b) for(int i=a;i<b;i++)
	#define rep1(i,a,b) for(int i=a;i<=b;i++)	
	#define all(c) (c).begin(),(c).end()
	#define sz(x)       (int)x.size() 
	#define PI 3.14159265358979323846
	
	 const int N =2e5+5;
	
	 int mod= 1e9+7;
	 int dx[4]={0,0,+1,-1};
	 int dy[4]={+1,-1,0,0};  
	 
	 
	int po(int a, int b) {
		a %= mod;
		int res = 1;
		while (b > 0) {
			if (b & 1)
				res = (res * a) % mod;
			a =(a*a) % mod;
			b >>= 1;
		}
		 return res;	
	   }

	  
	 void solve() {		 
		  long double l;
		  cin>>l;
		 
		  
		   long double a=l*l*l,b=27,ans=0;
		  	  ans=a/b;				  
		   cout<<fixed<<setprecision(7)<<ans<<endl;
	            
	 }
	
int32_t main() {
	cool;
	int t=1;
	//cin>>t;
	while(t--)
	   solve();
	   
	   
	   return 0;	   
}


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

string	check(string &a, string &b)
{
	int i;

	for (i = 0; a[i] || b[i]; i++)
	{
		if (a[i] != b[i])
			break;
	}
	string ans;

	if (a[i] > b[i])	
		ans = "GREATER";
	else if (a[i] < b[i])
		ans = "LESS";
	else
		ans = "EQUAL";
	return (ans);
}

int		main(void)
{
	string a, b, ans;
	cin >> a >> b;

	if (a.size() == b.size())
		ans = check(a, b);
	else
	{
		if (a.size() > b.size())	
			ans = "GREATER";
		else
			ans = "LESS";
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    int a,b;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        if (a < b){
            System.out.println("a < b");
        }else if (a > b){
            System.out.println("a > b");
        }else{
            System.out.println("a == b");
        }
    }
    public static void main(String[] args){
        new Main().solve();     
    }
 
}

Measured memory_bytes: 17156
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
	set<int> twos;
	{
		int num = 1;
		while (num < 10000000000000) {
			twos.insert(num);
			num *= 2;
		}
	}

	int N;
	cin >> N;

	vector<int> A;
	inputVector(A, N);

	sort(all(A));
	reverse(all(A));

	unordered_map<int, int> left;
	for (int a : A) {
		left[a]++;
	}

	int ret = 0;
	for (int a : A) {
		if (left[a] == 0) {
			continue;
		}
		for (auto it = twos.rbegin(); it != twos.rend(); it++) {
			int target = *it;
			if (target <= a) continue;
			if (a != target - a && left[target - a] || a == target - a && left[a] >= 2) {
				left[a]--;
				left[target - a]--;
				ret++;
				break;
			}
		}
	}

	cout << ret << endl;

    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  int n, k, x, y,ans;
  cin >> n >> k >> x >> y;

  if (k <= n) ans = k * x + (n - k) * y;
  else
    ans = n * x;

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


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<map>
#include <algorithm>
#include<cstdlib>
#include<cmath>
#include<deque>
#include <numeric>
#include<valarray>
typedef unsigned long long ull;
typedef  long long ll;


ll testnum(ll x, ll y)
{
	ll tmpq = x / (1 <<y);
	ll tmpz = tmpq * y;

	return tmpz;

}
ll testnumu(ll x, ll y)
{
	ll tmpq = x / (1<<y);
	ll tmpz = (tmpq + 1) * (1 <<y) ;

	return tmpz;

}

int main() {
	ll  b , a ;
	std::cin >> a >> b ;

	ll fb = 0;
	if (b % 2) {
		fb = (b + 1) / 2 % 2;
	}
	else
	{
		fb = b ^ ((b) / 2 % 2);
	}

	ll fa = 0;
	if (a > 0) {
		a = a - 1;
		if ((a) % 2) {
			fa = (a + 1) / 2 % 2;
		}
		else
		{
			fa = (a) ^ ((a) / 2 % 2);
		}
	}
	std::cout << (fa ^ fb) << std::endl;

	return 0;
}

Measured memory_bytes: 256
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

signed main() {
    int n;
    cin >> n;
    string s = "";
    if (n == 25) {
        s = "Christmas";
    } else if (n == 24) {
        s = "Christmas Eve";
    } else if (n == 23) {
        s = "Christmas Eve Eve";
    } else if (n == 22) {
        s = "Christmas Eve Eve Eve";
    }

    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
def solve():
    A = []

    import sys
    f_i = sys.stdin
    q = f_i.readline()
    
    ans = []
    for q in f_i:
        if q[0] == '0':
            A.append(q[2:])
        elif q[0] == '1':
            ans.append(A[int(q[2:])])
        else:
            A.pop()
    print(''.join(ans), end='')

solve()


Measured memory_bytes: 19956
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;


int main() {
    int n,m;
    while(true){
        cin>>n>>m;
        if(n==0&&m==0)break;
        vector<int> v(m,0);
        rep(i,n){
            int a,b;
            cin>>a>>b;
            a--;
            if(v[a]<b)v[a]=b;
        }int ans=0;
        rep(i,m){
            ans+=v[i];
        }
        cout<<ans<<endl;
    }

    return 0;
}



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

int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<char>> c(52,vector<char> (52));
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      cin >> c.at(i).at(j);
    }
  }
  bool can = true;
  for(int i=1;i<=H;i++){
    for(int j=1;j<=W;j++){
      if(c.at(i).at(j)=='#'&&(c.at(i).at(j-1)!='#'&&c.at(i).at(j+1)!='#'&&c.at(i-1).at(j)!='#'&&c.at(i+1).at(j)!='#')){
        can = false;
      }
    }
  }
  if(can) cout << "Yes" << endl;
  else cout << "No" << endl;  
}

Measured memory_bytes: 256
s = input()

if not s[0] == "A":
    print ("WA")
    exit ()

if not list(s[2:-1]).count("C") == 1:
    print ("WA")
    exit ()

s = (s.replace('A','')).replace('C','')

if s.islower():
    print ("AC")
else:
    print ("WA")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
const int N=2005;
int edge,to[N<<1],last[N<<1],size[N],ans,Next[N<<1],d[N],sum,n,x,y,son[N];
char s[N];
void add(int x,int y){
	to[++edge]=y;
	Next[edge]=last[x];
	last[x]=edge;
}
void dfs(int x,int fa){
	d[x]=d[fa]+1;
	son[x]=s[x]-'0';
	int mx=0;
	for (int i=last[x];i;i=Next[i]){
		int u=to[i];
		if(to[i]==fa) continue;
		dfs(to[i],x);
		son[x]+=son[to[i]];
		size[x]+=size[u]+son[u];
	}
	sum=sum+d[x]*(s[x]-'0');
}
int get(int x,int fa){
	int mx=0;
	for (int i=last[x];i;i=Next[i])
		if(to[i]!=fa && size[to[i]]+son[to[i]]>size[mx]+son[mx]) mx=to[i];
	if (mx==0) return 0;
	int t=get(mx,x)+son[mx];
	if (t<=size[x]-size[mx]-son[mx])  return size[x]&1;
	else return t-(size[x]-size[mx]-son[mx]);
}
int main(){
	scanf("%d",&n);
	scanf("%s",s+1);
	for (int i=1;i<n;i++){
		scanf("%d%d",&x,&y);
		add(x,y),add(y,x);
	}
	ans=1000000000;
	d[0]=-1;
	for (int i=1;i<=n;i++)
		{
			memset(size,0,sizeof(size));
			sum=0;
			dfs(i,0);
			if (!get(i,0))ans=std::min(ans,size[i]/2);
		} 
	if (ans<1000000000) printf("%d\n",ans);
	else puts("-1");
} 


Measured memory_bytes: 384
s = input()
n = len(s)
count = 0
count2 = 0
for i in range(n):
	if i % 2 == 0:
		x = "0"
	else:
		x = "1"
	if s[i] == x:
		count2 += 1 
		#print(i, s[i],x, "OK")
	else:
		count += 1
		#print(i, s[i], x)
print(min(count,count2))

Measured memory_bytes: 3188
S = input()
checker = '01'*100001
keep1 = checker[:len(S)]
keep2 = checker[1:len(S)+1]
ans_1 = 0
ans_2 = 0
for i in range(len(S)):
    if S[i] != keep1[i]:
        ans_1 += 1
    else:
        ans_2 += 1
print(min(ans_1, ans_2))

Measured memory_bytes: 9404
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int[] d = new int[n];
                for(int i = 0 ; i < n ; i++){
                        d[i] = sc.nextInt();
                }
                sc.close();
                Arrays.sort(d);
                int yono = 1;
                for(int i = 1 ; i < n ; i++){
                        if(d[i - 1] != d[i]) yono++;
                }
                System.out.println(yono);
        }
}
//鶏になれ

Measured memory_bytes: 35808
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll a,b,c,k;
  cin >> a >> b >> c >> k;
  ll ac = a;
  ll bc = b;
  ll cc = c;
  vector<ll> bit(k);
  bool res = false;
  for(int i = 0;i < k;i++)bit[i] = 0;
  for(int i = 0;i < pow(3,k);i++){
    a = ac;
    b = bc;
    c = cc;
    for(int j = 0;j < k;j++){
      if(bit[j] == 0)a *= 2;
      else if(bit[j] == 1)b *= 2;
      else c *= 2;
      if(a < b && b < c){
        res = true;
        break;
      }
      //cout << a << " " << b << " " << c << endl;
    }
    if(a < b && b < c){
      res = true;
      break;
    }
    ll it = -1;
    for(int j = 0;j < k;j++){
      if(bit[j] != 2){
        bit[j]++;
        it = j;
        break;
      }
    }
    if(it == -1)break;
    for(int j = 0;j < it;j++)bit[j] = 0;
    //cout << bit[0] << bit[1] << bit[2] << endl;
  }
  if(res)cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 4100
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,x,y,i,j,total=0;
    cin>>a>>b>>c>>x>>y;
    if(c*2>=a+b){
        total+=a*x+b*y;
    }
    else{
        total+=min(x,y)*c*2;
        if(x>=y){
            if(a<=c*2)
                total+=(x-y)*a;
            else
                total+=(x-y)*c*2;
        }
        else{
            if(b<=c*2)
                total+=(y-x)*b;
            else
                total+=(y-x)*c*2;
        }
    }
    cout<<total<<endl;

    return 0;
}

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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin>>s;
	int k=1;
	string s1="",s2="";
	s1+=s[0];
	for(int i=1;i<(int)s.size();i++) {
		s2+=s[i];
		if(s1!=s2) {
			k++;
			s1=s2;
			s2="";
		}
	}
	cout<<k;
	return 0;
}

Measured memory_bytes: 720
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

int main()
{
	int N, R;
	cin >> N >> R;

	if (N < 10) {
		cout << R + 100 * (10 - N) << endl;
	}
	else {
		cout << R << endl;
	}
	
}


Measured memory_bytes: 3564
l1 = [1, 3, 5, 7, 8, 10, 12]
l2 = [4, 6, 9, 11]
l3 = [2]

a, b = map(int,raw_input().split())
if a in l1 and b in l1:
	print "Yes"
elif a in l2 and b in l2:
	print "Yes"
elif a in l2 and b in l3:
	print "Yes"
else :
	print "No"

Measured memory_bytes: 2568
//064 A - RGB Cards 2017/06/10
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;

int main(){
    int r , g , b; cin >> r >> g >> b;
    int num = r * 100 + g * 10 + b;
    cout << ( num % 4 == 0 ? "YES" : "NO" ) << endl;
}

Measured memory_bytes: 256
n=int(input())
w=input()
d1={}
d2={}
d3={}
for i in range(0,10):
  d1[str(i)]=0
  for j in range(10):
    d2[str(i)+str(j)]=0
    for k in range(10):
      d3[str(i)+str(j)+str(k)]=0
for i in range(len(w)):
  for j in range(10):
    for k in range(10):
      if d2[str(j)+str(k)]>0:
        d3[str(j)+str(k)+w[i]]=1
  for j in range(10):
    if d1[str(j)]>0:
      d2[str(j)+w[i]]=1
  d1[w[i]]+=1
ans=0
for i in d3:
  if d3[i]>0:
    ans+=1
print(ans)

Measured memory_bytes: 42988
#include<stdio.h>
#include<string.h>
int main()
{
    int count=0,i,j;
    char S[200000];
    char T[200000];
    scanf("%s",&S);
    scanf("%s",&T);
    int len1 = strlen(S);
    int len2 = strlen(T);
    for( i=0,j=0; i < len1&&j < len2; i++,j++)
        {
            if(S[i]!=T[j])
            count++;
        }
        printf("%d\n",count);
}

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

// main.cpp

int main() {
  std::int_fast64_t n, k;
  std::cin >> n >> k;

  std::vector<std::vector<std::int_fast64_t>> dots(2 * k, std::vector<std::int_fast64_t>(2 * k, 0));
  for (std::int_fast64_t i = 0; i < n; ++i) {
    std::int_fast64_t x_i, y_i;
    char c_i;
    std::cin >> x_i >> y_i >> c_i;
    switch (c_i) {
    case 'B':
      ++dots[x_i % (2 * k)][y_i % (2 * k)];
      ++dots[(x_i + k) % (2 * k)][(y_i + k) % (2 * k)];
      break;
    case 'W':
      ++dots[x_i % (2 * k)][(y_i + k) % (2 * k)];
      ++dots[(x_i + k) % (2 * k)][y_i % (2 * k)];
      break;
    }
  }

  std::vector<std::vector<std::int_fast64_t>> cumsum(2 * k, std::vector<std::int_fast64_t>(2 * k, 0));
  for (std::int_fast64_t i = 0; i < 2 * k - 1; ++i) {
    for (std::int_fast64_t j = 0; j < 2 * k - 1; ++j) {
      cumsum[i + 1][j + 1] = cumsum[i][j + 1] + cumsum[i + 1][j] - cumsum[i][j] + dots[i][j];
    }
  }

  std::int_fast64_t answer = 0;
  for (std::int_fast64_t i = 0; i < k; ++i) {
    for (std::int_fast64_t j = 0; j < k; ++j) {
      const std::int_fast64_t captured = cumsum[i + k][j + k] - cumsum[i][j + k] - cumsum[i + k][j] + cumsum[i][j];
      const std::int_fast64_t complement = n - captured;
      answer = std::max(answer, std::max(captured, complement));
    }
  }

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 62976
using System;

namespace ALDS1_1_B {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            if (a < b) {
                int temp = a;
                a = b;
                b = temp;
            }

            int r = a % b;
            while (r != 0) {
                a = b;
                b = r;
                r = a % b;
            }
            Console.WriteLine(b);
        }
    }
}

Measured memory_bytes: 9188
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class CForbiddenList {
public:
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        int X, N;
        in>>X>>N;
        vc<int> cnt(103, 0);
        REP(i, N){
            int p;
            in>>p;
            cnt[p]++;
        }
        int ans = -1, mn = 101010;
        REP(i, 103){
            if(cnt[i]) continue;
            if(chmin(mn, abs(X-i))) ans = i;
        }
        out<<ans<<'\n';
    }
};


int main() {
	CForbiddenList solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=(int)1e7+50;
int k,l,r;
vector<ll> num;
ll q[N];
inline ll read(){
	ll cnt=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-f;c=getchar();}
	while(isdigit(c)){cnt=(cnt<<1)+(cnt<<3)+(c^48);c=getchar();}
	return cnt*f;
}
inline void prework(){for(int i=1;i<=9;++i){q[++r]=i;}}
int main(){
	k=read();if(1<=k&&k<=9) {printf("%d",k);return 0;}
	l=1,r=0;prework();
	while(r>l){
		ll cur=q[l];++l;
		if(cur>1e11)break;
		num.push_back(cur);
		int del=cur%10;
		r++;q[r]=(cur<<1)+(cur<<3)+del;
		if(del!=0)q[++r]=(cur<<1)+(cur<<3)+del-1;
		if(del!=9)q[++r]=(cur<<1)+(cur<<3)+del+1;
	}
	sort(num.begin(),num.end());
	cout<<num[k-1]<<endl;
	return 0;
}

Measured memory_bytes: 22764
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <bitset>
#include <string>
#include <cmath>
#include <set>
#include <map>
#define Rep(i, x, y) for (int i = x; i <= y; i ++)
#define Dwn(i, x, y) for (int i = x; i >= y; i --)
#define RepE(i, x) for (int i = pos[x]; i; i = g[i].nex)
#define ev g[i].y
#define eps 1e-10
using namespace std;
typedef long long ll;
typedef double db;
const int N = 2005, inf = 1 << 28;
int n, a[N], b[N], ps, c[2][N], ans = inf, fl;
char s[N];
struct arr { int x, y; } p[N];
bool cmp(arr a, arr b) { return a.x > b.x; }
void solve(bool f) {
	Rep(l, 0, n - 1) {
		int num, k, mx;
		num = mx = 0;
		k = inf;
		ps = 0;
		Rep(i, 0, n - 1) {
			int j;
			if (!f) j = (i + l) % n;
			else j = (i - l + n) % n;
			if (a[i]) {
				if (!b[j]) p[++ ps] = (arr) { c[!f][i], c[f][i] }, num ++;
			} else {
				if (b[j]) num ++;
			}
		}
		p[++ ps].x = 0;
		sort(p + 1, p + ps + 1, cmp);
		Rep(i, 1, ps) {
			k = min(k, 2 * (p[i].x + mx));
			mx = max(mx, p[i].y - l);
		}
		// cout << l<<" "<<num<<" "<< k<<endl;
		ans = min(ans, num + k + l);
	}
}
int main()
{
	scanf ("%s", s);
	n = strlen(s);
	Rep(i, 0, n - 1) a[i] = s[i] - '0';
	scanf ("%s", s);
	Rep(i, 0, n - 1) b[i] = s[i] - '0';
	Rep(i, 0, n - 1) if (b[i]) fl = 1;
	Rep(i, 0, n - 1) if (a[i]) {
		if (!fl) { puts("-1"); return 0; }
		Rep(j, 0, n - 1) if (b[(i + j) % n]) { c[0][i] = j; break ; }
		Rep(j, 0, n - 1) if (b[(i - j + n) % n]) { c[1][i] = j; break ; }
	}
	solve(0);
	solve(1);
	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 256
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
using lint = long long;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (int i = 0; i < (int)vec.size(); i++) {
		os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	}
	return os;
}

#ifdef _DEBUG
template <class Head>
void dump(const char* str, Head &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + 1, t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

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

	bool pos = false;
	pos |= A % 3 == 0;
	pos |= B % 3 == 0;
	pos |= (A + B) % 3 == 0;

	if (pos) cout << "Possible" << "\n";
	else cout << "Impossible" << "\n";

	return 0;
}

Measured memory_bytes: 256
/*
g++ -std=c++14 -O2 -Wall a.cpp -o a && a
*/

//  io
#include <iostream>
//#include <cstdio>
#include <iomanip> //http://www.cplusplus.com/reference/iomanip/
#include <limits>
//  util
#include <string>
#include <cstring>
#include <algorithm>
//#include <utility>
//#include <functional> //http://www.cplusplus.com/reference/functional/
//#include <cstdlib>
#include <cmath>
//#include <complex>
//#include <random>
//#include <bitset>
//  containers https://en.cppreference.com/w/cpp/container
#include <vector>
#include <queue>
#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//  time
//#include <ctime>
//#include <chrono>
//                  https://en.cppreference.com/w/cpp/header/chrono
//                  http://www.cplusplus.com/reference/chrono/

using namespace std;
typedef vector<int> arri;
typedef vector<float> arrf;
typedef pair<int, int> pairi;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 0x7fffffffffffffff;
const ll infneg = -0x7fffffffffffffff;

//file input routed to stdinout
/*
std::ifineam inFile("input.txt");
std::ofineam outFile("output.txt");
std::cin.rdbuf(inFile.rdbuf());
std::cout.rdbuf(outFile.rdbuf());
*/

int pre[100001];

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

    int n, k;
    cin >> n >> k;

    string s;
    cin >> s;

    arri v;

    int firstsign = (int)(s[0] - '0');
    int sign = firstsign;

    int consec = 1;

    v.push_back(0);
    for (int i = 1; i < n; i++)
    {
        int aux = (int)(s[i] - '0');
        if (aux == sign)
        {
            consec++;
        }
        else
        {
            v.push_back(consec);
            consec = 1;
            sign = aux;
        }
    }
    v.push_back(consec);

    pre[0] = 0;
    for (int i = 1; i < v.size(); i++)
    {
        pre[i] = pre[i - 1] + v[i];
    }

    int maxV = 0;

    int aux;
    for (int i = 1; i < v.size(); i++)
    {
        int index;
        if ((firstsign + i + 1) % 2 == 0)
        {
            index = min(i + 2 * k - 1, (int)(v.size() - 1));
        }
        else
        {
            index = min(i + 2 * k, (int)(v.size() - 1));
        }

        aux = pre[index] - pre[i - 1];

        maxV = max(maxV, aux);
    }

    cout << maxV;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> ii;
typedef map<int, int> MPII;
typedef set<int> SETI;

const int mxN = 2e5;
const ld pi = 4.0 * atanl(1.0);
const int iinf = 1e9 + 10;
const int inf = 1e18 + iinf + 10;
const int mod = 1000000007;
const ld prec = .000001;

#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(c) c.begin(), c.end()
#define rall(c) c.end(), c.begin()

ll n, m, t, a[mxN];
vi v;

void fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }

int main() {
  fast();
  cin >> n;
  ll ans = 1, i = 2;
  while (n != 1) {
    n /= 2;
    ans += i;
    i *= 2;
  }
  cout << ans;

  return 0;
}



Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 //   freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	
    int n,sum,a,b;
 
    cin>>n;
    b=INT_MAX;
    sum=0;
    while(n--)
    {
    	cin>>a;
    	sum+=a;
    	if(a%10!=0 && a<b)
    		b=a;
    }
 
    if(sum%10==0)
    {
    	if(b==INT_MAX)
    		cout<<0;
    	else
    		cout<<sum-b;
    }
    else
    	cout<<sum;
 
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long A, B, C;
	cin >> A >> B >> C;
	long long M = max({ A,B,C });
	long long sum;
	if (M % 2 == (A + B + C) % 2) {
		sum = M - A + M - B + M - C;
	}
	else {
		sum = M + 1 - A + M + 1 - B + M + 1 - C;
	}
	cout << sum / 2 << endl;
}


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main() {
    input! {
        _n: usize,
        k: usize,
        s: String,
    }
    let mut vals: Vec<u32> = Vec::new();
    let mut tmp = 0;
    let mut pre = s.chars().nth(0).unwrap();
    if pre == '0' {
        vals.push(0);
    }
    for c in s.chars() {
        if c != pre {
            vals.push(tmp);
            tmp = 1;
            pre = c;
        } else {
            tmp += 1;
        }
    }
    vals.push(tmp);
    if s.chars().last().unwrap() == '0' {
        let v: u32 = *vals.last().unwrap();
        vals.push(0);
    }

    let mut sumvals: Vec<u32> = Vec::new();
    let mut tmp = 0;
    for val in vals.clone() {
        tmp += val;
        sumvals.push(tmp);
    }
    let mut left = 0;
    let mut ans = 0;
    loop {
        if left >= sumvals.len() {
            break;
        }
        let right = std::cmp::min(sumvals.len() - 1, left + 2 * k);
        let v = sumvals[right] - sumvals[left] + vals[left];
        left += 2;
        ans = std::cmp::max(ans, v);
    }
    println!("{}", ans);
}


Measured memory_bytes: 6396