akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<tuple<ll,ll>> vtl;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
#define pf(a) cout << (a) << endl;
#define be(x) (x).begin(),(x).end()
bool is_prime(ll n){
    if(n==2)return true;
    else if(n<2||n%2==0)return false;
    ll i=3;
    while(i<=sqrt(n)){
        if(n%i==0)return false;
        i+=2;
    }
    return true;
}
void solve(){
    char s;
    cin>>s;
    s++;
    cout<<s<<endl;
}
int main(){
    cout<<std::fixed<<std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			int num = sc.nextInt();
			int sum = 0;
			
			for(int i = 0; i < 600; i = i + num){
				sum = sum + (num * i * i);
			}
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 15332
#include<bits/stdc++.h>
using namespace std;
int le[201]={0,1,9,30,76,141,267,400,624,885,1249,1590,2208,2689,3411,4248,5248,6081,7485,8530,10248,11889,13687,15228,17988,20053,22569,25242,28588,31053,35463,38284,42540,46581,50893,55362,61824,65857,71247,76884,84388,89349,97881,103342,111528,120141,128047,134580,146316,154177,164817,174438,185836,194157,207927,218812,233268,245277,257857,268182,288216,299257,313635,330204,347836,362973,383709,397042,416448,434025,456967,471948,499740,515581,536073,559758,583960,604833,633651,652216,683712,709065,734233,754734,793188,818917,846603,874512,909496,933081,977145,1006126,1041504,1073385,1106467,1138536,1187112,1215145,1255101,1295142,1342852,1373253,1422195,1453816,1502376,1553361,1595437,1629570,1691292,1726717,1782111,1827492,1887772,1925853,1986837,2033674,2089776,2145333,2197483,2246640,2332104,2379085,2434833,2490534,2554600,2609625,2693919,2742052,2813988,2875245,2952085,3003306,3096024,3157249,3224511,3306240,3388576,3444609,3533637,3591322,3693924,3767085,3842623,3912324,4027884,4102093,4181949,4270422,4361548,4427853,4548003,4616104,4718640,4812789,4918561,5003286,5131848,5205481,5299011,5392008,5521384,5610705,5739009,5818390,5930196,6052893,6156139,6239472,6402720,6493681,6623853,6741078,6864016,6953457,7094451,7215016,7359936,7475145,7593865,7689630,7886244,7984165,8130747,8253888,8403448,8523897,8684853,8802826,8949612,9105537,9267595,9376656,9574704,9686065,9827097,9997134,10174780,10290813,10493367,10611772,10813692};
int main() {
	int k;
	cin>>k;
	cout<<le[k];

	return 0;
}


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

int main() {
    string S;
    cin >> S;
    map<char, int> mp;
    for(int i = 0; i < S.size(); i++) mp[S[i]]++;
    int ans = 0;
    for(char a = 'a'; a <= 'z'; a++) {
        ans += (mp[a] % 2);
    }
    cout << (ans) / 2 << endl;
    return 0;
}


Measured memory_bytes: 3168
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(double x){
  printf("%.15f",x);
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
int N;
int K;
int P[200000];
int main(){
  int i;
  int mx;
  int tmp = 0;
  double res;
  rd(N);
  rd(K);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=(0);Lj4PdHRW<(N);Lj4PdHRW++){
      rd(P[Lj4PdHRW]);
    }
  }
  for(i=(0);i<(K);i++){
    tmp += P[i];
  }
  mx = tmp;
  for(i=(K);i<(N);i++){
    tmp += P[i] - P[i-K];
    chmax(mx, tmp);
  }
  wt_L((mx + K) / 2.0);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200214-1

// --- original code ---
// int N, K, P[2d5];
// {
//   int mx, tmp = 0;
//   double res;
//   rd(N,K,P(N));
//   rep(i,K) tmp += P[i];
//   mx = tmp;
//   rep(i,K,N){
//     tmp += P[i] - P[i-K];
//     mx >?= tmp;
//   }
//   wt((mx + K) / 2.0);
// }


Measured memory_bytes: 1024
#include<map>
#include<set>
#include<cmath>
#include<regex>
#include<queue>
#include<stack>
#include<bitset>
#include<vector>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>

#pragma warning(disable:4996)
using namespace std;

int sx;
int sy;
int tx;
int ty;

int main() {
	scanf("%d%d%d%d", &sx, &sy, &tx, &ty);
	for (int i = sy; i < ty; ++i) {
		putchar('U');
	}
	for (int i = sx; i < tx; ++i) {
		putchar('R');
	}
	for (int i = ty; i > sy; --i) {
		putchar('D');
	}
	for (int i = tx; i > sx; --i) {
		putchar('L');
	}
	putchar('L');
	for (int i = sy; i < ty; ++i) {
		putchar('U');
	}
	putchar('U');
	putchar('R');
	for (int i = sx; i < tx; ++i) {
		putchar('R');
	}
	putchar('D');
	putchar('R');
	for (int i = ty; i > sy; --i) {
		putchar('D');
	}
	putchar('D');
	putchar('L');
	for (int i = tx; i > sx; --i) {
		putchar('L');
	}
	putchar('U');
	puts("");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main()
{
    int n, d;
    int x[102], y[102];
    bool s = 1;
 
    cin >> n;
 
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i];
 
    x[n] = x[0];
    y[n] = y[0];
    x[n + 1] = x[1];
    y[n + 1] = y[1];
 
    for (int i = 0; i < n; i++) {
        d = (x[i + 1] - x[i]) * (y[i + 2] - y[i]) - (x[i + 2] - x[i]) * (y[i + 1] - y[i]);
        if (d < 0) {
            s = 0;
            break;
        }
    }
 
    cout << s << endl;
 
    return 0;
}


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

using namespace std;

typedef long long int64;

int main()
{
  int N, A[100000];

  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i], --A[i];

  int now = 0, ret = 0;
  bool v[100000] = {};
  while(!exchange(v[now], 1)) {
    now = A[now];
    ++ret;

    if(now == 1) {
      cout << ret << endl;
      return (0);
    }
  }

  cout << -1 << endl;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload3(_1, _2, _3, name, ...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) for (ll i = (a); i < (n); ++i)
#define rep(...) _overload3(__VA_ARGS__, rep3, rep2, rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<typename T> inline void print(const T& x) {cout << x << "\n";}
template<typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template<typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
struct Init {Init() {cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10);}} init;

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

    scc_graph graph(n);
    rep(m) {
        ll a, b;
        cin >> a >> b;
        graph.add_edge(a, b);
    }
    auto scc = graph.scc();
    cout << sz(scc) << "\n";
    each(v, scc) {
        cout << sz(v);
        each(x, v) {
            cout << " " << x;
        }
        cout << "\n";
    }

}

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

