akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
  cin >> N;
  vector<int> t(N);
  vector<int> v(N);
  for (int i = 0; i < N; ++i) cin >> t[i];
  for (int i = 0; i < N; ++i) cin >> v[i];
  vector<int> vmax(N + 1, INT_MAX);

  for (int i = 0; i < N; ++i) {
    if (i > 0) vmax[i] = min(vmax[i], v[i - 1]);
    vmax[i] = min(vmax[i], v[i]);
  }


  vmax[0] = vmax[N] = 0;

  for (int tt = 0; tt <= N; ++tt) {
    for (int i = N; i >= 0; --i) {
      int tsum = 0;
      for (int j = i - 1; j >= 0; --j) {
        tsum += t[j];
        vmax[j] = min(vmax[j], vmax[i] + tsum);
      }
    }

    for (int i = 0; i <= N; ++i) {
      int tsum = 0;
      for (int j = i + 1; j <= N; ++j) {
        tsum += t[j - 1];
        vmax[j] = min(vmax[j], vmax[i] + tsum);
      }
    }
  }

  double ret = 0;
  for (int i = 0; i < N; ++i) {
    int yv = v[i];
    int x1 = 0;
    int x2 = t[i];
    int y1 = vmax[i];
    int y2 = vmax[i + 1];
    // cout<< "yv, y1, y2: " << yv << ' ' << y1 << ' ' << y2 << endl;
    // intersection 1, 2
    double xx = (x2 + y2 - y1) / 2.0;
    // 1, vertical
    double xv1 = yv - y1;
    xv1 = max(xv1, 0.0);
    // 2, vertical
    double xv2 = y2 - yv + x2;
    // cout<< "xx, xv1, xv2: " << xx << ' ' << xv1 << ' ' << xv2 << endl;
    xv2 = min(xv2, x2 + 0.0);
    double inc = 0;
    if (xv1 < xv2) {
      inc += (y1 + y1 + xv1) * xv1 / 2.0;
      inc += yv * (xv2 - xv1);
      inc += (y2 + y2 + (x2 - xv2)) * (x2 - xv2) / 2.0;
    } else {
      inc += (y1 + y1 + xx) * xx / 2.0;
      inc += (y2 + y2 + (x2 - xx)) * (x2 - xx) / 2.0;
    }
    // cout<< v[i] << ' ' << v[i + 1] << ' ' << v[i] << ' ' << t[i] << ' ' << inc << endl;
    ret += inc;
  }
  
  cout<< fixed << setprecision(10) << ret << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node *NodePointer;
NodePointer N;

void init(){
  N = malloc(sizeof(struct node));
  N->next = N;
  N->prev = N;
}

void printList(){
  NodePointer cur = N->next;
  int snl = 1;
  while(cur != N){
    if ( snl == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    snl = 0;
  }
  printf("\n");
}

void deleteFirst(){
  NodePointer t = N->next;
  N->next = t->next;
  t->next->prev = N;
}
 
void deleteLast(){
 
  NodePointer delnode = N->prev;
 
  N->prev = delnode->prev;
  delnode->prev->next = N;
  free(delnode);
}
 
void delete(int skey){
  int judge = 0;
  NodePointer t;
  NodePointer n; 

  for(n = N->next;n != N;n = n->next){
    if(n->key == skey){
      judge = 1;
    }
  }

  if(judge == 1){
    n = N->next;
    while(n != N){
      if(n->key == skey)
	break;
      n=n->next;
    }
    t = n->prev;
    t->next = n->next;
    t->next->prev = t;
    free(n);
  }
}

void insert(int skey){
  NodePointer new;
  static int count = 0;
  new = malloc(sizeof(struct node));
  new->key = skey;
 
  if(count == 0){
  new->next = N;
  N->next = new;
  new->prev = N;
  N->prev = new;
  count++;
  }
 
  else{
    new->next = N->next;
    N->next->prev = new;
    N->next = new;
    new->prev = N;
    count++;
  }
}

int main(){
  int key, n, i;
  char com[12];
   
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s",com);
    if(strcmp(com,"insert") == 0){
      scanf("%d",&key);
      insert(key);
    }
    else if(strcmp(com,"deleteFirst") == 0)
      deleteFirst();
    else if(strcmp(com,"deleteLast") == 0)
      deleteLast();
    else{
      scanf("%d",&key);
      delete(key);
    }
  }
  printList();
  return 0;
}


Measured memory_bytes: 32964
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = numeric_limits<ll>::max()/4;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    ll ans = 0, cnt = 1;
    ll pre = -1;
    rep(i,n){
        if(pre == a[i])cnt++;
        else{
            ans += cnt/2;
            cnt = 1;
        }
        pre = a[i];
    }
    ans += cnt/2;
    cout << ans << endl;
}

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

int main(){
    int h,w;
    cin>>h>>w;
    char c[h+1][w+1];
    for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
        c[0][j]='#';
        c[i][0]='#';
        cin>>c[i][j];
    }
    long long dp[h+1][w+1]={};
    long long mod=1e9+7;
    dp[1][1]=1;
    for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
        if(c[i][j]=='.'){
            dp[i][j]+=dp[i-1][j]+dp[i][j-1];
            dp[i][j]%=mod;
        }
    }

    cout<<dp[h][w];

}

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

int main()
{
	ll n,m;
	cin >> n >> m;
	ll N=n;
	map<ll,ll> mp;
	while(n--)
	{
		ll x;
		cin >> x;
		//if(mp.find(x)==mp.end())mp[x]=0LL;
		mp[x]++;
	}
	ll M = m;
	while (m--)
	{
		ll b,c;
		cin >> b >> c;
		//if(mp.find(c)==mp.end())mp[c]=0LL;
		mp[c] += b;
	}
	ll sum = 0;
	//auto itr = mp.end();
	ll cnt = 0;
	auto i = mp.end();
	i--;
	for(;;)
	{

		if((*i).second==0)i--;
		sum+=(*i).first;
		(*i).second--;
		//cout<<(*i).first<<';'<<(*i).second<<endl;
		if(++cnt==N)break;
	}
	cout<<sum<<endl;
	

	return 0;
}

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

