akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define rep(i, n) for(ll i=0; i<(ll)(n); i++)
#define repd(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=b-1; (ll)(a)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};


int main(){
    ll  x;  cin >> x;
    string res="Yes";
    if(x<30) res = "No";
    cout << res << endl;
}


Measured memory_bytes: 3596
n,a,b=map(int,input().split())
s=input()
kakutei=0
kaigai=0
for i in range(n):
  if s[i]=="a":
    if kakutei < a+b:
      print("Yes")
      kakutei += 1
    else:
      print("No")
  elif s[i]=="b":
    if kakutei < a+b and kaigai < b:
      print("Yes")
      kakutei += 1
      kaigai += 1
    else:
      print("No")
  else:
    print("No")

Measured memory_bytes: 4016
#include <stdio.h>
#include <math.h>

int GetDigit(int num);

int main(void){
  int i;
  long n;
  int d;
  long count=0;

  scanf("%ld", &n);

  d=GetDigit(n);
  // printf("d=%d\n", d);

  //d-1の位まで処理
  for(i=1; i<d; i++){
    if(i%2==1){
      count+=9*pow(10,i-1);
    }
  }

  //1,3,5の位の数字の時
  if(d%2==1){
    count+=n-pow(10,d-1)+1;
  }

  printf("%ld", count);

  return 0;
}

int GetDigit(int num){
    int digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}


Measured memory_bytes: 256
a, b, c, d = map(int, input().split())
takahashi = [a, b]
aoki = [c, d]
attackers = [takahashi, aoki]
attacker = 0

while attackers[0][0]!=0 and attackers[1][0]!=0:
  attackers[attacker^1][0] = max(0, attackers[attacker^1][0]-attackers[attacker][1])
  attacker = attacker^1

if attackers[0][0]==0:
  print('No')
else:
  print('Yes')

Measured memory_bytes: 9212
'use strict';

