akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(ll i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(ll i=int(m)-1; i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;


int main() {
  ll k; cin >> k;
  string s; cin >> s;

  if (s.size() <= k) {
    cout << s << "\n";
  }
  else {
    cout << s.substr(0, k) << "...\n";
  }
  return 0;
}


Measured memory_bytes: 3656
#include <cstdio>
#include <algorithm>

const int MN = 200005;
const int MM = 200005;

int N, M;
char s[MN];
char c1[MM][3], c2[MM][3];

int main() {
	scanf("%d%d", &N, &M);
	scanf("%s", s + 1);
	for (int i = 1; i <= M; ++i)
		scanf("%s%s", c1[i], c2[i]);
	int lb = 0, rb = 0;
	for (int i = M; i >= 1; --i) {
		if (*c2[i] == 'L') {
			if (s[lb + 1] == *c1[i]) ++lb;
			if (rb && s[N - rb + 1] == *c1[i]) --rb;
		}
		if (*c2[i] == 'R') {
			if (s[N - rb] == *c1[i]) ++rb;
			if (lb && s[lb] == *c1[i]) --lb;
		}
		if (lb + rb >= N) break;
	}
	printf("%d\n", std::max(N - lb - rb, 0));
	return 0;
}

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

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

const int mod =  1000000007;  //出力は (ans % mod + mod) % mod  (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60;


#define N_MAX 201010
ll f[N_MAX],rf[N_MAX];   
//f[n]  := n!
//rf[n] := (n!)^-1

ll modpow(ll a,ll b){    // aのb乗
    ll ans=1;
    while(b>0){
        if(b&1) ans=ans*a%mod;
        a=a*a%mod;
        b/=2;
    }
    return ans;
}

void init(){
    f[0] = 1;
    for(ll i = 1; i < N_MAX; i++){
        f[i] = (i * f[i-1]) % mod;
    }
    for(ll i = 0; i < N_MAX; i++){
        rf[i] = modpow(f[i],mod-2);
    }
}

ll com(ll n, ll k){
    //init();
    ll a = f[n];
    ll b = rf[k];
    ll c = rf[n-k];

    ll bc = (b * c) % mod;

    return ((a * bc) % mod);
}


int main()
{
    ll s; cin >> s;
    ll ans = 0;
    ll num = 1;
    init();
    while(s / num >= 3){
        ll n = s - num*3;
        ans += com(n+num-1,num-1);
        ans %= mod;
        num++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 6712
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);

#define debug(x) (#x " : " + to_string(x))
#define debug_cout(x) (cout << #x << " : " << to_string(x) << endl)
#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 rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair((a), (b));
using namespace std;
using ll = long long;
//#define int long long
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
constexpr int INF = (int)2e9;

/*****/

int main()
{
	ll L, R;
	cin >> L >> R;

	ll min = INF;
	for (ll i = L; i <= R; i++)
	{
		for (ll j = i + 1; j <= R; j++)
		{
			ll ret = (i * j) % 2019;

			chmin(min, ret);

			if (min == 0)
				break;
		}

		if (min == 0)
			break;
	}

	cout << min << endl;

	return 0;
}


Measured memory_bytes: 256
//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define CLR(x) memset(x,0,sizeof x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define MAX 1000000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f
typedef long long ll;
//orz yht
using namespace std;
string i_s(int x){
	if(x==0)
	return "0";
	string ret="";
	while(x){
		ret=ret+(char)(x%10+'0');
		x/=10;
	}
	reverse(ret.begin(),ret.end());
	return ret;
}
string add(string a,string b){
	if(a=="")
	a="0";
	if(b=="")
	b="0";
	if(a.length()<b.length())
	swap(a,b);
	while(b.length()<a.length()){
		b='0'+b;
	}
	for(int i=0;i<a.length();i++){
		a[i]=a[i]+(b[i]-'0');
	}
	bool big=false;
	for(int i=a.length()-1;i>=0;i--){
		if(big){
			a[i]++;
		}
		big=false;
		if(a[i]>'9'){
			a[i]=a[i]-10;
			big=true;
		}
	}
	if(big)
	a='1'+a;
	return a;
}
string mul(string a,string b){
	vector<int> va,vb;
	if(a=="0" || b=="0")
	return "0";
	string ans;
	for(int i=0;i<a.length();i++){
		va.push_back(a[i]-'0');
	}
	for(int i=0;i<b.length();i++){
		vb.push_back(b[i]-'0');
	}
	reverse(va.begin(),va.end());
	reverse(vb.begin(),vb.end());
	vector<int> res;
	res.clear();
	res.resize(1005);
	for(int i=0;i<a.length();i++){
		for(int j=0;j<b.length();j++){
			res[i+j]+=(va[i]*vb[j]);
		}
	}
	for(int i=0;i<1005;i++){
		if(res[i]>9){
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	for(int i=0;i<1005;i++){
		ans+=(res[i]+'0');
	}
	reverse(ans.begin(),ans.end());
	int k=0;
	while(ans[k]=='0'){
		k++;
	}
	ans=ans.substr(k);
	return ans;
}
bool is_prime(int n){
	if(n<2)
    return false;
    for(int i=2;i*i<=n;i++)
    if(n%i==0)
    return false;
    return true;
}
string s;
int l,r,ans;
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	cin>>s;
	l=0;
	r=s.length()-1;
	while(l<r){
		if(s[l]==s[r]){
			l++;
			r--;
			continue;
		}
		if(s[l]=='x'){
			l++;
			ans++;
			continue;
		}
		if(s[r]=='x'){
			r--;
			ans++;
			continue;
		}
		cout<<-1;
		return 0;
	}
	cout<<ans;
	//system("pause");
	return 0;
}

Measured memory_bytes: 512
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split(' ')))
    x = 0
    for i in a:
        x = x + i
    m = x / n
    t = 0
    for i in a:
        t = t + (i - m)**2
    t = t / n
    t = t**(1/2)
    print(t)


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

using namespace std;

int main()
{
	string s, out = "";
    getline( cin, s );
	
	for(int i = 0; i < s.size(); i++)
	{
		if((int)s[i] >= 65 && (int)s[i] <= 90)
			out += (int)s[i]+32;
		else if((int)s[i] >= 97 && (int)s[i] <= 122)
			out += (int)s[i]-32;
		else
			out += s[i];
	}
	cout << out << "\n";
	
	return 0;
}


Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_range(i, s, e) for (int i = (s); i < (int)(e); i++)
#define rep_rev(i, s, e) for (int i = (s)-1; i >= (int)(e); i--)
#define sort_vec(v) sort((v).begin(),(v).end())
typedef int64_t lint;
// lint mod = 998244353;

int app() {
  int n,m;
  cin>>n>>m;

  int sum=0;
  int a;
  rep(i,m){
    cin>>a;
    sum+=a;
  }

  return (n-sum<0)?-1:n-sum;
}

int main(){cout<<app()<<endl;return 0;}


Measured memory_bytes: 3640
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:isize,
    b:isize,
    }
    println!("{}",max(0,a-b))
}

