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

typedef long long int ll;

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

  int one = 0;
  for (int i = 0; s[i] == '1'; i++) one++;
  cout << ((k <= one) ? 1 : s[one] - '0') << endl;
}


Measured memory_bytes: 256
using System;

namespace ITP1_9_C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int pointT = 0;
            int pointH = 0;
            for(int i = 0; i < n; i++)
            {
                string[] cards = Console.ReadLine().Split(' ');
                int point = cards[0].CompareTo(cards[1]);
                if (point > 0)
                    pointT += 3;
                else if (point < 0)
                    pointH += 3;
                else
                {
                    pointT++;
                    pointH++;
                }
            }
            Console.WriteLine("{0} {1}", pointT, pointH);
        }
    }
}

Measured memory_bytes: 9916
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

bool f(int n){
  bool flag3 = false;
  bool flag5 = false;
  bool flag7 = false;
  while(n){
    switch(n % 10){
      case 3: flag3 = true; break;
      case 5: flag5 = true; break;
      case 7: flag7 = true; break;
    }
    n /= 10;
  }
  return flag3 && flag5 && flag7;
}

int main(){
  int N;
  cin >> N;
  vector<int> v = {3, 5, 7};
  vector<int> temp1 = {3, 5, 7};
  rep(i, 9){
    vector<int> temp2;
    for(auto &x: temp1){
      temp2.push_back(x * 10 + 3);
      temp2.push_back(x * 10 + 5);
      temp2.push_back(x * 10 + 7);
    }
    temp1 = temp2;
    for(auto &x: temp1){
      v.push_back(x);
    }
  }

  int ans = 0;
  for(auto &x: v){
    if(x <= N && f(x)) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1328
#include <bits/stdc++.h>
using namespace std;
int main()
{int a,b;
  cin >> a >> b;
  vector<vector<int>> X(a, vector<int>(b));
  for(int i=0; i<a; ++i){
    for(int j=0; j<b; ++j){
      cin >> X[i][j];
    }
  }

  int count = 0;
  for (int i = 0; i < a; ++i){
    for(int j=i+1; j<a; ++j){
      int norm = 0;
      for(int k = 0; k<b; ++k){
        norm += pow((X[i][k]-X[j][k]),2.0);
      }
    if(ceil(sqrt(norm)) == floor(sqrt(norm))){count += 1;}
    }
  }

  cout << count << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
const long long INF = INT_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ll long long int
#define ALL(x) x.begin(),x.end()
using namespace std;
ll ans = 0, sum = 0, n, k, counter = 0, w, h;
string s;
vector<ll> v;
vector < pair<ll, ll > > vp;
vector<vector<ll> > vv(50, vector<ll>(50, INF));
vector<string> vs;
vector<char> vc;
vector<ll> vi;

/*--------------------template--------------------*/


int main() {
	cin >> s;
	if (s.size() == 2 && s[0] == s[1]) {
		cout << 1 << ' ' << 2 << endl;
	}
	else if (s.size() == 2) {
		cout << -1 << ' ' << -1 << endl;
	}
	else {
		REP(i, s.size() - 3) {
			if ((s[i] == s[i + 1] && s[i] == s[i + 2]) || (s[i] == s[i + 2] || s[i + 1] == s[i + 2])) {
				k = i+1;
				sum++;
			}
		}
		if (sum != 0) {
			cout << k << ' ' << k + 2 << endl;
		}
		else {
			cout << -1 << ' ' << -1 << endl;
		}
	}
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
// ----------------------R00TDADA------------------------------
#define rep(i, a, b) for (__typeof((b)) i = (a); i < (b); i++)
#define nrep(i, a, b) for (__typeof((b)) i = (a); i > (b); i--)
#define all(a) (a).begin(), (a).end()
#define ff first
#define ss second
#define ppi pair<int, int>
#define pppi pair<ppi, int>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define prq priority_queue
#define mp make_pair
#define mem(x, val) memset((x), (val), sizeof(x));
#define sz(x) (int)x.size()
#define M_PI 3.14159265358979323846
#define rootdada                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define int long long
#define M 1000000007

signed main()
{
    rootdada;
    // #ifndef ONLINE_JUDGE
    //     // for getting input from input.txt
    //     freopen("input.txt", "r", stdin);
    //     // for writing output to output.txt
    //     freopen("output.txt", "w", stdout);
    // #endif
    int n, m;
    cin >> n >> m;
    int ans = (n * (n - 1) / 2 + m * (m - 1) / 2);
    cout << ans << endl;
}

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

using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int  mod = mo;
constexpr int inf = 1<<30;
constexpr int mo2 = 998244353;
constexpr ll infl = 1ll<<60;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin>>n;
    string str;
    cin>>str;
    for(auto &a : str){
        a = (char)(((a-'A'+n)%26)+'A');
    }
    cout << str << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<utility>
#include<algorithm>
#include<functional>
#include<ctime>
#include<cmath>
#include<cstdlib>
#include<cstdio>
using namespace std;
int A[100100];
map<int,int> mp;
int main()
{
	int N,T,lst,x;
	cin>>N>>T;
	for(int i=0;i<N;i++)
	{
		cin>>A[i];
		if(!i)
			x=A[i];
		else	x=min(lst,A[i-1]);
		mp[A[i]-x]++;
		lst=x;
	}
	map<int,int>::iterator it=mp.end();
	it--;
	cout<<it->second<<endl;
	return 0;
}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() { 
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin>>s;
  for(int i=0;i<s.size();i+=2) { 
    cout<<s[i];
    }
  
  return 0;
}


Measured memory_bytes: 3688
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
using namespace std;

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

	vector<int> X(N);
	for(int i=0; i<N; i++)
		cin >> X[i];

	vector<int> buf(X);
	sort(buf.begin(), buf.end());

	int index = N / 2 - 1;
	for(int i=0; i<N; i++){
		//cout << X[i] << " " << buf[index] << endl;
		if(X[i] <= buf[index])
			cout << buf[index+1] << endl;
		else
			cout << buf[index] << endl;
	}

	return 0;
}


Measured memory_bytes: 3712
N = int(input())
p = [
    sum(N // (i**k) for k in range(1, 8))
    for i in range(2, 97 + 1)
    if all(i % j != 0 for j in range(2, i))
]
def f(m):
  return len([i for i in p if i >= m])
ans = f(74) + f(24) * (f(2) - 1) + f(14) * (f(4) - 1) + f(4) * (f(4) - 1) * (f(2) - 2) // 2
print(ans)

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

void Main()
{
  int n;
  cin >> n;
  if (n < 600) cout << 8 << endl;
  else if (n < 800) cout << 7 << endl;
  else if (n < 1000) cout << 6 << endl;
  else if (n < 1200) cout << 5 << endl;
  else if (n < 1400) cout << 4 << endl;
  else if (n < 1600) cout << 3 << endl;
  else if (n < 1800) cout << 2 << endl;
  else cout << 1 << endl;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  Main();
  return 0;
}


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



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pi> vpi;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

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

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

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

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

/*
PROG:
LANG: C++
*/

class BComparingStrings {
public:
    void solve(std::istream &in, std::ostream &out) {
        int a, b;
        in >> a >> b;
        if (a < b) {
            swap(a, b);
        }
        string res(a, '0' + b);
        out << res << "\n";
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    BComparingStrings solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
template<class T>inline bool CHMIN(T&a,T b){if(a > b){a = b;return true;}return false;}
template<class T>inline bool CHMAX(T&a,T b){if(a < b){a = b;return true;}return false;}
constexpr int INF = 1e18;
 
signed main(){
	string s;
	cin >> s;
	string t = "";
	REP(i,3)t += s[i];
	out(t);
}

Measured memory_bytes: 3628
n,*a=map(int,open(0).read().split())
b=[0]*-~n
for i in range(n,0,-1):b[i]=(sum(b[j]for j in range(i,n+1,i))+a[i-1])%2
c=[i for i in range(n+1)if b[i]]
print(len(c),*c)

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

int main(){
    ll n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;++i)cin>>a[i];
    ll ans = 0; 
    ll mul = 1;             //mul = multiplier --> (power of 2)
    for(int j=1;j<=64;++j){
        ll count_e = 0,count_o = 0;         //count of even and odd numbers among n elements
        for(int i=0;i<n;++i){
            if(a[i]&1)count_o++;
            else count_e++;
            a[i] = (a[i]>>1);           //right shift so that the elements will be ready to be judged in the next iteration if it's even or odd
        }
        ll pairs = (count_o*count_e)%mod;   // total no.of pairs whose product of those two respective nums has it's last digit as set (1) 
        ans = (ans + pairs*mul)%mod;
        mul = (mul*2LL)%mod;
    }
    cout<<ans;
}

Measured memory_bytes: 5928
# 蟻本1-6-1例題相当
# 今回は、xのみ確定した際、y,zの取りうる値の組の数を求める。
# よって1重のfor文で回してみる
# 最大で2500となる
# 今回は、xの取りうる範囲を考慮する

k, s = map(int,input().split())
xmin = (s - 2 * k) if (s - 2 * k) > 0 else 0
xmax = k if k < s else s
count = 0
for x in range(xmin, xmax+1):
  if 0 <= s-x and s-x <= k: #(y,z) = (0, s-x), ... ,(s-x, 0)
    count += s-x+1
  elif k <= s-x and s-x <= 2*k: #(y,z) = (s-x-k, k), ... ,(k, s-x-k)
    count += 2*k-(s-x)+1
print(count)

Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	int dn[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	string youbi[7] = {"Monday", "Tuesday", "Wednesday", "Thursday",
		"Friday", "Saturday", "Sunday"};
	int m, d;
	while (cin >> m >> d) {
		if (m == 0) break;
		int sum = 0;
		for (int i = 1; i < m; ++i) {
			sum += dn[i];
		}
		sum += d;
		cout << youbi[(sum + 2) % 7] << endl;
	}
	return 0;
}

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

int F[102][102];

void
DFS (int Y, int X, int A)
{
  if (F[Y][X] != A)
    return;

  F[Y][X] = 7;

  DFS (Y - 1, X, A);
  DFS (Y, X + 1, A);
  DFS (Y + 1, X, A);
  DFS (Y, X - 1, A);
}

int
main ()
{
  int w, h;
  int xs, ys;
  int xg, yg;
  int n;
  int c, d, x, y;

  while (true)
    {
      cin >> w >> h;
      if (w == 0 && h == 0)
	break;
      cin >> xs >> ys;
      cin >> xg >> yg;
      cin >> n;

      for (int i = 0; i < n; i++)
	{
	  cin >> c >> d >> x >> y;
	  if (d == 0)
	    {
	      for (int a = 0; a < 4; a++)
		{
		  for (int b = 0; b < 2; b++)
		    {
		      F[y + b][x + a] = c;
		    }
		}

	    }
	  else
	    {
	      for (int a = 0; a < 2; a++)
		{
		  for (int b = 0; b < 4; b++)
		    {
		      F[y + b][x + a] = c;
		    }
		}
	    }

	}


      if (F[ys][xs] == 1 || F[ys][xs] == 2 || F[ys][xs] == 3
	  || F[ys][xs] == 4 || F[ys][xs] == 5)
	{
	  DFS (ys, xs, F[ys][xs]);
	}

      if (F[yg][xg] == 7)
	{
	  cout << "OK" << endl;
	}
      else
	{
	  cout << "NG" << endl;
	}
   
    /*for (int y = 0; y < h; y++)
	{
	  for (int x = 0; x < w; x++)
	    {
	      cout << F[y][x];
	    }
         cout << endl;
	}*/
   
    for (int y = 1; y <= h; y++)
	{
	  for (int x = 1; x <= w; x++)
	    {
	      F[y][x] = 0;
	    }
	}

    
   
    }

  return 0;
}

Measured memory_bytes: 3008
/**
*    created: 02.08.2020 21:46:26
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,s,n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dx2[8] = {0, 1, 0, -1, 1, 1,-1, -1};
const int dy2[8] = {1, 0,-1, 0, 1, -1, 1, -1};
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;

signed main() {

    cin.tie(0);
    ios_base::sync_with_stdio(false);

    int n; cin >> n;
    string s; cin >> s;
    int r = 0;
    rep(i,n) if (s[i] == 'R') r++;
    int wcnt = 0;
    rep(i,r) if (s[i] == 'W') wcnt++;
    cout << wcnt << endl;
    return 0;
}

Measured memory_bytes: 3740
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
void init(int a[100001]){
    for(int i = 0; i < 100001; i++){
        a[i] = MM;
    }
}
int main(){
    int cnt = 0;
    int r,g,b,n; cin >> r >> g >> b >> n;
    for(int i = 0; i <= 3000; i++){
        for(int j = 0; j <= 3000; j++){
            if(i*r + j*g > n) j = 3000;
            ll k = n - i*r - j*g;
            if(k % b == 0 && k >= 0) cnt++;
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
import sys

INF = 1000000000

def resolve():
  n = int(input())
  x = list(map(int, input().split()))
  ans = INF
  for i in range(1, 100):
    t = x
    tmp = 0
    for j in x:
      tmp += abs(i - j) ** 2
    ans = min(ans, tmp)
  print(ans)
  return

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 3060
A = list(input())
B = list(input())
result = 'EQUAL'
if len(A) > len(B):
    result = 'GREATER'
elif len(B) > len(A):
    result = 'LESS'
else:
    for i in range(len(A)):
        if A[i] > B[i]:
            result ='GREATER'
            break
        elif B[i] > A[i]:
            result = 'LESS'
            break
print(result)    

Measured memory_bytes: 9072
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
        
N,M,K = map(int,input().split())
uf = UnionFind(N)

friend_cnt = [0] * N
for i in range(M):
    A,B = map(lambda x:int(x)-1,input().split())
    uf.union(A,B)
    friend_cnt[A]+=1
    friend_cnt[B]+=1
    
block_cnt = [0] * N
for i in range(K):
    C,D = map(lambda x:int(x)-1,input().split())
    if uf.same(C,D):
        block_cnt[C]+=1
        block_cnt[D]+=1
        
print(' '.join(map(lambda i:str(uf.size(i)-friend_cnt[i]-block_cnt[i]-1), range(N))))


Measured memory_bytes: 105688
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define quick                    \
    ios::sync_with_stdio(false); \
    cin.tie(0);
#define time cerr << (0.1 * clock()) / CLOCKS_PER_SEC << endl;
#define mod 1000000007
typedef long long ll;
typedef pair<ll, ll> pl;
#define forn(n) for (ll i = 0; i < ll(n); i++)

void solve() {
    string s, t;
    cin >> s;
    cin >> t;
    int count = 0;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] != t[i]) {
            count++;
        }
    }
    cout << count << '\n';
}

int main() {
    quick;
    solve();
    // ll t;
    // cin >> t;
    // while (t--) {
    //     solve();
    // }
}

Measured memory_bytes: 3816
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define vl vector<ll>
#define vpl vector<pair<ll,ll>>

int main(){
    int n,k;cin>>n>>k;
    vl h(n);rep(i,n)cin>>h[i];

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

    vl d(n-k+1);

    rep(i,n-k+1){
        d[i]=h[i+k-1]-h[i];
    }

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

    cout<<d[0]<<endl;


}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
using ll = long long;
using ii = pair<int, int>;
constexpr int MN = 2e5+5;
constexpr int MOD = 1e9+7;


inline ll pw(ll base, ll exp) {
	ll res = 1;
	while (exp) {
		if (exp & 1) (res *= base) %= MOD;
		exp >>= 1, (base *= base) %= MOD;
	}
	return res;
}

inline ll inv(ll x) { return pw(x, MOD-2); }

ll fact[MN] = { 1 }, ifact[MN] = { 1 };

inline ll nCr(int n, int k) { return fact[n]*ifact[k]%MOD*ifact[n-k]%MOD; }

int c[MN], w[MN];
vector<int> G[MN];
vector<ii> P[MN];
bitset<MN> vis;

inline void add(int u, int v) { G[u].push_back(v), G[v].push_back(u); }

void dfs(int u, vector<int> & ret) {
	ret.push_back(c[u]);
	vis[u] = 1;
	for (int v : G[u]) if (!vis[v]) {
		vector<int> tmp; dfs(v, tmp);
		if (tmp.size() > ret.size()) swap(tmp, ret);
		for (int x : tmp) ret.push_back(x);
	}
}


int main() {
	if (fopen("in", "r")) freopen("in", "r", stdin), freopen("out", "w", stdout);
	ios_base::sync_with_stdio(0), cin.tie(0);
	
	int N, X, Y; cin >> N >> X >> Y;
	for (int i = 0; i < N; ++i) {
		cin >> c[i] >> w[i];
		P[--c[i]].emplace_back(w[i], i);
	}

	for (int i = 0; i < N; ++i) {
		sort(begin(P[i]), end(P[i]));
		for (int j = 1; j < P[i].size(); ++j)
			if (P[i][0].f+P[i][j].f <= X) add(P[i][0].s, P[i][j].s);
	}

	int a = N, b = N; P[N].emplace_back(1e9, 0);
	for (int i = 0; i < N; ++i) {
		if (P[i].size()) {
			if (P[i][0].f < P[a][0].f) b = a, a = i;
			else if (P[i][0].f < P[b][0].f) b = i;
		}
	}

	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < P[i].size(); ++j) {
			if (i != a && P[a][0].f+P[i][j].f <= Y) add(P[a][0].s, P[i][j].s);
			if (i != b && P[b][0].f+P[i][j].f <= Y) add(P[b][0].s, P[i][j].s);
		}
	}

	for (int i = 0; i < N; ++i) fact[i+1] = (i+1ll)*fact[i]%MOD, ifact[i+1] = inv(fact[i+1]);

	ll ans = 1;
	for (int i = 0; i < N; ++i) if (!vis[i]) {
		vector<int> v; dfs(i, v);
		map<int, int> m;
		for (int x : v) ++m[x];
		(ans *= fact[v.size()]) %= MOD;
		for (ii p : m) (ans *= ifact[p.s]) %= MOD;		
	}
	cout << ans;
}


Measured memory_bytes: 34752
#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<string>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> V(N);
  for (int i=0; i<N; i++) cin >> V[i];
  sort(V.begin(),V.end());
  int l=N/2-1;
  int r=N/2;
  int cnt = 0;
  for (int i=V[l]+1; i<=V[r]-1; i++) {
    cnt++;
  }
  int lcnt = 0;
  int rcnt = 0;
  for (int i=0; i<r; i++) lcnt++;
  for (int i=r; i<N; i++) rcnt++;
  if (lcnt == rcnt) cnt++;
  if (V[l] == V[r]) cnt--;
  cout << cnt << endl;
}
  

Measured memory_bytes: 640
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define double long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define pii pair<int,int>
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   1000000007 // 1e9 + 7
using namespace std;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int exp(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}
string s;
int d;
vector<int> v(10100);
int dp[10100][100][2];
int f(char c){
    return (c-'0');
}
int add(int a,int b){
    int ret = a + b;
    if(ret >= M) ret-= M;
    return ret;
}
int solve(int idx,int mdl,bool sml){
    int &x = dp[idx][mdl][sml];
    if(x!=-1){
        return x;
    }
    if(idx == s.size()){
        return (sml && !mdl);
    }
    x = 0;   
    int lm = f(s[idx]);
    if(sml){
        for(int i=0;i<=9;i++){
            x = add(x,solve(idx+1, (mdl + i)%d, (i <= lm))) ;
        }
    }
    else{
        for(int i=0;i<=9;i++){
            x = add(x,solve(idx+1, (mdl + i)%d, (i < lm))) ;
        }
    }
    return x;
}
int32_t main(){
    fastio;
    cin >> s >> d;
    reverse(td(s));
    ms(dp,-1);
    cout << mod(solve(0,0,1)-1,M) << endl;
}

Measured memory_bytes: 16896
#include <stdio.h>

int main(void)
{
    int seq = 1;
    while(1){
        int n;
        int x[50], y[50];

        scanf("%d", &n);
        if(n == 0)
            break;

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

        double area = 0;

        for(i = 0; i < n; i++){
            double temp = 0.5 * (((double)x[i] * (double)y[(i + 1)%n]) - ((double)x[(i + 1)%n] * (double)y[i]));
            area += temp;
        }

        if(area < 0)
            area *= -1;

        printf("%d %.1f\n", seq++, area);
    }

    return 0;
}

Measured memory_bytes: 636
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools
    import string

    n = int(input())
    # s = [input() for _ in range(n)]
    a_z = string.ascii_lowercase
    counters = []
    for _ in range(n):
        s = input()
        # print(s)
        tmp_counter = {char: 0 for char in a_z}
        input_counter = collections.Counter(s)
        for char, count in input_counter.items():
            tmp_counter[char] += count
        counters.append(tmp_counter)

    char_common = collections.defaultdict(int)
    for char in a_z:
        char_common[char] = min([counter[char] for counter in counters])
    
    ans = ''
    for char in a_z:
        ans += char_common[char] * char
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3824
/*
 	?????¨NANA????????§?\????

 */
#include<bits/stdc++.h>

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
using namespace std;

const int INF = 1e16 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
int n,k,memo[300][300];
vi day,high,cost;
vi low;

int hot(int num,int mae){
    //cout <<"a";
    if(memo[num][mae]>=0){return memo[num][mae];}
    if(num>=n){
      //  cout << "a";
        return memo[num][mae]=0;
    }else{
        int ans = 0;
        //???????????????????????§???????±?
        rep(i,0,k){
            if(low[i]<day[num]){
            }else if(high[i]>day[num]){
            }else{
                ans=max(ans,hot(num+1,cost[i])+abs(cost[i]-mae));
               // cout << num<<" "<<cost[i]<<" "<<mae <<endl;
            }
        }
        //cout << "k";
        return memo[num][mae]=ans;
    }
}

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    rep(i,0,210)rep(j,0,210)memo[i][j]=-1;
    cin >> n >> k ;
    rep(i,0,n){
        int x ;
        cin >> x;
        day.pb(x);
    }
    rep(i,0,k){
        int x , y , z;
        cin >> x >> y >> z;
        low.pb(y);//??????????????????
        high.pb(x);//??????????????????
        cost.pb(z);
    }
    //sort(low.begin(),low.end());//low?????????
    int ans = 0;
    rep(i,0,k){
        if(low[i]>=day[0]&&high[i]<=day[0]){
            //cout << cost[i] << endl;
            ans = max(ans,hot(1,cost[i]));
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3712
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;

int main(){
int a=read(),b=read();
write((a-1)*(b-1));
}

Measured memory_bytes: 256
lst = []
for i in range(3):
    l = list(map(int,input().split()))
    lst.append(l)

n = int(input())
B = [int(input()) for _ in range(n)]

y = []
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(lst[i][j])
    y.append(tmp)
for i in range(3):
    tmp = []
    for j in range(3):
        tmp.append(lst[j][i])
    y.append(tmp)

y.append([lst[0][0], lst[1][1], lst[2][2]])
y.append([lst[0][2], lst[1][1], lst[2][0]])

res = False
for i in range(len(y)):
    a,b,c = y[i][0], y[i][1], y[i][2]
    if (a in B) and (b in B) and (c in B):
        res = True
print('Yes' if res else 'No')

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl




typedef long long ll;
const ll mod = 1e9+7;
const int maxn = 1e6 + 5;



int n, k;
ll ans;
ll acc[maxn], accr[maxn];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
    cin>>n>>k;
    for (int i=1; i<=n; i++) {
	acc[i]=acc[i-1]+i;
    }

    for (int i=n; i>=0; i--) {
	accr[i]=accr[i+1]+i;
    }


    for (int i=k; i<=n+1; i++) {
	ll lo=acc[i-1];
	ll hi=accr[n-i+1];
	ans += (hi-lo+1);
	ans %= mod;
    }

    cout<<ans<<endl;

    return 0;
}


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

public class Main {
	static class Node {
		int notNIL = 1;
		int id = -1;
		Node parent = NIL;
		Node left = NIL;
		Node right = NIL;
		Node sibling = NIL;
		int degree;
		int depth = -2;
		int height = -2;
	}
	static Node NIL = new Node();
	
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		Node[] tree = new Node[n + 1];
		NIL.notNIL = 0;
		NIL.depth = -1;
		NIL.height = -1;
		tree[0] = NIL;
		for (int i = 1; i < n + 1; i ++) {
			tree[i] = new Node();
		}

		for (int i = 0; i < n; i ++) {
			int id = scanner.nextInt();
			Node u = tree[id + 1];
			u.id = id;
			
			Node left = tree[scanner.nextInt() + 1];
			u.left = left;
			left.parent = u;
			
			Node right = tree[scanner.nextInt() + 1];
			u.right = right;
			right.parent = u;
			
			left.sibling = right;
			right.sibling = left;
			
			u.degree = left.notNIL + right.notNIL;
		}

		scanner.close();
		
		Node root;
		for (root = tree[1]; root.parent != NIL; root = root.parent);
		
		System.out.println("Preorder");
		preorder(root);
		System.out.println();
		System.out.println("Inorder");
		inorder(root);
		System.out.println();
		System.out.println("Postorder");
		postorder(root);
		System.out.println();
	}
	
	static void preorder(Node u) {
		if (u == NIL) return;
		
		System.out.print(" ");
		System.out.print(u.id);
		preorder(u.left);
		preorder(u.right);
	}
	
	static void inorder(Node u) {
		if (u == NIL) return;
		
		inorder(u.left);
		System.out.print(" ");
		System.out.print(u.id);
		inorder(u.right);
	}
	
	static void postorder(Node u) {
		if (u == NIL) return;
		
		postorder(u.left);
		postorder(u.right);
		System.out.print(" ");
		System.out.print(u.id);
	}
} 



Measured memory_bytes: 26296
#include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <iterator>
using namespace std;
int main()
{
	string inp;
	stack <int> var;
	cin>>inp;
	int s=inp.size(),i;
	for(i=0 ; i<s ; i++){
		if(inp[i]=='0') var.push(0);
		else if(inp[i]=='1') var.push(1);
		else if(inp[i]=='B'){
			if(!var.empty()) var.pop();
		}
	}
	vector <int> out;
	while(!var.empty()){
		int x=var.top();
		out.push_back(x);
		var.pop();
	}
	for(auto itr=out.end()-1; itr>=out.begin() ; itr--){
		cout<<*itr;
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for (int i = (a); i < (b); i++)
#define FO(i,a,b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;

char str[1005];
ll T;

ll parse1() {
    int len = strlen(str);
    ll cN = 1;
    ll totV = 0;
    for (int i = 0; i < len; i+= 2) {
        cN *= (str[i]-'0');
        if (i == len-1 || str[i+1] == '+') {
            totV += cN;
            cN = 1;
        }
    }
    return totV;
}

ll parse2() {
    int len = strlen(str);
    ll cN = (str[0]-'0');
    for (int i = 2; i < len; i += 2) {
        if (str[i-1] == '+') {
            cN += (ll)(str[i]-'0');
        } else {
            cN *= (long long)(str[i]-'0');
        }
    }
    return cN;
}

int main() {
    scanf ("%s ", str);
    scanf ("%lld", &T);
    int c1 = (parse1() == T);
    int c2 = (parse2() == T);
    if (c1 && c2) {
        printf ("U\n");
    } else if (c1) {
        printf ("M\n");
    } else if (c2) {
        printf ("L\n");
    } else {
        printf ("I\n");
    }

    return 0;
}

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

int k[10];

void a(){
  k[0]=1;
  for(int i=1;i<10;i++){
    k[i]=k[i-1]*i;
  }
}

int main(){
  a();
  int n;
  cin>>n;
  vector<double> x(n),y(n);
  for(int i=0;i<n;i++){
    cin>>x[i]>>y[i];
  }
  double sum=0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      sum+=2*k[n-1]*sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
    }
  }
  printf("%.10lf\n",sum/k[n]);
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(void){

    int r, c;

    cin >> r >> c;

    int a[101][101] = {0};

    int i, j, b;

    for(i = 0;i < r;i++){

        for(j = 0;j < c + 1;j++){

            if(j != c){ 
                
                cin >> a[i][j];
                
                a[i][c] = a[i][c] + a[i][j];

                a[r][j] = a[r][j] + a[i][j];
                
                cout << a[i][j] << ' ';

            }

            if(j == c) cout << a[i][c];

        }

        cout << endl;

    }

    for(j = 0;j < c + 1;j++){

        if(j != c)cout << a[r][j] << ' ';

        else{cout << a[r][j];
        
        }

        a[r][c] = a[r][c] + a[r][j];

    }

    cout << endl;

return 0;

}

Measured memory_bytes: 1208
#include <iostream>
#include <vector>
#include <cmath>

double grad(std::vector<int>, double);

int main(void)
{
  int N;
  std::cin >> N;
  int temp;
  std::vector<int> a;
  double ave=0;
  for(int ii=0;ii<N;ii++){
    std::cin >> temp;
    a.push_back(temp);
    ave += temp;
  }
  ave /= N;
  
  while(fabs(grad(a, ave))>0.001){
    ave = ave-0.1*grad(a, ave);
  }
  
  if(ave-(int)ave<0.5){
    ave=(int)ave;
  }else{
    ave=(int)ave+1;
  }
  
  int cost=0;
  for(int ii=0;ii<N;ii++){
    cost += pow(a[ii]-ave, 2);
  }
  
  std::cout << cost << std::endl;
  
  return 0;
}

double grad(std::vector<int> a, double ave)
{
  double sum=0;
  for(int ii=0;ii<a.size();ii++){
    sum += ave-a[ii];
  }
  return sum;
}

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

int main() {
	// your code goes here
	int n;
	int sum1=0;
	int sum2=0;
	cin>>n;
	int w[n];
	int s[n];
	int s2[n];
	int t;
	for (int i=0;i<n;i++){
	    cin>>t;
	    w[i]=t;
	    sum1+=t;
	    s[i]=sum1;
	}
	int minsum=sum1;
	for (int i=n-1;i>0;i--){
	    sum2+=w[i];
	    s2[i]=sum2;
	    t=abs(s[i-1]-sum2);
	    if (t<minsum) minsum=t;
	}
	cout<<minsum;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rp(i,n) for (int i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) sort(a.begin(), a.end(), [](int i, int j) -> bool { return abs(i) < abs(j); });
using namespace std;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
using ll = long long;
double pi=3.14159265359;

//出力するよ
void output(vector<int> s){
    int n = s.size();
    for (int i = 0; i < n; i++){
        //if (i != 0)
        //    cout << " ";
        cout << s[i]<<endl;
    }
    //cout << endl;
}

void output3(vector<int> s){
    int n = s.size();
    for (int i = 0; i < n; i++){
        if (i != 0)
            cout << " ";
        cout << s[i];//<<endl;
    }
    cout << endl;
}
int MOD = pow(10, 9) + 7;


//配列の最大の長さ
int longest=2*pow(10,5);
//分割後のリスト２つ
vector<int> L(longest/2 + 2),R(longest/2 +2);
//最大の値
int MAX=pow(10,10);

int merge(vector<int> A,int n,int left,int mid,int right){
    int i,j,k;
    int cnt=0;
    int n1=mid-left;
    int n2=right-mid;
    for(int i=0;i<n1;i++) L[i]=A[left+i];
    for(int i=0;i<n2;i++) R[i]=A[mid+i];
    L[n1]=R[n2]=MAX;
    i=j=0;

    for(k=left;k<right;k++){
        if(L[i]<=R[i]){
            A[k]=L[i];
            i++;
        }else{
            A[k]=R[j];
            j++;
            cnt+=n1-i;
        }
    }
    return cnt;
}

//マージソートする
int mergeSort(vector<int> A,int n,int left,int right){
    int mid;
    int v1,v2,v3;
    if(left+1<right){
        mid=(left+right)/2;
        v1=mergeSort(A,n,left,mid);
        v2=mergeSort(A,n,mid,right);
        v3=merge(A,n,left,mid,right);
        return v1+v2+v3;
    }else return 0;
}

ll merge_cnt(vector<int> &a) {
    int n = a.size();
    if (n <= 1) { return 0; }

    ll cnt = 0;
    vector<int> b(a.begin(), a.begin()+n/2);
    vector<int> c(a.begin()+n/2, a.end());

    cnt += merge_cnt(b);
    cnt += merge_cnt(c);

    int ai = 0, bi = 0, ci = 0;
    // merge の処理
    while (ai < n) {
        if ( bi < b.size() && (ci == c.size() || b[bi] <= c[ci]) ) {
            a[ai++] = b[bi++];
        } else {
            cnt += n / 2 - bi;
            a[ai++] = c[ci++];
        }
    }
    return cnt;
}

signed main(){
    int n; cin>>n;
    vector<int> a(n);
    rp(i,n) cin>>a[i];

    //反転数を求めてくれる
    //int ans=mergeSort(a,n,0,n);
    cout<<merge_cnt(a)<<endl;    

}


Measured memory_bytes: 9284
/*Made by Shivam Solanki*/
#include<bits/stdc++.h> 
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define ll long long int
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<pii> vp;
typedef vector<pll> vpll;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef set<int> sii;
typedef set<ll> sll;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umii;
typedef unordered_map<ll,ll> umll;
typedef queue<int> qii;
#define rep(i,k,n) for (int i = k; i < n; ++i) 
#define repr(i,k,n) for (int i = n; i>=k; --i)
#define repll(i,k,n) for (ll i = k; i < n; ++i) 
#define repllr(i,k,n) for (ll i = n; i >= k; --i) 
#define pb push_back
#define mp make_pair
#define gcd __gcd
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int INF = 1e9+5;
const int MOD = 1e9+7;

void solve(){
    int n,m;
    cin>>n>>m;
    cout<<(n==m?"Yes":"No");
}
    
int main(){
    // #ifndef ONLINE_JUDGE  
        // freopen("input.txt", "r", stdin); 
        // freopen("output.txt", "w", stdout); 
    // #endif 
    // fastio;
    int t=1;
    // cin>>t;
    while(t--)
        solve();
    return 0;
}

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

int ds(int p)
{
    int ret = 0;
    while (p) {
        ret += p % 10;
        p /= 10;
    }
    return ret;
}

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

    Int(n);
    
    int ans = INF;
    Rep(i, n) {
        ans = min(ans, ds(i) + ds(n-i));
    }
    std::cout << ans << std::endl;

    return 0;
}


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

using namespace std;

int frogCost(int h[],int d[],int n,int k){
  if(d[n] != INT_MAX)
    return d[n];
    int cost = INT_MAX;
    for(int i=1;i<=k;i++){
      if((n-i)>=0){
      int diff = abs(h[n-i] - h[n]);
      cost = min(cost,diff+frogCost(h,d,n-i,k));
    }
    }
    d[n] = cost;
    return cost;
}
int main(){
  int N,K;

  cin>>N>>K;
  int heights[N];
  int cost[N];
  for(int i=0;i<N;i++){
    int h;
    cin>>h;
    heights[i] = h;
    cost[i] = INT_MAX;
  }
cost[0] = 0;
  // for(int j=0;j<N;j++){
  //   for(int k=1;k<=K;k++){
  //     if(j+k<N){
  //       int diff = abs(heights[j] - heights[j+k]);
  //       cost[j+k] = min(cost[j+k],cost[j]+diff);
  //     }
  //   }
  // }
  cout<<frogCost(heights,cost,N-1,K);
  return 0;
}


Measured memory_bytes: 13788
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
using namespace std;

typedef long long ll;

int N;
int ans = 0;
typedef pair < int, int > P;

bool pairCompare(const P& firstElof, const P& secondElof)
{
	return firstElof.first < secondElof.first;
}

int main() {
	cin >> N;
	vector <P> p;
	int first, second;
	for (int i = 0; i < N - 1; i++) {
		cin >> first;
		second = i;
		p.push_back(P(first, second));
	}
	vector <int> A(N, -1);

	sort(p.begin(), p.end(), pairCompare);

	for (int i = 0; i < N - 1; i++) {
		if (A[p[i].second] == -1) {
			A[p[i].second] = p[i].first;
		}
		if (A[p[i].second + 1] == -1) {
			A[p[i].second + 1] = p[i].first;
		}
	}

	for (int i = 0; i < N; i++) {
		ans += A[i];
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FOR(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
typedef long long ll;
void solve(){
	int n;
	cin>>n;
	vector<ll> v(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	ll count=0;
	FOR(i,v.size())REP(j,i+1,v.size())REP(k,j+1,v.size()){
		if(v[i]^v[j]&&v[j]^v[k]&&v[k]^v[i]){
			if(v[i]+v[j]>v[k]&&v[k]+v[j]>v[i]&&v[i]+v[k]>v[j])count++;
		}
	}
	cout<<count<<"\n";
}
int main(){
	FASTIO
	solve();
	return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
typedef long long int ll;
typedef vector<int> vi;

int main(){
    while(1){
        int x, y, s;
        cin >> x >> y >> s;
        if(!(x || y || s)) break;
        int max_ = 0;
        int tmp, tmp_x;
        rep(i, s+1){
            rep(j, s+1){
                tmp_x = i*(100+x)/100 + j*(100+x)/100;
                if(tmp_x == s){
                    tmp = i*(100+y)/(100) + j*(100+y)/(100);
                    max_ = max(tmp, max_);
                }
            }
        }
        cout << max_ << endl;
    }
    return 0;
}


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

#define pii pair<int,int>
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
template<typename T, typename U> 
static inline void amin(T &x, U y){
	if(x>y)
		x = y;
}
template<typename T, typename U> 
static inline void amax(T &x, U y){
	if(x<y)
		x = y;
}
#define rep(i,n) for(int i = 0; i < n; ++i)
#define REP(i,k,n) for(int i = k; i <= n; ++i)
#define REPR(i,k,n) for(int i = k; i >= n; --i)

int inf = 2e9;
ll INF = 2e18;
const int mod = 1e9+7;

int main(){
	int n;
	cin >> n;
	int a[n];
	rep(i,n){
		cin >> a[i];
	}
	vvi dp(n,vi(n,0));
	REPR(l,n-1,0){
		REP(r,l,n-1){
			if(l==r){
				dp[l][r] = a[l];
			}else{
				dp[l][r] = max(a[l]-dp[l+1][r],a[r]-dp[l][r-1]);
			}
		}
	}
	cout<<dp[0][n-1]<<endl;
	return 0;
}

Measured memory_bytes: 70656
#include <iostream>
#include <map>

using namespace std;
map<int,int> mp;
int main(){
	int i,j,n;
	long long ans = 0,num1 = 0,num2 = 0,num3 = 0,num4 = 0;
	cin >> n;
	for(i=2;i<=n;i++){
		int x = i;
		for(j=2;j<x;j++){
			while(x%j==0){
				mp[j]++;
				x /= j;
			}
		}
		if(x!=1) mp[x]++;
	}
	for(auto x:mp){
		if(x.second>=74) ans++;
		if(x.second>=24) num1++;
		if(x.second>=14) num2++;
		if(x.second>=4) num3++;
		if(x.second>=2) num4++;
	}
	ans += num1*(num4 - 1);
	ans += num2*(num3 - 1);
	ans += num3*(num3-1)/2*(num4 - 2);
	cout << ans << endl;
}

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

int main()
{
    int c,i,n;
    double sum=0,a,b;

    cin>>n;
    for(i=1;i<=n;i++){
    cin>>a;

    sum=sum+(1/a);
    }

    b=1/sum;
   cout<<fixed<<setprecision(6)<<b<<endl;

    return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <map>
#include <complex>
#include <iomanip>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <cstring>

#define ll long long
#define ld long double
#define HS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define INF 0x3f3f3f3f3f3f3f3f
#define point complex <double> 
#define pi acos(-1)
#define mod 1000000007


using namespace std;


double dot(point a, point b)
{
	return (conj(a) * b).real();
}
double cross(point a, point b)
{
	return (conj(a) * b).imag();
}

ll cntA[100005], cntB[100005];


int main() {
	HS
		int n;
	cin >> n;
	ll arr[100005], brr[100005], crr[100005];
	for (int i = 0; i < n; i++)
		cin >> arr[i];
	for (int i = 0; i < n; i++)
		cin >> brr[i];
	for (int i = 0; i < n; i++)
		cin >> crr[i];
	sort(arr, arr + n);
	sort(brr, brr + n);
	sort(crr, crr + n);
	ll ans = 0;
	for (int i = 0; i < n; i++)
	{
		int x = upper_bound(crr, crr + n, brr[i]) - crr;
		
		if (x < n)
			cntB[i + 1] = n - x;

		cntB[i + 1] += cntB[i];
	}
	for (int i = 0; i < n; i++)
	{
		int x = upper_bound(brr, brr + n, arr[i]) - brr;
		if (x < n)
			ans += cntB[n] - cntB[x];
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 6768