function Main(input) {
    let tmp = input.trim().split('\n');
    const [N, D] = tmp[0].split(' ').map((v) => Number(v));
    tmp.shift();
    const points = tmp.map((v) => v.split(' ').map((v) => Number(v)));

    let result = 0;
    for (const [p, q] of points) {
        const ans = Math.sqrt(p * p + q * q);
        if (ans <= D) {
            result += 1;
        }
    }
    console.log(result);

    return;
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 95476
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

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



int main(){
    int N; ll C;
    cin >> N >> C;
    VLL x(N+1), sumV(N+1);
    VLL maxInClockwise(N+1), maxInAntiClockwise(N+2);
    VI v(N+1);
    x[0] = sumV[0] = v[0] = 0;
    maxInClockwise[0] = 0;
    //O -> B -> O -> A
    FORS(i, 1, N){
        cin >> x[i] >> v[i];
        sumV[i] = sumV[i-1] + v[i];
        maxInClockwise[i] = max(maxInClockwise[i-1], sumV[i] - x[i]);
    }
    ll ans = maxInClockwise[N];
    RREPS(i, N){
        ll ret = sumV[N] - sumV[i-1] - C + x[i] + maxInClockwise[i-1];
        ret -=  C - x[i];
        chmax(ans, ret);
    }
    //O -> A -> O -> B
    maxInAntiClockwise[N+1] = 0;
    RREPS(i, N){
        maxInAntiClockwise[i] = max(maxInAntiClockwise[i+1], 
                                    sumV[N] - sumV[i-1] - C + x[i]);
    }
    REP(i, N){
        ll ret = sumV[i] - x[i] + maxInAntiClockwise[i+1];
        ret -= x[i];
        chmax(ans, ret);
    }

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


Measured memory_bytes: 3712
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {

	int t,s,f,n;

	while (1) {
		cin >> t;
		if (t == 0) {
			break;
		}
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> s >> f;
			t = t - (f - s);
		}
		if (t > 0) {
			cout << t << endl;
		}else {
			cout << "OK" << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 1160
/*input
3
10 10
20 20
30 30
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i, j, k)  for(int i = j; i <  k; ++i)
#define RREP(i, j, k) for(int i = j; i >= k; --i)
#define F first
#define S second
#define mp make_pair
#define pb emplace_back
#define PII pair<int , int>
#define DBGG(i,j)     cout << i << " " << j << endl
#define DB4(i,j,k,l)  cout << i << " " << j << " " << k << " " << l << endl
#define IOS cin.tie(0) , cout.sync_with_stdio(0)
#define endl "\n"
///------------------------------------------------------------
#define int long long
#define MAX 100009
#define INF 0x3f3f3f3f

int n , a[MAX] , b[MAX] , x[MAX] , sol[MAX];
int cmp(int aa , int bb){
    return x[aa] < x[bb];
}
int32_t main(){
    IOS;
    cin >> n;
    REP(i , 1 , n + 1) cin >> a[i] >> b[i];
    REP(i , 1 , n + 1) x[i] = a[i] + b[i];
    REP(i , 1 , n + 1) sol[i] = i;
    sort(sol + 1 , sol + 1 + n , cmp);
    int fr = 1 , ba = n , v1 = 0 , v2 = 0;
    while(fr <= ba){
        if(fr <= ba){
            v1 += a[sol[ba]];
            ba --;
        }
        if(fr <= ba){
            v1 -= b[sol[ba]];
            ba --;
        }
    }
    cout << v1 << endl;
    return 0;
}

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

int main(){
  string  Alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  string  alpha = "abcdefghijklmnopqrstuvwxyz";
  char a;
  int which = 0;
  cin >> a ;
  for(int i = 0; i < 26; i++){
    if(a == Alpha[i]) which = 1; 
  } 

  if(which > 0) cout << 'A' << endl;
  else cout << 'a' << endl;
  
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n;
    cin >> n;
    vector<int> v(n, 0);
    REP(i, n-1){
        int a;
        cin >> a;
        v[a-1]++;
    }
    REP(i, n){
        cout << v[i] << '\n';
    }
    return 0;
}


Measured memory_bytes: 4048
/*    
                                                                             
	1. Practice makes a man perfect.
	2. Let go of the past.
	3. Without pain, without sacrifice, we would have nothing.
	4. Great things never come from comfort zones.
	5. Turn your wounds into wisdom.
	6. No pain ... no palm, no throne, no glory,no cross, no crown.
	7. You never know how strong you are until being strong is your only choice.
	8. Smooth seas do not make skillful sailors.
	9. I am not what happened to me, I am what I choose to become.
	10. No matter how fail life pushes you down, No matter how much you hurt,You can always bounce back.
		
		
	--> This lines keep me motivated.		

	Author:- Gaurang_Kothiya
	
*/
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  

#define data_set(type) tree<type,null_type,less<type>,rb_tree_tag,tree_order_statistics_node_update>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define ld long double
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(int i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()
#define ook(num) order_of_key(num)
#define fbo(num) find_by_order(num)
#define gcd(a,b) __gcd(a,b)
#define bits(n) __builtin_popcountll(n)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846

const int inf= 1e9 +1;
const int inf64= 1e18 -1;
const int MOD= 1e9 +7;


 
void Solve()
{	
	int n;
	int mn=20000,mx=-20000;
	cin>>n;
	int a[n];
	f(i,0,n-1){
		cin>>a[i];
		mn=min(mn,a[i]);
		mx=max(mx,a[i]);
	}
	int ans=inf64;
	f(k,mn,mx)
	{
		int cost=0;
		f(i,0,n-1)
		{
			cost += (k-a[i])*(k-a[i]);
		}
		ans=min(ans,cost);
	}
	cout<<ans;
}
 
signed main() 
{
	speed		

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

	int q=1;
	//cin>>q;
	
	while(q--)
	Solve();
		
	return 0;
} 

Measured memory_bytes: 3596
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;
 
template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)
 
const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

 
int main() {
    int N; cin >> N;
    vector<int> s(N);
    rep(i,N) cin >> s[i];
    
    // DP gorioshi ver.
    bool dp[110][11000];
    dp[0][0] = 1;
    rep(i,N+1) {
        rep(j,11000) {
            if (dp[i][j] == 1) {
                dp[i+1][j] = 1;
                dp[i+1][j+s[i]] = 1;
            }
        }
    }

    int res = 0;
    rep(i,11000) {
        if (dp[N][i] == 1 && i % 10 != 0) res = i;
    }

    cout << res << endl;
    return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define sz(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define dbg(x) cerr << #x << " is " << x << "\n";

using ll = long long;
using ii = pair<ll,ll>;

const int MOD = 1e9+7;

ll powmod(ll a, ll b, ll r = 1) {
  while(b) {
    if(b & 1) r = r * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  } return r;
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0);
  ll n; cin >> n;
  ll ans = (powmod(10LL, n) + powmod(8LL, n) - 2LL * powmod(9LL, n)) % MOD;
  if(ans < 0) ans += MOD;
  cout << ans << "\n";
  return 0;
}

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

int dist(int x,int y)
{
	return abs(x-y);
}
int main()
{
    int a,b,c,d;
    cin >> a >> b >> c >> d;   
    if(dist(a,c)<=d) cout << "Yes" << endl;
    else if(dist(a,b)<=d && dist(b,c)<=d) cout << "Yes" << endl;
    else cout << "No" <<endl;

	return 0;
}



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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int a, b; cin >> a >> b;
  if(a%3==0 or b%3==0 or (a+b)%3==0)cout<<"Possible";
  else cout<<"Impossible";
  cout<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string r[4] = {"dream", "dreamer", "erase", "eraser"};
	rep(i, 4) reverse(all(r[i]));
	string s;
	cin>>s;
	reverse(all(s));
	int pos = 0;
	while(pos<s.size()){
		int pos2 = -1;
		rep(i, 4) if(pos+r[i].size()<=s.size() && s.substr(pos, r[i].size())==r[i]) pos2 = pos+r[i].size();
		pos = pos2;
		if(pos<0){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	cout<<"YES"<<endl;
	return 0;
}


Measured memory_bytes: 512
require 'pp'
n = gets.chomp.to_i

red = []
n.times do
  red << gets.chomp.split(" ").map(&:to_i)
end

blue = []
n.times do
  blue << gets.chomp.split(" ").map(&:to_i)
end

red.sort! do |x, y|
  y[0] <=> x[0]
end

blue.sort! do |x, y|
  y[0] <=> x[0]
end

pair = 0

q = []

loop do
  break if blue.empty?
  # pp pair, red, blue, q
  # puts

  if !red.empty? && red.last[0] < blue.last[0]
    r = red.pop
    q << r
    q.sort! do |x, y|
      y[1] <=> x[1]
    end
  else
    b = blue.pop
    index = nil
    q.each_with_index do |r, i|
      if r[1] < b[1]
        index = i
        pair += 1
        break
      end
    end
    q.delete_at(index) if index
  end
end

puts pair


Measured memory_bytes: 4092
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int  maxn = 21;
const ll MOD = 1e9 +  7;
int arr[5], k;
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    for(int i = 0; i < 5; i ++){
        cin >> arr[i];
        
    }
    cin >> k;
    int ret = 0;
    for(int i = 0; i < 5 ;i ++){
        for(int j = i + 1; j < 5; j ++){
            if(abs(arr[j] - arr[i]) > k){
                return 0 * printf(":(");
            }
        }
    }
    cout << "Yay!";
    return 0;
}
///// 86694623
///// 62990530


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = INT64_MAX;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

void solve() {
    ll N;
    cin >> N;
    ll X = 1;
    while(X * (X+1)/2 < N) {
        X++;
    }
    vll I(X);
    iota(WHOLE(I), 1);
    for(auto &i:I) if(i!=X * (X+1)/2-N) out(i);
}

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


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

li base(int i) {
    if (i == 1) {
        return 300000;
    }
    if (i == 2) {
        return 200000;
    }
    if (i == 3) {
        return 100000;
    }
    return 0;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    li x, y;
    cin >> x >> y;

    li ans = base(x) + base(y);
    if (x == 1 && y == 1) {
        ans += 400000;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
//#include<bits/stdc++.h>
//using namespace std;
//#define mem(a) memset(a,0,sizeof(a))
//#define dbg(x) cout<<#x<<" = "<<x<<endl
//#define ll long long
////不要再爆long long了！！！！！！！！不要再爆long long了！！！！！！！ 
//ll a[100010];
//bool sfyc(ll a,ll b)
//{
//	ll ta=a,tb=b;
//	int la=0,lb=0;
//	while(ta){la++,ta/=10;}
//	while(tb){lb++,tb/=10;}
//	//printf("la=%d,lb=%d\n",la,lb);//*************
//	if(la+lb>20)return 1;
//	return 0;
//}//溢出返回1 ,不溢出不一定 
//int main()
//{
//	int n,i,flag=0;
//	ll t,k=1;
//	cin>>n;
//	for(i=0;i<n;i++)
//	{
//		scanf("%lld",&a[i]);
//		if(a[i]==0)flag=1;
//	}
//	if(flag)cout<<0;
//	else
//	{
//		for(i=0;i<n;i++)
//		{
//			if(sfyc(k,a[i]))
//			{
//				//printf("**11111111**\n");//************
//				cout<<-1;
//				return 0;
//			}
//			k*=a[i];
//			if(k>1000000000000000000)
//			{
//				//printf("*22222222222**\n");//****************
//				cout<<-1;
//				return 0;
//			}
//		}
//		printf("%lld",k);
////		if(k>1000000000000000000)
////			{
////				printf("*2333**\n");//****************
////				cout<<-1;
////				return 0;
////			}
////		if(k==1000000000000000001)printf("**5555\n");//*********
////		if(1000000000000000001>1e8)printf("*4444\n");//********
//	}
//	
//	return 0;
//}
//
////#include<bits/stdc++.h>
////using namespace std;
////#define mem(a) memset(a,0,sizeof(a))
////#define dbg(x) cout<<#x<<" = "<<x<<endl
////#define ll long long
//////不要再爆long long了！！！！！！！！不要再爆long long了！！！！！！！ 
////
////inline __int128 read(){
////    __int128 x=0,f=1;
////    char ch=getchar();
////    while(ch<'0'||ch>'9'){
////        if(ch=='-')
////            f=-1;
////        ch=getchar();
////    }
////    while(ch>='0'&&ch<='9'){
////        x=x*10+ch-'0';
////        ch=getchar();
////    }
////    return x*f;
////}
//// 
////inline void print(__int128 x){
////    if(x<0){
////        putchar('-');
////        x=-x;
////    }
////    if(x>9)
////        print(x/10);
////    putchar(x%10+'0');
////}
////
////int main(void){
////    __int128 a,b,k;
////    int n,i,flag=0;
////    cin>>n;
////    k=read();if(k==0)flag=2;
////    for(i=1;i<n;i++)
////    {
////    	a=read();
////    	b=a*k;
////    	if()
////	}
////    return 0;
////}

#include<bits/stdc++.h>
using namespace std;
#define mem(a) memset(a,0,sizeof(a))
#define dbg(x) cout<<#x<<" = "<<x<<endl
#define ll long long
//不要再爆long long了！！！！！！！！不要再爆long long了！！！！！！！ 
ll a[100010];
int main()
{
	int n,i,f_yc=0,f_0=0;
	ll t,k=1,temp;
	cin>>n;
//	for(i=0;i<n;i++)
//	{
//		scanf("%lld",&t);
//		if(t==0){cout<<0;return 0;}//f_0=1;
////		temp=t*k;
////		if(temp/k!=t)f_yc=1;
////		if(temp-(ll)1000000000000000000>0)f_yc=1;
////		if(temp<0)f_yc=1;
//		ll temp=1000000000000000000/k;
//		if(t>temp){cout<<-1;return 0;}//f_yc=1;
//		k*=t;
//	}
	int flag=0;
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
		if(a[i]==0)flag=1;
	}
	if(flag){cout<<0;return 0;}
	for(i=0;i<n;i++)
	{
		//temp=1e18/k;
		temp=1000000000000000000/k;
		if(a[i]>temp){cout<<-1;return 0;}
		k*=a[i];
	}
	printf("%lld",k);
//	if(f_0)cout<<0;
//	else if(f_yc)cout<<-1;
//	else printf("%lld",k);
	return 0;
}

Measured memory_bytes: 4548
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int t,n;
        int[] p = {0,6,4,3,2};
        for(int i=0;i<4;i++){
            t=sc.nextInt();
            n=sc.nextInt();
            System.out.println(p[t]*n*1000);
        }
    }
}

Measured memory_bytes: 17332
#include <bits/stdc++.h>
using namespace std;
long long N, M;
const long long MOD = 1000000007;
long long fin = 1;

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

long long comb(long long n, long long b) {
    long long ans = 0;
    long long top = 1;
    long long under = 1;
    long long r = 0;

    if(b > n - b) {
        r = n - b;
    }else {
        r = b;
    }

    for(long long i = n; i >= n - r + 1; --i) {
        top *= i;
        top %= MOD;
    }

    for(long long i = 1; i <= r; ++i) {
        under *= i;
        under %= MOD;
    }

    ans = top * modinv(under, MOD) % MOD;
    return ans;
}

int main() {
    cin >> N >> M;
    for(long long i = 2; i * 1LL * i <= M; ++i) {
        if(M % i != 0) continue;
        long long count = 0;
        while(M % i == 0) {
            M /= i;
            count++;
        }
        fin *= comb(count + N - 1, count) % MOD;
        fin %= MOD;
    }
    if(M > 1) fin = fin * N % MOD;

    cout << fin << endl;
}

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

typedef double du ;
typedef string st ;
typedef long long ll ;
typedef long double ld ;
typedef long long int lli ;

#define vi vector <lli>
#define loop(num) for (lli i = 0 ; i < num ; i ++ )
#define loopcin(num , ar ) for (lli i = 0 ; i < num ; i ++ ) {cin >> ar [i] ;}
#define loopcout(num , ar) for (lli i = 0 ; i < num ; i ++ ) {cout << ar [i] << ' '; }

#define forr(num1 , num2) for (lli i = num1 ; i < num2 ; i ++ )
#define forrcin(num1 , num2 , ar ) for (lli i = num1 ; i < num2 ; i ++ ) {cin >> ar [i] ;}
#define forrcout(num1 , num2 , ar) for (lli i = num1 ; i < num2 ; i ++ ) {cout << ar [i] << ' '; }

#define D2forrcin(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cin >> A[i][j] ;}}
#define D2forrcout(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cout << A[i][j] << ' ' ;}cout << endl ;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define F first
#define S second

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main ()
{
    fastio
    lli num1 , num2 ;
    cin >> num1 >> num2 ;
    cout << (num1 + num2 < 24 ? num1 + num2 : num1 + num2 - 24) ;

    return 0 ;
}

/*___________________________________________________________________functions___________________________________________________________________________*/



Measured memory_bytes: 256
#include <iostream>
#define ll long long int
using namespace std;

int main(){

    ll N,a,b,ret,_ret;
    cin >> N;

    a = N;
    b = 1;
    ret = a + 1 - 2;

    for (int i=1; i<=100000000; i ++){
        if(a%i == 0){
            _ret = (a/i) + (b*i) - 2;
            if(ret > _ret){
                ret = _ret;
            }
        }
    }

    cout << ret<< endl;


    return 0; 
}

Measured memory_bytes: 384
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N = I()
x = LI()
L = I()

from bisect import bisect_right

arrive = [[0]*N for _ in range(30)]  # arrive[k][i] = i番目(0-indexed)のホテルから2**k日で到達できる最も遠いホテル
for k in range(30):
    if k == 0:
        for i in range(N):
            arrive[0][i] = bisect_right(x,x[i]+L)-1
    else:
        for i in range(N):
            arrive[k][i] = arrive[k-1][arrive[k-1][i]]


def query(a,b):  # (a-1)番目のホテルから(b-1)番目の駅まで移動するのにかかる日数
    a -= 1
    b -= 1
    ans = 1
    for k in range(29,-1,-1):
        if arrive[k][a] >= b:
            continue
        else:
            a = arrive[k][a]
            ans += 1 << k
    print(ans)


Q = I()
for i in range(Q):
    a,b = MI()
    if a > b:
        a,b = b,a
    query(a,b)


Measured memory_bytes: 109152
#include <iostream>
#include <vector>
#include <algorithm>

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

using namespace std;

typedef long long ll;

int n;

void make_irre (vector <ll> & a )
{
	ll g;			// Ååöñ
	vector <ll> pre;
	do{
		pre = a;
		g = a[0];
		for (int i = 1; i < n; i++ )
			g = __gcd (g, a[i] );
		rep (i, n )
			a[i] /= g;
	}while (pre != a );
}

int main()
{
	while (cin >> n && n ){
		vector <ll> d (n, 0LL ), v(n, 0LL );

		rep (i, n )
			cin >> d[i] >> v[i];

		// ùñªÌ
		rep (i, n ){
			ll g = __gcd(d[i], v[i] );	
			v[i] /= g;
			d[i] /= g;
		} // end rep
		// ¬x¯mÌùñ»(?)
		make_irre (v );

		// £¯mÌùñ»(?)
		make_irre (d );

		// ®ä»
		rep (i, n ){
			if (v[i] % d[i] == 0 ){
				v[i] /= d[i];
			}else{
				ll m = d[i];
				rep (j, n )
					if (i != j )
						v[j] *= m;
			} // end if
		} // end rep
		make_irre (v );

		rep (i, n )
			cout << v[i] << endl;
	} // end loop
		
	return 0;
}

Measured memory_bytes: 912
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> N;
    vvi ca(N, vi(N - 1));
    vvi a(N, vi(N - 1));
    REP(i, N)
    cin >> ca[i];
    set<pair<int, int>> st;
    int x = 0;
    map<pair<int, int>, int> mp;
    REP(i, N - 1)
    REP(j, N) {
        pair<int, int> tmp = make_pair(max(j + 1, ca[j][i]), min(j + 1, ca[j][i]));
        if (st.count(tmp) == 1) {
            a[j][i] = mp[tmp];
        } else {
            mp[tmp] = x;
            a[j][i] = x++;
            st.insert(tmp);
        }
    }
    dump(a);
    vi col(N + 1, 0);
    vi ph(N * N, 0);
    set<int> s;
    map<int, int> m;
    function<void(int, int)> dfs = [&](int phase, int row) {
        if (col[row] == N - 1)
            return;
        int n = a[row][col[row]];
        dump(phase, row, n);
        if (s.count(n) == 1) {
            col[row]++;
            int &row2 = m[n];
            col[row2]++;
            dump(row, row2);
            ph[n] = max(phase, ph[n]);
            dfs(ph[n] + 1, row);
            dfs(ph[n] + 1, row2);
        } else {
            s.insert(n);
            m[n] = row;
            ph[n] = phase;
        }
    };
    REP(i, N) {
        dfs(1, i);
    }
    dump(ph);
    REP(i, N) {
        if (col[i] != N - 1) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << *max_element(ALL(ph)) << endl;
}

Measured memory_bytes: 113664
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        int[][] graph;
        int[] deg;
        int[] value;

        int calc(int u) {
            if (value[u] >= 0) {
                return value[u];
            }
            int max = 0;
            int[] g = graph[u];
            for (int t = 0; t < deg[u]; t++) {
                int tmp = value[g[t]] + 1;
                if (tmp == 0) {
                    tmp = calc(g[t]) + 1;
                }
                if (tmp > max) {
                    max = tmp;
                }
            }
            return value[u] = max;
        }

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            char[] c = in.next().toCharArray();
            int n = c.length + 1;
            graph = new int[n][2];
            deg = new int[n];
            for (int i = 0; i < c.length; i++) {
                if (c[i] == '<') {
                    graph[i + 1][deg[i + 1]++] = i;
                } else {
                    graph[i][deg[i]++] = i + 1;
                }
            }
            value = new int[n];
            Arrays.fill(value, -1);
            long sum = 0;
            for (int i = 0; i < n; i++) {
                sum += calc(i);
            }
            out.println(sum);
        }

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
        }

        public FastScanner(String fileName) {
            try {
                br = new BufferedReader(new FileReader(fileName));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                String line = null;
                try {
                    line = br.readLine();
                } catch (IOException e) {
                }
                st = new StringTokenizer(line);
            }
            return st.nextToken();
        }

    }
}