Measured memory_bytes: 2076
#include <iostream>

using namespace std;

int main(void) {
	string str;
	cin >> str;
	bool pass = true;
	for (int i = 0; pass && i < 4; ++i) {
		int count = 0;
		for (int j = 0; pass && j < 4; ++j) {
			if (str[i] == str[j]) {
				++count;
			}
		}
		if (count != 2) {
			pass = false;
		}
	}
	if (pass) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
//author-micheal corleone
//the godfather
#include <bits/stdc++.h>
#include <set> 
#include<algorithm>
#include <set> 
#include<algorithm>
#define ll long long int
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define out(n) printf("%lld\n",n)
#define inf 100000000000000
#define endl "\n"
#define precise(x) fixed << setprecision(x) 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
const int MOD =1000000007;
#define f(i,a,n) for(int i=a;i<n;i++)
#define pb push_back
 
using namespace std;

bool sortcol( const vector<int>& v1, 
               const vector<int>& v2 ) { 
 return v1[1] < v2[1]; 
}
 ll mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}
 //ll power(ll x, ll y) 
//{ 
  //  ll temp; 
    //if( y == 0) 
     //   return 1; 
    //temp = power(x, y/2); 
    //temp=temp%MOD;
    //if (y%2 == 0) 
     //   return (temp%MOD)*(temp%MOD); 
    //else
      //  return (x%MOD)*(temp%MOD)*(temp%MOD); 
//} 
 
 
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
    if(n==1 || r==0)return 1;
  //  ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=((((ans * n)%MOD )*modinv(i,MOD))%mod);n--;sum+=ans;sum%=mod;}return sum;
}
 //diamond[2000005],ans[1000006];
 const int maxn=5e5+1000;
 
 
int main()
{
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
     ll t;
    // cin>>t;
   
     t=1;	
     for(ll testcase=0;testcase<t;testcase++)
    {
        ll i1,i2,k,j,j1,a1,i31,i3,j2,i5,i4,i6,i7,i,m,n;
        ll x,y,z;
        ll total=0,cnt=0;
        ll flag=0;
        y=0;
        ll res,res1,ans,res2,q,sum;
        ans=0,cnt=0;
        res1=0,res=0,sum=0;
        ll flag1=0;
        ll k1,k2,k3;
        k1=1,k2=0;
        k3=0;
        ll required,days,h,w;
        //cin>>n;
        
        //for(it=mp.begin();it!=mp.end(),it++)
        //{
        //	for(int i=0;i<it->second.size();i++) cout<<it->second[i]<<" ";
		//}
		string s1,s2;
		cin>>s1>>s2;
		x=s1.length()-s2.length();
		ans=INT_MAX;
		for(i=0;i<=s1.length()-s2.length();i++)
		{
			k1=0;
			k2=i;
			f(j,0,s2.length())
			{
				if(s1[k2]!=s2[j])
				{
					k1++;
				}
				k2++;
			}
			ans=min(ans,k1);
		}
		cout<<ans<<endl;
		
	
	
    }
}
	

Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 100005;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    COMinit();
    ll n,d;
    cin >> n;
    vector<ll> a(n+1),c(n+1,0);
    rep(i,n+1){
        cin >> a[i];
        c[a[i]]++;
        if (c[a[i]] == 2) d = a[i];
    }
    ll i1,i2,cnt = 0;
    rep(i,n+1){
        if (a[i] == d){
            if (cnt == 0){
                i1 = i;
                cnt++;
            }
            else i2 = i;
        } 
    }
    i2 = n-i2;
    rep(k,1,n+2){
        PRINT((COM(n+1,k)+MOD-COM(i1+i2,k-1))%MOD);
    }
}




