akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	string S;
	cin >> S;
	int N =S.length();
	for(int k =0; k < 26; k++) {
		int mx =0, mi =10000000, mxp =0, mip =0, mxip =0;
		vector<int> sums(N+1,0);
		for(int i =0; i < N; i++) {
			if(S[i] == 'a'+k) sums[i+1] =sums[i]+1;
			else sums[i+1] =sums[i]-1;
			mx =max(mx,sums[i+1]-mi);
			if(mx == sums[i+1]-mi) {
				mxp =i+1;
				mxip =mip;}
			mi =min(mi,sums[i]);
			if(mi == sums[i]) mip =i;}
		if(mx > 0) {
			cout << mxip+1 << " " << mxp << "\n";
			return 0;}
		}
	cout << "-1 -1\n";
	return 0;}

// look at my code
// my code is amazing


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

#define itn int
#define LL long long
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define all(x) (x).begin(), (x) end()
#define sz(x) (int)((x).size())

using namespace std;
inline int getint(){
	int x;
	scanf("%d" , &x );
	return x;
}
inline string getstring(void){
	char x[100005];
	scanf("%s",x); string s = x;
	return s;
}
string a,b,c;
void solve(){	
	a = getstring();
	b = getstring();
	c = getstring();
	printf("%c%c%c\n",a[ 0 ]-'a'+'A',b[0]-'a'+'A',c[0]-'a'+'A' );
}	
int main(){
 
	/*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	*/
	int T = 1;
  	while(T--){
    solve();
  }
  	
  	return 0;
}


Measured memory_bytes: 256
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = nextbig(), a = nextbig(), b = nextbig();
  if(a > b)return 0;
  if(a === b)return 1;
  if(n === 1n)return 0;
  return (n-2n) * (b-a) + 1n;
}

Measured memory_bytes: 29568
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  string a,b,c;cin >> a >> b >> c;
  bool issat = false;
  if(a[a.length()-1] == b[0] && b[b.length()-1] == c[0])issat = true;
  YESNO(issat);
  return 0;
}


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

int main() {

    int n; cin >> n;    
    vector<int> c(n - 1), s(n - 1), f(n - 1);
    for (int i = 0; i < n - 1; i++) {
        cin >> c[i] >> s[i] >> f[i];
    }

    for (int i = 0; i <= n - 1; i++) {
        int ans = 0;
        if (i != n - 1) {
            ans += s[i];
            ans += c[i];
            for (int j = i + 1; j <= n - 2 ; j++) {

                if (s[j] <= ans) {
                    int tmp = ans % f[j];
                    if (tmp != 0) {
                        ans += f[j] - tmp;
                    }
                }
                else { // ans < s[j]
                    ans += s[j] - ans;
                }
                ans += c[j];
            }
        }
        else {
            ans = 0;
        }
        cout << ans << 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++)
#define irep(i,a,b) for(typeof(i) i = (a); i < (b); ++i)
#define itrep(it,c) for(auto it = (c).begin(); it != (c).end(); ++it)


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

	ll A,B,C,D;
	cin >> A >> B >> C >> D;

	while (true) {
		C -= B;
		if (C <= 0) {
			cout << "Yes" << endl;
			break;
		}
		A -= D;
		if (A <= 0) {
			cout << "No" << endl;
			break;
		}
	}
}


Measured memory_bytes: 3652
#include<stdio.h>
int main(){
	int n, i, tmp;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		if (i % 3 == 0) {
			printf(" %d", i);
		}
		else {
			tmp = i;
			do {
				if (tmp % 10 == 3) {
					printf(" %d", i);
					break;
				}
				tmp /= 10;
			} while (tmp);
		}
	}
	printf("\n");
}


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

#define int long long 
#define ll long long 
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define ff first
#define ss second
#define vi vector<ll>
#define mod 1000000007
#define MOD 1000000007
#define full(a) a.begin(),a.end()
#define inf INT_MAX
#define minf INT_MIN
#define dd double
#define fori(x,n) for(ll i=x;i<n;i++)


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

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    
    ll n;
    cin>>n;
    ll a[n];
    fori(0,n)cin>>a[i];
    sort(a,a+n);

    ll sum=a[n-1],cnt=1;
    for(int i=n-2;i>=0;i--){
        cnt+=2;
        if(cnt>n)break;
        if(cnt==n-1){sum+=2*a[i];break;}
        else if(cnt==n){
            sum+=a[i];
            break;
        }
        sum+=2*a[i];}

    cout<<sum<<"\n";



    return 0;  
}
    

Measured memory_bytes: 5160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
vector<string> split(string s, char p){vector<string>v;stringstream m(s);string b;while(getline(m,b,p))v.push_back(b);return v;}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