int main() {
  int n, k;
  cin >> n >> k;
  vector<double> p(n);
  rep(i, n) cin >>  p[i];
  
  rep(i, n) p[i] = (1 + p[i]) / 2;
  double sum = 0;
  rep(i, k) sum += p[i];
  double ans = sum;
  for (int i = 1; i + k - 1 < n; ++i) {
    sum = sum - p[i-1] + p[i + k - 1];
    ans = max(ans, sum);
  }
  printf("%.1f\n", ans);
  return 0;
}

Measured memory_bytes: 4840
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main(){
  int n,f[100],a[100],t[100],x[100],y[100],i,alm=-1,blm=-1,p,flag=0;
  double maxa=0.0,maxb=0.0,asmax=1000,bsmax=1000;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> f[i] >> a[i] >> t[i] >> x[i] >> y[i];
  }
  for(i=1;i<n;i++){
    flag=0;
    if(t[i]==t[i-1]&&a[i]!=a[i-1]){
      p=(x[i]-x[i-1])*(x[i]-x[i-1])+(y[i]-y[i-1])*(y[i]-y[i-1]);
      if(p<0) p*=-1;
      if(t[i]==0&&sqrt(p)>=maxa){
	if(maxa==sqrt(p)) flag=1;
	maxa=sqrt(p);
	if(flag==1&&asmax>(double)(f[i]-f[i-1])/60){
	asmax=(double)(f[i]-f[i-1])/60;
	alm=i;
	}
        else{
	  asmax=(double)(f[i]-f[i-1])/60;
	  alm=i;
	}
      }
      if(t[i]==1&&sqrt(p)>=maxb){
	if(maxb==sqrt(p)) flag=1;
     	maxb=sqrt(p);
      	if(flag==1&&bsmax>(double)(f[i]-f[i-1])/60){
	  bsmax=(double)(f[i]-f[i-1])/60;
	  blm=i;
	}
	else{
	  bsmax=(double)(f[i]-f[i-1])/60;
	  blm=i;
	}
      }
    }
  }
  if(alm==-1){
    cout << -1 << ' ' << -1 << endl;
  }
  else{
    printf("%.8f %.8f\n",maxa,asmax);
  }
  if(blm==-1){
    cout << -1 << ' ' << -1 << endl;
  }
  else{
    printf("%.8f %.8f\n",maxb,bsmax);
  }
  return 0;
}

Measured memory_bytes: 1244
#include<iostream>
#include<vector>

using namespace std;