Measured memory_bytes: 5120
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {

    static class Task {
        String name;
        Integer time;

        public Task(String name, Integer time) {
            this.name = name;
            this.time = time;
        }

        public Task() {
        }

        @Override
        public String toString() {
            return this.name+" "+this.time;
        }
    }

    static Queue<Task> queue = new LinkedList<Task>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] p1 = sc.nextLine().trim().split(" ");
        int n = Integer.parseInt(p1[0]);
        int p = Integer.parseInt(p1[1]);
        for (int i = 0; i < n; i++) {
            String[] split = sc.nextLine().trim().split(" ");
            queue.add(new Task(split[0], Integer.parseInt(split[1])));
        }
        int sum=0;
        while (!queue.isEmpty()){
            Task poll = queue.poll();
            if(poll.time<=p){
                sum+=poll.time;
                poll.time=sum;
                System.out.println(poll);
            }else{
                poll.time-=p;
                sum+=p;
                queue.add(poll);
            }
        }
    }
}


Measured memory_bytes: 108984
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
    int k,ans=1;
    cin>>k;
    if(k==4||k==6||k==9||k==10||k==14||k==21||k==22||k==25||k==26)ans++;
    else if(k==28||k==30)ans=4;
    else if(k==8||k==12||k==18||k==20||k==27)ans=5;
    else if(k==16)ans=14;
    else if(k==24)ans=15;
    else if(k==32)ans=51;
    cout<<ans;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
ans = ""