int main(){
    ll N; cin >> N;
    vector<ll> A(N);
    vector<ll> B(N+1);
    vector<ll> C(N+1);
    REP(i, N) {
        cin >> A[i];
        B[i+1] = B[i] + A[i];
    }
    REPR(i, N) {
        C[i] = C[i+1] + A[i];
    }

    ll ans = 1e15;
    REP(i, N) {
        chmin(ans, abs(B[i] - C[i]));
    }
    cout << ans << "\n";
}


Measured memory_bytes: 7928
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


    using namespace std;
 
    int main(){
      int a,b;
      cin >> a >> b;
      a+=11;
      b+=11;
      if(a%13>b%13) cout << "Alice" << endl;
      if(a==b) cout << "Draw" << endl;
      if(a%13<b%13) cout << "Bob" << endl;
      return 0;}

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

using namespace std;
 
int main(){
	
	int S[4] = {};
	int P[2] = {};
	
	while( cin >> S[0] ){
		
	for(int i=1;i<4;i++)
	cin >> S[i];
	
	for(int i=0;i<2;i++)
	cin >> P[i];
	
	sort(S, S+4);
	sort(P, P+2);
	
	int TotalScore = S[1] + S[2] + S[3] + P[1];
	cout << TotalScore << "\n";
}
  return 0;
}


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

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

typedef pair<int, int> p;
vector <p> v;

int main(){
  int n,m;
  int a,b;

  scanf("%d %d",&n,&m);

  REP (i,m) {
    scanf("%d %d",&a,&b);
    v.push_back(make_pair(a, b));
  }

  bool w[n + 1] = {0};

  REP (i, m) {
    if (v.at(i).first == 1) w[v.at(i).second] = 1;
  }

  bool ans = false;
  REP (i, m) {
    if (v.at(i).second == n && w[v.at(i).first] == 1) {
      ans = true;
    }
  }

  if (ans) printf("POSSIBLE\n");
  else printf("IMPOSSIBLE\n");

}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
template<class T> inline bool chkmax(T& a,T b){return a<b?a=b,1:0;}
template<class T> inline bool chkmin(T& a,T b){return a>b?a=b,1:0;}
template<typename T> inline T& read(T& x){
    static char c; bool flag=0;
    while(!isdigit(c=getchar())) if(c=='-') flag=1;
    for(x=c-'0';isdigit(c=getchar());(x*=10)+=c-'0');
    if(flag) x=-x;
    return x;
}
const int maxn=500010;
int n,f[maxn][2],pre[maxn];
char s[maxn];
int main(){
#ifdef xffyjq
    freopen("exec.in","r",stdin);
    freopen("exec.out","w",stdout);
#endif
    read(n); scanf("%s",s+1);
    int pos=0;
    for(int i=1;i<=n;i++) if(s[i]=='0'){
        pre[i]=pos; pos=i;
    }
    for(int i=1;i<=n;i++){
        f[i][0]=f[i-1][0];
        if(s[i]=='0') continue;
        if(f[i-1][1]) chkmax(f[i][0],f[i][1]=f[i-1][1]+1);
        if(i>2&&s[i-1]=='0'&&s[i-2]=='1'){
            chkmax(f[i][0],f[i][1]=f[i-3][0]+1);
            chkmax(f[i][0],f[pre[i-1]+1][0]+(i-1)-(pre[i-1]+2));
            chkmax(f[i][0],f[pre[i-1]][0]+(i-1)-(pre[i-1]+1));
        }
    }
    printf("%d\n",f[n][0]);
    return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>
#include <map>
#include <stack>

struct max_min
{
    int64_t max = 0;
    int64_t min = 0;
};

const int64_t cc = pow( 10, 9 ) + 7;
//std::cout<< std::fixed << std::setprecision(10) << ( double )( max ) / 2;
bool sort_pair( std::pair< int64_t, int64_t > origin, std::pair< int64_t, int64_t > another )
{
    return origin.first < another.first;
}

//コンビネーションをmodで割った余りを産出
int64_t nCk( int64_t n, int64_t k  )
{
    int64_t ans_x = 1;
    int64_t ans_y = 1;

    for( int i = n; i > n - k; i-- )
    {
        ans_x *= i;
    }

    for( int i = 1; i <= k; i++ )
    {
        ans_y *= i;
    }

    return ans_x / ans_y;
}

int main()
{
    std::string word = "aa";
    std::string w = "Yes";
    int64_t a,b,c,d,e,f;
    std::cin>> a;
    std::cin>> b;
    
    if( a != b )
    {
        w = "No";
    }

    std::cout<< w;
}


Measured memory_bytes: 256
#include <stdio.h>

    void printArr(int a[],int n);

    void bubbleSort(int a[],int n);
    int counter;

int main()
{
    int n ;
    int R[200];

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

    bubbleSort(R,n);

    printArr(R,n);
    printf("%d\n",counter);
    return 0;
}
    void bubbleSort(int a[],int n){
        int flag = 1;
        counter = 0 ;
        while(flag){
            flag = 0;
            for(int j=n-1;j>=1;j--){
                if(a[j]<a[j-1]){
                    int tmp = a[j];
                    a[j] = a[j-1];
                    a[j-1] = tmp;
                    flag = 1;
                    counter++;
                }
            }
        }
    }


    void printArr(int a[],int n){
        for(int i= 0;i<n;i++){
            printf("%d%s",a[i],(i == n-1)? "\n": " ");
            //if(i == n-1) printf("\n");
        }
    }


Measured memory_bytes: 2104
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int a[5];
  int k;
  rep(i,5) cin>>a[i];
  cin>>k;
  rep(i,5){
    repi(j,i+1,5){
      if((a[j]-a[i])>k){cout<<":("<<endl;return 0;}
    }
  }
  cout<<"Yay!"<<endl;


  return 0;
}


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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);

  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.rbegin(), a.rend());

  multiset<int> s;
  s.insert(a[0]);
  long long sum = 0;

  for (int i = 1; i < n; i++) {
    auto it = prev(s.end());
    sum += *it;
    s.erase(it);
    s.insert(a[i]);
    s.insert(a[i]);
  }
  cout << sum << '\n';
  return 0;
}