int main(){
  int a=0;
  int b=0;
  int c=0;
  long long N;
  cin>>N;
  vector<long long> A(N);
  long long mod=1000000007;
  for(int i=0; i<N; i++){
    cin>>A[i];
  }
  long long ans=1;
  long long buf=0;
  long long flag=0;
  for(int i=0; i<A.size(); i++){
	buf=0;
    flag=0;
    if(a==A[i]){
		buf++;
      	if(flag==0){
          flag++;
          a++;
        }
    }
    if(b==A[i]){
      buf++;
      if(flag==0){
        flag++;
        b++;
      }
    }
    if(c==A[i]){
      buf++;
      if(flag==0){
        flag++;
        c++;
      }
    }
    ans = ans * buf % mod;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <map>
#include <vector>
#include <iomanip>

using namespace std;

int main(void) {
  int N, K;
  cin >> N >> K;
  if ((N + 1) / 2 >= K) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 888
/****************### With The name of ALLAH, most Gracious, most Compassionate ###****************/

/**============================================================================**\
|   Author      : Md Jubayer Hossen Jame
|   Study       : CSE, BRUR
|   Today       : Monday, 14 September, 2020
|   Source      : AtCoder Online Judge
|   Problem link: https://atcoder.jp/contests/abc150/tasks/abc150_a
|   Algorithm   :
|
\**============================================================================**/

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

#define FI                    freopen("input.txt", "r", stdin)
#define FO                    freopen("output.txt", "w", stdout)
#define FasterIO              ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

typedef long long             ll;
typedef unsigned long long    ull;
typedef unsigned int          ui;

#define mem(x,y)              memset(x,y,sizeof(x));
#define pii                   pair<int,int>
#define mk                    make_pair
#define ff                    first
#define ss                    second
#define pb                    push_back
#define ppb                   pop_back
#define all(x)                (x).begin(), (x).end()
#define rall(x)               (x).rbegin(), (x).rend()
#define for0(i, n)            for (int i = 0; i < (int)(n); ++i)
#define endl                  '\n'

const double PI = acos(-1.0);

#define gcd(a,b)              __gcd(a,b)
#define lcm(a,b)              (a*(b/gcd(a,b)))

///Direction Array
// 4 Direction - DOWN, UP, RIGHT, LEFT
int dx4[]= {+1, -1, +0, +0};
int dy4[]= {+0, +0, +1, -1};
#define isValid(a, b, R, C)   (0 <= a && a < R) && (0 <= b && b < C)
int dx8[]= {+0, +0, +1, -1, -1, +1, -1, +1};
int dy8[]= {-1, +1, +0, +0, +1, +1, -1, -1};

///Knight Moves
int dr[] = {-1, 1, -2, -2, -1, 1, 2, 2};
int dc[] = {-2, -2, -1, 1, 2, 2, 1, -1};
/**************************************************************************************************/

void test_case()
{
    int coin, value;
    cin >> coin >> value;

    string ans = "No";
    if(500 * coin >= value)ans = "Yes";
    cout << ans << endl;
}

int main()
{
#ifndef ONLINE_JUDGE
    //FI;
    //FO;
#endif // ONLINE_JUDGE
    //FasterIO

    int T = 1;
    //cin >> T;
    for(int tc = 1; tc <= T; ++tc)
    {
        //cout << "Case #" << tc << ":" << endl;
        test_case();
    }
    return 0;
}


Measured memory_bytes: 3628
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	string s;
	cin >> s;
	int ans = 0;
	rep(i, s.size()) ans += (s[i] == '1');
	cout << ans << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


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

using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	vector<int> p;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		int pi;
		cin >> pi;
		p.push_back(pi);
	}
	sort(p.begin(), p.end(), std::greater<int>());
	p[0] /= 2;
	int sum = std::accumulate(p.begin(), p.end(), 0);
	cout << sum << endl;
	return 0;
}

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

int main(){
  ll N,K,ans=0;
  cin >> N >> K;
  if(K%2==1) ans = pow(ll(N/K),3);
  else{
    ll tmp1 = K/2;
    ll tmp2=1,cnt=0;
    while(tmp1*tmp2<=N){
      tmp2+=2;
      cnt++;
    }
    ans = pow(cnt,3)+pow(ll(N/K),3);
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define modulo 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60


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


	int N; cin >> N;
	int A[3];
	for (int i = 0; i < 3; i++) cin >> A[i];
	int L[8];
	for (int i = 0; i < N; i++) cin >> L[i];

	ll ans = INF;
	int maxm = 1;
	for (int i = 0; i < N; i++) maxm *= 4;
	// int ansm;

	for (int m = 0; m < maxm; m++) {
		int tmp = m;
		ll tmpAns = 0LL;
		int tmpLength[3];
		tmpLength[0] = A[0], tmpLength[1] = A[1], tmpLength[2] = A[2];

		// i番目のtmp%4がi番目の棒の使い道
		for (int i = 0; i < N; i++) {
			if (tmp % 4 != 3) {
				if (tmpLength[tmp % 4] != A[tmp % 4]) tmpAns += 10;
				tmpLength[tmp % 4] -= L[i];
			}
			tmp /= 4;
		}

		for (int i = 0; i < 3; i++) {
			if(tmpLength[i] != A[i]) tmpAns += abs(tmpLength[i]);
			else tmpAns += INF;
		}

		
		 // if (ans > tmpAns) ansm = m;
		ans = min(ans, tmpAns);
	}

	cout << ans << endl;

	/*
	for (int i = 0; i < N; i++) {
		cout << ansm % 4 << " ";
		ansm /= 4;
	}
	*/

	return 0;
}

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

#define fo(i,s,t) for(int i = s; i <= t; ++ i)
#define fd(i,s,t) for(int i = s; i >= t; -- i)
#define bf(i,s) for(int i = head[s]; i; i = e[i].next)
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define VI vector<int>
#define sf scanf
#define pf printf
#define fp freopen
#define SZ(x) ((int)(x).size())
#define MPS
typedef long long ll;
typedef double db;
typedef unsigned long long ull;
const int inf = 1<<30;
const ll INF = 1ll<<60;
const db Inf = 1e20;
const db eps = 1e-9;

void gmax(int &a,int b){a = (a > b ? a : b);}
void gmin(int &a,int b){a = (a < b ? a : b);}

int a, b, c;

int main()
{
	cin >> a >> b >> c;
	if(a > b) swap(a, b);
	if(b > c) swap(b, c);
	if(a > b) swap(a, b);
	int x = c - b;
	a += x; b += x;
	if((b-a)&1) x += (b-a)/2 + 2;
	else x += (b-a)/2;
	cout << x << endl;
	return 0;
}

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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

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

    int cnt = 1;

    int modK = 7;

    bool ok = false;
    rep(_,K){
        modK = modK % K;
        if(modK == 0){
            ok = true;
            break;
        }else{
            cnt++;
            modK = 10*modK + 7;
        }
    }
    if(ok) cout << cnt << endl;
    else cout << -1 << endl;
}

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

int main() {
	int n;cin>>n;
  	vector<int> a(100001,0);
  	vector<int> b(100001,0);
  	vector<int> c(100001,0);
  	vector<int> d(100001,0);
  	vector<int> temp(n);
  	
  	for(int i=0;i<n;i++){
      	cin>>temp[i];
    	if(i%2==0){
        	a[temp[i]]++;	
          	c[temp[i]]++;	
          
        }else{
        	b[temp[i]]++;	
          	d[temp[i]]++;	
        }
    }
  
  	sort(c.begin(),c.end());
  	reverse(c.begin(),c.end());
  	int a1=-1,a2=-1,asuu1,asuu2;
  	asuu1=c[0];asuu2=c[1];
  
  	sort(d.begin(),d.end());
  	reverse(d.begin(),d.end());
  	int b1=-1,b2=-1,bsuu1,bsuu2;
  	bsuu1=d[0];bsuu2=d[1];
  
  	for(int i=0;i<n;i++){
    	if(i%2==0){
        	if(a[temp[i]]==asuu1) a1=temp[i];
          	if(a[temp[i]]==asuu2) a2=temp[i];
        }else{
        	if(b[temp[i]]==bsuu1) b1=temp[i];
          	if(b[temp[i]]==bsuu2) b2=temp[i];
        }
    }
  //cout<<asuu1<<" "<<asuu2<<" "<<endl;
  //cout<<bsuu1<<" "<<bsuu2<<" "<<endl;
  //cout<<a1<<" "<<b1<<" "<<endl;
  //cout<<a2<<" "<<b2<<" "<<endl;
  
  if(a1!=b1){
  	cout<<n-asuu1-bsuu1<<endl;
  }else{
  	int ans;
    ans=min(n-asuu1-bsuu2,n-asuu2-bsuu1);
    cout<<ans<<endl;
  }
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;
using Complex = complex<double>;
const double PI = acos(-1);

ll N, M;
vector<int> A;

ll cnt(ll sum) {
    ll res = 0;
    int r = N;
    for (int i = 0; i < N; ++i) {
        while (r > 0 && A[r - 1] + A[i] >= sum)
            r--;
        res += N - r;
    }
    return res;
}

bool isOK(ll num) {
    return M <= cnt(num);
}

ll search() {
    ll ok = 1;
    ll ng = LLINF;

    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if (isOK(mid))
            ok = mid;
        else
            ng = mid;
    }
    return ok;
}

int main() {
    cin >> N >> M;
    A.resize(N);
    for (int i = 0; i < N; ++i)
        cin >> A[i];
    sort(A.begin(), A.end());
    ll ok = search();

    vector<ll> Asum(N + 1);
    for (int i = 0; i < N; ++i)
        Asum[i + 1] = Asum[i] + A[i];

    ll ans = 0;
    int r = N;
    for (int i = 0; i < N; ++i) {
        while (r > 0 && A[i] + A[r - 1] > ok)
            r--;
        ans += (ll)A[i] * (N - r) + Asum[N] - Asum[r];
    }
    ans += ok * (M - cnt(ok + 1));

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


Measured memory_bytes: 1408
#include <cstdio>

int main(void)
{
    char r[5], a[5];
    while (1){
        scanf("%s %s", r, a);
        if (r[0] == '0' && a[0] == '0') break;
        int hit = 0, blow = 0;
        for (int i = 0; i < 4; i++){
            if (r[i] == a[i]) hit++;
        }
        for (int i = 0; i < 4; i++){
            for (int j = 0; j < 4; j++){
                if (r[i] == a[j]) blow++;
            }
        }
        printf("%d %d\n", hit, blow - hit);
    }
    
    return (0);
}

Measured memory_bytes: 0
from collections import deque

que = deque()
n = int(input())

for loop in range(n):
    input_command = input()
    
    if input_command == 'deleteFirst':
        que.popleft()
    
    elif input_command == 'deleteLast':
        que.pop()
    
    else:
        command, x = input_command.split()
        
        if command == 'insert':
            que.appendleft(x)
        elif command == 'delete':
            try:
                que.remove(x)
            except:
                pass

print(' '.join(que))


Measured memory_bytes: 69736
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int h,n;
    cin>>h>>n;
    long long int sum=0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        sum+=x;
    }
    if(sum>=h)
    {
        cout<<"Yes\n";
    }
    else{
        cout<<"No\n";
    }
    return 0;
}



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

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    ll n;
    cin >> n;
    vector<ll> p, w;
    for (ll d = 2; d * d <= n; ++d)
    {
        ll wyk = 0;
        while (n % d == 0)
        {
            ++wyk;
            n /= d;
        }
        if (wyk != 0)
        {
            p.push_back(d);
            w.push_back(wyk);
        }
    }
    if (n != 1)
    {
        p.push_back(n);
        w.push_back(1);
    }
    ll odp = 0;
    for (int i = 0; i < p.size(); ++i)
    {
        ll il = 1;
        while ((il + 1) * il / 2 <= w[i])
            ++il;
        --il;
        odp += il;
    }
    cout << odp;
    return 0;
}


