akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

int n;
string a, b;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> a >> b;
    for (int i = 0; i < n; i++) {
        int cnt = 0;
        bool flag = true;
        for (int j = 0; j < n - i; j++) {
            if (a[i + j] != b[j]) flag = false;
            cnt++;
        }

        if (flag) {
            printf("%d", n + n - cnt);
            return 0;
        }
    }
    cout << n + n;
    return 0;
}


Measured memory_bytes: 256
import numpy as np

a, b, x = map(int, input().split())

if x <= a * a * b / 2:
    a_ = 2 * x / a / b
    r = (a_**2 + b**2)**0.5
    theta = np.arcsin(b / r)
else:
    b_ = 2 * (a**2 * b - x) / a**2
    r = (a**2 + b_**2)**0.5
    theta = np.arcsin(b_ / r)

print(np.degrees(theta))

Measured memory_bytes: 12508
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

int main() {
  int n, q;
  scan(n, q);
  string s;
  scan(s);
  vi ins;
  rep (i, n-1) {
    if (s[i] == 'A' && s[i+1] == 'C') {
      ins.push_back(i);
    }
  }
  rep (i, q) {
    int l, r;
    scan(l, r);
    --l;
    r -= 2;
    int ans = upper_bound(all(ins), r) - lower_bound(all(ins), l);
    print(ans);
  }
  return 0;
}


Measured memory_bytes: 3324
n = int(input())
x = list(map(float, input().split()))
y = list(map(float, input().split()))
a = []
p1, p2, p3, p_inf = 0, 0, 0, 0
for i in range(n):
    c = abs(x[i]-y[i])
    p1 += c
    p2 += c ** 2
    p3 += c ** 3
    a.append(c)

p_inf = max(a)

print(p1, p2**(1/2), p3**(1/3), p_inf)



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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(5e3 + 5);

/////////////////////////////////////////////////////////////
class StringMatching {
 public:
  string s;
  string t;
  string phi;
  string sct;
  vector<int> z;

  StringMatching(string s, string t, char phi) {
    this->z = vector<int>(t.size() + 1 + s.size(), 0);

    this->s = s;
    this->t = t;
    this->phi = phi;
    init();
  }

  void init() {
    sct = t + phi + s;
    make_z();
  }

  void make_z() {
    int n = sct.size();
    int l = 0, r = 0;

    z[0] = sct.size();

    for (int i = 1; i < n; ++i) {
      if (i > r) {
        l = r = i;
        while (r < n && sct[r - l] == sct[r]) r += 1;

        z[i] = r - l;
        r -= 1;
      } else {
        int k = i - l;  // focus at prefix-substring (begin with sct[k]) with which already dealed

        // no prefix-substring (begin with sct[i]) longer than (r - i + 1) could be expected
        // since, "sct[0..(r - l)] == sct[l..r]" entails "sct[k..(r - l)] == sct[i..r]",
        // but z[k] is smaller than length of sct[i..r]
        if (z[k] < r - i + 1) {
          z[i] = z[k];
        } else {  // there could be longer prefix-substring (begin with sct[i])
          l = i;
          while (r < n && sct[r - l] == sct[r]) r += 1;

          z[i] = r - l;
          r -= 1;
        }
      }
    }
  }

  bool match_from(int i) {
    return z[t.size() + 1 + i] == t.size();
  }
};
/////////////////////////////////////////////////////////////

int n;
string s;