Measured memory_bytes: 13536
n, m = map(int, input().split())
a = list(map(int, input().split()))

from fractions import gcd
from functools import reduce

a = [i >> 1 for i in a]

def applied_lcm(x, y):
    g = gcd(x, y)
    x //= g
    y //= g
    if x %2 == 0:
        return 0
    if y %2 == 0:
        return 0
    n = x * y * g
    if n >> 10**9:
        return 0

    return n

p = reduce(applied_lcm, a)
if p == 0:
    ans = 0
else:
    ans = (m//p) - (m//(p+p))
print(ans)

Measured memory_bytes: 14124
#include<stdio.h>
int main()
{
  int i,n;
  long int max=-999999999999999999,min;
  scanf("%d",&n);
  int t[n];
  for(i=0; i<n; i++)
    scanf("%d",&t[i]);
  min=t[0];
  for(i=1; i<n;i++){
    if(max<t[i]-min)
      max=t[i]-min;
    if(min>t[i])
      min=t[i];
  }
 // printf("max:%ld min:%ld\n",max,min);
  printf("%ld\n",max);
    
 
return 0;
}


Measured memory_bytes: 2620
#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>
#include<algorithm>
#include<utility>
#include<vector>
#include<climits>
#include<queue>
#include<random>

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

using namespace std;

int a,b;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    string s;
    cin >> s;
    string ans = "";
    rep(i, s.size()) {
        if(i % 2 == 0) ans += s.at(i);
    }

    cout << ans << endl;
}

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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int res = 0;
  for (int i = 0; i <= A; ++i) {
    for (int j = 0; j <= B; ++j) {
      for (int k = 0; k <= C; ++k) {
        int total = 500*i + 100*j + 50*k; // 合計金額
        if (total == X) ++res; // 合計金額が X に一致したら答えをインクリメント
      }
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
  
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}
  
int main()
{
  int i,j,right,third;
  ll tmp;
  int N; cin >> N;
  ll L[1001] = {0};
  ll LS[1001] = {0};
  ll ans = 0;

  rep(i,N){
      cin >> tmp;
      L[tmp]++;
  }
  repd(i,1,1001){
      LS[i] = LS[i-1] + L[i];
  }

  repd(i,1,1001){
      if(L[i] >= 3){
          tmp = L[i] * (L[i]-1) * (L[i]-2) / 6;
          ans += tmp;
      }
  }

  repd(i,1,1001){
      if(L[i]>=2){
          right = min(i*2 - 1,1000);
          third = LS[right] - L[i];
          tmp = L[i] * (L[i]-1) / 2;
          tmp *= third;
          ans += tmp;
      }
  }

  repd(i,1,1001){
      if(L[i]==0){continue;}
      repd(j,i+1,1001){
          if(L[j]==0){continue;}
          right = min(i + j - 1,1000);
          third = LS[right] - LS[j];
          tmp = L[i] * L[j] * third;
          ans += tmp;
      }
  }
  cout << ans << endl;

  return 0;
}


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

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

		int z, ans = 0;
		for (int x = 0; x <= K; x++) {
			for (int y = 0; y <= K; y++) {
				z = S - x - y;
				if (0 <= z && z <= K) ans++;
			}
		}

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

Measured memory_bytes: 256
n,q = map(int, input().split( ))
s = input()

cnt =[0]
tmp = 0
for i in range(1,n):
    if s[i-1:i+1]=="AC":
        tmp+=1
    cnt.append(tmp)

for i in range(q):
    l,r = map(int, input().split( ))
    l-=1;r-=1
    print(cnt[r]-cnt[l])




Measured memory_bytes: 50932
#include <iostream>
using namespace std;
int main(void){
    
    int n,t;
    float a;
    
    cin >> n;
    
    t = 0;
    for(int i = 1;i <= n;i++){
        
        if(i % 2 != 0) t = t  + 1;
    
        
    }
    
    a = ((float)t) / ((float)n);
    
    cout << a << endl;
    
    return 0;
}

Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define ARRAY_LENGTH(array) sizeof(array)/sizeof(*array)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
    ll D, T, S;
    cin >> D >> T >> S;

    if(D <= T*S) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

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

int main() {
  ll A, B, N;
  cin >> A >> B >> N;
  if ((N+1)/B > 0) {
    cout << A*(B-1)/B << endl;
    return 0;
  }
  cout << N*A/B << endl; 
}

Measured memory_bytes: 3620
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < n; i++)