Measured memory_bytes: 3644
using System;
using System.Linq;
class test{
  static long mod =1000000007;
  public static void Main(){
    var nab =  Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
    long n = nab[0];
    long a = nab[1];
    long b = nab[2];
    long res = Pow(2,n);
    long A = Conv(n,a);
    long B = Conv(n,b);
 
    res = ((res%mod) -(A%mod) -(B%mod) -1)%mod;
    if(res<0){
      res= mod+res; 
    }
    Console.WriteLine(res);
  }
  
  static long Pow(long x, long n){
    if(n==1){
      return x %mod;
    }else if(n%2 ==1 ){
      return (x * Pow(x,n-1)) %mod;
    }
    long z = Pow(x,n/2);
    return (z*z) %mod;
  }
  
  static long Conv(long n, long m){
    long x =1;
    long y =1;  
    m = Math.Min(m,n-m);
    while(m>0){
      x*=n--; 
      x%=mod;
      y*=m--;
      y%=mod;
    }  
    return (x * Pow(y,mod-2)) % mod;
  }
}

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

const int MAXN = 100005;
const int MOD = 1000000007;

char s[MAXN];
int n, c[26];

int main(){
	scanf("%d %s", &n, s);
	
	for(int i = 0; i < n; i++){
		c[s[i] - 'a']++;
	}
	
	long long res = 1;
	for(int i = 0; i < 26; i++)
		res = res * (c[i] + 1) % MOD;
	printf("%lld\n", (res - 1 + MOD) % MOD);
	
	return 0;
}


Measured memory_bytes: 3912
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

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

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

    int n;
    cin>>n;
    vector<int> as(n);
    rep(i, n) cin>>as[i];
    
    int q;
    cin>>q;
    rep(i, q) {
        int b, e;
        cin>>b>>e;
        reverse(as.begin() + b, as.begin() + e);
    }
    rep(i, n) cout<<as[i]<<((i != n - 1) ? ' ' : '\n');
}


Measured memory_bytes: 3244
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
//#define MOD 998244353
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define rev(p) reverse(p.begin(),p.end());
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define popcount(x) __builtin_popcountll(x)
#define sz(x) ((ll)x.size())
const int M=1000000007;
const int MM=998244353;
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";

 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  if(m<=1)return 0;
  a%=m;
  ll ans=1LL;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}


 