#Noneが0番目、Zが26番目の要素になる。
Alphabet = ["None","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

for char in S:
    char_position = Alphabet.index(char)
    added_num = char_position + N
    if added_num > 26:
        added_num = added_num % 26
    if added_num == 0:
        added_num = 26
    changed_char = Alphabet[added_num]
    ans = ans + changed_char

print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
//
// Created by karayuu on 2018-12-24.
//

int main() {
    while (true) {
        int h, w;
        cin >> h >> w;

        if (h == 0 && w == 0) {
            break;
        }

        for (int i = 1; i <= h; i++) {
            string s;
            for (int j = 1; j <= w; j++) {
                s += "#";
            }
            cout << s << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3180
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = 2e9;
const int MAX_N = 1;

int main() {
  int N, K; cin >> N >> K;
  if (N % K == 0) cout << 0 << endl;
  else cout << 1 << endl;
  return 0;
}


Measured memory_bytes: 256
a,b=map(int,input().split())

c=a&b&0b11111111111111111111111111111111
d=(a|b)&0b11111111111111111111111111111111
e=(a^b)&0b11111111111111111111111111111111
print(format(c,'032b'))
print(format(d,'032b'))
print(format(e,'032b'))



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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.14159265358979 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

void solve ( int test_case )
{
    int n , m ;
    cin >> n >> m ;

    if ( m == n )
    {
        cout << "Yes" ;
        R ;
    }

    cout << "No" ;
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=0 ; i < t ; i++ ) solve(i);
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner teclado = new Scanner(System.in);
		double X=teclado.nextDouble(),A=teclado.nextDouble();
		if(X<A) {
			System.out.println("0");
		}else {
			System.out.println("10");
		}

	}

}

Measured memory_bytes: 25172
from itertools import product
s = input()
ans = "0"
#opで+の候補生成
for op in product(["-", "+"], repeat=len(s)-1):
    
    op = list(op)
    op.append("")
    #op=('', '+')の場合，1+""+2+"+"+5になる
    if eval(''.join( a + b for a, b in zip(s, op))) ==7:
        print(''.join( a + b for a, b in zip(s, op))+"=7")
        exit()


Measured memory_bytes: 38512
#include<stdio.h>
#include<string.h>
int main(){
    char s[200000+1];
    char t[200000+1];
    int count=0;
    scanf("%s",s);
    scanf("%s",t);
    for(int i=0;i<strlen(s);i++){
        if(s[i]==t[i]){
            continue;
        }else{
            count=count+1;
        }
    }
    printf("%d\n",count);
}

Measured memory_bytes: 2120
#include <iostream>
#include <utility>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

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

int f(int x) {
  return ((x)*(x+1)*(x+2))/6;
}

const int INF = 1 << 28;
int adp[1000000];
int odp[1000000];
bool done[1000000] = {};
bool odan[1000000] = {};
vector<int> list;

int main()
{
  for(int i = 1; f(i) < 1000000; ++i) {
    list.push_back(f(i));
  }
  rep(i, 1000000) {
    adp[i] = INF;
    odp[i] = INF;
  }
  done[0] = true;
  adp[0] = 0;
  odan[0] = true;
  odp[0] = 0;
  for(auto v : list) {
    rep(i, 1000000 - v) {
      if(done[i]) {
        adp[i + v] = min(adp[i + v], adp[i] + 1);
        done[i + v] = true;
      }
      if(v&1 && odan[i]) {
        odp[i + v] = min(odp[i + v], odp[i] + 1);
        odan[i + v] = true;
      }
    }
  }

  int n;
  while(cin >> n, n) {
    cout << adp[n] << " " << odp[n] << endl;
  }

  return 0;
}

Measured memory_bytes: 10984
A,B,K = map(int,input().split())
List = []
for i in range(K):
    c = A + i
    d = B - i
    if((c in List) == False and c >= A and c <= B):
        List.append(c)
    if((d in List) == False and d >= A and d <= B):
        List.append(d)
List = sorted(List)
for i in List:
    print(i)

Measured memory_bytes: 38384
/*
 * zyrch - Rupanshu Yadav
 */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <utility>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <cassert>
#include <sstream>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL) 

#define forn(i,a,b) for (int i = (a); i < ll(b); ++i)
#define fo(i,a) forn(i,0,ll(a))
#define rforn(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define ro(i,a) rforn(i,0,a)
#define trav(a,x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

const ll INF = 1e18;

ll mod = 1000000007;
inline ll fast_expo(ll base,ll power,ll modulo=mod){
    base%=modulo;
    if (base<0) base+=modulo;
    ll x=base,cnt=power,ans=1;
    while(cnt){
        if (cnt&1) ans=(ans*x)%modulo;
        x=(x*x)%modulo;
        cnt>>=1;
    }
    return ans;
}

ll takemod(ll a, ll mo){
	a %= mo;
	if(a < 0) a+=mo;
	return a;
}

// if mod is prime
ll modinv(ll a, ll mo){
	return takemod(fast_expo(takemod(a,mo), mo-2, mo), mo);
}

//=========================CODE STARTS HERE=============================//

int main() {
	
	ll n, m;
	cin >> n >> m;
	
	cout << (n * (n - 1))/2 + (m * (m- 1))/2;
	
	return 0; 
}


Measured memory_bytes: 256
#include <stdio.h>
 
int main(void) {
    double max,min,now;
    scanf("%lf",&max);
    min=max;
    while(1) {
        if(scanf("%lf",&now)==-1)break;
        if(now<min)min=now;
        if(now>max)max=now;
    }
    printf("%f\n",max-min);
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int n, a, b;
ll h[114514];

bool is_ok(ll x){
	ll y=x;
	REP(i, n){
		ll tmp=h[i]-x*b;
		if(tmp>0){
			y-=(tmp-1)/(a-b)+1;
		}
	}
	return y>=0;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>a>>b;
	REP(i, n){
		cin>>h[i];
	}
	ll lb=0, ub=1e9;
	while(ub-lb>1){
		ll mid=(lb+ub)/2;
		if(is_ok(mid)){
			ub=mid;
		}
		else{
			lb=mid;
		}
	}
	cout<<ub<<'\n';
	return 0;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define INF (1<<20)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int main()
{
	string s;
	cin >> s;

	map<char, ll> m;
	
	ll s_size = s.size(),ans = 0;
	rep(i, s.size()) m[s[i]]++;

	rep(i, s.size()) {
		ans += s_size - m[s[i]];
		s_size--;
		m[s[i]]--;
	}
	cout << ans + 1<< endl;
	return	0;
}

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

using namespace std;

int a[107];
string s;
int ans=1e9;

int main() {
	cin>>s;
	int n=s.length();
	for(int i=0; i<n; i++) a[i]=s[i]-'0';
	for(int i=0; i<n; i++) {
		if (i<n-2) ans=min(ans, abs(a[i]*100+a[i+1]*10+a[i+2]-753));
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
import heapq


N = int(input())
C = list(input())
W = [i for i, c in enumerate(C) if c == 'W']
R = [-i for i, c in enumerate(C) if c == 'R']
if not W or not R:
    print(0)
else:
    heapq.heapify(W)
    heapq.heapify(R)
    res = 0
    while W[0] < -R[0]:
        i = heapq.heappop(W)
        j = heapq.heappop(R)
        heapq.heappush(W, -j)
        heapq.heappush(R, -i)
        res += 1
    print(res)

Measured memory_bytes: 90456
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


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

 vector<ll> a(n+2,0);
 vector<ll> d(n+2,0);
 for(ll i=1;i<=n;i++) cin>>a[i];
 for(ll i=1;i<=n;i++){
  if( a[i] < a[i-1] )  d[i]++;
  if( a[i] < a[i+1] )  d[i]++;
 }

 priority_queue<mp,vector<mp>,greater<mp> > q;
 for(ll i=1;i<=n;i++){
  if( d[i] == 0 ) q.push( mp( l-a[i] ,i ) );
 }
 ll res = 0;
 while(!q.empty() ){
  mp now = q.top();
  q.pop();
  ll nn = now.second;
  ll time = now.first;
  res = max( res , time );
  d[nn-1]--;
  d[nn+1]--;
  if( d[nn-1] == 0 ){
   q.push( mp(time + l-a[nn-1] , nn-1 ) );
  }
  if( d[nn+1] == 0 ){
   q.push( mp(time + l-a[nn+1] , nn+1 ) );
  }
 }
 cout<<res<<endl;

    return 0;
}



Measured memory_bytes: 5448
n = gets.chomp.split(" ").map(&:to_i)
x = gets.chomp.split(" ").map(&:to_i)

def gcd(a, b)
    if a < b
        a, b = b, a
    end
    r = a % b
    if r == 0
        return b
    end
    return gcd(r, b)
end

x.map!{|item|(item-n[1]).abs}.sort!
max=x[0]
(n[0]-1).times{|t|
    max = gcd(max,x[t+1])
}
puts max

Measured memory_bytes: 10240
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	
	public static final int X = 0;
	public static final int Y = 1;
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		doIt();
		//test();
	}
	public static void test(){
//		double pi = 3.141592;
		double t = 1 / Double.NEGATIVE_INFINITY;
		System.out.println(t);
		if(t == 0){
			System.out.println(Math.abs(t));
		}
//		System.out.println(pi);
//		pi = (double)Math.round(pi * 1000) / 1000;
//		System.out.println(pi);
	}
	
	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		for(int i = 0; i < n; i++){
			double[][] pos = new double[3][2];
			
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 2; k++){
					pos[j][k] = sc.nextDouble();
				}
			}
			//abとbcの傾きを求める
			double[] a = new double[2];

			for(int j = 0; j < 2; j++){
				a[j] = (pos[j + 1][Y] - pos[j][Y]) / (pos[j + 1][X] - pos[j][X]);
				//System.out.println(a[j]);
			}
			//それらの垂直を求める
			for(int j = 0; j < 2; j++){
				a[j] = -1 / a[j];
				//System.out.println("a[" + j + "] = " + a[j]);
			}
			//垂直二等分線の高さを求める
			double[] b = new double[2];
			double[][] pos2 = new double[2][2];
			for(int j = 0; j < 2; j++){
				//b = y - ax
				pos2[j][X] = (pos[j][X] + pos[j + 1][X]) / 2;
				pos2[j][Y] = (pos[j][Y] + pos[j + 1][Y]) / 2;
				b[j] = pos2[j][Y] - a[j] * pos2[j][X];
				//System.out.println("b[" + j + "] = " + b[j]);
			}
			double xp;
			double yp;
			if(Math.abs(b[1]) == Double.POSITIVE_INFINITY){
				xp = pos2[1][X];
				yp = a[0]*xp + b[0];
			}
			else if(Math.abs(b[0]) == Double.POSITIVE_INFINITY){
				xp = pos2[0][X];
				yp = a[1]*xp + b[1];
			}
			else{
				//xp = (b2 - b1) / (a1 - a2)
				xp = (b[1] - b[0]) / (a[0] - a[1]);
				yp = a[0] * xp + b[0];
				
			}
			double r = Math.sqrt(Math.pow(pos[0][X] - xp, 2) + Math.pow(pos[0][Y] - yp, 2));
			
			//xp,yp,rを丸める
			r = (double)Math.round(r * 1000) / 1000;
			
			//System.out.println(xp + " " + yp + " " + r);
			if(xp == 0){
				xp = Math.abs(xp);
			}
			if(yp == 0){
				yp = Math.abs(yp);
			}
			System.out.printf("%.3f %.3f %.3f\n", xp,yp,r);
//			if(i < n - 1){
//				System.out.print("\n");
//			}
		}
	}
}