using namespace std;

int main(void) {
  long N;
  cin >> N;
  vector<long> A(N);
  rep (i, N) cin >> A[i];
  sort(A.begin(), A.end());
  rep (i, N-1) {
    if ((A[i] + A[i+1]) < 0) {
      A[i] *= -1;
      A[i+1] *= -1;
    }
  }
  long result = 0;
  rep (i, N) result += A[i];
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int W, H, N;
int X[200000], Y[200000];
char D[200000];
map<int, vector<int> > mp;
int F[200000];
int T[200000];

void solve(vector<int> &seq) {
  if (seq.empty()) return;
  //cout<<"{"; for (int x : seq) cout << x<<",";cout<<"}\n";
  vector<int> left, right;
  vector<P> xs;
  for (int i : seq) {
    xs.pb(P(X[i], i));
  }
  sort(all(xs));
  for (P p : xs) {
    int i = p._2;
    if (D[i] == 'S') left.pb(i);
    else right.pb(i);
  }
  // LLL...RR
  rep(j, xs.size()) {
    int i = xs[j]._2;
    if (j < left.size()) {
      T[i] = F[left[j]];
    }
    else {
      T[i] = F[right[j - (int)left.size()]];
    }
  }
  sort(all(xs));
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> W >> H >> N;
  rep(i, N) {
    cin >> X[i] >> Y[i] >> D[i];
    mp[X[i]+Y[i]].pb(i);
    if (D[i] == 'S') F[i] = H - Y[i];
    else F[i] = W - X[i];
  }
  rep(i, N) T[i] = -1;
  for (auto &p : mp) {
    bool flip = p._1 % 2;
    vector<int> a[2];
    for (int i : p._2) {
      int parity = X[i]%2;
      if (flip && D[i] == 'S') parity ^= 1;
      a[parity].pb(i);
    }
    solve(a[0]); solve(a[1]);
  }
  //rep(i, N) cout<<i<<": "<<T[i]<<"\n";
  vector<P> xs;
  rep(i, N) xs.pb(P(T[i], i));
  sort(all(xs));
  rep(i, N) cout << xs[i]._2+1 << "\n";
  return 0;
}

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

using namespace std;

const int maxn = 1e5+500;

int main()
{
	int a,b;
	cin>>a>>b;
	if((a+b)%2==0){
		cout<<(a+b)/2<<endl;
	}else{
		cout<<"IMPOSSIBLE"<<endl;
	}
}


Measured memory_bytes: 256
//writer：Sakura
//problem：Two Sequences
//id：abc_092d
//from：Atcoder
//matrix:XOR——^（位运算）

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int n;
int a[200005],b[200005];
int ans;

/*
ll fj(ll x){
	ll res=0;
	for(ll i=1;i<=x;i++){
		if(x%i==0)res^=i;
	}
	return res;
}*/

int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)scanf("%d",&b[i]);
	/*for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			//printf("%lld %lld %lld\n",a[i],b[j],a[i]+b[j]);
			//printf("%lld\n",a[i]+b[j]);
			ans^=(a[i]+b[j]);
		}
	}*/
	/*ll ans1=0,ans2=0;
	for(int i=1;i<=n;i++){
		ans1+=a[i];
	}
	for(int i=1;i<=n;i++){
		ans2+=b[i];
	}*/
	//printf("%lld %lld\n",ans1,ans2);
	//ll res;
	//res=fj(ans1)^fj(ans2);
	//printf("%d\n",res);
	for(int i=28;i>=0;i--){
		for(int j=1;j<=n;j++){
			a[j]&=(1<<i+1)-1;
			b[j]&=(1<<i+1)-1;
		}
		sort(b+1,b+n+1);
		int k=0,j=1;
		for(k=0,j=1;j<=n;j++)
			k+=b+n+1-lower_bound(b+1,b+n+1,(1<<i+1)+(1<<i)-a[j])+lower_bound(b+1,b+n+1,(1<<i+1)-a[j])-lower_bound(b+1,b+n+1,(1<<i)-a[j]);
		if(k&1)ans+=1<<i;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1792
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	
      	int n = sc.nextInt();
      	int k = sc.nextInt();
     	long as[] = new long[n];
      
      	for(int i = 0;i < n;i++) as[i] = sc.nextLong();
       	
      	for(int i = 0;i < n-k;i++){
          	if(as[k + i] > as[i]) System.out.println("Yes");
          	else System.out.println("No");
        }
	}
}