ll poww(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;

}

template<typename T,typename F>
void chmax( T &a,F b){
  if(b>a)a=b;
}

template<typename T,typename F>
void chmin( T &a,F b){
  if(b<a)a=b;
}

const ll N=5e5+5;


ll f(ll a,ll b){
  ll c=0;
  while(a||b){
    a/=10;
    b/=10;
    c++;
  }
  return c;
}


int main()
{ 

IOS;

ll n,k;

cin>>n;

vl a(n);
FOR(i,n)cin>>a[i];

sort(all(a));

ll ans=0;

for(int i=0;i<n;i++){
  for(int j=i+1;j<n;j++){
    ll d=lb(all(a),a[i]+a[j])-a.begin()-j-1;
    //d3(i,j,d);
    ans+=d;
  }
}

cout<<ans;

//end_routine();

return 0;
 
}


Measured memory_bytes: 3688
#include <bits/stdc++.h>
#include<string>
    
using namespace std;
            
    #define ll long long
    #define do long double
    #define ff first
    #define ss second
    #define pb push_back
    #define mp make_pair
    #define inf LONG_LONG_MAX
    #define mod 1000000007
    #define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

void solve()
{
	ll n,m,i,j,k;
	cin>>n;
	ll a[n];
	for(i=0;i<n;i++)
	cin>>a[i];
	ll ans=0;
	vector<ll> v(64);
	for(i=0;i<n;i++)
	{	ll c=0;
		while(a[i]>0)
		{
			if(a[i]&1)
				v[c]++;
			c++;
			a[i]/=2;

		}
	}	
	for(i=0;i<64;i++)
	{
		ll x=v[i]*(n-v[i]);
		x%=mod;
		x=((x%mod)*((1LL<<i)%mod))%mod;
		ans+=x;
		ans%=mod;
	}
	cout<<ans;
	

	
}



int main()
{
    FAST
    ll n,m,i,j;
    ll q;
    q=1;
    //cin>>q;
    while(q--)
    	solve();
	

}

Measured memory_bytes: 2560
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		const long MOD = 1000000007;
		static void Main(string[] args)
		{
			var cin = new Scanner2();
			long t1 = cin.Long();
			long t2 = cin.Long();
			long a1 = cin.Long();
			long a2 = cin.Long();
			long b1 = cin.Long();
			long b2 = cin.Long();

			long da1 = t1 * a1;
			long da2 = t2 * a2;
			long db1 = t1 * b1;
			long db2 = t2 * b2;
			long da = da1 + da2;
			long db = db1 + db2;

			if (da == db) {
				Console.WriteLine("infinity");
				return;
			}

			if ((da1 > db1 && da2 > db2) || (da1 < db1 && da2 < db2)) {
				Console.WriteLine(0);
				return;
			}

			if ((da1 > db1 && da > db) || (da1 < db1 && da < db)) {
				Console.WriteLine(0);
				return;
			}

			long dif1 = da1 - db1;
			long difall = da - db;
			if ((dif1 > 0 && difall > 0) || (dif1 < 0 && difall < 0)) {
				Console.WriteLine(0);
				return;
			}

			long ans = 0;
			if (Math.Abs(dif1) % Math.Abs(difall) == 0) {
				ans = (Math.Abs(dif1) / Math.Abs(difall)) * 2;
			} else {
				ans = (Math.Abs(dif1) / Math.Abs(difall)) * 2 + 1;
			}

			Console.WriteLine(ans);
		}
	}


	public class Scanner2
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private readonly string filePath_;
		private string[] buf_;
		private int index_;
		Func<string> reader_;

		public Scanner2(string file = "")
		{
			if (string.IsNullOrWhiteSpace(file)) {
				reader_ = Console.ReadLine;
			} else {
				filePath_ = file;
				var fs = new StreamReader(file);
				reader_ = fs.ReadLine;
			}
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = reader_();
			while (st == "") {
				st = reader_();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}

		public void Save(string text)
		{
			if (string.IsNullOrWhiteSpace(filePath_)) {
				return;
			}

			File.WriteAllText(filePath_ + "_output.txt", text);
		}
	}
}

Measured memory_bytes: 11220
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,m,p;
    long long int y;
    cin>>n>>m;
    std::multimap<int, long long int> map;
    std::map<long long int, int> year;
    for (int i=0;i<m;i++) {
        cin>>p>>y;
        map.emplace(p,y);
        year.emplace(y,i+1);
    }
    std::deque<string> ans(100001,"");
    for (int i=1;i<=n;i++) {
        auto p=map.equal_range(i);
        std::deque<long long int> deq;
        for (auto itr=p.first;itr!=p.second;itr++) {
            deq.emplace_back(itr->second);
        }
        sort(deq.begin(),deq.end());
        for (int j=0;j<deq.size();j++) {
            string tmp="";
            if (to_string(i).size()==5) {
                tmp=tmp+"0"+to_string(i);
            } else if (to_string(i).size()==4) {
                tmp=tmp+"00"+to_string(i);
            } else if (to_string(i).size()==3) {
                tmp=tmp+"000"+to_string(i);
            } else if (to_string(i).size()==2) {
                tmp=tmp+"0000"+to_string(i);
            } else if (to_string(i).size()==1) {
                tmp=tmp+"00000"+to_string(i);
            } else {
                tmp=tmp+to_string(i);
            }
            if (to_string(j+1).size()==5) {
                tmp=tmp+"0"+to_string(j+1);
            } else if (to_string(j+1).size()==4) {
                tmp=tmp+"00"+to_string(j+1);
            } else if (to_string(j+1).size()==3) {
                tmp=tmp+"000"+to_string(j+1);
            } else if (to_string(j+1).size()==2) {
                tmp=tmp+"0000"+to_string(j+1);
            } else if (to_string(j+1).size()==1) {
                tmp=tmp+"00000"+to_string(j+1);
            } else {
                tmp=tmp+to_string(j+1);
            }
            ans[year[deq[j]]]=tmp;
        }
    }
    for (int i=0;i<ans.size();i++) {
        if (ans[i]!="") {
            cout<<ans[i]<<endl;
        }
    }
}