#define double long double
#define int long long
#define ALL(x) x.begin(),x.end()
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend()) 
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 998244353 
#define F(i, a, n) for(i=a;i<n;i++)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)


int32_t main(void)
{
    FASTER;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int i, j;
    int n, k;
    DI(n, k);
    int a[n];
    F(i, 0, n)
    	SI(a[i]);
    F(i, k, n)
    {
    	if(a[i] > a[i - k])
    		SO("Yes");
    	else
    		SO("No");
    }
    
    #ifdef LOCAL
    	cout<<endl<<endl<<"Time: "<<(float)clock()/CLOCKS_PER_SEC<<" seconds"<<endl;
    #endif
    return 0;
}

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

#define INF (1<<29)
#define max_n 10000

using namespace std;

struct node_t{
  node_t *pp,*lp,*rp;
  int id,val,mini,minId,lazy;
  bool rev;

  node_t(int id,int v):id(id),val(v){
    pp=lp=rp=NULL;
    rev=false; 
    lazy=0; 
    update();
  }
   
  void update(){
    mini=val,minId=id;
    if(lp && mini>lp->mini)mini=lp->mini,minId=lp->minId;
    if(rp && mini>=rp->mini)mini=rp->mini,minId=rp->minId;
  }
   
  void apply(int v){ lazy+=v, val+=v, mini+=v; }
   
  void push(){
    if(rev){
      rev=false;
      swap(lp,rp);
      if(lp)lp->rev^=true;
      if(rp)rp->rev^=true;
    }
    if(lp)lp->apply(lazy);
    if(rp)rp->apply(lazy);
    lazy=0;
  }
 
  bool is_root(){
    return !pp || (pp->lp != this && pp->rp != this);
  }
  
  void rotr(){
    node_t *q=pp,*r=q->pp;
    q->push(),push();
    if((q->lp=rp))rp->pp=q;
    rp=q;q->pp=this;
    if((pp=r)){
      if(r->lp==q)r->lp=this;
      if(r->rp==q)r->rp=this;
    }
    q->update();
  }

  void rotl(){
    node_t *q=pp,*r=q->pp;
    q->push(),push();
    if((q->rp=lp))lp->pp=q;
    lp=q;q->pp=this;
    if((pp=r)){
      if(r->lp==q)r->lp=this;
      if(r->rp==q)r->rp=this;
    }
    q->update();
  }

  void splay(){
    while(!is_root()){
      node_t *q=pp;
      if(q->is_root()){
	if(q->lp==this)rotr();
	else rotl();
      } else {
	node_t *r=q->pp;
	if(r->lp==q){
	  if(q->lp==this){q->rotr();rotr();}
	  else {rotl();rotr();}
	} else {
	  if(q->rp==this){q->rotl();rotl();}
	  else {rotr();rotl();}
	}
      }
    }
    push();
    update();
  }
};

node_t *expose(node_t *x){
  node_t *rp=NULL;
  for(node_t *p=x;p;p=p->pp){
    p->splay();
    p->rp=rp;
    p->update();
    rp=p;
  }
  x->splay();
  return rp;
}

node_t *find_root(node_t *x){
  expose(x);
  while(x->lp)x=x->lp;
  return x;
}

bool isConnected(node_t *x, node_t *y){
  if(x==y)return true;
  expose(x),expose(y);
  return (x->pp != NULL);
}
/*
void cut(node_t *c){
  expose(c);
  node_t *p=c->lp;
  c->lp=NULL;
  p->pp=NULL;
  c->val=INF;
}

void link(node_t *c,node_t *p){
  expose(c);
  expose(p);
  c->pp=p;
  p->rp=c;
  c->update();
}
*/

//Unverified.
void evert(node_t *p){
  expose(p);
  p->rev^=true;
}

void cut(node_t *c){
  expose(c);
  node_t *p=c->lp;
  c->lp=NULL;
  p->pp=NULL;
  c->val=INF;
}

void link(node_t *c,node_t *p){
  if(isConnected(c,p))return;
  evert(c);
  c->pp=p;
}


//Verified.
int minId(node_t *x){expose(x); return x->minId;}
void add(node_t *x,int val){ expose(x); x->apply(val); }

//Verified. AOJ GRL_5_C
node_t *LCA(node_t *x,node_t* y){
  expose(x);
  return expose(y);
}

int min(node_t *from, node_t *to){
  evert(from);
  expose(to);
  return to->mini;
}

void add(node_t *from, node_t *to,int v){
  evert(from);
  expose(to);
  to->lazy+=v;
}