Measured memory_bytes: 61220
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)

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

    int max_bit = 31;
    vector<ll> a(n);
    vector<ll> b(n);
    for(int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
    }
    vector<ll> candidates;
    candidates.push_back(k);
    for(int i = 1; i < max_bit; i++){
        if(k&(1<<i)){
            ll tmp = k;
            tmp -= (1<<i);
            tmp = tmp|((1<<i)-1);
            candidates.push_back(tmp);
        }
    }
    ll ans = -1;
    for(int i = 0; i < candidates.size(); i++){
        ll tmpsum = 0;
        for(int j = 0; j < n; j++){
            bool isOK = true;
            for(int bit = 0; bit < max_bit; bit++){
                if(!(candidates[i]&(1<<bit)) && a[j]&(1<<bit)){
                    isOK = false;
                    break;
                }
            }
            if(isOK){
                tmpsum += b[j];
            }
        }
        ans = max(ans,tmpsum);
    }
    cout << ans << endl;

}


Measured memory_bytes: 1920
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>


using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;


const ll mod=1000000007;


ll calc(int n, int x)
{
	vvll bp(n);

//printf("calc n=%d x=%d\n", n, x);
	for(auto&mbp:bp) mbp.assign(x+1, 0);

	bp[0].assign(x+1, 1);
	for(int i=1;i<n;i++)
	{
		bp[i][0]=1;
		for(int j=1;j<=x;j++)
		{
			bp[i][j]+=bp[i-1][j  ];
			bp[i][j]+=bp[i  ][j-1];
			bp[i][j]%=mod;
		}
	}
	return bp[n-1][x];
}


int main(void)
{
	int n, m;

	while(scanf("%d%d", &n, &m)==2)
	{
		ll ans=1;

		for(int i=2;i*i<=m;i++)
		{
			if(m%i==0)
			{
				int x;
				for(x=0;m%i==0;m/=i,x++)
				{
				}
				ans=(ans*calc(n, x))%mod;
			}
		}
		if(m>1) ans=(ans*calc(n, 1))%mod;
		printf("%lld\n", ans);
	}

	return 0;
}


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

int main(){

    string S,T;
    cin>>S>>T;
    vector<vector<int>> A(26),B(26);
    for(int i=0;i<S.size();i++){
        A.at(S.at(i)-'a').push_back(i);
        B.at(T.at(i)-'a').push_back(i);
    }
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    bool ans=true;
    for(int i=0;i<26;i++){
        for(int j=0;j<min(A.at(i).size(),B.at(i).size());j++){
            if(A.at(i).at(j)!=B.at(i).at(j)){
                ans=false;
                break;
        }
        }
    }
    if(ans) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
    


Measured memory_bytes: 3080
/**
*	created: 27.08.2020 23:16:47
**/
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
using ll = long long;
using P = pair<int,int>;
// #define endl '\n'
#define int long long
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,s,n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1ll << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;
template<typename T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<typename T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
template<typename T> T pow(T a, ll n) {T r(1); while(n) {if (n & 1) r *= a; a *= a; n >>= 1;} return r;}
struct faster_io {faster_io() {cin.tie(0); ios_base::sync_with_stdio(false);}} faster_io_;

// 重み付きUnionFind
struct UnionFind {
    vector<int> par, wei;
    UnionFind(int n) : par(n,-1), wei(n,0) {}
    int root(int x) {
        if (par[x] < 0) return x;
        int r = root(par[x]); wei[x] += wei[par[x]];
        return par[x] = r;
    }
    bool unite(int x, int y, int w) {
        w += weight(x); w -= weight(y);
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) {swap(x,y); w *= -1;}
        par[x] += par[y]; par[y] = x; wei[y] = w;
        return true;
    }
    bool same(int x, int y) {return root(x) == root(y);}
    int weight(int x) {root(x); return wei[x];}
    int size(int x) {return -par[root(x)];}
    int diff(int x, int y) {return weight(y) - weight(x);}
};