Measured memory_bytes: 86408
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <complex>
using namespace std;

void solve(void){
	stack<int> s;
	string ope;
	while (cin >> ope) {
		if (ope == "+") {
			int x = s.top(); s.pop();
			int y = s.top(); s.pop();
			s.push(x+y);
		}
		else if (ope == "-") {
			int x = s.top(); s.pop();
			int y = s.top(); s.pop();
			s.push(y-x);
		}
		else if (ope == "*") {
			int x = s.top(); s.pop();
			int y = s.top(); s.pop();
			s.push(x*y);
		}
		else {
			s.push(stoi(ope));
		}
	}
	cout << s.top() << endl;
}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}



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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  string T; cin >> T;
  ll l = T.size(); rep(i,l) if (T[i]=='?') T[i] = 'D';
  cout << T << endl;
  return 0;
}

Measured memory_bytes: 3756
#include<bits/stdc++.h>
using namespace std;
const int N=110000;
int n;
vector<int>g[N];
int known[N],val[N];
int k;
int l[N],r[N];
int used[N];
int known_parity[N][2];
int shit;
vector<int>order;
int par[N];
int ans[N];
void dfs(int v)
{
	used[v]=1;
	l[v]=-1e9;
	r[v]=1e9;
	for(int i=0;i<g[v].size();i++)
	{
		int to=g[v][i];
		if(used[to])
			continue;
		dfs(to);
		par[to]=v;
		if(known_parity[to][0])
			known_parity[v][1]=1;
		if(known_parity[to][1])
			known_parity[v][0]=1;
		l[v]=max(l[v],l[to]-1);
		r[v]=min(r[v],r[to]+1);
	}
	if(known[v]==1)
	{
		l[v]=max(l[v],val[v]);
		r[v]=min(r[v],val[v]);
		known_parity[v][val[v]%2]=1;
	}
	if(known_parity[v][0]==1&&known_parity[v][1]==1)
		shit=1;
	if(l[v]>r[v])
		shit=1;
	order.push_back(v);
}
int solve_val(int v,int par)
{
	if(par==0)
		return l[v];
	l[v]=max(l[v],ans[par]-1);
	r[v]=min(r[v],ans[par]+1);
	while(l[v]%2==ans[par]%2)
		l[v]++;
	return l[v];
}
int main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		int a,b;
		cin>>a>>b;
		known[a]=1;
		val[a]=b;
	}
	dfs(1);
	if(shit)
	{
		cout<<"No"<<endl;
		return 0;
	}
	reverse(order.begin(),order.end());
	cout<<"Yes"<<endl;
	for(int i=0;i<order.size();i++)
	{
		int v=order[i];
		ans[v]=solve_val(v,par[v]);
	}
	for(int i=1;i<=n;i++)
		cout<<ans[i]<<endl;
	return 0;
}