Measured memory_bytes: 20480
#include <iostream>
#define rep(i, n) for(int i = 0; i < (n); i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using namespace std;
int dp[110][110];
const int inf = 1<<30;

int main() {
  int H, W; cin >> H >> W;
  char s[H][W];
  rep(i, H)rep(j, W) cin >> s[i][j];
  rep(i, H)rep(j, W) dp[i][j] = inf;
  dp[0][0] = (s[0][0] == '.') ? 0 : 1;
  rep(i, H) {
    rep(j, W) {
      if(i == 0 && j == 0) continue;
      if(i) chmin(dp[i][j], dp[i-1][j] + (s[i-1][j] == '.' && s[i][j] == '#'));
      if(j) chmin(dp[i][j], dp[i][j-1] + (s[i][j-1] == '.' && s[i][j] == '#'));
    }
  }
  cout << dp[H-1][W-1] << endl;
  return 0;
}


Measured memory_bytes: 384
N, C = map(int, input().split())
xv = [[int(i) for i in input().split()] for _ in range(N)]

av = 0
fa1 = 0
bv = 0
fb1 = 0
fa = []
fb = []
ga = []
gb = []
for i in range(N):
    ax = xv[i][0]
    av += xv[i][1]
    bx = C - xv[-(i+1)][0]
    bv += xv[-(i+1)][1]
    fa1 = max(fa1, av-ax)
    fa.append(fa1)
    ga.append(av - 2*ax)
    fb1 = max(fb1, bv-bx)
    fb.append(fb1)
    gb.append(bv - 2*bx)

p = max(0, fa[-1], fb[-1])

for i in range(N-1):
    p = max(p, fa[i]+gb[N-i-2], ga[i]+fb[N-i-2])

print(p)


Measured memory_bytes: 41348
S=input()
T=input()
#条件は、SとTで、同じ文字が同じ場所に同数存在していること
d={}
#used=set()
for (s,t) in zip(S,T):
    try:
        if d[s]!=t:
            print("No")
            exit()
    except KeyError:
        #sとtの対応関係を記録
        d[s]=t

v=d.values() 
if len(v)!=len(set(v)):
    print("No")
else:
    print("Yes")

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

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

    string s;
    cin >> s;
    string answer ;
    if(s == "Rainy"){
        answer = "Sunny\n";
    }
    else
    if(s == "Sunny"){
        answer = "Cloudy\n";
    }
    else{
        answer = "Rainy\n";
    }
    cout << answer << "\n";


return 0;}


Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split()))

if 2 == N:
	print(abs(H[0] - H[1]))
	exit()

dp = [0] * N
dp[1] = abs(H[0] - H[1])
dp[2] = abs(H[0] - H[2])
#print(dp)

for n in range(1, N - 2):
	dp[n + 1] = min(dp[n + 1], dp[n] + abs(H[n] - H[n + 1]))
	dp[n + 2] = dp[n] + abs(H[n] - H[n + 2])
	#print(dp)
dp[N - 1] = min(dp[N - 1], dp[N - 2] + abs(H[N - 2] - H[N - 1]))
#print(dp)
print(dp[N - 1])


Measured memory_bytes: 13776
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] num = new int[3];
        List<Integer>  list = new ArrayList<>();

        for(int i=0; i<3; i++){
            num[i] = Integer.parseInt(sc.next());
        }

        list.add(num[0]+ num[1]);
        list.add(num[1] + num[2]);
        list.add(num[2] + num[0]);

        Collections.sort(list, (a,b)-> a-b);

        System.out.println(list.get(0));

    }
}

Measured memory_bytes: 27092
#n = int(input())
#n, x  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
n = 4
m = [0]*n
counter = 0
for i in range(n):
  m[i] = int(input())

for i in range(m[0]+1):
  mod = m[3] - 500*i
  if (mod < 0):
    continue
  for ii in range(m[1]+1):
    mod_2 = mod - 100*ii
    if (mod_2 < 0):
      continue
    if (mod_2 <= m[2]*50):
      counter = counter + 1

print(counter)

Measured memory_bytes: 3064
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

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

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


int main(){
  ll s,w; cin >> s >> w;
  if(s <= w) cout << "unsafe" << endl;
  else cout << "safe" << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll x;
  cin >> x;
  cout << (x/500)*1000 + ((x%500)/5)*5 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];
    int ans = 0;
    int now = 0;
    int l = 0, r = 0;
    rep(i, 0, n){
        l = a[i] - m;
        r = a[i] + m;
        if(now < l) ans += l - now;
        now = r;
    }
    if(now < t) ans += t - now;
    cout << ans << endl;
}

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

int n, k;
int main(){
	scanf("%d %d", &n, &k);
	double tot = 0.0;
	for (int i = 1; i <= n; i++){
		double u = 1.0/(1.0*n);
		int x = i;
		while (x < k){
			x *= 2;
			u *= (1.0/2.0);
		}
		tot += u;
	}
	printf("%.12lf\n", tot);
	return 0;
}


Measured memory_bytes: 256
def main():
    n, T = map(int, input().split())
    t = list(map(int, input().split()))
    
    ans = T
    pre = t[0]
    for tt in t:
        if tt - pre < T:
            ans += tt - pre
        else:
            ans += T
        pre = tt
    print(ans)
               