//AOJ GRL_5_C
node_t *node[100001];

int main(void){
  int n;
  cin >> n;
  
  for(int i=0;i<n;i++)node[i]=new node_t(i,0);
  for(int i=0;i<n;i++){
    int k,t;
    cin >> k;
    for(int j=0;j<k;j++){
      cin >> t;
      link(node[t],node[i]);
    }
  }

  int q;
  cin >> q;
  for(int i=0;i<q;i++){
    int u,v;
    cin >> u >> v;
    cout << LCA(node[u],node[v])->id << endl;
  }
  
  return 0;
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, q; cin >> n >> q;
	string s; cin >> s;
	vi v(n + 1);
	REP(i, n - 1) {
		if (s[i] == 'A'&&s[i + 1] == 'C')v[i + 2] = 1;
	}
	REP(i, n)v[i + 1] += v[i];
	REP(i, q) {
		int l, r; cin >> l >> r;
		int t = v[r] - v[l - 1];
		if (l != 1 && s[l - 2] == 'A'&&s[l - 1] == 'C')t--;
		cout << t << endl;
	}
}

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

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

using ll = long long;
using namespace std;

template <long long N>
class Modulo {
 public:
  using Type = decltype(N);
  // constructor
  constexpr Modulo (Type n = 0) : number_((N + n) % N) {}
  // unary operator
  constexpr auto operator - () const {
    return Modulo(-number_);
  }
  constexpr auto operator ~ () const {
    // Only if N is prime, and number_ and N are coprime
    return power(*this, N - 2);
  }
  // compound assign operator
  constexpr auto & operator += (const Modulo & m) {
    number_ = (number_ + m.number_) % N;
    return *this;
  }
  constexpr auto & operator -= (const Modulo & m) {
    return *this += -m;
  }
  constexpr auto & operator *= (const Modulo & m) {
    number_ = (number_ * m.number_) % N;
    return *this;
  }
  constexpr auto & operator /= (const Modulo & m) {
    return *this *= ~m;
  }
  // binary operator with type conversion
  constexpr friend auto operator + (Modulo lhs, const Modulo & rhs) {
    return lhs += rhs;
  }
  constexpr friend auto operator - (Modulo lhs, const Modulo & rhs) {
    return lhs -= rhs;
  }
  constexpr friend auto operator * (Modulo lhs, const Modulo & rhs) {
    return lhs *= rhs;
  }
  constexpr friend auto operator / (Modulo lhs, const Modulo & rhs) {
    return lhs /= rhs;
  }
  // friend function
  constexpr friend auto power (const Modulo & m, Type exponent) {
    constexpr auto unit = Modulo(1);
    if ( exponent == 0 ) return unit;
    return (exponent & 1 ? m : unit) * power(m*m, exponent >> 1);
  }
  constexpr friend auto number (const Modulo & m) {
    return m.number_;
  }
  // stream operator
  friend auto & operator << (std::ostream & os, const Modulo & m) {
    return os << number(m);
  }
 private:
  Type number_;
};

int
main ()
{
    using Number = Modulo<1'000'000'007ll>;

    ll n, k;
    cin >> n >> k;

    vector<Number> fac(n+1);
    vector<Number> inv(n+1);
    fac[0] = 1;
    for (int i = 1; i <= n; ++i) {
      fac[i] = fac[i - 1] * i;
    }
    inv[n] = ~fac[n];
    for (int i = n; 1 <= i; --i) {
      inv[i - 1] = inv[i] * i;
    }
    auto c = [&](int n, int r) { return fac[n] * inv[r] * inv[n - r]; };

    auto answer = Number(0);
    auto max_allow_empty = min(k, n - 1);
    for (ll i = 0; i <= max_allow_empty; ++i) {
      answer += c(n, i) * c(n - 1, i);
    }

    cout << answer << endl;
}


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

#define int long long
#define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define cps CLOCKS_PER_SEC
#define mod (int)(1000000007)
#define f first
#define s second
#define debug1(x) cerr<<x<<"\n"
#define debug2(x,y) cerr<<x<<" "<<y<<"\n"
#define debug3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<"\n"
#define nl cerr<<"\n";
#define pq priority_queue
#define inf 9999999999999999
#define test cerr<<"abcd\n";
#define pi pair<int,int>
#define pii pair<int,pi>
#define pb push_back
#define mxn 505
#define mxnn 2000005
int dp[mxn][mxn],sum[mxn];
int getsum(int l,int r) {
if(r<l) return 0;
return sum[r] - sum[l-1];
}
int32_t main(){
int n;
cin >>n;
int arr[n+1];
for(int i = 1;i<=n;i++) cin>>arr[i];
memset(dp,0,sizeof dp);
sum[0] = 0;
for(int i = 1;i<=n;i++) sum[i] = sum[i-1] + arr[i];
for(int i = 2;i<=n;i++){
    for(int l = 1;l<=n;l++){
        int r = l+i-1;
       /* if(r == l+1){
            dp[l][r] = arr[l]+arr[r];
            continue;
        }*/
        if(r>n) continue;
        int mn = inf;
        for(int j = l;j<r;j++){
            int a = dp[l][j]+getsum(l,j);
            int b = dp[j+1][r]+getsum(j+1,r);
            mn = min(mn,a+b);
        }
        dp[l][r] = mn;
    }
}
cout<<dp[1][n];
return 0;
}


Measured memory_bytes: 2304
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> PII;
#define MOD (1000000007ll)