Measured memory_bytes: 15608
x = int(input())
a = 1
b = 2
p = 2
while True:
    while True:
        if b**p <= x:
            a = max(a, b**p)
            p += 1
        else:
            p = 2
            break
    b += 1
    if b**p > x:
        break
print(a)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  string S;
  cin>>S;
  int N=S.size();
  vector<pair<char,int>> A={make_pair('a',0)};
  for(char c:S){
    if(A.back().first==c)A.back().second++;
    else A.push_back({c,1});
  }
  A.erase(A.begin());
  vector<int> B(N);
  int M=A.size(),sum=0;
  for(int i=0;i<M;i+=2){
    sum+=A[i].second;
    B[sum-1]+=(A[i].second+1)/2+A[i+1].second/2;
    B[sum]+=A[i].second/2+(A[i+1].second+1)/2;
    sum+=A[i+1].second;
  }
  for(int i=0;i<N;i++)cout<<B[i]<<(i==N-1?'\n':' ');
}

Measured memory_bytes: 5652
//package AtCoder;
import java.util.*;
class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		long h=sc.nextLong();
		long attack=0;
		int k=0;
		while(h>1)
		{
			h=h/2;
			attack+=(long)Math.pow(2,k);
			k++;
		}
		attack=(long) (attack+Math.pow(2,k));	
		System.out.println(attack);
	}

}


