akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <algorithm>
using namespace std;
struct point
{
    long long x, h;
} p[200001];
bool cmp(point const &p1, point const &p2)
{
    return p1.x < p2.x;
}
int main()
{
    // 读入数据
    long long N, D, A;
    scanf("%lld%lld%lld", &N, &D, &A);
    D <<= 1; // 先将半个宽度乘2使之成为左右区间宽度
    for (int i = 1; i <= N; i++)
    {
        scanf("%lld%lld", &p[i].x, &p[i].h);
    }

    sort(p + 1, p + N + 1, cmp); // 按坐标升序

    long long tmp = 0;            // 炸弹伤害
    long long hurt[200001] = {0}; // 记录每个点的伤害
    long long ans = 0;            // 记录答案
    for (int i = 1; i <= N; i++)  // 循环处理每个Monster
    {
        p[i].h -= tmp;  // 先减去上几次投弹的伤害
        if (p[i].h > 0) // 第i个还没死，考虑继续炸
        {
            long long n = (p[i].h + A - 1) / A; // 至少还需要炸的次数
            long long h = n * A;                // 本次投弹伤害
            tmp += h;                           // 更新伤害
            ans += n;                           // 更新答案

            long long l = i, r = N + 1; // 二分查找，寻找轰炸点使得i恰好在爆炸范围的左端
            while (l < r - 1)
            {
                long long mid = (l + r) >> 1;
                if (p[mid].x - D <= p[i].x) // 更新后能否炸到i
                    l = mid;
                else
                    r = mid;
            }
            hurt[l] += h; // 最终在l处投弹，记录该处伤害
        }
        tmp -= hurt[i]; // 处理完第i个，轰炸区间向右移动，不再计算i点投弹所产生的伤害
    }

    printf("%lld", ans); // 输出答案
    return 0;
}

Measured memory_bytes: 4864
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define lf long double
#define vi vector<int>
#define vl vector<long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define in insert
#define all(x) x.begin(),x.end()
#define zapp ios::sync_with_stdio(false);cin.tie(0)
const int MAXN = 1e5 + 5;

int main()
{
	zapp;
	ll n, i;
	cin >> n;
	vl a(n);
	ll sum = 0;
	map<ll, ll> mp;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
		sum += a[i];
		mp[a[i]]++;
	}
	ll q;
	cin >> q;
	while (q--)
	{
		ll b, c;
		cin >> b >> c;
		if (mp.find(b) != mp.end())
		{
			sum -= b * mp[b];
			sum += c * mp[b];
			mp[c] += mp[b];
			mp.erase(b);
		}
		cout << sum << "\n";
	}


	return 0;
}



Measured memory_bytes: 7852
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifndef STOP_DEBUG
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

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

template <typename T> lint gcd(T a, T b) {return b?gcd(b, a%b):a;}
template <typename T> lint lcm(T a, T b) {return a * b / gcd(a, b);};
template <typename T> bool chmax(T &a, const T& b) {if (a < b) {a = b;return true;}return false; }
template <typename T> bool chmin(T &a, const T& b) {if (a > b) {a = b;return true;}return false; }
struct IoSetup{
    IoSetup(){
      ios::sync_with_stdio(false);
      cin.tie(0);
      cout << fixed << setprecision(20);
      cerr << fixed << setprecision(20);
    }
} IoSetup;