signed main() {
    int n, m; cin >> n >> m;
    UnionFind uf(n);
    rep(i,m) {
        int l, r, d; cin >> l >> r >> d; l--; r--;
        if (uf.same(l,r) && uf.diff(l,r) != d) {
            cout << "No" << endl;
            return 0;
        }
        else uf.unite(l,r,d);
    }
    cout << "Yes" << endl;
    return 0;
}

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

//Made with <3 by MinumCoklatPanas
typedef long long ll;
const ll INF = 1e9;
const ll INFF = 1e18;
const ll MAXN = 510;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double INFD = 1E9;
const double EPS = 1e-9;

bool isPrime[1000010];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    memset(isPrime,1,sizeof(isPrime));
    isPrime[1] = 0;
    vector<ll> primes;
    for (ll i = 1 ; i <= 1000000 ; i++) if (isPrime[i])
    {
        primes.push_back(i);
        for (ll j = i + i ; j <= 1000000 ; j += i)
            isPrime[j] = 0;
    }
    ll a,b;
    cin >> a >> b;
    ll fpb = __gcd(a,b);
    // cout << fpb << endl;
    vector<ll> factors;
    for (ll i = 1 ; i * i <= fpb ; i++) if (fpb % i == 0)
    {
        factors.push_back(i);
        if (i * i != fpb)
            factors.push_back(fpb / i);
    }
    ll ans = 1;
    for (ll i = 0 ; primes[i] * primes[i] <= fpb ; i++) if (fpb % primes[i] == 0)
    {
        ++ans;
        while (fpb % primes[i] == 0)
            fpb /= primes[i];
    }
    ans += (fpb >= 2);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5144
#include<bits/stdc++.h>
#define ULL unsigned long long
#define LL long long
#define Max 100005
#define mem(a,b) memset(a,b,sizeof(a));
#define pb push_back
#define mp make_pair
const LL mod=1e9+7;
const ULL base=131;
const LL LL_MAX=9223372036854775807;
using namespace std;
multiset<LL>s;
LL a[Max];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=0;i<n;i++){
        if(!s.size() || a[i]<=*s.begin()){
            s.insert(a[i]);
        }else{
            multiset<LL>::iterator t=s.lower_bound(a[i]);
            t--;
            s.erase(t);
            s.insert(a[i]);
        }
    }
    printf("%d\n",s.size());
    return 0;
}



Measured memory_bytes: 5760
import fractions
from functools import reduce

n, x = map(int, input().split())
xl = list(map(int, input().split()))
xl.append(x)
xl.sort()
xldiv = []
for i in range(n):
    xldiv.append(xl[i + 1] - xl[i])

print(reduce(fractions.gcd, xldiv))


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

using namespace std;

#define int long long
#define double long double 
const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;


typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef unordered_map<int,int> mii;
typedef unordered_map<char,int> mci;
typedef unordered_map<string,int> msi;

#define pb push_back
#define f first
#define s second 
 

void solve() {
    int n,k; cin>>n>>k;
    vi A(n);
    bool ans;
    for(int i=0;i<n;i++) cin>>A[i];
    vvb dp(k+1,vb(2,0)) ;
    //dp[0][0] = dp[0][1] = 0;
    for(int i=1;i<=k;i++) {
        ans = 1;
        for(int j=0;j<n;j++) {
            if(i>=A[j]) {
                ans = ans && dp[i-A[j]][1];
            }
        }
        dp[i][0] = 1 - ans;
        ans = 1;
        for(int j=0;j<n;j++) {
            if(i>=A[j]) {
                ans = ans && dp[i-A[j]][0];
            }
        }
        dp[i][1] = 1 - ans;
    }
    if(dp[k][0]) {
        cout<<"First\n";
    }
    else {
        cout<<"Second\n";
    }
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    //#ifdef LOCAL
      //  freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    //#endif

    int tc; tc=1;
    for (int t = 1; t <= tc; t++) {
        //cout << "Case #" << t  << ": ";
        solve();
    }
}

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

int main() {
	int q;
	priority_queue<int> q1;
	priority_queue<int, vector<int>, greater<int>> q2;
	cin>>q;
	ll sum=0;
	while(q--){
		int t, a, b;

   cin>>t;
   if(t==1)
   {
       cin>>a>>b;
       sum+=b;
       q1.push(a);
       q2.push(a);
       int x=q1.top(),y=q2.top();q1.pop(),q2.pop();
       sum+=x-y;
       q1.push(y);
       q2.push(x);
   }
   else cout<<q1.top()<<" "<<sum<<endl;
	}

	return 0;
}