Measured memory_bytes: 22612
#include <stdio.h>

int main(void){
  float ax,ay,bx,by,cx,cy,dx,dy;
  float a,b,c,d;

  while(scanf("%f%f%f%f%f%f%f%f",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy) != EOF){
    a = by - ay;
    b = bx - ax;
    c = dy - cy;
    d = dx - cx;

    if(a==0 && d==0 || b==0 && c==0 || (a/b)*(c/d) == -1){
      printf("YES\n");
    }
    else{
      printf("NO\n");
    }
  }

  return 0;
}

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

// repetition
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

// const value
// const ll MOD = 1e9 + 7;
// const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
// const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline ll toLL(string s) {
  ll v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  rep(i, s.size()) {
    if(s[i] == '7') {
      cout << "Yes"
           << "\n";
      return 0;
    }
  }
  cout << "No"
       << "\n";
  return 0;
}


Measured memory_bytes: 3576
// https://atcoder.jp/contests/abcXXX/tasks/abcXXX_x

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

struct C {
    vector<ll> v_{};

    explicit C(vector<ll> v) : v_(move(v)){}
    bool resolve() {
        auto v = v_;
        sort(v.begin(), v.end());
        int count = 0;
        for(int i=0; i < v.size(); ++i) {
            if (v[i] != v_[i]) {
                count++;
            }
        }
        return count == 2 || count == 0;
    }
};