int calc(int begin) {
  string target = s.substr(begin, s.size() - begin);

  int min_inds[MAX_N];
  int max_inds[MAX_N];

  for (int i = 0; i <= s.size(); ++i) {
    min_inds[i] = s.size();
    max_inds[i] = -1;
  }

  StringMatching sm(s, target, '_');

  for (int i = 0; i < s.size(); ++i) {
    int cur = sm.z[sm.t.size() + 1 + i];
    min_inds[cur] = min(min_inds[cur], i);
    max_inds[cur] = max(max_inds[cur], i);
  }

  int ind_min = s.size();
  int ind_max = -1;
  for (int i = s.size(); i > 0; --i) {
    ind_min = min(ind_min, min_inds[i]);
    ind_max = max(ind_max, max_inds[i]);

    min_inds[i] = ind_min;
    max_inds[i] = ind_max;
  }

  int ret = 0;

  for (int i = 1; i < s.size(); ++i) {
    if (min_inds[i] == max_inds[i]) continue;

    if (min_inds[i] + i - 1 < max_inds[i]) {
      ret = max(ret, i);
    }
  }

  return ret;
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  cin >> s;

  int ans = 0;

  for (int i = 0; i < s.size(); ++i) {
    ans = max(ans, calc(i));
  }

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

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define MOD int(1e9+7)
using namespace std;

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

int main(){
    string L;
    cin >> L;
    ll dp[2][100005]={0};
    dp[0][0] = 1;
    dp[1][0] = 2;
    for(int i = 1; i < L.size(); i++){
        dp[0][i] = (dp[0][i-1]*3)%MOD;
        if(L[i] == '0') dp[1][i] = dp[1][i-1];
        else{
            dp[0][i] = (dp[0][i]+dp[1][i-1])%MOD;
            dp[1][i] = (dp[1][i]+(dp[1][i-1]*2)%MOD)%MOD;
        }
    }

    cout << (dp[0][L.size()-1]+dp[1][L.size()-1])%MOD << endl;

    return 0;
}

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

int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a == b + c || b == a + c || c == a + b) cout << "Yes" << "\n";
	else cout << "No" << "\n";
	return 0;
}

Measured memory_bytes: 256
daymonth = [0, 2, 5, 6, 2, 4, 0, 2, 5, 1, 3, 6, 1]
str = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]


#print(input().split(" "))

m = 1
d = 1

while m!=0:
	md = input().split(" ")
	m = int(md[0])
	d = int(md[1])
	if m != 0:
		print(str[(daymonth[m] + d) % 7])