if __name__ == '__main__':
    main()

Measured memory_bytes: 26708
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
#define MOD LL(1e9+7)
#define MAXN 200000
#define MAXL 100000

LL ans,len;
char s[MAXL+5];
LL cf[MAXN+5];
LL A[MAXL+5],C[MAXL+5];
LL L[MAXL+5],R[MAXL+5];

LL Get(LL x,LL y) {
	LL ret=0;
	ret=(ret+(A[x]*C[y])%MOD*cf[L[x]+R[y]])%MOD;
	ret=(ret+(A[x]*R[y])%MOD*cf[L[x]+R[y]-1])%MOD;
	ret=(ret+(L[x]*C[y])%MOD*cf[L[x]+R[y]-1])%MOD;
	ret=(ret+(L[x]*R[y])%MOD*cf[L[x]+R[y]-2])%MOD;
	return ret;
}
void Init() {
	cf[0]=1;
	for(int i=1;i<=MAXL;i++)
		cf[i]=(3*cf[i-1])%MOD;
}
int main() {
	Init();
	scanf("%s",s+1);
	len=strlen(s+1);
	for(int i=1;i<=len;i++) {
		A[i]=A[i-1],L[i]=L[i-1];
		if(s[i]=='A')
			A[i]++;
		else if(s[i]=='?')
			L[i]++;
	}
	for(int i=len;i>=1;i--) {
		C[i]=C[i+1],R[i]=R[i+1];
		if(s[i]=='C')
			C[i]++;
		else if(s[i]=='?')
			R[i]++;
	}
	for(int i=1;i<=len;i++)
		if(s[i]=='B'||s[i]=='?')
			ans=(ans+Get(i-1,i+1))%MOD;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long
//#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];

ll solve(ll a) {
  if (a % 4 == 0) {
    return a;
  } else if (a % 4 == 1) {
    return 1;
  } else if (a % 4 == 2) {
    return a ^ 1;
  } else if (a % 4 == 3) {
    return 0;
  }
  return 0;
}

int main() {
  ll x, y; cin >> x >> y;
  
  ll a = solve(y) ^ solve(x-1);

  cout << a << endl;
  
}


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

typedef long long ll;
typedef pair<int, int> pii; 
const int N = 2e5+10, mod = 1e9+7;

void solve() {
    string s, t; cin >> s >> t;
    cout << t + s << endl;
}   

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t = 1;
    while (t--) solve();
    return 0;
}


Measured memory_bytes: 3624
// ITP1_2_A.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if (a < b)
    {
        cout << "a < b" << endl;
        return 0;
    }
    if (a > b)
    {
        cout << "a > b" << endl;
        return 0;
    }
    cout << "a == b" << endl;
    return 0;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します



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

typedef pair<int, int> P;
typedef long long int ll;
ll INF = 1000000000;

int N, X[50], Y[50];

int main(){
    cin >> N;
    for(int i=0;i<N;i++)    cin >> X[i] >> Y[i];

    vector<P> XY(N);
    for(int i=0;i<N;i++)    XY[i] = P(X[i], Y[i]);

    sort(XY.begin(), XY.end());

    map<P, bool> m;
    for(auto i : XY)    m[i] = true;

    ll ans = INF;

    for(int i=0;i<N-1;i++){
        for(int j=i+1;j<N;j++){
            int p = XY[j].first - XY[i].first;
            int q = XY[j].second - XY[i].second;
            ll res = 0;
            for(int k=0;k<N;k++){
                P tmp = P(XY[k].first - p, XY[k].second -q);
                if(!m[tmp]){
                    res++;
                }
            }
            ans = min(ans, res);
        }
    }

    if(N==1)    cout << 1 << endl;
    else        cout << ans << endl;
}

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

int main() {
  int n; cin >> n;
  vector<int> a(n);

  int maxn = 0, maxi;
  for(int i=0; i<n; ++i){
    cin >> a[i];
    if(maxn < a[i]){
      maxn = a[i];
      maxi = i;
    }
  }

  sort(a.begin(), a.end(), std::greater<int>());

  for(int i=0; i<n; ++i){
    if(i != maxi) cout << maxn << endl;
    else cout << a[1] << endl;
  }
}


Measured memory_bytes: 2432
n = int(input())
arr  = list(map(int , input().split()))
cnt =[-1]*(n+1)
mod = 10**9+7
fact=[1]
now =1
for i in range(1, n+2):
	now =(now%mod)*(i%mod)
	now = now%mod
	fact.append(now)
inverse = []
for i in range(n+2):
	inverse.append(pow(fact[i] , mod-2, mod))
l  , r, =0 , 0
for i in range(0, n+1):
	if cnt[arr[i]]!=-1:
		l = cnt[arr[i]]
		r= i
		break
	cnt[arr[i]]=i

for i in range(1, n+2):
	ans = (fact[n+1]*inverse[i]*inverse[n+1-i])%mod
	rem = n-r+l
	# subtract all the combination which are duplicates the subsequence will either from the
	# left elements of first duplicate or right elements of last duplicates
	# we need to subtract those
	if rem>=i-1:
		ans = ans-(fact[rem]*inverse[i-1]*inverse[rem-(i-1)])%mod+mod
		ans = ans%mod
	print(ans)

Measured memory_bytes: 87304
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  
  if(a+b == c){
    cout << "Yes" << endl;
  }
  else if(a+c == b){
    cout << "Yes" << endl;
  }
  else if(b+c == a){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}
           