int main() {
  int n, k; cin >> n >> k;
  cout << n - k + 1 << '\n';
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define ALL(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 99999999999
#define PRINT(var) std::cout<<#var"= "<<var<<std::endl

using namespace std;
typedef long long  int ll;

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

ll m;

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

  vector<ll> a(m+1);
  vector<ll> b(m+1);

  REP(i,m)cin >>a[i+1];
  ll num=0;
  ll index=1;
  while(1){
    if(b[index]==0){
      b[index]++;
      index=a[index];
      num++;
    }else{
      break;
    }
    if(index==2){
      cout << num <<endl;
      return 0;
    }
  }


  cout <<-1<<endl;
  return 0;
}

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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

ll mpow(ll a,ll b){
    ll res=1;
    //a%=mod;
    while(b){
    	if(b%2) res=res*a; //%mod;
		a=a*a; //%mod;
		b/=2;
	}
	return res;
}

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

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

void solve(){
	//code
	int n;
	cin>>n;
	int l[n];
	for(int i=0;i<n;i++)
		cin>>l[i];
		
	sort(l,l+n);
	
	int count=0;	
	for(int i=0;i<n-2;i++){
		for(int j=i+1;j<n-1;j++){
			for(int k=j+1;k<n;k++){
				if(l[i]<l[j]+l[k] && l[j]<l[i]+l[k] && l[k]<l[i]+l[j])
					count++;
				else
					break;
			}
		}
	}
	cout<<count;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3620
X,Y = map(int, input().split())
import sys

if X==1 and Y==1:
    print("1000000")
    sys.exit()

ans = 0
if X == 1:
    ans += 300000
if X == 2:
    ans += 200000
if X == 3:
    ans += 100000

if Y == 1:
    ans += 300000
if Y == 2:
    ans += 200000
if Y == 3:
    ans += 100000

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[100009];
int main()
{

    int a, b , c;
    cin >> a >> b >> c;
    swap(a,b);
    swap(a,c);
    cout << a << " " << b << " " << c;


    return 0;
}


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

int main()
{
    vector<int> a(3);
    for (int i = 0; i < 3; i++)
        cin >> a[i];

    sort(a.begin(), a.end());
    if (a[2] == a[0] + a[1])
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 3624
// in the name of GOD
#include <bits/stdc++.h>
#define  S second
#define  F first
#define pb push_back
#define sz(cp) 1LL*cp.size()
#define tm are_you_now_tm_is_define_?
#define ta(c) c-'a'+1 
//#define int long long
using namespace std;
typedef long long ll ;
typedef long double ld ;
typedef pair < ll , ll > pii ;
const int maxn = 310 ;
ll ent[maxn][maxn] , mod , n , k , part[maxn][maxn] , dp[maxn][maxn] ;

inline ll _s(ll i){
	return i % mod ;
}
inline ll _z(ll i , ll j){
	return i * j % mod ;
}


int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin >> n >> k >> mod ;
	for(int y = 0 ;  y < maxn;  y++){
		ent[0][y] = ent[y][y] = 1 ;
		for(int x = 1 ; x < y ; x++)
		ent[x][y] = _s(ent[x-1][y-1]+ent[x][y-1]) ;
	}
	for(int y = 0 ; y <= k ; y++)
	part[0][y] =  y+1 , dp[0][y] = 1 ;
	for(int _n = 1 ; _n <= n ; _n++)
	for(int _k = 1 ; _k <= k ; _k++){
		part[_n][_k] = part[_n][_k-1] ;
		for(int id = 1 ; id <= _n ; id++){
			ll hel = _z(ent[id-1][_n-1],_z(part[id-1][_k-1],dp[_n-id][_k])) ;
			dp[_n][_k] = _s(dp[_n][_k]+hel) ;
		}
		part[_n][_k] = _s(part[_n][_k] + dp[_n][_k]) ;
		//cout << _n << ' ' << _k << ' ' << dp[_n][_k] << endl ;
	}
	cout << dp[n][k] ;
	return 0 ;
}



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

using namespace std;

int N,M;
int es[50][50] = {{0}};
int memo[50];
int check(int s,int g){
	// cout << s << " " << g << endl;
	if(s==g)return true;
	if(memo[s])return 0;
	memo[s] = 1;
	int ret = 0;
	for(int i = 0;i < N;i++){
		if(es[s][i])ret += check(i,g);
	}
	return ret;
}

int main(){
	int a,b;
	cin>>N>>M;
	for(int i = 0;i < M;i++){
		cin>>a>>b;
		a--;b--;
		es[a][b] = 1;
		es[b][a] = 1;
	}
	int ans = 0;
	for(int i = 0;i < N;i++){
		for(int j = i+1;j < N;j++){
			if(!es[i][j])continue;
			es[i][j] = 0;
			es[j][i] = 0;
			fill_n(memo,50,0);
			if(!check(i,j))ans++;
			es[i][j] = 1;
			es[j][i] = 1;
		}
	}
	cout << ans << endl;
}

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

int main()
{
    double x;
    // scanf("%d", &x);
    cin >> x;
    // printf("%d\n", x * x * x);
    cout << 2 * x * 3.1415926535 << endl;
}

Measured memory_bytes: 3788
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct io { io() { ios::sync_with_stdio(false); cin.tie(0); } };
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;


signed main(void) 
{
    string s;
    cin >>s;
    rep(i, s.size()) {
        if (i % 2 == 0 && s[i] == 'L'){
            mes("No");
            re0;
        }
        if (i % 2 == 1 && s[i] == 'R'){
            mes("No");
            re0;
        }
    }
    mes("Yes");
    
    
    
    
    

}


Measured memory_bytes: 3604
/* ex 3-2
    kas056 */
#include <stdio.h>
int main(void){
    int N , remain;
 
    // Nの読み込み
    scanf("%d", &N);
    //余り(remain)で考える
    remain = N % 10;//以下条件によって場合分け（「または」を使うとき）
    //remainが2,4,5,7,9の場合
    if (remain==2 || remain==4 || remain==5 || remain==7 || remain==9){
        printf("hon\n");
    }
    //remainが0,1,6,8の場合
    else if (remain==0 || remain==1 || remain==6 || remain==8){
        printf("pon\n");
    }
    //remainが3の場合
    else{
        printf("bon\n");
    }
    return 0;
}

Measured memory_bytes: 1620
#include <stdio.h>

int main(void){
  int n, i, count;
  int s[64];
  count = 0;

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    scanf("%d", &s[i]);
    if (s[i] != i + 1)
      count++;
  }
  if (count == 0 || count == 2)
    printf("YES");
  else
    printf("NO");

    return 0;

}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
long long mod = 1000000007;
long long modpow(long long m,long long n){
    long long res = 1;
    if(n > 0){
        res = modpow(m,n / 2);
        if(n % 2 == 0){
            res = (res * res) % mod;
        }
        else{
            res = (((res * res) % mod) * m) % mod;
        }
    }
    return res;
}
ll fac[200001];
ll conbi(ll a,ll b){//aCbをmodで割ったあまりを求める
  ll res = fac[a];
  res *= modpow(fac[b],mod - 2),res %= mod;
  res *= modpow(fac[a - b],mod - 2),res %= mod;
  return res;
}
int main(){
  fac[0] = 1;
  for(int i = 1;i <= 200000;i++){
    fac[i] = fac[i - 1] * i;
    fac[i] %= mod;
  }
  ll n,m;
  cin >> n >> m;
  map<ll,ll> insuu;
  for(int i = 2;i <= sqrt(m);i++){
    while(m % i == 0){
      insuu[i]++;
      m /= i;
    }
  }
  if(m > 1)insuu[m]++;
  ll res = 1;
  for(auto i:insuu){
    res *= conbi(i.second + n - 1,i.second);
    res %= mod;
  }
  cout << res << endl;
}

Measured memory_bytes: 5268
using System;

namespace AtCoderBegin
{
    class Program
    {
        static void Main(string[] args)
        {
            int temp = int.Parse(Console.ReadLine());
            if (temp < 30)
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
        }
    }
}


Measured memory_bytes: 27412
n = int(input())
a = [None]*2
a[0] = list(map(int,input().split()))
a[1] = list(map(int,input().split()))

dp = [[0]*n for i in range(2)]
dp[0][0] = a[0][0]

for i in range(n):
    if i == 0:
        dp[1][i] = dp[0][i]+a[1][i]
    else:
        dp[0][i] = dp[0][i-1]+a[0][i]
        dp[1][i] = max(dp[0][i],dp[1][i-1])+a[1][i]

print(dp[1][n-1])


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long l;
int main(){
    l a,b,x=1,vx=0,z=0;
    cin>>a>>b;
    l c[b],d[b],y[b],e[b],f[b];
    for(l i=0;i<b;i++){
        cin>>c[i]>>d[i];
        y[i]=c[i];
    }
    sort(y,y+b);
    for(l i=0;i<b;i++){
        vx=0;
        for(l j=0;j<b;j++){
            if(y[b-1]>=d[j]){
                e[z]=c[j];
                f[z]=d[j];
                y[z]=e[z];
                z++;
                vx=1;
            }
        }
        sort(y,y+z);
        y[b-1]=y[z-1];
        x+=vx;
        for(l j=0;j<z;j++){
            c[j]=e[j];
            d[j]=f[j];
        }
        z=0;
        if(vx==0) break;
    }
    cout<<x<<endl;
}


Measured memory_bytes: 4096
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62



def solve(K: int, S: str):
    if len(S) <= K:
        print(S)
    else:
        print(S[:K]+'...')
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(K, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9472
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stdio.h>
#include <queue>
#include <cmath>
#include <utility>
#include <map>

using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)

int i, j, k;

void add(vector<int>& A, int p) {
	if (p >= A.size()) {
		A.push_back(1);
		return;
	}
	if ( A[p]== 0) {
		A[p] = 1;
		return;
	}
	if (A[p] == 1) {
		A[p] = 0;
		add(A, p + 1);
	}
}

int main() {
	int N;
	vector<int> S;
	cin >> N;
	int n = abs(N);

	for (i = 0; n >1; ++i) {
		if (n % 2 == 1) {
			S.push_back(1);
		}
		else
		{
			S.push_back(0);
		}
		n /= 2;
	}
	S.push_back(1);

	if (N == 0) {
		cout << 0;
		return 0;
	}
	if(N > 0){
		for(i=1;i<S.size();i+=2){
			if (S[i] == 1)
				add(S, i + 1);
		
		
			
		}
		for(i=S.size()-1;i>=0;i--)
			cout << S[i];
		
		return 0;
	}
	else {
		for (i = 0; i < S.size(); i += 2) {
			if (S[i] == 1)
				add(S, i + 1);



		}
		for (i = S.size() - 1; i >= 0; i--)
			cout << S[i];

		return 0;


	}



	return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define ll long long

using namespace std;

inline ll read()
{
    ll x=0,f=1;char ch = getchar();
    while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
    while (isdigit(ch)) {x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
    return x*f;
}

const int maxn = 4010;

int b[maxn],w[maxn];
int tmp,tmp1;
int n,m;
int posb[maxn];
int posw[maxn];
int f[maxn][maxn];
int g[maxn][maxn],g1[maxn][maxn];

int main()
{
  //freopen("magolor.in","r",stdin);
  //freopen("magolor.out","w",stdout);
  n=read();
  for (int i=1;i<=2*n;i++)
  {
      char s[10];
  	  scanf("%s",s+1);
  	  int x=read();
      for (int j=i;j<=n*2;j++)
        if (s[1]=='B')
        {
        	g[j][x-1]++;
        	posb[x]=i;
        }
        else
        {
            g1[j][x-1]++;
            posw[x]=i;
        }
  }
  for (int i=1;i<=2*n;i++)
    for (int j=n;j>=0;j--) g[i][j]+=g[i][j+1],g1[i][j]+=g1[i][j+1];
  //for (int i=1;i<=2*n;i++)
  //  for (int j=1;j<=n;j++) cout<<i<<" "<<j<<" "<<g[i][j]<<endl;
  memset(f,127/3,sizeof(f));
  f[0][0]=0;
  for (int i=0;i<=n;i++)
    for (int j=0;j<=n;j++) 
      {
      	 if (i==0 && j==0) continue;
      	 if (i>0) f[i][j]=min(f[i][j],f[i-1][j]+g[posw[i]-1][j]+g1[posw[i]-1][i]);
		 if (j>0) f[i][j]=min(f[i][j],f[i][j-1]+g1[posb[j]-1][i]+g[posb[j]-1][j]);
      }
   //for (int i=0;i<=n;i++)
    //  for (int j=0;j<=n;j++)
      //  cout<<i<<" "<<j<<" "<<f[i][j]<<endl;
    cout<<f[n][n];
  return 0;
}


Measured memory_bytes: 188160
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define push_back pb
#define int long long int
int32_t main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
	while (t--)
	{
		int n, x, t;
		cin >> x >> n >> t;
		int tr = ceil((1.0 * x) / n );
		cout << tr*t;
	}
	return 0;
}

Measured memory_bytes: 3736
inputStr = input()
numList = inputStr.split(' ')
numList = [int(x) for x in numList]

#print('a: ',numList[0])
#print('b: ',numList[1])

if numList[0]==numList[1]:
    print('a == b')
elif numList[0]>numList[1]:
    print('a > b')
elif numList[0]<numList[1]:
    print('a < b')

Measured memory_bytes: 7624
import java.io.*;
import java.util.*;

class Main {
	public static void main(String[] $) {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		long N=sc.nextLong();
		long X=sc.nextLong();
		long M=sc.nextLong();
		long ans=0;
		int[] vis=new int[(int)M];
		long[] pre=new long[(int)M];
		Arrays.fill(vis, -1);
		int p=0;
		while (N-->0) {
			vis[(int)X]=p++;
			pre[(int)X]=ans;
			ans+=X;
			X=X*X%M;
			if (vis[(int)X]!=-1) {
				int T=p-vis[(int)X];
				ans+=N/T*(ans-pre[(int)X]);
				N%=T;
			}
		}
		System.out.println(ans);
	}
	
	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}


Measured memory_bytes: 36828
N = int(input())

X = list(map(int,input().split()))

X_c = X.copy()

X_c.sort()

#print (X_c)
#print (N//2)


bh = X_c[(N//2)-1]
fr = X_c[N//2]

#print (bh)
#print (fr)


for i in X:

    if i < fr:
        print (fr)
    else:
        print (bh)

    
    


Measured memory_bytes: 25472
#include<iostream>
using namespace std;
 
struct Human{
  bool a,b,c;
  Human(){
    a = b = c = false;
  }
};
 
int main(){
 
    int n,x,y,z,tmp,count=0;
 
    cin >> n;
 
    Human hu[n+1];
 
    cin >> x;
 
    for(int i=0;i<x;i++){
      cin >> tmp;
      hu[tmp].a = true;
    }
 
    cin >> y;
 
    for(int i=0;i<y;i++){
      cin >> tmp;
      hu[tmp].b = true;
    }
 
    cin >> z;
 
    for(int i=0;i<z;i++){
      cin >> tmp;
      hu[tmp].c = true;
    }
 
    for(int i=1;i<n+1;i++){
      if(!hu[i].c || (hu[i].a && !hu[i].b) ){
        continue;
      }
      count++;
    }
 
    cout << count << endl;
 
 
 
 
    return 0;
}

Measured memory_bytes: 3092
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	char str[1024];
	int cnt = -1;
	int a = 0,b = 0;
	while(scanf("%s",str),true){
		if(++cnt % 3 != 0){
			(str[0] == 'A') ? a++ : b++;
			printf("%d %d\n",a,b);
			a = 0,b = 0;
		}
		else if(cnt != 0){
			if(a > b)a++;
			else b++;
			if(str[0] == '0'){
				printf("%d %d\n",a,b);
				break;
			}
			printf("%d %d\n",a,b);
			a = 0,b = 0;
		}
		int len = strlen(str);
		for(int i = 1; i < len; i++){
			(str[i] == 'A') ? a++ : b++;
		}
	}
	return 0;
}

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

using namespace std;

int n, s;
int dp[3010];
int ans = 0;
const int MOD = 998244353;

int add(long long a, long long b){
    return (a + b) % MOD;
}

int mul(long long a, long long b){
    return (a * b) % MOD;
}

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

    for(int i = 1; i <= n; i++){
        int x;
        scanf("%d", &x);
    
        for(int tmp = s; tmp > x; tmp--){
            dp[tmp] = add(dp[tmp], dp[tmp - x]);
        }

        dp[x] = add(dp[x], i);

        ans = add(ans, mul(dp[s], n - i + 1)); dp[s] = 0;
    }

    printf("%d\n", ans);
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream&o,const pair<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
mt19937 rnd(random_device{}());

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
V<ll>fac,rfac; void setFac(int n,int mod){fac=rfac=V<ll>(++n);fac[0]=1;FOR(i,1,n)fac[i]=fac[i-1]*i%mod;rfac[n-1]=modInv(fac[n-1],mod);FORR(i,n-1,1)rfac[i-1]=rfac[i]*i%mod;}

ll randInt(ll l,ll r){return uniform_int_distribution<ll>(l,r)(rnd);}
double randDouble(double l,double r){return uniform_real_distribution<double>(l,r)(rnd);}
void dout(double d){printf("%.12f\n",d);}

const double PI = acos(-1);
const double EPS = 1e-10;
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7; //998244353;

ll k, x, y, px, py;
V<pll> ans;
pll _f(ll a, ll b){
  ll d = a+b;
  if(d==k) return mp(a, b);
  if(d>=k*2 || d%2) return mp(min(a, k), k-min(a, k));
  return mp(d/2, -k+d/2);
}
pll f(ll a, ll b){
  bool x, y, z;
  if(x=a<0) a *= -1;
  if(y=b<0) b *= -1;
  if(z=a<b) swap(a, b);
  auto p = _f(a, b);
  if(z) swap(p.fi, p.se);
  if(y) p.se *= -1;
  if(x) p.fi *= -1;
  return p;
}
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> k >> x >> y;
  if((x+y)%2 && k%2==0){
    cout << -1 << "\n";
    return 0;
  }
  while(x!=px || y!=py){
    auto p = f(x-px, y-py);
    px += p.fi;
    py += p.se;
    ans.pb({px, py});
  }
  cout << sz(ans) << "\n";
  for(auto p:ans) cout << p.fi << " " << p.se << "\n";
}

Measured memory_bytes: 5868
#include <iostream>
#include <limits.h>
#include <string>
using namespace std;

int main(void){
    long long n, m;
    cin >> n >> m;
    if (n == 1) {
        if (m == 1) cout << 1;
        else if (m == 2) cout << 0;
        else cout << m - 2;
    } else if (n == 2) cout << 0;
    else {
        if (m == 1) cout << n - 2;
        else if (m == 2) cout << 0;
        else cout << (m - 2) * (n - 2);
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const int INF = numeric_limits<int>::max();

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

int main()
{
    int n; cin >> n;
    cout << floor(n/3) << endl;
    return 0;
}


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

int main(){
  string S;
  cin >> S;
  int N=S.size();
  for(int i=0;i<=7;i++){
    string T=S;
    T.erase(i,N-7);
    if(T=="keyence"){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
#define fbo find_by_order
#define ook order_of_key

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 122)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 122)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 122)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1,p2;
    p1 = mp(l1,r1); p2 = mp(l2,r2);
    if(p1>p2)swap(p1,p2);
    if(p2.fi <= p1.se)return true;
    else return false;
}
ll quickpow (ll num1, ll num2, ll MOD){
    if(num2==0)return 1;
    else if(num2==1)return num1;
    else{
        ll temp = quickpow (num1,num2/2,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2%2==1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return quickpow (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/__gcd(num1,num2))*num2;}
// end of Template
set<int> s;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        int temp; cin>>temp;
        s.insert(temp);
    }

    if(s.size() == n)cout<<"YES\n";
    else cout<<"NO\n";
}


Measured memory_bytes: 9600
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

bool my_lt(string s, string t){
  int l;
  bool answer;
  l = min(s.size(), t.size());
  
  //prepare for when the first substring was the same
  if(s.size() < l){
    answer = true;
  }else if(t.size() < l){
    answer = false;
  }
  
  //compare
  for (int i=0; i< l; i++){
    if(s[i] < t[i]){
      answer = true;
      break;
    }else if(t[i] < s[i]){
      answer = false;
      break;
    }
  }
  return answer;
}



int main(){
  int n,l;
  string s;
  bool lt;
  
  cin >> n >> l;
  vector<string> v;
  for(int i = 0; i < n; i++){
    cin >> s;
    v.push_back(s);
  }
  
  for(int i=0; i < n; i++){
    for(int j=0; j < n-1; j++){
      lt = my_lt(v[j+1], v[j]);
      if(lt){
        s = v[j];
        v[j] = v[j+1];
        v[j+1] = s;
      }
    }
  }
  
  for(int i=0; i < n; i++){
    cout << v[i];
  }
  cout << endl << flush;
  
  return 0;
}



Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>

/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = mp::number<mp::cpp_dec_float<1024>>;
using Bint = mp::cpp_int;
*/

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007

signed main(){
    string S,T;
    cin>>S>>T;
    cout<<T<<S<<endl;
}


Measured memory_bytes: 3024
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(void)
{

    int n;
    cin >> n;
    vector<double> v(n);
    
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    
    sort(v.begin(), v.end());
    
    for (int i = 1; i < n; i++)
    {
        //cout << v[i - 1] << " " << v[i] << endl;
        v[i] = (v[i - 1] + v[i]) / 2;
    }
    cout << v[n - 1] << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::min;
using std::max;
using std::fill;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) <= (n); i++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
#define int long long

const long long MOD = 1e9 + 7;

const long long inf = 1e18;
const long long infsmart = 1e12;

ll n;

ll ds(ll x)
{
    ll y = 0;
    while (x > 0)
    {
        y += x % 10;
        x /= 10;
    }
    return y;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    if (n % ds(n) == 0)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int a = 0;
    int b = 0;
    int c = 0;
    int su[1000];
    int k = 1;
    cin >> a >> b >> c;
    for (int i = 1; i < 101; ++i) {
        if (a % i == 0 && b % i == 0) {
            su[k] = i;
            k++;
        }
        if(max(a,i) == i && max(b,i) == i){
            break;
        }
    }
    cout << su[k-c];
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String s = sc.next();
        sc.close();

        // 主処理
        int red = s.replaceAll("[^R]", "").length();
        int blue = s.replaceAll("[^B]", "").length();
        boolean judge = blue < red;
        String result = judge ? "Yes" : "No";

        // 出力
        System.out.println(result);
    }
}


Measured memory_bytes: 22996
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>

#define MAX_V 100000
#define INF (1<<29)

using namespace std;

vector<int>G[MAX_V];
int par[MAX_V],pnum[MAX_V],lowest[MAX_V],num;
bool used[MAX_V];

void dfs(int v,int prev){
  pnum[v]=num,lowest[v]=num;
  num++;
  used[v]=true;

  for(int i=0;i<G[v].size();i++){
    int nx=G[v][i];
    if(!used[nx]){
      par[nx]=v;
      dfs(nx,v);
      lowest[v]=min(lowest[v],lowest[nx]);
    }
    else if(nx!=prev){
      lowest[v]=min(lowest[v],pnum[nx]);
    }
  }
}

vector<int> ArticulationPoints(int n){
  fill(pnum,pnum+MAX_V,INF);
  fill(lowest,lowest+MAX_V,INF);
  fill(used,used+MAX_V,false);

  dfs(0,-1);
  num=1;
  int cnt=0;
  vector<int>ans;
  for(int i=0;i<n;i++){
    if(par[i]==0 && i!=0)cnt++;
    if(par[i]>0 && lowest[i]>=pnum[par[i]])ans.push_back(par[i]);
  }

  if(cnt>=2)ans.push_back(0);
  sort(ans.begin(),ans.end());
  ans.erase(unique(ans.begin(),ans.end()),ans.end());
  return ans;
}

int main(void){

  int n,m;
  cin >> n >> m;
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  vector<int> ans=ArticulationPoints(n);
  for(int i=0;i<ans.size();i++)
    cout << ans[i] << endl;

  return 0;
}

Measured memory_bytes: 5908
#include<iostream>
using namespace std;
       
int S[1000000], N;
            
// 二分探索
int binarysearch( int key ) {
  int left = 0;
  int right = N;
  int mid;
  while (left < right) {
    mid = (left + right) / 2;
    if (S[mid] == key) return 1;
    else if (key < S[mid]) right = mid;
    else if (S[mid] < key) left = mid + 1;
  }
  return 0;
}
            
int main() {
  int Q, k, sum = 0;
              
  cin >> N;
  for ( int i = 0; i < N; i++) cin >> S[i];
  cin >> Q;
  for ( int i = 0; i < Q; i++) {
    cin >> k;
    if ( binarysearch(k) ) {
      sum++;
    } 
  }
  cout << sum << endl;          
  return 0;
}


Measured memory_bytes: 3476
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//pair sort
bool compare_by_b(pair<LL, LL> a, pair<LL, LL> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

const long long MOD = 5;
const string YES = "YES";
const string NO = "NO";

void solve(long long A, long long B, long long C){
    // (n * A) % B = C
    // (7+14)mod5=2
    // 7*(sum)mod5=C?
    //
    //(7mod5+7mod5*2 )mod5=C
    // 7mod5*(1+2+3...)mod5=C?
    // 7mod5*(n(n+1)/2)mod5=C
    // if((A%B)%C==0)cout<<YES<<endl;
    // else cout<<NO<<endl;
    LL sum=0;
    for(LL i=A; i <= B * (A); i++){
        sum+=i;
        if(i*A%B==C){
            cout<<YES<<endl;
            return;
        }
    }
    cout<<NO<<endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    solve(A, B, C);
    return 0;
}


Measured memory_bytes: 256
# ARC076C - Reconciled?
from math import factorial


def main():
    n, m = list(map(int, input().rstrip().split()))
    MOD = 10 ** 9 + 7
    dif = abs(n - m)
    if abs(n - m) not in (0, 1):
        print(0)
    else:
        if dif == 0:
            ans = (factorial(n) * factorial(m) * 2) % MOD
        else:
            ans = (factorial(n) * factorial(m)) % MOD
        print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 5188
<?php

fscanf(STDIN,"%s",$s);

$arrayS = str_split($s);
$array = [];


for ($i = 0; $i < strlen($s); $i++) {
    if ($i % 2 == 0 || $i == 0) {
        $array[] = $arrayS[$i];
    }
}


echo implode($array);

Measured memory_bytes: 14840
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    while(N){
        vector<pair<double,string> >V(N);
        rep(i,0,N){
            string str;
            int p,a,b,c,d,e,f,s,m;
            cin >> str >> p >> a >> b >> c >> d >> e >> f >> s >> m;
            int tim = (a + b + c + d + e) + (m - 1) * (d + e);
            int value = f * m * s - p;
            V[i] = make_pair(1. * value / tim , str);
        }
        //sort
        rep(i,0,N){
            rep(j,i,N){
                if(V[i].first < V[j].first){
                    swap(V[i], V[j]);
                }
                if(V[i].first == V[j].first && V[i].second > V[j].second){
                    swap(V[i], V[j]);
                }
            }
        }
        rep(i,0,N){
            cout << V[i].second << endl;
        }
        cout << "#" << endl;
        cin >> N;
    }
}


Measured memory_bytes: 3008
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define PI (acos(-1))

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const int inf=1e9;

typedef pair<int,Pi> Pii;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;
  cin>>n>>m;
  vector<vector<int>> g(n);
  rep(i,m){
	  int u,v;
	  cin>>u>>v;
	  u--,v--;
	  g[u].push_back(v);
  }
  int s,t;
  cin>>s>>t;
  s--,t--;
  vector<vector<int>> dist(m+10,vector<int>(3,inf));
  priority_queue<Pii,vector<Pii>,greater<Pii>> que;
  que.push(Pii(0,Pi(s,0)));
  dist[s][0]=0;
  while(!que.empty()){
    Pii now=que.top();
    que.pop();
    int d=now.fi;
    int v=now.se.fi;
    int state=now.se.se;
    if(dist[v][state]<d) continue;
    for(auto itr:g[v]){
      if(dist[itr][(state+1)%3]>dist[v][state]+1){
        dist[itr][(state+1)%3]=dist[v][state]+1;
        que.push(Pii(dist[itr][(state+1)%3],Pi(itr,(state+1)%3)));
      }
    }
  }
  if(dist[t][0]!=inf){
    cout<<dist[t][0]/3<<endl;
  }else{
    cout<<-1<<endl;
  }
}


Measured memory_bytes: 11264
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int n;
long long a[100009];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+n+1);
	int d=n;
	long long S=1;
	int res=0;
	while(d>=1){
		if(a[d]==a[d-1]){
			++res;
			S=S*a[d];
			d-=2;
		}
		else --d;
		if(res==2){
			cout<<S;
			return 0;
		}
	}
	cout<<"0";
	return 0;
}