Measured memory_bytes: 7664
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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 INF = 1LL << 60;

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

  if(s == "SSS") cout << 0 << endl;
  else if(s == "SRS") cout << 1 << endl;
  else if(s == "RSS") cout << 1 << endl;
  else if(s == "SSR") cout << 1 << endl;
  else if(s == "SRR") cout << 2 << endl;
  else if(s == "RSR") cout << 1 << endl;
  else if(s == "RRS") cout << 2 << endl;
  else if(s == "RRR") cout << 3 << endl;

  return 0;
}


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

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void()
#endif

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> sum_a(n, 0);
  for (int i = 0, a; i < n; i++) {
    cin >> a;
    if (i == 0) {
      sum_a[i] = a;
    } else {
      sum_a[i] = sum_a[i - 1] + a;
    }
  }
  long long ans = (int)2e9;
  for (int i = 0; i < n - 1; i++) {
    long long x = sum_a[i];
    long long y = sum_a[n - 1] - sum_a[i];
    ans = min(ans, abs(x - y));
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 4732
n = int(input())
v = list(reversed(sorted(map(float, input().split()))))

if __name__ == '__main__':
    s = 0.0
    div = 1.0
    for i, vi in enumerate(v):
        if i != len(v) - 1:
            s += vi / (2.0 ** (i+1))
        else:
            s += vi / (2.0 ** i)
    print(s)



Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll long long  int
#define N 100000
#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 po pop_back
#define pb push_back
#define lb lower_bound
#define fi first
#define se second
#define debug(x) cout << #x << " = " << x << endl
#define ub upper_bound
#define ibs ios_base::sync_with_stdio(false)
#define cti cin.tie(0)
#define all(x) x.begin(), x.end()
#define PI 3.14159265
#define cot cout.tie(0)
using namespace std;
/**
        * @author :: Sawlani
        *
        */
       int main()
       {
           //freopen("input.txt","r",stdin);

            ll h;
            cin >> h;
            ll k=log2(h);
            ll ans=pow(2,k+1)-1;

            cout << ans << endl;
       }

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

int main(){
	string a,b;cin>>a>>b;
  if(a==b)cout<<"EQUAL"<<endl,exit(0);
  if(a.size()>b.size())cout<<"GREATER"<<endl,exit(0);
  if(a.size()<b.size())cout<<"LESS"<<endl,exit(0);
  for(int i=0;i<a.size();i++){
  if(a[i]-'0'>b[i]-'0')cout<<"GREATER"<<endl,exit(0);
  if(a[i]-'0'<b[i]-'0')cout<<"LESS"<<endl,exit(0);

  }
}

Measured memory_bytes: 256
# 与えられた数値の桁数と桁値の総和を計算する.
def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


n = int(input())

answer = 0
for num in range(1, n + 1, 2):
    cnt = 0
    for candidate in range(1, num + 1):
        if num % candidate == 0:
            cnt += 1

    if cnt == 8:
        answer += 1

print(answer)


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

int main() {
    int x, n;
    cin >> x >> n;
    int p[n];
    rep(i, n) cin >> p[i];
    sort(p, p + n);

    int error = 1e5;
    int ans = 0;

    rep(i, 105) {
        bool ok = true;
        rep(j, n) if (i == p[j]) ok = false;
        if (!ok) continue;

        int e = abs(i - x);

        if (error > e) {
            ans = i;
            error = e;
        }
    }

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


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n,m; cin>>n>>m;
	ll ans=1900*m+100*(n-m);
	for(int i=0;i<m;i++) ans*=2LL;
	cout<<ans<<'\n';
}


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

#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prtd(n, var)  cout << fixed << setprecision(n) << var << endl
#define prt2(var1, var2) cout << var1 << " " << var2 << endl

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

int main(void) {
  int n;
  cin >> n;

  vecll h(n);
  rep(i,n){
    cin >> h[i];
  }

  vec dp(n);
  dp[0] = 0;
  dp[1] = abs(h[1]-h[0]);
  REP(i,2,n){
    dp[i] = min((dp[i-2]+abs(h[i]-h[i-2])), (dp[i-1]+abs(h[i]-h[i-1])));
  }

  prt(dp[n-1]);
}


Measured memory_bytes: 1408
#include<iostream>
using namespace std;
int main(){
	char a[3];
	int sum=0;
	cin>>a;
	if(a[0]=='o')sum++;
	if(a[1]=='o')sum++;
	if(a[2]=='o')sum++;
	cout<<700+sum*100;
	return 0;	
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;
 
int main(){
	
	int n, m; cin>>n>>m;
	vector<int> x(m);
	for(auto &i:x) cin>>i;
	
	sort(x.begin(),x.end());
	vector<int> d(m-1);
	for(int i=0; i<m-1; i++){
		d.at(i)=x.at(i+1)-x.at(i);
	}
	sort(d.begin(),d.end());
	int sum{};
	for(int i=0; i<m-n; i++){
		sum += d.at(i);
	}
	cout << sum<<endl;
	
}


Measured memory_bytes: 1152
#include <iostream>
#include <string>
using namespace std;
int H, W;
string s[50];

bool inside(int i, int j) {
  return i >= 0 && i < H && j >= 0 && j < W;
}

bool alone(int i, int j) {
  if (s[i][j] == '.') return false;
  const int di[] = {0, 1, 0, -1};
  const int dj[] = {1, 0, -1, 0};
  
  for (int k = 0; k < 4; ++k) {
    int ni = i + di[k];
    int nj = j + dj[k];
    if (!inside(ni, nj)) continue;
    if (s[ni][nj] == '#') return false;
  }
  return true;
}

bool sub() {
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (alone(i, j)) return false;
    }
  }
  return true;
}