int main(void){
	string c[2];
	cin >> c[0];
	cin >> c[1];
	reverse(c[1].begin(),c[1].end());
	cout << ((c[0]==c[1])?"YES":"NO") << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<deque>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
const int error=1e9+7;
#define F first
#define S second
#define MK make_pair






int main(){
    int n;
    int sum=0;
    cin>>n;
    for(int i=0;i<n;i++){
        int b;
        cin>>b;
        int count=0;
        while(b%2==0){b/=2; count++;}
        sum+=count;
    }
    cout<<sum<<endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000

#ifdef LOCAL
  #define dprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define dprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

//const double PI = 3.1415926535897932384626433832795;

int main() {
  int n;
  cin >> n;
  string ans;
  switch(n % 10) {
    case 3:
      ans = "bon";
      break;
    case 0:
    case 1:
    case 6:
    case 8:
      ans = "pon";
      break;
    default:
      ans = "hon";
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;


void solve() {
    int N, M; cin >> N >> M;
    vector<int> A(M);
    for (int i = 0; i < M; i++) cin >> A[i];

    int ans = N - accumulate(A.begin(), A.end(), 0);

    if (ans < 0) cout << -1 << endl;
    else cout << ans << endl;
}


int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3632
N = int(input())
count = 0

for i in range(1,N+1,2):
	j = 0
	yakusuu = 0

	while(j<=i):
		j += 1
		if(i%j==0):

			yakusuu += 1

	if(yakusuu==8):
		count += 1
print(count)

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

using ll = long long ;

int main() {
    string S ;
    cin >> S ;
    
    ll N = S.size() ;
    ll ans = 0 ;
    
    for( int tmp=0 ; tmp < ( 1 << (N-1) ) ; tmp++ ){
        
        bitset<10> p( tmp ) ;
        
        string K = S ;
        ll k = K.size() ;
        
        for( int i = 0 ; i<10 ; i++ ){
            
            if( p.test(i) ){
                
                K = K.insert( ( N - (i+1) ) , " " ) ;
        
            }
        }
        k = K.size() ;
        
        vector<char> A(k) ;
        ll a = A.size() ;
        
        for( int i=0 ; i<k ; i++){
            
            A.at(i) = K.at(i) ;
              
        }
        
        ll ans1 = 0 ;
        ll ans2 = 0 ;
        
        for( int i=0 ; i<a ; i++ ){
            
            if( A.at(i) == ' ' ){
                ans2 += ans1 ;
                ans1 = 0 ;
            }
            else{
                ll an = A.at(i) - '0' ;
        
                ans1 = ans1*10 + an ;
        
            }
        }
        ans2 += ans1 ;
        ans += ans2 ;
        
    }
    cout << ans << endl;
}



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

#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< pii,vector<pii> ,greater< pii >>

using namespace std;


//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*int power(int a,int n)
{
    if(n == 1)return a%mod;
    if(n == 0)return 1;
    if(n&1)return ((a%mod)*(power((a*a)%mod,n/2))%mod)%mod;
    return power((a*a)%mod,n/2)%mod;
}*/
//const int md = 998244353;

/*int inverse(int x){

    return power(x,mod-2)%mod;//little fermat....
}*/
const int inf = (int) 1e18;
const int md = (int) 1e9+21;


signed main()
{
    showoff;
    int a,b;
    cin >> a >> b;
    if(a >= 13)cout << b;
    else if(a >= 6)cout << b/2;
    else cout << 0;

    return 0;
}
//*->for large size of matrix take int not long long if possible......
//*->always take maximum as inf for safer side ...

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


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

    return gcd_ori(b, a % b);
}

int main() {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;

    ll ans = 0;
    ll tmp = 0;
    if(A%C==0){
        tmp = B/C - A/C + 1;
    }
    else{
        tmp = B/C - A/C;
    }
    ll tmp2 = 0;
    if(A%D==0){
        tmp2 = B/D - A/D + 1;
    }
    else{
        tmp2 = B/D - A/D;
    }

    ll lcm_n;
    if(C>D) lcm_n = C*D / gcd_ori(C, D);
    else lcm_n = C*D / gcd_ori(D,C);
    ll tmp3 = 0;
    if(A%lcm_n==0){
        tmp3 = B/lcm_n - A/lcm_n + 1;
    }
    else{
        tmp3 = B/lcm_n - A/lcm_n;
    }

    //cout << tmp << " " << tmp2 << " " << tmp3 << endl;

    ans = B - A + 1 - (tmp + tmp2 - tmp3);
    cout << ans << endl;

}

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

int main(void) {

	int a, b, c;

	std::cin >> a >> b >> c;

	int count = 0;

	for (size_t i = 0; i < a; i++) {
		int v;

		std::cin >> v;

		for (size_t i = 1; i <= b; i+=v) {
			count++;
		}
	}

	std::cout << count + c << std::endl;

	return 0;
}

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

typedef long long ll;
using namespace std;

bool judge(vector<string> v){
    bool j=true;
    char last_c=v[0].back();
    for(int i=1;i<v.size();i++){
        if(v[i].front()!=last_c){
            j=false;
            break;
        }
        else{
            last_c=v[i].back();
        }
        for(int k=0;k<i;k++){
            if(v[i]==v[k]){
                j=false;
                break;
            }
        }
    }
    
    return j;
}


int main(){
    int n;cin >> n;
    vector<string>w(n);
    for(int i=0;i<n;i++){
        cin >> w[i];
    }
    
    if(judge(w))cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    public void solve(){
        Scanner sc = new Scanner(System.in);
        int m = 0;
        int kaisu = 1;
        int syu = sc.nextInt();
        
        while(syu != 0){
            for(int k=1; k<=syu; k++){
            int j = sc.nextInt();
                
                if(j >= 2){
                    kaisu++;
                }else if(j == 1){
                    m++;
                }
            }
            if(kaisu >= 2){
                System.out.println(kaisu+m);
            }else{
                System.out.println("NA");
            }
            
            m = 0;
            kaisu = 1;
            syu = sc.nextInt();
        }
    }
    public static void main(String args[]){
        Main obj = new Main();
        obj.solve();
    }
}
            
                
         

Measured memory_bytes: 158632
/*
*
*	AUTHOR :- @soham01
*		// "WORK HARD AND NEVER GIVE UP" //
*
*/
#include "bits/stdc++.h"

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> //find_by_order(), order_of_key()
#define pb push_back
#define mp make_pair
#define vi vector<long long int >
#define vb vector<bool>
#define vs vector<string>
#define vd vector<double>
#define vvi vector<vector<long long int> >
#define vp vector<pair<long long int , long long int > >
#define seti set<long long int >
#define setc set<char>
#define setd set<double>
#define mod 1000000009
#define endl '\n'
typedef long long int lli;

// ITS MY REQUEST TO PLEASE PLEASE DO LOOK AT THE CONSTRAINS GIVEN CAREFULLY
// DO CHECK FOR CORNER CASES

/*-------LET THE GAME BEGIN-----------*/

void solve()
{
    lli n,m,i,j,c=0,s=0,f=0;
    cin>>n>>m;
    lli arr[n];
    for(i=0;i<n;i++)
    {
        cin>>arr[i];
        s+=arr[i];
    }
    f=ceil((s/(4.0*m)));
    
   // cout<<f<<" "<<s<<endl;
    sort(arr,arr+n,greater<int>());
    for(i=0;i<n;i++)
    {
        if(arr[i]>=f)c++;
    }
    if(c>=m)
    {
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

		solve();
	return 0;
}





Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		if (line.equals("A")) {
			System.out.println("T");
		}
		else if (line.equals("T")) {
			System.out.println("A");
		}
		else if (line.equals("C")) {
			System.out.println("G");
		}
		else if (line.equals("G")) {
			System.out.println("C");
		}
	}
}

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

using namespace std;

int main()
{
    int flg[100005] = {};
    int n,m;
    int h[100005], a, b;
    cin >> n >> m;

    for(int i=0; i<n; i++) cin >> h[i];

    for(int i=0; i<m; i++) {
        cin >> a >> b;
        int hoge;
        if(h[a-1] > h[b-1]){
            flg[b-1] = 1;
        } else if (h[a-1] < h[b-1]){
            flg[a-1] = 1;
        } else {
            flg[a-1] = 1;
            flg[b-1] = 1;
        }
    }

    int cnt = 0;

    for(int i=0; i<n; i++) if(flg[i] == 0) cnt++;

    cout << cnt << endl;

    return 0;
    
}

Measured memory_bytes: 4460
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=a%10;
		a/=10;
		a/=10;
		int c=a%10;
		if(b==c) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}
}

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