int main() {
    ll N;
    cin >> N ;
    vector<ll> v{};
    for (int i=0; i < N; ++i) {
        ll x;
        cin >> x;
        v.emplace_back(x);
    }
    C c{move(v)};
    cout << (c.resolve() ? "YES" : "NO") << endl;
    return 0;
}


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

int main()
{
	int a,b,c,x,ans=0;
	cin>>a>>b>>c>>x; //50 10 5
	x/=10;
	for (int i=0;i<=a;i++)
		for (int j=0;j<=b;j++)
			for (int k=0;k<=c;k++)
				if (i*50+j*10+k*5==x){
					ans++;
					//cout<<i<<' '<<j<<' '<<k<<endl;
				}
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int factors(int n){
    int count=0;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0){
            if(i*i==n)
            count+=1;
            else
            count+=2;
        }
    }
    return count;
}
int main(){
    int n;
    cin>>n;
    int sum=0;
    for(int i=1;i<n;i++)
    {
        sum+=factors(n-i);
    }
    cout<<sum;
}

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

int main() {
	int N, K, X, Y; cin >> N >> K >> X >> Y;

    int cnt = 0;
    for(int i = 1; i <= N; ++i) {
        if(i <= K) {
            cnt += X;
        } else {
            cnt += Y;
        }
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	ll a,b,c;
	int ans=0;
	cin >>a>>b;
	c=__gcd(a,b);
	ll bef=c;
	for(ll c=2;c<=sqrt(bef);c++){
		if(bef%c==0){
			ans++;
		}
		while(bef%c==0){
			bef/=c;
		}
	}
	if(bef!=1){
		ans++;
	}
	cout<<ans+1<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
    #define int ll
    #define M 1000000007
    #define hell 998244353
    #define inf 1e18
    #define pb push_back
    #define pi 3.1415926536
    #define mp make_pair
    #define ub upper_bound
    #define lb lower_bound
    #define all(a) a.begin(),a.end()
    #define ll long long
    #define vec vector <int>
    #define pii pair<int,int>
    #define endl "\n"
    #define gcd __gcd
    using namespace std;
    int power(int x, unsigned int y, unsigned int m) 
    { 
        if (y == 0) 
            return 1; 
        int p = power(x, y/2, m) % m; 
        p = (p * p) % m; 
  
        return (y%2 == 0)? p : (x * p) % m; 
    } 
    int modInverse(int a, int m) 
    {   
        return power(a, m-2, m);
    }
    int nCrModPFermat(int n, int r, int p) 
    { 
           if (r==0) 
              return 1; 
  
        int fac[n+1]; 
        fac[0] = 1; 
        for (int i=1 ; i<=n; i++) 
            fac[i] = fac[i-1]*i%p; 
  
        return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
    } 
    signed main()
    {
        ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
        ll t=1;
        // cin >> t;
        /*SAARE INPUTS LENA*/
        /*VARIABLES KI RANGE DEKHLENA*/
        /*EXPONENT RANGE OF OUTPUT KA DHYAN RAKHNA*/
        while(t-->0)
        {
            ll n=0;
            cin>>n;
            if(n==0)
                cout<<"1";
            else
                cout<<"0";
        }
        return 0;
    }

Measured memory_bytes: 3644
ans=[]
n=int(input())
for i in range(n):
    X=input()
    Y=input()
    com=[0]
    for i in Y:
        for j in range(len(com)-1,-1,-1):
            tmp=X.find(i,com[j])
            if tmp+1:
                if j+1<len(com):
                    com[j+1]=min(com[j+1],tmp+1)
                else:
                    com.append(tmp+1) 
    ans.append(len(com)-1)
for i in range(n):
    print(ans[i])


Measured memory_bytes: 5612
#include<stdio.h>
#include<math.h>

#define true 1;
#define false 0;

int prime(int a);

int main(){
  int n, a;
  int count = 0;
  int i;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d", &a);
    if(prime(a) != 0){
      count++;
    }
  }

  printf("%d\n", count);

  return 0;
}

int prime(int a){
  int j;

  if(a == 1){
    return false;
  }
  for(j = 2; j <= sqrt(a); j++){
    if(a % j == 0){
      return false;
    }
  }
  return true;
}



Measured memory_bytes: 2068
N, M = [int(x) for x in input().split()]

dp = [1] * (N + 1)
ans = 1

for i in range(M):
	dp[int(input())] = 0

if N == 1:
	print(ans)
else:
	for i in range(N - 1):
		dp[i + 2] = (dp[i] + dp[i + 1]) * dp[i + 2]
	print(dp[N] % 1000000007)

Measured memory_bytes: 462708
n = int(input())

k = 7
m = k%n
if m == 0:
    print(1)
    exit()
cnt = 1

for i in range(1,n+1):
    k = (10*k + 7)%n
    m = k%n
    if m == 0:
        print(i+1)
        exit()
print(-1)

Measured memory_bytes: 9152