Measured memory_bytes: 12000
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;

int main(void){
    double x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    cout << fixed << setprecision(8) << sqrt(pow(x2 - x1,2) + pow(y2 - y1,2)) << endl;
    return 0;
}


Measured memory_bytes: 3272
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int INF = 1<<30;

// DAME:
int main() {
    int h, w, wnum=0;
    cin >> h >> w;
    vector< vector<char> > s(h, vector<char>(w));
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cin >> s[i][j];
            if(s[i][j]=='.'){
                wnum++;
            }
        }
    }

    // TIPS: 幅優先探索BFS
    // queueの使い方
    vector< vector<int> > dist(h, vector<int>(w, INF));
    queue< pair<int, int> > que;

    dist[0][0] = 1;
    que.push(make_pair(0, 0));

    vector<int> dx{0, -1, 1, 0};
    vector<int> dy{-1, 0, 0, 1};

    while(!que.empty()){
        pair<int, int> cur = que.front();
        que.pop();
        int x = cur.first;
        int y = cur.second;
        // ここで行動を選択
        for(int dir=0; dir<4; ++dir){
            int nx = x+dx[dir];
            int ny = y+dy[dir];

            // 境界判定
            if(nx>=0 && nx<h && ny>=0 && ny<w){
                // 白マスかつ最短距離か判定
                if(s[nx][ny]=='.' && dist[x][y]+1 < dist[nx][ny]){
                    // 最短距離を更新
                    dist[nx][ny] = dist[x][y]+1;
                    // queueに追加
                    que.push({nx, ny});
                }
            }
        }
    }

    if(dist[h-1][w-1] == INF){
        // ゴールできない
        cout << -1 << endl;
        return 0;
    }

    cout << wnum-dist[h-1][w-1] << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n); for(int i = 0;i < (int)(n);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
int main(){
    int 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;

int main() {
  int N;
  string A,result;
  cin >> N;
  for (int i=0; i<N; i++) {
    cin >> A;
    if (A=="Y") {
      result = "Four";
      break;
    } else {
      result ="Three";
    }
  }
  cout << result;

}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<array>
#include<cmath>
#include<vector>
#include<utility>
#include<algorithm>
#include<ctype.h>
using namespace std;


int main() {
	int x, a, b;
	cin >> x >> a >> b;
	if (a>=b) {
		cout << "delicious" << endl;
	}
	else if (b-a<=x) {
		cout << "safe" << endl;
	}
	else {
		cout << "dangerous" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,i,j;
	cin>>n;
	if(n/10 == 9)
		cout<<"Yes"<<endl;
	else
	{
		if(n%10 == 9)
			cout<<"Yes"<<endl;
		else
		{
			cout<<"No"<<endl;
		}
	}
	return 0;
 }

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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void dfs(int cx, int cy, int c, vector<vector<int>> &cost, const vector<vector<bool>> &used, bool isFirst) {
    if (!isFirst && cost[cx][cy] <= c) return;
    cost[cx][cy] = c;
    int N = (int)cost.size();
    for (int i=0; i<4; ++i) {
        int nx = cx + dx[i], ny = cy + dy[i];
        if (nx < 0 || N <= nx || ny < 0 || N <= ny) continue;
        if (used[cx][cy]) dfs(nx, ny, c, cost, used, false);
        else dfs(nx, ny, c+1, cost, used, false);
    }
}

void solve() {
    int N;
    cin >> N;
    vector<int> p(N*N);
    for (int i=0; i<N*N; ++i) {
        cin >> p[i];
        --p[i];
    }

    vector<vector<int>> cost(N, vector<int>(N));
    vector<vector<bool>> used(N, vector<bool>(N, false));
    for (int i=0; i<N; ++i) {
        for (int j=0; j<N; ++j) {
            cost[i][j] = min({i, j, N-1-i, N-1-j});
        }
    }
    int res = 0;
    for (int i=0; i<N*N; ++i) {
        int x = p[i] / N, y = p[i] % N;
        res += cost[x][y];
        used[x][y] = true;
        dfs(x, y, cost[x][y], cost, used, true);
    }
    cout << res << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


Measured memory_bytes: 31984
while True:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
    except EOFError:
        break
    if x1 == x2:
        if y3 == y4:
            print('YES')
        else:
            print('NO')
        continue
    elif x3 == x4:
        if y1 == y2:
            print('YES')
        else:
            print('NO')
        continue
    p = (y2 - y1) / (x2 - x1)
    q = (y4 - y3) / (x4 - x3)
    EPS = 1e-9
    if -1.0 - EPS <= p * q <= -1.0 + EPS:
        print('YES')
    else:
        print('NO')

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

inline int read()
{
	int ret=0; char c=getchar();
	while(c<48||c>57)c=getchar();
	while(c>=48&&c<=57)ret=ret*10+c-48,c=getchar();
	return ret;
}

int n,s,d;

int main()
{
	n=read();
//	s=n-2; if(s%3==1)s-=2;
    
    if(n==3){
    	puts("2 63 5");///....
    	return 0;//exit(0) //wu
	}
    
	s=min(n-2,15000-(n&1));
	if(s%3==1)s-=2;
	d=n-s;
	for(int i=1; i<=s; ++i)printf("%d ",i*2);
	for(int i=1; i<=d; ++i)printf("%d ",i*6-3);
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

bool check(int m, vector<int> &A, vector<int>& F, int K){
	if(m < 0) return false;
	int N = A.size(), sum = 0;
	vector<int> B(N);
	
	for(int i = 0; i < N; i++){
		B[i] = m/F[i];
	}
	
	for(int i = 0; i < N; i++){
		if(B[i] < A[i]) sum += A[i] - B[i];
	}
	
	return sum <= K;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N, K, ans = 0;
	vector<int> A, F;
	
	cin>>N>>K;
	
	A.resize(N);
	F.resize(N);
	
	for(int i = 0; i < N; i++){
		cin>>A[i];
	}
	
	for(int i = 0; i < N; i++){
		cin>>F[i];
	}
	
	
	sort(F.begin(), F.end(), greater<int>());
	sort(A.begin(), A.end());
	
	int l = -1, h = INF, m;
	
	while(l+1 < h){
		m = (l+h)/2;
		
		if(check(m, A, F, K)){
			h = m;
		} else {
			l = m;
		}
	}
	
	cout<<h<<endl;
	
	return 0;
}

Measured memory_bytes: 4992
#include<cstdio>
#include<cstring>
#include<cstring>
using namespace std;
int main(){
	
	int n;
	scanf("%d",&n);
	
	for(int q = 0;q < n; q++){
		
		char str[1000] = {0};
		scanf("%s",str);
		
		char ans[1000] = {0};
		
		ans[0] = str[0];
		
		bool check[1280] = {0};
		
		check[str[0]] = 1;
		
		int x = 1;
		for(int i = 3; i < strlen(str); i+=3){
			
			if(check[str[i]] == 1)continue;
			check[str[i]] = 1;
			
			if(str[i-1] == '>'){
				ans[x] = str[i];
				x++;
			}
			else if(str[i-2] == '<'){
				for(int j = x;j > 0; j--)ans[j] = ans[j-1];
				ans[0] = str[i];
				x++;
			}
		}
		
		printf("%s\n",ans);
		
	}
	return 0;
}

Measured memory_bytes: 1016
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define BUF_SIZE 30

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

int get_int2(int *a1, int *a2) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d", a1, a2);
#else
#error
#endif
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %d", a1, a2, a3);
#else
#error
#endif
  return 0;
}

struct edge {
    int src;
    int dst;
    int weight;
};

#define EDGE_MAX 2000
#define VERTEX_MAX 1000
#define INF ((int64_t)0x01010101)

int main(void) {
    int vs, es, start;
    get_int3(&vs, &es, &start);
    struct edge edges[EDGE_MAX];

    int i, j;
    for(i = 0; i < es; i++) {
        int src, dst, w;
        get_int3(&src, &dst, &w);
        edges[i] = (struct edge){src, dst, w};
    }

    int min_dist[VERTEX_MAX];
    memset(min_dist, 0x01, sizeof(int)*VERTEX_MAX);
    min_dist[start] = 0;
    for(j = 0; j < vs; j++) {
        int flag = 0;
        for(i = 0; i < es; i++) {
            struct edge e = edges[i];
            if(min_dist[e.src] == INF) continue;
            int new = min_dist[e.src] + e.weight;
            if(min_dist[e.dst] > new) {
                min_dist[e.dst] = new;
                flag = 1;
            }
        }
        // there is negative loop
        if(j == (vs-1) && flag) {
            printf("NEGATIVE CYCLE\n");
            return 0;
        }
    }

    for(i = 0; i < vs; i++) {
        if(min_dist[i] >= INF) {
            printf("INF\n");
        } else {
            printf("%d\n", min_dist[i]);
        }
    }
    return 0;
}


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

int n;
long long W;
std::vector<long long> d[5];
int main()
{
	std::cin >> n >> W;

	long long fw;
	for (int i = 0; i < n; ++i) {
		long long w, v;
		std::cin >> w >> v;
		if (i == 0) {
			d[0].emplace_back(v);
			fw = w;
		}
		else
			for (int i = 0; i < 4; ++i)
				if (fw + i == w)
					d[i].emplace_back(v);
	}

	for (int i = 0; i < 4; ++i)
		std::sort(d[i].begin(), d[i].end(), std::greater<long long>());

	long long ans = 0;
	long long vi = 0, wi = 0;
	for (size_t i = 0; i <= d[0].size(); ++i) {
		if (i != 0) {
			vi += d[0][i - 1];
			wi += fw;
		}

		long long vj = 0, wj = 0;
		for (size_t j = 0; j <= d[1].size(); ++j) {
			if (j != 0) {
				vj += d[1][j - 1];
				wj += fw + 1;
			}

			long long  vk = 0, wk = 0;
			for (size_t k = 0; k <= d[2].size(); ++k) {
				if (k != 0) {
					vk += d[2][k - 1];
					wk += fw + 2;
				}

				long long vl = 0, wl = 0;
				for (size_t l = 0; l <= d[3].size(); ++l) {
					if (l != 0) {
						vl += d[3][l - 1];
						wl += fw + 3;
					}
					if (wi + wj + wk + wl <= W)
						ans = std::max(ans, vi + vj + vk + vl);
				}
			}
		}
	}

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


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

using namespace std;

int main()
{
	long long n, t, ti;
	cin >> n >> t >> ti;
	auto r = 0ll;
	for (int i = 1; i < n; i++)
	{
		long long cti;
		cin >> cti;
		r += min(t, cti-ti);
		ti = cti;
	}
	r += t;
	cout << r << endl;
	return 0;
}


Measured memory_bytes: 256
def resolve():
    from itertools import accumulate
    n = int(input())
    a = list(map(int, input().split()))
    b = list(accumulate(a))
    from collections import Counter
    c = Counter(b + [0])
    def calc(x): return x * (x - 1) // 2
    ans = 0
    for k, v in c.items():
        ans += calc(v)
    print(ans)


resolve()


Measured memory_bytes: 43152
n=int(input())
c1=0
c2=0
c3=0
ans=0
for i in range(n):
    s=input()
    if s[0]=="B" and s[-1]=="A":
        c1+=1
    if s[0]=="B" and s[-1]!="A":
        c2+=1
    if s[0]!="B" and s[-1]=="A":
        c3+=1
    for j in range(len(s)-1):
        if s[j]=="A"and s[j+1]=="B":
            ans+=1
if c1==0:
    ans+=min(n-1,min(c2,c3))
elif c1!=0:
    if c2+c3>0:
        ans+=c1+min(c2,c3)
    if c2+c3==0:
        ans+=c1-1
print(ans)

Measured memory_bytes: 9156
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef complex<double> Point;
typedef Point Vector;
typedef pair<Point, Point> Segment;
typedef Segment Line;
constexpr double EPS = (1e-9L);
double dot(const Point& p1, const Point& p2) { return (conj(p1) * p2).real(); }
double cross(const Point& p1, const Point& p2) { return (conj(p1) * p2).imag(); }
constexpr bool eq(double a) { return abs(a) < EPS; }
Point project(Segment s, Point p) {
	Vector base = s.fi - s.se;
	double r = dot(p - s.fi, base) / norm(base);
	return s.fi + base * r;
}
Point reflect(Segment s, Point p) { return p + (project(s, p) - p) * 2.0; }
int ccw(const Point& p1, const Point& p2, const Point& p3) {
	Point a = p2 - p1, b = p3 - p1;
	if (cross(a, b) > EPS) return 1;
	if (cross(a, b) < -EPS) return -1;
	if (dot(a, b) < -EPS) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
bool intersect(Point &p1, Point &p2, Point &p3, Point &p4) {
	return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
			ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
bool intersect(Segment &s1, Segment &s2) {
	return intersect(s1.fi, s1.se, s2.fi, s2.se);
}
double getDistance(Point &a, Point &b) { return abs(a - b); }
double getDistanceLP(Line &l, Point &p) {
	return abs(cross(l.se - l.fi, p - l.fi) / abs(l.se - l.fi));
}
double getDistanceSP(Segment &s, Point &p) {
	if(dot(s.se - s.fi, p - s.fi) < 0.0) return abs(p - s.fi);
	if(dot(s.fi - s.se, p - s.se) < 0.0) return abs(p - s.se);
	return getDistanceLP(s, p);
}
double getDistance(Segment &s1, Segment &s2) {
	if(intersect(s1, s2)) return 0.0;
	return min(min(getDistanceSP(s1, s2.fi), getDistanceSP(s1, s2.se)),
				min(getDistanceSP(s2, s1.fi), getDistanceSP(s2, s1.se)));
}
int main() {
	cout << setprecision(10) << fixed;
	int q; cin >> q;
	Segment s1, s2;
	double x1, y1, x2, y2, x3, y3, x4, y4;
	rep(i, 0, q) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		s1 = mp(Point(x1, y1), Point(x2, y2));
		s2 = mp(Point(x3, y3), Point(x4, y4));
		P(getDistance(s1, s2));
	}
	return 0;
}

Measured memory_bytes: 3356
#include<bits/stdc++.h>
using namespace std;
int ara[100005];
int main()
{
    int n,submit,i,x,cor=0,penal=0;
    string s;
    cin>>n>>submit;
    for(i=1;i<=submit;i++)
    {
        cin>>x>>s;
        if(ara[x]==-1)
            continue;
        if(s=="WA")
            ara[x]++;
        if(s=="AC" && ara[x]!=-1)
        {
            cor++;
            penal+=ara[x];
            ara[x]=-1;
        }
    }
    cout<<cor<<' '<<penal<<endl;
    return 0;
}


Measured memory_bytes: 640
#include <stdio.h>

int main(void)
{
	int a, b;
	
	scanf("%d %d", &a, &b);
	
	if (a < b) {
		puts("a < b");
	} else if (a > b) {
		puts("a > b");
	} else {
		puts("a == b");
	}
	
	return 0;
}

Measured memory_bytes: 580
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#ifndef LOCAL
#define endl '\n'
#endif

const int mod = 1e9 + 7;

int pwr(int a,int b) {
	int ans = 1;
	while(b) {
		if(b & 1) ans = (ans * 1LL * a) % mod;
		a = (a * 1LL * a) % mod;
		b >>= 1;
	}
	return ans;
}

void solve() {
	int n;
	cin >> n;
	ll s = 0;
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= n; j++) {
			for(int k = 1; k <= n; k++) {
				s += __gcd(__gcd(i, j), k);
			}
		}
	}
	cout << s;
}

int main() {
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	// cin >> t;
	t = 1;
	for(int tt = 1; tt <= t; tt++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 3664