int main() {
  cin >> H >> W;
  for (int i = 0; i < H; ++i) {
    cin >> s[i];
  }
  cout << (sub() ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

map<int, int> m;

signed main() {
	int N;
	cin >> N;

	vector<int> A;
	inputVector(A, N);

	rep(i, N) {
		m[-A[i]]++;
	}

	int v1 = -1;
	int v2 = -1;
	itrep(it, m) {
		int key = (*it).first;
		int value = (*it).second;

		if (v1 == -1 && value >= 2) {
			value -= 2;
			v1 = -key;
		}

		if (v2 == -1 && value >= 2) {
			value -= 2;
			v2 = -key;
		}
	}

	cout << (v1 == -1 || v2 == -1 ? 0 : v1 * v2) << endl;

    return 0;
}


Measured memory_bytes: 7296
use std::io::*;
use std::str::FromStr;
use std::cmp;
use std::collections::HashMap;
use std::collections::HashSet;
use std::char;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
fn read_tuple2<T: FromStr, S: FromStr>() -> (T, S) {
    let a = read();
    let b = read();
    (a, b)
}

fn count_two(n: u64) -> u64 {
    fn go(count:u64, num: u64) -> u64 {
        if num % 2 == 0 {
            go(count +1, num / 2)
        } else {
            count
        }
    }
    go(0, n)
}

fn main() {
    let n: u64 = read();
    let alist: Vec<u64> = (0..n).map(|_|read()).collect();
    let ans:u64 = alist.iter().map(|a|count_two(*a)).sum();
    println!("{}", ans);
}



Measured memory_bytes: 2192
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define sz(x) int(x.size())

typedef long long ll;

using namespace std;

/*******-c++14 don't include-*******/
template<typename T>
T gcd(T a, T b){if( b == 0)return a; return gcd(b, a%b); }
template<typename T>
T lcm(T a, T b){return a*b/gcd(a,b); }
void printArr(int *a, int len){for(int i=0; i<len; i++){if(i)cout << " ";cout << a[i];}cout << endl;}
/*******---------------------*******/

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 200001;
//--global--//



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


int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//


    int n;
    cin >> n;
    int *a;
    a = new int[MAX];

    int S = 0;
    rep(i, n){
        cin >> a[i];
        S += a[i];
    }

    //x1 = S - 2(A2...)
    int *x;
    x = new int[MAX];
    int as = 0;
    for(int i=1; i<n; i+=2){
        as += a[i];
    }
    x[0] = S - 2 * as;
    for(int i=1; i<n; i++){
        x[i] = 2*a[i-1] - x[i-1];
    }

    rep(i, n){
        if(i)cout << " ";
        cout << x[i];
    }
    cout << endl;
    
    
    return 0;
}


Measured memory_bytes: 2048
n, m = [int(x) for x in input().split()]

s = [0]*(n+1)
d = [0]*(n+1)

for i in range(m):
	a, b = [int(x) for x in input().split()]
	if a == 1:
		s[b] = 1
		if d[b] == 1:
			print('POSSIBLE')
			break
	elif b == n:
		d[a] = 1
		if s[a] == 1:
			print('POSSIBLE')
			break
else:
	print('IMPOSSIBLE')

Measured memory_bytes: 6132
from collections import deque

def main():
    K = int(input())
    que = deque([i for i in range(1, 10)])

    while K:
        if K == 1:
            ans = que.popleft()
            break
        K -= 1
        v = que.popleft()
        if v % 10 == 0:
            que.append(v * 10)
            que.append(v * 10 + 1)
        elif v % 10 == 9:
            que.append(v * 10 + 8)
            que.append(v * 10 + 9)
        else:
            que.append(v * 10 + (v % 10 - 1))
            que.append(v * 10 + (v % 10))
            que.append(v * 10 + (v % 10 + 1))
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 12896
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
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; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class D {
public:

    vector<P> graph[200005];
    vector<bool> used;
    vector<int> potential;
    bool ret;

    void dfs(int p, vector<int>& v) {
      used[p] = true;
      v.push_back(p);
      for(auto e: graph[p]) {
        if (!used[e.first]) {
          potential[e.first] = e.second - potential[p];
          dfs(e.first, v);
        } else {
          // sanity check
          if (e.second - potential[p] != potential[e.first]) {
            ret = false;
          }
        }
      }
    }


    void solve(istream& cin, ostream& cout) {
      SPEED;
      int r, c; cin >> r >> c;
      used.resize(r+c);
      potential.resize(r+c);
      ret = true;
      int n; cin >> n;
      rep(i, n) {
        int x, y, a; cin >> x >> y >> a;
        x--; y--;
        graph[x].emplace_back(y+r, a);
        graph[y+r].emplace_back(x, a);
      }

      for(int i=0; i<r+c; i++) {
        if (used[i]) continue;
        vector<int> v;
        dfs(i, v);
        int mix = INT_MAX/2;
        int miy = INT_MAX/2;
        for(auto e: v) {
          if (e < r) {
            chmin(mix, potential[e]);
          } else {
            chmin(miy, potential[e]);
          }
        }
        if (mix + miy < 0) {
          ret = false;
        }
      }
      cout << (ret ? "Yes" : "No") << endl;

    }
};

signed main() {
  D solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

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

const int mod=998244353;
int main()
{
	int n,s;
	cin>>n>>s;
	int a[n+1],dp[n+1][3005];
	for(int i=1;i<=n;i++)cin>>a[i];
	memset(dp,0,sizeof(dp));
	//dp[0][0]=1;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=s;j++)
		{
			//if(a[i]==j)continue;
			dp[i][j]+=dp[i-1][j];
			dp[i][j]%=mod;
		}
		dp[i][a[i]]+=i;
		dp[i][a[i]]%=mod;
		for(int j=a[i];j<=s;j++)
		{
			dp[i][j]+=dp[i-1][j-a[i]];
			dp[i][j]%=mod;
		}
		
		ans+=dp[i][s];ans%=mod;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 35456
using System;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] W = Console.ReadLine().Split(' ');
            int[] B = new int[N];
            for(int i=0;i<N-1;i++)
            {
                B[i] = int.Parse(W[i]);
            }
            B[N-1] = B[N - 2];

            int sum = B[0];
            for(int i=0;i<N-1;i++)
            {
                if(B[i]<=B[i+1])
                {
                    sum += B[i];                    
                }
                else
                {
                    sum += B[i+1];
                }
            }
            Console.WriteLine(sum);
        }
    }
}


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