Measured memory_bytes: 3644
n,k=gets.split.map(&:to_i)
a=gets.split.map(&:to_i)
#n,k=200000,200000
#a=[0]*200000
[k,41].min.times do
  b=[]
  l=[0]*n
  c=0
  0.upto(n-1) do |i|
    c+=1
    if i+a[i]<n-1
      l[i+a[i]]+=1
    end
    b[i]=c
    c-=l[i]
  end
  l=[0]*n
  c=0
  (n-1).downto(0) do |i|
    if i-a[i]>0
      l[i-a[i]]+=1
    end
    b[i]+=c
    c-=l[i]
    c+=1
  end
  a=b.dup
end
puts a.join(" ")


Measured memory_bytes: 105440
#include<cstdio>
#include<iostream>
#include<iomanip>
#include<vector>
#include<tuple>
#include<queue>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>

using namespace std;

template< int id > struct CompTupleBy
{
  template<class T> 
  bool operator()( const T& a, const T& b ) const {
    return std::get<id>(a) < std::get<id>(b);
  }
};

int main(int argc, char* argv[]){
  int n,m;
  cin >> n >> m;
  vector<tuple<int, long long int, long long int, long long int>> t;
  for(int i=0;i<m;i++){
    long long int p, y;
    cin >> p >> y;
    t.push_back(make_tuple(i+1,p,y,0));
  }
  sort(t.begin(),t.end(),CompTupleBy<2>());
    // for(int i = 0;i<m;i++){
    //   cout << get<0>(t[i]) << get<1>(t[i]) << get<2>(t[i]) << get<3>(t[i]) << endl;
    // }
  int pre[100001];
  for(int i=0;i<n+1;i++){
    pre[i] = 0;
  }
//  for(int i=0;i<n+1;i++)cout<<pre[i]<<endl;
  for(int i=0;i<m;i++){
    long long int& x = get<3>(t[i]);
    // cout << endl;
    // cout << i << "t " << get<1>(t[i]) << endl;
    // cout << pre[get<1>(t[i])] << endl;
    x = get<1>(t[i])*1000000 + pre[get<1>(t[i])]+1;
    pre[get<1>(t[i])]++;
  }
  sort(t.begin(),t.end(),CompTupleBy<0>());
  for(int i=0;i<m;i++){
    cout << setfill('0') << setw(12) << get<3>(t[i]) << endl;
  }
  return 0;
}

Measured memory_bytes: 6512
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x) cout<<#x<<" = "<<(x)<<endl;
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  string s; cin >> s;
  M m;
  REP(i,s.size()) m[s[i]-'0']++;
  COUT(min(m[0],m[1])*2);
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
ll t[200001];

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll conv(ll x, ll y){
    ll tmp = t[x - y] * t[y];
    return t[x] * modinv(tmp, MOD) % MOD;
}

int main(void){
    ll h, w, a, b;
    cin >> h >> w >> a >> b;

    t[0] = 1;
    rep(i, 1, 200001){
        t[i] = t[i - 1] * i % MOD;
        t[i] %= MOD;
    }

    ll ans = 0;
    rep(i, 0, h - a){
        ans += conv(b - 1 + i, i) * conv((h - 1 - i) + (w - b - 1), w - b - 1) % MOD;
        ans %= MOD;
    }

    cout << ans << endl;
    return 0;

}


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

using namespace std;

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

#define rep(i, n) for (int i = 0; i < n; i++)
#define repext(i, a, b) for (int i = a; i < b; i++)
#define reprev(i, n) for (int i = n - 1; i >= 0; i--)
#define repextrev(i, a, b) for (int i = b - 1; i >= a; i--)

#define vec_all(vec) vec.begin(), vec.end()
#define sum(vec) accumulate(vec_all(vec), 0)
#define srt(vec) sort(vec_all(vec))

// vectorデバッグ
template <typename T>
void dump_vec(vector<T> vec)
{
    rep(i, vec.size())
    {
        cout << i << ": " << vec[i] << endl;
    }
}

// --- notice ---
// intの和はllにしろ

int main()
{
    int n;
    cin >> n;
    ll s = 0;
    int tmp;
    rep(i, n) {
        cin >> tmp;
        s += (tmp - 1);
    }

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

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

int mod = 1'000'000'007;

int main(){
    int n, k;
    cin >> n >> k;
    vector<vector<int>> edge(n);
    for (int i = 1; i < n; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    vector<bool> used(n, false);
    queue<int> q;
    q.push(0);
    vector<int> node(n, 0);
    node[0] = k;
    while (q.size()){
        int x = q.front(); q.pop();
        used[x] = true;
        int color = k - 2;
        if (x == 0) color++;
        for (int i = 0; i < edge[x].size(); i++){
            if (!used[edge[x][i]]) {
                node[edge[x][i]] = color;
                color--;
                q.push(edge[x][i]);
            }
        } 
    }
    long long ans = 1;
    for (int i = 0; i < n; i++){
        ans *= node[i];
        ans %= mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 6904
#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 length;
  length = S.size();
  int flag = 0;
  
  rep(i, length){
  	if(i % 2 == 0 && (S[i] == 'R' || S[i] == 'U' || S[i] == 'D')) continue;
    else if(i % 2 == 1 && (S[i] == 'L' || S[i] == 'U' || S[i] == 'D')) continue;
    else flag = 1;
  }
  
  if(flag==0) cout << "Yes" << endl;
  else cout << "No" << endl;

}

Measured memory_bytes: 256
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

n, m = map(int, input().split())
x = []
for i in range(m):
    x.append(list(map(int, input().split())))
# print(x)
p1 = set()
p2 = set()
for i in x:
    if i[0] == 1:
       p1.add(i[1])
    elif i[1] == n:
        p2.add(i[0])
# print(p1, p2)
if len(p1 & p2) >= 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


Measured memory_bytes: 61164