Measured memory_bytes: 3828
import re
S,T=open(0)
S=S.replace('?','.')
T=T[:-1]
s=len(S)
t=len(T)
for i in range(s-t,-1,-1):
 if re.match(S[i:i+t],T):print((S[:i]+T+S[i+t:]).replace('.','a'));exit()
print('UNRESTORABLE')


Measured memory_bytes: 71692
#include <iostream>
#include <string>
using namespace std;
#define rep(i,q) for(int i = 0; (q) > i; i++)
int main(){
  int gen;cin>>gen;
  int a[4];
  a[0] = gen/1000;
  a[1] = gen/100 % 10;
  a[2] = gen/10 % 10;
  a[3] = gen % 10;
  string s;
  rep(i,8){
    int sm = a[0];
    s = to_string(a[0]);
    if(i / 4 == 0)sm -= a[1],s += "-";
    else sm += a[1],s += "+";
    s += to_string(a[1]);
    if((i / 2) % 2 == 0)sm -= a[2],s += "-";
    else sm += a[2],s += "+";
    s += to_string(a[2]);
    if(i % 2 == 0)sm -= a[3],s += "-";
    else sm += a[3],s += "+";
    s += to_string(a[3]);
    if(sm == 7){
      cout << s + "=7" << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;

const ll MOD=1000000007;

vector<ll> g[100005];
ll d[100005];
ll vis[100005];
ll dp[100005][2];

void bfs(){
	queue<ll> q;
	q.push(0);
	vis[0]=1;
	while(SZ(q)){
		ll t=q.front(); q.pop();
		for(auto i:g[t]){
			if(vis[i]==1)continue;
			q.push(i);
			vis[i]=1;
			d[i]=d[t]+1;
		}
	}
}

ll f(ll x, ll y){
	ll &r=dp[x][y];
	if(r>=0)return r;
	r=1;
	for(auto i:g[x]){
		if(d[i]<d[x])continue;
		r*=(f(i,0)+f(i,1)*(1-y));
		r%=MOD;	
	}
	return r;
}


int main(){FIN;
	ll n; cin>>n;
	ll u,v;
	fore(i,0,n-1){
		cin>>u>>v; u--; v--;
		g[u].pb(v);	
		g[v].pb(u);
	}
	bfs();
	mset(dp,-1);
	cout<<(f(0,0)+f(0,1))%MOD;
	return 0;
}

Measured memory_bytes: 15872
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr start, itr goal){ for(auto i = start; i != goal; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(10)
#define highest(x) (63 - __builtin_clzl(x))
struct combination{ vector<long> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } long C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

int main(){
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        int a;
        cin >> a;
        if(a % 2 == 1){
            cout << "first" << endl;
            return 0;
        }
    }
    cout << "second" << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  cin>>n;
  rep(j,n){
    string s;
    cin>>s;
    vi a(26,0);
    string ans="";
    ans+=s[0];
    a[s[0]-'a']++;
    for(i=1;i<s.size();i+=3)if(a[s[i+2]-'a']==0){
      if(s[i]=='-')ans=ans+s[i+2];
      else ans=s[i+2]+ans;
      a[s[i+2]-'a']++;
    }
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
//#define int long long

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

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

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

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

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

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s;
    cin >> s;
    int n = (int)s.size();
    REP(i, n)
    {
        if(i % 2 == 0 && s[i] == 'L' || i % 2 == 1 && s[i] == 'R')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

int cnt;


int main(){
    ll x, y;
    cin >> x >> y;
    cnt = 0;

    ll n = x;
    while (n <= y)
    {
        n = 2*n;
        ++cnt;
    }
    cout << cnt <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

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

  int n;
  cin >> n;

  vector<P> ts(n);  // <s, t>の配列
  for (int i = 0; i < n; i++) {
    int x, l;
    cin >> x >> l;

    int s = x - l;
    int t = x + l;
    ts[i] = P(t, s);
  }

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

  int ans = 0;
  int r = -1000000000; // 右端 
  for (int i = 0; i < n; i++) {
    if (r <= ts[i].second) {
      ans++;
      r = ts[i].first;
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
A = map(int, raw_input().split())
k = int(raw_input())

m = max(A)
idx = A.index(m)

for i in range(k):
    m *= 2

result = 0
for i in range(3):
    if i == idx:
        result += m
    else:
        result += A[i]
print(result)

Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
long long int n,k;
const long long int x=100000;
long long int a[x];
long long int dp[x+10];
long long int frog_jump(int i)
{
  long long int next=INT_MAX,ans=INT_MAX;
  if(i+1==n)
    return 0;
  if(dp[i]!=-1)
    return dp[i];
  for(int j=1;j<=k;j++)
  {
    if(i+j<=n-1)
    {
      next=abs(a[i]-a[i+j])+frog_jump(i+j);
      ans=min(ans,next);
      dp[i]=ans;
    }
  }
  
  return dp[i];
}
int main()
{
  long long int result;
  memset(dp,-1,sizeof(dp));
  cin>>n;
  cin>>k;
  for(int i=0;i<n;i++)
  	cin>>a[i];
  result=frog_jump(0);
  cout<<result<<endl;
}
  
      

Measured memory_bytes: 12944
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll X;
    cin>>X;
    cout<<(X>=30 ? "Yes" : "No")<<endl;
    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;

#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 0x20000000;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}


void execute()
{
    ll N;
    cin >> N;

    cout << 1000*((N+999)/1000)-N << endl; 
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define mp make_pair
#define timer ((double)clock() / CLOCKS_PER_SEC)
#define endl "\n"
#define spc " "
#define d1(x) cerr<<#x<<":"<<x<<endl
#define d2(x, y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl
#define d3(x, y, z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl
#define fast_io() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;

typedef long long int lli;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<double, double> dd;

const int N = (int)(1e6 + 5);
const int LOG = (int)(20);

int x, y, n;
char s[N];
map<char, int> m;

int main() {
	fast_io();
	// freopen("inp.in", "r", stdin);

	cin >> s + 1;
	n = strlen(s + 1);
	for(int i = 1; i <= n; i++)
		m[s[i]]++;
	if((m['W'] != 0 && m['E'] == 0) || (m['W'] == 0 && m['E'] != 0) || (m['N'] != 0 && m['S'] == 0) || (m['N'] == 0 && m['S'] != 0))
		cout << "No";
	else
		cout << "Yes";

}

Measured memory_bytes: 384
N = int(input())
count = 0
ans = 1
for i in range(1,N+1):
    tmp_count = 0
    tmp_i = i
    while(tmp_i%2==0):
        tmp_count+=1
        tmp_i /= 2
    if count < tmp_count:
        count = tmp_count
        ans = i
print(ans)


Measured memory_bytes: 2940
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc126_e

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

class Graph():

    def __init__(self):
        self.adjacency_dict = {}
    
    def add_vertex(self, v):
        self.adjacency_dict[v] = []

    def add_edge(self, v1, v2):
        self.adjacency_dict[v1].append(v2)
        self.adjacency_dict[v2].append(v1)

    def remove_edge(self, v1, v2):
        self.adjacency_dict[v1].remove(v2)
        self.adjacency_dict[v2].remove(v1)

    def remove_vertex(self,v):
        while self.adjacency_dict[v] != []:
            adjacency_vertex = self.adjacency_dict[v][-1]
            self.remove_edge(v, adjacency_vertex)
        del adjacency_vertex[v]

    def get_vertexes(self):
        return self.adjacency_dict.keys()

    def get_edges(self, v):
        return self.adjacency_dict[v]

    def print_graph(self):
        print(self.adjacency_dict)


n, m = map(int, input().strip().split())
xyz = [list(map(int, input().strip().split())) for _ in range(m)]

g = Graph()
for i in range(n):
    g.add_vertex(i)
for i in range(m):
    g.add_edge(xyz[i][0]-1, xyz[i][1]-1)

res = 0
reached_nodes = [0 for _ in range(n)]
for i in g.get_vertexes():
    if reached_nodes[i] == 1:
        continue
    res += 1
    reached_nodes[i] = 1
    q = [i]
    while len(q) > 0:
        u = q.pop()
        for v in g.get_edges(u):
            if reached_nodes[v] == 1:
                continue
            q.append(v)
            reached_nodes[v] = 1

print(res)


Measured memory_bytes: 54064
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	long x = sc.nextLong();
      	long k = sc.nextLong();
      	long d = sc.nextLong();
      	long ans;
      	x = Math.abs(x);
      	if(x/d > k){
          	ans = x - d*k;
        }else{
        	long e = x/d;
          	k -= e;
          	x -= e*d;
          	if(k%2 == 1) x = Math.abs(x-d);
          	ans = x;
        }
      	System.out.println(ans);
    }
}

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

using namespace std;

int main() {
  int K;
  int A,B;
  cin>>K;
  cin>>A;
  cin>>B;
  bool C=false;
  for(int i=A;i<=B;i++){
    if(i%K==0){C=true;}
  }
 if(C){
   cout<<"OK"<<endl;
 }else{
   cout<<"NG"<<endl;
 }
}


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

typedef long long ll;

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

    string s; cin >> s;
    int n = s.size();
    int ans = 1,uku = 1;
    for(int i=1;i<n;){
        if(uku==1){
            if(s[i]!=s[i-1]){
                ans++;
                i++;
            }else{
                if(i!=n-1) ans++;
                i+=2;
                uku = 2;
            }
        }else{
            ans++;
            i++;
            uku = 1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 720