#define ll long long int
#define pf push_front
#define mod  1000000007
#define inf  1000000000000000000
#define pi  acos(-1.0)
#define maxn  1000009
#define endl '\n'
#define sorted(s)  sort(s.begin(),s.end())
#define reversed(s) reverse(s.begin(),s.end())
#define sortarr(a) sort(a,a+n)
#define slc(n) scanf("%I64d", &n)
#define sl(n)  scanf("%lld", &n)
#define sf(n)  scanf("%lf", &n)
#define si(n)  scanf("%d", &n)
#define sch(n)  scanf(" %c", &n)
#define ss(n)  scanf("%s", n)
#define prf printf
#define pb  push_back
#define fr first
#define sc second
#define all(a)  a.begin(),a.end()
#define forl(n) for(i=0;i<n;i++)
#define ison(n,j) (n&(1LL<<j))
#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
ll con[65],c[65];
int main()
{
   ll n,i,j,res=0;
   cin>>n;
   ll a[n+5];
   for(i=0;i<n;i++)
    cin>>a[i];
   for(i=0;i<n;i++)
   {
       for(j=0;j<64;j++)
       {
           if((bool)(a[i]&(1LL<<j)))
            con[j]++;
           else
            c[j]++;
       }
   }
   for(i=0;i<64;i++)
    {
        res+=(((con[i]*c[i])%mod)*((1LL<<i)%mod))%mod;//,cout<<con[i]<<" "<<c[i]<<endl;
        res%=mod;
    }
   cout<<res%mod<<endl;

    return 0;
}


Measured memory_bytes: 5880
#include <stdio.h>

#define MAX 3000

int main( void )
{
int a[MAX];
int b[MAX];
for ( int i = 0; i < MAX; ++i ) {
scanf( "%d %d", a + i, b + i );
}
for ( int i = 0; i < MAX; ++i ) {
if ( a[i] == 0 && b[i] == 0 ) {
break;
}
if ( a[i] < b[i] ) {
printf( "%d %d\n", a[i], b[i] );
}
else {
printf( "%d %d\n", b[i], a[i] );
}
}
return 0;
}


Measured memory_bytes: 2600
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>

#define rep(i,n) for(int (i)=0;i < (n);(i)++)
#define ll long long
#define INF 9223372036854775807

using namespace std;

// input
ll n;
ll a[200001];
map<ll,ll> count;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
	ll in;
	
	cin >> n;
	rep(i,n) {
		cin >> in;
		a[i] = in;
		if(count.find(in) == count.end()) {
			count[in] = 1;
		} else {
			count[in] += 1;
		}
	}

	ll all_ans = 0;
	for(auto p = count.begin();p != count.end();p++) {
		ll tmp = p->second;
		all_ans += (tmp * (tmp - 1)) / 2;
	}

	rep(i,n) {
		ll t = a[i];
		// cout << t << ' ' << i << endl;
		ll ans = all_ans;

		if(count[t] > 1) {
			ll n = count[t];
			ans -= (n*(n-1)) / 2;
			ans += ((n-1) * (n-2)) / 2;
		}
		cout << ans << endl;
	}
} 



Measured memory_bytes: 11136
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


a, b, c = LI()
k = I()
i = 0
while i < k:
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
    if a < b and b < c:
        break
    i += 1
    # print(a, b, c)
if a < b and b < c:
    print('Yes')
else:
    print('No')


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

int main()
{
  i64 N, M;
  cin >> N >> M;
  vector<i64> A(M);
  for (i64 i = 0; i < M; i++)
    cin >> A[i];
  i64 sum = 0;
  for (i64 i : A)
    sum += i;
  cout << max(-1LL, N - sum) << endl;
  return 0;
}


Measured memory_bytes: 3668
n=int(input())
a,b=[],[]
for i in range(n):
	x,y=map(int,input().split())
	a+=[x]
	b+=[y]