int n, m;
unordered_map<int, vector<int>> graf;
bool ok = 0;
void dfs(int v, int deep) {
    if(deep >= 2) {
        if(v == n) {
            ok = 1;
        }
        return;
    }
    for (auto x : graf[v]) {
        dfs(x, deep + 1);
    }
}

void solve() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        graf[a].push_back(b);
    }
    dfs(1, 0);
    if(ok) {
        cout << "POSSIBLE";
    }
    else {
        cout << "IMPOSSIBLE";
    }
}


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


Measured memory_bytes: 18144
#include <iostream>

using namespace std;

int main()
{
    int n, k;
    int d[110], visited[110] = {0};
    scanf("%d%d", &n, &k);
    for(int i = 1; i <= k; i++){
        scanf("%d", &d[i]);
        for(int j = 1; j <= d[i]; j++){
            int a;
            scanf("%d", &a);
            visited[a] = 1;
        }
    }
    int sum = 0;
    for(int i = 1; i <= n; i++){
        if(visited[i] == 0)
            sum++;
    }
    printf("%d", sum);
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) cin >> vec.at(i);

  int sum = 0;
  for (int i = 0; i < N - 1; i++){
    for (int j = i + 1; j < N; j++){
        sum += vec.at(i) * vec.at(j);
    }
  }

  cout << sum << endl;
}

Measured memory_bytes: 3636
# # 整数の入力
# a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# # 文字列の入力
# s = input()
import math
a, b, x = map(int, input().split())
x /= a
# print(x, a, b)
if x <= a * b / 2:
    ans = 90 - math.degrees(math.atan(x * 2 / b / b))

else:
    y = a * b - x
    ans = math.degrees(math.atan(y * 2 / a / a))

print(ans)


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

typedef long long ll;
const int mod = 1e9 + 7;

ll H, N;
vector<ll> A;

int main() {
    cin >> H >> N;
    A.resize(N);

    rep(i, N) cin >> A[i];
    ll sum = accumulate(A.begin(), A.end(), 0LL);
    if (H <= sum) puts("Yes");
    else puts("No");
}

Measured memory_bytes: 1024
from bisect import bisect_left

INF = 10 ** 11

a, b, q = map(int, input().split())
s = [-INF] + [int(input()) for _ in range(a)] + [INF]
t = [-INF] + [int(input()) for _ in range(b)] + [INF]
x = [int(input()) for _ in range(q)]

for e in x:
    si = bisect_left(s, e)
    ti = bisect_left(t, e)

    ans = INF
    for ss in [s[si-1], s[si]]:
        for tt in [t[ti-1], t[ti]]:
            d1 = abs(e - ss) + abs(ss - tt)
            d2 = abs(e - tt) + abs(tt - ss)
            ans = min(ans, d1, d2)

    print(ans)