Measured memory_bytes: 1024
/*
CF ID: Ankit717
PROG: Binary String To Subsequences
LANG: C++
*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define mod 1000000007
#define maxn 200005
#define f(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rf(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);i--)
#define pb push_back
#define pf push_front
#define nl cout << "\n";

const ll INF=1e18L+5;
 
struct Data{
	ll p;
	ll h;
};

void ini(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
}

bool comp(pll &a,pll &b){
	if(a.first==b.first){
		return a.second>b.second;
	}else{
		return a.first<b.first;
	}
}

// vector<pll> adj[maxn];
// vector<ll> par;
// vector<bool> vis;

ll gcd(ll a,ll b){
    while(a!=0){
        ll temp=a;
        a = b % a;
        b = temp;
    }

    return b;
}

// bool prime[maxn],near[maxn];
// void sieve(){
// 	f(i,0,maxn+1){
// 		prime[i]=true;
// 	}
// 	prime[0]=falsrime[1]=false;
// 	for(ll i=2;i*i<=maxn;i++){
// 		if(prime[i]){
// 			for(j=i*i;j<=maxn;j+=i){
// 				prime[j]=false;
// 			}
// 		}
// 	}
// }

void solve(){
	ll n,x,t;
	cin >> n >> x >> t;

	ll temp=ceil((float)n/x);
	cout << temp*t;
}	

int main(){
	ini();
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	
    
	// ll t;
	// cin >> t;
	// f(i,0,t){
		solve();
	//}
}


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

  int N , M ,L ;
  int ans = 0 ;
  cin >> N >> M >> L ;
  if(L >= N && L <= N + M ) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	ll a, b, k; cin >> a >> b >> k;
	if (a < k)
	{
		cout << 0 << " " << max(0LL, b - (k - a)) << endl;
	}
	else
	{
		cout << a - k << " " << b << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	int n, l;
	cin >> n >> l;
	string s[100];
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	for (int i = 0; i < n-1; i++) {
		for (int j = n - 1; j > i; j--) {
			if (s[j].compare(s[j - 1]) < 0) {
				swap(s[j], s[j - 1]);
			}
		}
	}
	string sum;
	for (int i = 0; i < n; i++) {
		sum += s[i];
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9 + 7;
int INF = 2e18;

signed main() {
    int N;
    cin >> N;
    int ans = N / 2 - 1 + (N % 2 != 0);
    cout << ans << endl;
}

Measured memory_bytes: 256