ans=0
for i in range(n-1,-1,-1):
	a[i]+=ans
	t=a[i]//b[i]
	if a[i]%b[i]:t+=1
	ans+=t*b[i]-a[i]
print(ans)

Measured memory_bytes: 15016
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int k; cin >> k;
    VI dis(k, INF);
    dis[1] = 1;
    deque<int> q;
    q.push_back(1);
    while (!q.empty()) {
        int now = q.front(); q.pop_front();
        int d = dis[now];
        if (chmin(dis[(now * 10) % k], d)) {
            q.push_front((now * 10) % k);
        }
        if (chmin(dis[(now + 1) % k], d + 1)) {
            q.push_back((now + 1) % k);
        }
    }

    cout << dis[0] << "\n";
}

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

using namespace std;

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();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#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 range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int main(void){
	int x,y,s;
	while(cin >> x >> y >> s){
		if(x==0)
			break;
		int ans=0;
		range(a,1,s)range(b,1,s){
			int pa=a*(100+x)/100;
			int pb=b*(100+x)/100;
			if(pa+pb==s){
				int na=a*(100+y)/100;
				int nb=b*(100+y)/100;
				ans=max(ans,na+nb);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>

int search(int A[], int n, int key)
{
	int i = 0;
	A[n] = key;
	while( A[i] != key ) i++;
	return i != n;
}
int main() {
	int i, n, A[10001], q, key, sum = 0;
	scanf("%d",&n);	
	for( i = 0; i < n; i++ ) scanf("%d",&A[i]);
	scanf("%d",&q);
	for( i = 0; i < q; i++ ) {
		scanf("%d", &key);
		if ( search(A, n, key) ) sum++;
	}
	printf("%d\n", sum);
	return 0;
}



Measured memory_bytes: 1968
#include<bits/stdc++.h>
using namespace std;
using p = pair<int,int>;
using ll = long long;
const auto INF =(ll)1e5;
int main(){
  int n;
  cin >> n;
  auto a = vector<int>(n+2,0);
  for(int i=1;i<=n;i++){
    cin >> a[i];
  }
  auto sum = 0;
  for(int i = 0;i<=n;i++){
    sum += abs(a[i+1]-a[i]);
  }

  for(int i = 1;i<=n;i++){
    cout << sum -abs(a[i]-a[i+1]) - abs(a[i]-a[i-1]) +abs(a[i+1]-a[i-1])<< endl; 
  }

}

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

using namespace std;

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

    vector<int> A(N);
    int a;
    for (int i = 0; i < N; i++)
    {
        cin >> a;
        A[i] = a;
    }

    long double numer = 1;
    for (auto a : A)
    {
        numer *= a;
    }

    long double denom = 0;
    for (int i = 0; i < N; i++)
    {
        long double _denom = 1;
        for (int j = 0; j < N; j++)
        {
            if (i != j)
            {
                _denom *= A[j];
            }
        }
        denom += _denom;
    }

    cout << setprecision(20) << numer / denom << endl;
}

Measured memory_bytes: 888
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define DEBUG(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

int main(int argc, const char * argv[]) {
  std::cout << std::fixed << std::setprecision(15);

  int N; cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  int ans = 0;
  rep(i, N-2){
    if(A[i+1] >= A[i] && A[i+1] <= A[i+2]){
      ans++;
    }
    else if(A[i+1] <= A[i] && A[i+1] >= A[i+2]){
      ans++;
    }
  }
  cout << ans << endl;
}  


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

int main(){
  int n, m;
  cin >> n >> m;
  vector<int>l;
  vector<int>r;
  for(int i = 0; i < m; i++){
    int x, y;
    cin >> x >> y;
    l.push_back(x);
    r.push_back(y);
  }
  int lm = *max_element(l.begin(), l.end());
  int rm = *min_element(r.begin(), r.end());
  int ans = rm - lm + 1;
  ans = max(ans, 0);
  cout << ans;
  return 0;
}

Measured memory_bytes: 1276
using System;
using System.Collections.Generic;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("a");
            //vowel
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("z");
            //consonant
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("s");
            //consonant
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        string c = InputList[0];

        if (c == "a") Console.WriteLine("vowel");
        else if (c == "e") Console.WriteLine("vowel");
        else if (c == "i") Console.WriteLine("vowel");
        else if (c == "o") Console.WriteLine("vowel");
        else if (c == "u") Console.WriteLine("vowel");
        else Console.WriteLine("consonant");
    }
}


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

int main(){
    int64_t N;
    cin >> N;
    
    uint64_t ans = 0;
    for(int64_t r=1;r*(r+1)<N;r++){
        if(N % r != 0) continue;
        ans += N / r - 1;
    }
    cout << ans << endl;
    return 0;
}


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

double speed(int i){
	double height = i * 5 - 5;
	return 2 * 9.8 * height;
}
int main(){
	double vl;
	while(cin >> vl){
		int i = 0;
		while(speed(i) < vl * vl) i++;
		cout << i << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < 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 itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define n_max 55


int main(){
    int n;
    cin >> n;
    int A[n_max][26];
    REP(i,n_max) REP(j,26) A[i][j]=0;
    string s;
    int ind;
    REP(i,n){
        cin >> s;
        itrfor(itr,s){
            for(ind=0;ind<26;ind++){
                if(*itr == moji[ind]) break;
            }
            A[i][ind] +=1;
        }
    }

    REP(i,26){
        FOR(j,1,n){
            A[0][i] = min(A[j][i] , A[0][i]);
        }
    }

    REP(i,26){
        REP(j,A[0][i]) cout << moji[i];
    }
    cout << endl;
}




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

int main(){
    std::vector<int> input;
    for(int i = 0; i < 3; ++i){
        int in;
        std::cin >> in;
        input.push_back(in);
    }
    std::sort(input.begin(), input.end());

    for(int i = 0; i < 3; ++i){
        std::cout << input[i];
        if(i < 2) std::cout << " ";
        else std::cout << std::endl;
    }
    return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

int main(){
    ll N;
    cin >> N;

    vector<ll> A(N);

    for(ll i = 0;i < N;i++)
        cin >> A.at(i);

    ll hako1=0,hako2=0;

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

    for(ll i = 0;i < N -1;i++){
        if(A.at(i) == A.at(i+1)){
            if(hako1 <= hako2)
                hako1 = A.at(i);
            else
            {
                hako2 = A.at(i);
            }
            i++;
        }
    }    
    

    cout << hako1 * hako2 << endl;
    
}

Measured memory_bytes: 3884
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF (1LL<<57)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

int ar[MV];
ll arr[MV];

void solve(int T)
{
	int n,m;
	cin>>n>>m;
	cout<<((n == m) ? "Yes" : "No")<<"\n";
	return;	
}

int main(void)
{
	FLASH();
	int T;
	T = 1;

// #ifndef ONLINE_JUDGE
// 	time_t time_t1, time_t2;
// 	time_t1 = clock();
// #endif

	while(T--)
	solve(T);

// #ifndef ONLINE_JUDGE
// 	time_t2 = clock();
// 	SETF();
// 	cout<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
// 	UNSETF();
// #endif

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
int n,q;

struct UnionFind{
	vector<int> data;
	
	UnionFind(int sz){
		data.assign(sz, -1);
	}
	
	bool unite(int x, int y){
		x = find(x); y = find(y);
		if(x == y) return false;
		if(data[x] > data[y]) swap(x, y);
		data[x] += data[y];
		data[y] = x;
		return true;
	}
	
	bool same(int x,int y){
		if(find(x) == find(y)) return true;
		else return false;
	}
	
	int find(int k){
		if(data[k] < 0) return k;
		return data[k] = find(data[k]);
	}
	
	int size(int k){
		return -data[find(k)];
	}
};

int main(){
	cin >> n >> q;
	
	UnionFind data(n);
	REP(i,0,q){
		int a,b,c;
		cin >> a >> b >> c;
		if(a == 0) data.unite(b,c);
		else cout << data.same(b,c) << endl;
	}
	return 0;
}



Measured memory_bytes: 3156
/*
問題文
整数 n に対して，n を十進法で表したときの各桁の和を S(n) で表すことにします． たとえば，S(101)=1+0+1=2 です．

整数 N が与えられたとき，N が S(N) で割り切れるかどうかを判定してください．

制約
1≤N≤10**9
*/

#include <iostream>


using namespace std;


int main()
{
	int n;

	cin >> n;

	int sum = 0;

	int m = n;

	while ( m != 0){
		sum = sum + m % 10;
		m /= 10;
	}

	if (n%sum==0)	cout << "Yes\n";
	else			cout << "No\n";

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=int(a);i<(int)b;++i)


using namespace std;
using ll = long long;




int n,m,x;





int main(void)
{
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    
    cin >> n >> m >> x;
    ll num = 0,ans = 100000000;
    ll cost[n],get[m];
    vector<vector<ll>> ex(n);
    
    rep(i,n){
        cin >> cost[i];
        rep(j,m){
            ll k;
            cin >> k;
            ex[i].push_back(k);
        }
    }
    for(ll i =0;i < (1<<n);i++)
    {
        rep(t,m)get[t]=0;
        ll kane =0;
        for(ll j=0;j <= n;j++){
            if((1<<j) & i) {
                kane +=cost[j];
                rep(t,m){
                    get[t] += ex[j][t];
                }
        }
        }
        bool ok =true;
    rep(t,m) {
        if(get[t] < x) ok = false;
    }
    if(ok) ans = min(ans,kane);

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


    
    return 0;
}


Measured memory_bytes: 3660
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		while(true){
			final int H = sc.nextInt();
			final int W = sc.nextInt();
			
			if(H == 0 && W == 0){
				break;
			}
			
			for(int i = 0; i < H; i++){
				for(int j = 0; j < W; j++){
					if(i == 0 || i == H - 1 || j == 0 || j == W - 1){
						System.out.print("#");
					}else{
						System.out.print(".");
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}

}

Measured memory_bytes: 22880
a,b,c = gets.chomp.split(" ").map(&:to_i)
if c - a - b > 0  then
	if 4*a*b < (c-a-b)**2
 		puts "Yes"
	else
 		puts "No"
	end
elsif c - a - b < 0 then
  puts 'No'
else
  puts 'No'
end


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
int n;
long long b[65],a[100005];
void insert(long long v){
  for(int i=59;i>=0;i--){
   if((v>>i)&1){
  if(b[i]) v^=b[i];
  else{
   b[i]=v;
   for(int j=i-1;j>=0;j--) if((b[i]>>j)&1) b[i]^=b[j];
   for(int j=i+1;j<60;j++) if((b[j]>>i)&1) b[j]^=b[i];
   break;
}
}
}
}
int main(){
  cin>>n;
  for(int i=0;i<n;i++) cin>>a[i];
  long long x=0;
  for(int i=0;i<n;i++){x^=a[i];}
  for(int i=0;i<n;i++){
    for(int j=0;j<60;j++){
     if(x>>j&1) a[i] &=~(1LL<<j);
}
   insert(a[i]);
}
  long long res=0;
  for(int i=0;i<60;i++) res^=b[i];
  printf("%lld\n",x+2LL*res);
}

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

int main()
{
    int N, x;
    cin >> N >> x;
    vector<int> a(N);
    for (int i = 0; i < N; i++)
    {
        cin >> a.at(i);
    }

    sort(a.begin(), a.end());
    int res = 0;
    for (int i = 0; i < N; i++)
    {
        x -= a.at(i);
        if (x < 0)
        {
            break;
        }
        res++;
    }
    if (x > 0)
    {
        res--;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() {
	int a,b,c,t; cin>>a>>b>>c;
  	if(a>b){t=b;b=a;a=t;}
  	if(b>c){t=c;c=b;b=t;}
  	if(a>b){t=b;b=a;a=t;}
  	cout<<a<<" "<<b<<" "<<c<<endl;
}



Measured memory_bytes: 3124
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    int a,b,c,max;

    scanf("%d %d %d",&a,&b,&c);

    if(a>=b) max=a;
    else max=b;
    if(c>=max) max=c;

    printf("%d",a+b+c+9*max);

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int x, y; cin >> x >> y;
    ll ans = inf_l;
    for (bool b_front : vector<bool> {true,false}) {
        for (bool b_back : vector<bool> {true,false}) {
            int ct = 0;
            int tmp_x = x, tmp_y = y;
            if (b_front) {tmp_x *= -1; ct++;}
            if (b_back) {tmp_y *= -1; ct++;}
            if (tmp_y >= tmp_x) ans = min(ans,(ll)ct+tmp_y-tmp_x);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3616
n = int(input())
c = input()
ans = 0
j = n-1
for i in range(n):
    if i >= j:
        break
    if c[i] == 'R':
        continue
    while i < j and c[j] != 'R':
        j -= 1
    if i == j:
        break
    ans += 1
    j -= 1

print(ans)

Measured memory_bytes: 67784