Measured memory_bytes: 16388
(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let n = Scanf.sscanf (read_line ()) "%d" (
fun n -> 
        n
)

let k = Scanf.sscanf (read_line ()) "%d" (
fun k -> 
        k
)

let lst = 
        Str.split (Str.regexp " ") (read_line ())
      |> List.map int_of_string


let rec f l =
        match l with
                [] -> 0
                | first :: rest -> 
                        let a = first in
                        let b = abs (first - k) in
                                if a < b then
                                        (a * 2) + (f rest)
                                else
                                        (b * 2) + (f rest)

let () =
        f lst
      |> Printf.printf "%d\n"


Measured memory_bytes: 3072
#include <iostream>
#include <string>
#include <set>

using namespace std;

int main() {
	const int count = 3;
	set<int> penki;

	for (int i = 0; i < count; i++) {
		int tmp;
		cin >> tmp;
		penki.insert(tmp);
	}

	cout << penki.size() << endl;

	return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> X(N);
    for (int i=0; i<N; i++){
        cin >> X[i];
    }
    int i = 1;
    int min = 1000000000;
    while(true){
        int sum = 0;
        for (auto x : X){
            sum += (x - i) * (x - i);
        }
        if (sum < min){
            min = sum;
        } else{
            cout << min << endl;
            break;
        }
        i++;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    int k; 
    string s;
    cin >> s >> k;
    set<string> st;
    for(int i = 0; i < s.length(); ++i){
        for(int L = 1; i + L <= s.length() && L <= k; ++L){
            st.insert(s.substr(i, L));
            while(st.size() > k)st.erase(--st.end());
        }
    }
    cout << *st.rbegin() << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int n;
    scanf("%d", &n);

    int i, a[n];
    for (i=0; i<n; i++) {
        scanf("%d", &a[i]);
    }

    if (n != 0) {
        printf("%d", a[n-1]);
    }
    for (i=1; i<n; i++) {
        printf(" %d", a[n - 1 - i]);
    }
    printf("\n");

    return 0;
}


Measured memory_bytes: 2052
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;
const int MOD = 100000007;

int dp[1001][1001];

int main(){
	int r, c, a1, a2, b1, b2;
	cin >> r >> c >> a1 >> a2 >> b1 >> b2;
	dp[0][0] = 1;
	for(int i = 0; i < r; ++i){ dp[i][0] = 1; }
	for(int i = 0; i < c; ++i){ dp[0][i] = 1; }
	for(int i = 1; i < r; ++i){
		for(int j = 1; j < c; ++j){
			dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
		}
	}
	int xpos, xneg, ypos, yneg;
	if(a1 <= b1){
		xpos = b1 - a1;
		xneg = r - b1 + a1;
	}else{
		xpos = r - a1 + b1;
		xneg = a1 - b1;
	}
	if(a2 <= b2){
		ypos = b2 - a2;
		yneg = c - b2 + a2;
	}else{
		ypos = c - a2 + b2;
		yneg = a2 - b2;
	}
	int answer = dp[min(ypos, yneg)][min(xpos, xneg)];
	if(xpos == xneg){ answer = (answer * 2) % MOD; }
	if(ypos == yneg){ answer = (answer * 2) % MOD; }
	cout << answer << endl;
	return 0;
}

Measured memory_bytes: 5068
#include <cstdio>

int gcd(int x, int y);

int main()
{
    int x;
    int y;
    scanf("%d", &x);
    scanf("%d", &y);
    int ans = gcd(x, y);
    printf("%d\n", ans);
    return 0;
}

int gcd(int x, int y)
{
    if (x<y)
    {
        int z = y;
        y = x;
        x = z;
    }
    
    while (y>0)
    {
        int r = x%y;
        x = y;
        y = r;
    }
    return x;
}

Measured memory_bytes: 2736
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    N = int(input())
    L = [list(map(int,input().split())) for _ in range(N)]
    dp = [[0 for _ in range(3)] for _ in range(N+1)]

    for num,i in enumerate(L[0]):
        dp[0][num] = i

    for i in range(1,N):
        for dp_num,k in enumerate(dp[i-1]):
            for l_num,j in enumerate(L[i]):
                if l_num == dp_num:
                    continue
                dp[i][l_num] = max(k + j,dp[i][l_num])
    print(max(dp[N-1]))

if __name__ == "__main__":
    main()

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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n';
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ld PI = 3.14159265359;

const ll MOD = (ll) 1e9 + 7;
const ll MAXN = (ll) 3e5 + 10;
const ll INF = (ll) 2242545357980376863;
const ld EPS = (ld) 1e-8;
const ll LOG = (ll) 30;

ll n, x;
ll u[MAXN], l[MAXN], b[MAXN];

ll ind[MAXN];



ll val(ll i, ll h){
	return (h - b[i]) * (h > b[i] ? l[i] : u[i]);
}

bool check(ll h){
	ll ans = -INF;
	ll com = h / x;
	ll rem = h % x;
	ll s = 0;
	
	for(int i = 0; i < com; i++) s += val(ind[i], x);
	s += val(ind[com], rem);
	for(int i = com + 1; i < n; i++) s += val(ind[i], 0);
	ll sp;
	ans = s;
	for(int i = 0; i < com; i++){
		sp = s - val(ind[i], x) - val(ind[com], rem) + val(ind[i], rem) + val(ind[com], x);
		ans = max(ans, sp);
	}
	for(int i = com + 1; i < n; i++){
		sp = s - val(ind[i], 0) - val(ind[com], rem) + val(ind[i], rem) + val(ind[com], 0);
		ans = max(ans, sp);
	}
	return ans >= 0;
}

bool CMP(ll i, ll j){
	return val(i, 0) - val(i, x) < val(j, 0) - val(j, x);
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> x;
	for(int i = 0; i < n; i++) cin >> b[i] >> u[i] >> l[i];
	for(int i = 0; i < n; i++) ind[i] = i;
	sort(ind, ind + n, CMP);
	ll l = -1, r = n * x;
	ll mid;
	while(l + 1 < r){
		mid = (l + r) >> 1;
		if(check(mid)) r = mid;
		else l = mid;
	}
	
	//debug(check(115));
	cout << r;	
	return 0;
}

/*

                                 ____              ,----..               ,----..
   ,---,                       ,'  , `.           /   /   \             /   /   \
  '  .' \                   ,-+-,.' _ |          /   .     :           /   .     :
 /  ;    '.              ,-+-. ;   , ||         .   /   ;.  \         .   /   ;.  \
:  :       \            ,--.'|'   |  ;|        .   ;   /  ` ;        .   ;   /  ` ;
:  |   /\   \          |   |  ,', |  ':        ;   |  ; \ ; |        ;   |  ; \ ; |
|  :  ' ;.   :         |   | /  | |  ||        |   :  | ; | '        |   :  | ; | '
|  |  ;/  \   \        '   | :  | :  |,        .   |  ' ' ' :        .   |  ' ' ' :
'  :  | \  \ ,'        ;   . |  ; |--'         '   ;  \; /  |        '   ;  \; /  |
|  |  '  '--'          |   : |  | ,             \   \  ',  /          \   \  ',  /
|  :  :                |   : '  |/               ;   :    /            ;   :    /
|  | ,'                ;   | |`-'                 \   \ .'              \   \ .'
`--''                  |   ;/                      `---`                 `---`
                       '---'

*/


Measured memory_bytes: 7168
#include <bits/stdc++.h>
using namespace std;
bool f(string s,char a)
{
  for(int i=0; i<s.length(); i++)
    if(s[i]==a) return 1;
  return 0;
}
int main()
{
  string s;
  cin>>s;
  if(f(s,'W'))
  {
    if(!f(s,'E'))
    {
      cout<<"No";
      return 0;
    }
  }
  if(f(s,'S'))
  {
    if(!f(s,'N'))
    {
      cout<<"No";
      return 0;
    }
  }
  if(f(s,'E'))
  {
    if(!f(s,'W'))
    {
      cout<<"No";
      return 0;
    }
  }
  if(f(s,'N'))
  {
    if(!f(s,'S'))
    {
      cout<<"No";
      return 0;
    }
  }
  cout<<"Yes";
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

#define REP(i, n)    for(int i=0; i<n; ++i)
#define FOR(i, a, b) for(int i=a; i<b; ++i)
#define MAX_N 100000

int main() {
    int a[MAX_N], n, b;
    std::cin >> n;
    REP(i, n) {
        std::cin >> b;
        a[b-1] = i+1;
    }
    REP(i, n) std::cout << a[i] << (i == n-1 ? '\n' : ' ');
    return 0;
}



Measured memory_bytes: 1152
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Graph=vector<vector<int>>;
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();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  ll L,N,ans=0;
  cin>>L>>N;
  ll X[N+1];
  RREP(i,N) cin>>X[i];
  
  ll SUM[N+2],REV[N+2];
  SUM[0]=0;
  REV[N+1]=0;
  RREP(i,N) SUM[i]=SUM[i-1]+X[i];
  for(int i=N; i>=1; --i) REV[i]=REV[i+1]+(L-X[i]);
  
  
  RREP(i,N){
    ll cnt=0;
    if((N-i)%2==1) cnt=2*(SUM[(N+i-1)/2]-SUM[i-1])+2*REV[N-(N-i+1)/2+1]-L+X[N-(N-i+1)/2+1];
    else cnt=2*(SUM[(N+i)/2]-SUM[i-1])-X[(N+i)/2]+2*REV[(N+i)/2+1];
    chmax(ans,cnt);
  }
  
  RREP(i,N){
    ll cnt=0;
    if(i%2==0) cnt=2*(REV[i/2+1]-REV[i+1])+2*SUM[i/2]-X[i/2];
    else cnt=2*(REV[i/2+1]-REV[i+1])-(L-X[i/2+1])+2*SUM[i/2];
    chmax(ans,cnt);
  }
  
  
  co(ans);
  return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,n) for(int i=1;i<=n;++i)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
using namespace std;

int main(){
  string a,b,c;
  cin >> a >> b >> c;
  if (a.at(a.length()-1)==b.at(0) && b.at(b.length()-1)==c.at(0)) YES;
  else NO;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, a, b) for(int i = a, i##_len = (b); i < i##_len; ++i)

int main()
{
    int r;
    cin >> r;
    cout << r*r << endl;
    return 0;
}

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

int main() {
  string s;cin>>s;
  int n = s.size();
  string a,b;
  a = s.substr(0,(n+1)/2);
  reverse(a.begin(), a.end());
  b = s.substr(n/2, (n+1)/2);
  char x = a[0];
  rep(i,(n+1)/2) {
    if (a[i] != x or b[i] != x) {
      cout << n/2 + i;
      return 0;
    }
  }
  cout << n;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN      
using namespace std;
const ll mod=1e9+7;
const int N=5e5+4;
 
struct util
{
    int sum,mx;
};
 
util tree[4*N];
 
int arr[N];
 
void build(int node,int st,int end)
{
    if(st==end)
    {
        tree[node].sum=0;
        
        tree[node].mx=arr[st];
        
        return;
    }
    
    int mid=(st+end)/2;
    
    build(2*node,st,mid);
    
    build(2*node+1,mid+1,end);
    
    tree[node].mx=max(tree[2*node].mx,tree[2*node+1].mx);
}
 
void update(int node,int st,int end,int ind,int val)
{
    if(st==end)
    {
        tree[node].sum+=val;
        
        return;
    }
    
    int mid=(st+end)/2;
    
    if(ind<=mid)
    update(2*node,st,mid,ind,val);
    else
    update(2*node+1,mid+1,end,ind,val);
    
    tree[node].sum=tree[2*node].sum+tree[2*node+1].sum;
}
 
util query(int node,int st,int end,int l,int r)
{
    if(st>r or end<l)
    {
        util aux;
        
        aux.sum=aux.mx=0;
        
        return aux;
    }
    
    if(st>=l and end<=r)
    return tree[node];
    
    int mid=(st+end)/2;
    
    util a,b,here;
    
    a=query(2*node,st,mid,l,r);
    
    b=query(2*node+1,mid+1,end,l,r);
    
    here.sum=a.sum+b.sum;
    
    here.mx=max(a.mx,b.mx);
    
    return here;
}
 
int main()                  
{
    int n,q;
    
    scn(n); scn(q);
    
    rep(i,0,n)
    scn(arr[i]);
    
    build(1,0,n-1);
    
    vector<pair<int,int>> v[n];
    
    int ans[q];
    
    int prev[N]; //last[x] denotes the previous index in which x was present
    
    memset(prev,-1,sizeof(prev));
    
    rep(i,0,q)
    {
        int l,r;
        
        scn(l); scn(r);

        l--; r--;
        
        //cout<<l<<" "<<r<<" "<<i<<endl;
        
        v[r].emplace_back(l,i);
    }
    
    rep(i,0,n)
    {
        int here=arr[i];
        
        if(prev[here]!=-1)
        update(1,0,n-1,prev[here],-1);
        
        update(1,0,n-1,i,1);
        
        prev[here]=i;
        
        for(auto it:v[i])
        {
            int hr=i,hl=it.F,hind=it.S;
            
            //cout<<hl<<" "<<hr<<" "<<hind<<endl;
            
            util temp=query(1,0,n-1,hl,hr);
            
            ans[hind]=temp.sum;
        }
    }
    
    rep(i,0,q)
    priln(ans[i]);
}

Measured memory_bytes: 39448
#include<cstdio>
#include<cctype>
using namespace std;

int main(){
	char ch;
	while(1){
		scanf("%c",&ch);
		if(islower(ch))ch=toupper(ch);
		else if(isupper(ch))ch=tolower(ch);
		printf("%c",ch);
		if(ch=='\n')break;
	}
	return 0;
}

Measured memory_bytes: 940
#include <iostream>
#include <limits>
#define N 100

using namespace std;

const int INF=numeric_limits<int>::max();

int n,M[N][N],d[N];

void dijkstra(int s){
  bool visited[n];
  for(int i=0;i<n;i++){
    visited[i]=false;
    d[i]=INF;
  }
  d[s]=0;
  while(1){
    int mincost=INF;
    int u;
    //find minimum d from non-visited nodes
    for(int i=0;i<n;i++){
      if(!visited[i] && d[i]<mincost){
        mincost=d[i];
        u=i;
      }
    }
    if(mincost==INF) break;

    visited[u]=true;
    //update d
    for(int v=0;v<n;v++){
      if(!visited[v] && M[u][v]!=INF){
        if(d[u]+M[u][v]<d[v]){
          d[v]=d[u]+M[u][v];
        }
      }
    }
  }
}

int main(){
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++) M[i][j]=INF;
  }
  for(int i=0;i<n;i++){
    int u,k; cin >> u >> k;
    for(int i=0;i<k;i++){
      int v,c; cin >> v >> c;
      M[u][v]=c;
    }
  }
  dijkstra(0);
  for(int i=0;i<n;i++)
    cout << i << " " << d[i] << endl;
}

Measured memory_bytes: 3076
#include<iostream>
using namespace std;
int main(){
  int N,M,ans = 0;
  cin>>N>>M;
  int a[M];
  for(int i = 0; i <  M; i++ ){
    cin>>a[i];
    if(a[i] > M){
      ans ++;
    }
  }
  printf("%d\n", ans);
  return 0;
}



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

int main()
{
    string S;
    cin >> S;
    long long N,Rpos=0,Rcnt=0,Lcnt=0;
    N = S.length();
    long long M[N];
    rep(i,N) M[i]=0;

    rep(i,N) {
        if (S[i]=='R') {
            Rcnt++;
            if (S[i-1]=='L') {
                M[Rpos] += Lcnt/2;
                M[Rpos+1] += Lcnt/2+Lcnt%2;
                Lcnt=0;
            }
        } else if (S[i]=='L') {
            if (S[i-1]=='R') {
                Rpos=i-1;
                M[i-1]+=Rcnt/2+Rcnt%2;
                M[i]+=Rcnt/2;
            }
            Lcnt++;
            Rcnt=0;
            if (i==N-1){
                M[Rpos] += Lcnt/2;
                M[Rpos+1] += Lcnt/2+Lcnt%2;
            }

        }
    }

    rep(i,N) {
        if (i==N-1) {
            cout << M[i];
        } else {
            cout << M[i] << " ";
        }
    }

    return 0;
}


Measured memory_bytes: 1408
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::Integer;
#[allow(unused_imports)]
use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::collections::*;

#[fastout]
fn main() {
    input! {
        x: i32,
    }

    println!("{}", if x >= 30 { "Yes" } else { "No" });
}


Measured memory_bytes: 2164