akhauriyash/Code-Regression huggingface dataset:
Option Strict On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Dim N, M As Integer
    Dim A, B As String()

    Sub Main()
        N = NextInt()
        M = NextInt()
        A = New String(N - 1) {}
        B = New String(M - 1) {}

        For i As Integer = 0 To N - 1
            A(i) = ReadLine()
        Next

        For i As Integer = 0 To M - 1
            B(i) = ReadLine()
        Next

        Dim ans As String = "No"

        For Ni As Integer = 0 To N - 1
            For Nj As Integer = 0 To N - 1
                If Judge(Ni, Nj) Then
                    ans = "Yes"
                    Exit For
                End If
            Next
            If ans = "Yes" Then Exit For
        Next

        WriteLine(ans)
    End Sub

    Function Judge(Ni As Integer, Nj As Integer) As Boolean
        For i As Integer = 0 To M - 1
            For j As Integer = 0 To M - 1
                If Ni + i >= N OrElse Nj + j >= N Then Return False
                If B(i)(j) <> A(Ni + i)(Nj + j) Then Return False
            Next
        Next

        Return True
    End Function

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module


Measured memory_bytes: 20432
def main():
	s = input()
	t = input()

	s_ascend = "".join(sorted(s))
	t_descend = "".join(sorted(t, reverse = True))

	if s_ascend < t_descend:
		print("Yes")
	else:
		print("No")



  
if __name__ == "__main__":
  	main()

Measured memory_bytes: 9100
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int di[4] = {0, 1, 0, -1};
int dj[4] = {1, 0, -1, 0};

int main() {
    int n;
    cin >> n;
    vi p(n*n);
    rep(i, n*n) {
        cin >> p[i];
        --p[i];
    }

    vector<vector<int> > iru(n, vector<int>(n, 1));
    vvi mat(n, vi(n));
    rep(i, n) {
        rep(j, n) {
            mat[i][j] = min({i, j, n-1-i, n-1-j});
        }
    }

    int ans = 0;
    vector<P> que;
    vector<vector<bool> > used(n, vector<bool>(n, false));
    rep(iii, n*n) {
        int i = p[iii]/n, j = p[iii]%n;
        ans += mat[i][j];
        iru[i][j] = 0;

        que.clear();
        que.emplace_back(i, j);
        used[i][j] = true;
        rep(v, (int)que.size()) {
            int ni, nj;
            ni = que[v].first;
            nj = que[v].second;
            used[ni][nj] = false;

            int val = mat[ni][nj] + iru[ni][nj];
            rep(k, 4) {
                int nni = ni+di[k], nnj = nj+dj[k];
                if(nni < 0 || nnj < 0 || nni > n-1 || nnj > n-1) continue;
                if(mat[nni][nnj] > val) {
                    mat[nni][nnj] = val;
                    if(!used[nni][nnj]){
                        que.emplace_back(nni, nnj);
                        used[nni][nnj] = true;
                    }
                }
            }
        }

    }

    cout << ans << endl;
}

Measured memory_bytes: 8308
//FaW
#include<iostream>
#include<string>
using namespace std;

int main()
{
	int i = 0;
	string W, T;
	cin >> W >> T;
	for(int j = 0; j < T.size(); j++)
		if(isalpha(T[j]))
			T[j] = tolower(T[j]);
			if(T == W)
			i++;
	while(1){
		cin >> T;
		if(T == "END_OF_TEXT")
		break;
		for(int j = 0; j < T.size(); j++){
		if(isalpha(T[j]))
			T[j] = tolower(T[j]);	
		}
		if(T == W)
			i++;
	}
	cout << i << endl;
	return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using lond = long double;
#define rep(i,n) for (int i = 0; i < (n); ++i)
//ans
int main (){
	lint x,k,d;
	cin >> x >> k >> d;
	// rep(i,k){
	// 	x = min(abs(x-d),x+d);
	// }
	x = abs(x);
	if (x/d >= k) cout << x-d*k << endl;
	else{
		lint a = x/d;
		if (fmod(k-(x/d),2) == 0) cout << abs(x-a*d) << endl;
		else cout << abs(x-a*d-d) << endl;
	}
	return 0;
}


Measured memory_bytes: 3708
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<ctime>
using namespace std;

typedef long long ll;

const int NIL = -1;
const int MAX = 2147483647;
const int INF = -10001;
const int N = 1000001;
clock_t START, END;
bool debug = false;

int sumv[N << 2];
int sum, num, S, _size = MAX;

int main(void)
{
	if (debug) {
		START = clock();
		freopen("in18.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	}
	int n, i;
	queue<int> list;
	scanf("%d%d", &n, &S);
	for (i = 0; i < n; i++)
		scanf("%d", &sumv[i]);
	i = 0;
	sum = sumv[0];
	list.push(sumv[0]);
	while (i < n) {
		if (sum >= S) {
			_size = min(_size, static_cast<int>(list.size()));
			sum -= list.front();
			list.pop();
		}
		else {
			i++;
			sum += sumv[i];
			list.push(sumv[i]);
		}
	}
	if (_size == MAX)
		printf("0\n");
	else
		printf("%d\n", _size);
	if (debug) {
		END = clock();
		double endtime = (double)(END - START) / 1000;
		printf("total time = %lf s", endtime);
	}
	return 0;
}


Measured memory_bytes: 3788
#include<bits/stdc++.h>
#include <iostream>
#include <numeric>
#include <math.h>
#define ll  long long
#define ull unsigned long
#define mpa make_pair
#define pb push_back
#define ff first
#define pii pair<ll,ll>
#define dd double
#define trace(x) cerr << #x << " : " << x << endl
#define ss second
#define boost ios_base::sync_with_stdio(0)
#define forp(i,a,b) for(ll i=a;i<=b;i++)
#define rep(i,n)    for(ll i=0;i<n;++i)
#define ren(i,n)    for(ll i=n-1;i>=0;i--)
#define forn(i,a,b) for(ll i=a;i>=b;i--)
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end();
#define sc(x) scanf("%lld",&x)
#define clr(x,val) memset(x,val,sizeof(x))
#define pr(x) printf("%lld\n",x) 
#define gc getchar
#define pdd pair<dd,dd>
#define prec(x) cout<<fixed<<setprecision(x)
using namespace std;
 
vector<ll> adj[200005];
ll h[200005];
int main(){
	ll n,m,ans=0;
	cin>>n>>m;
	for(ll i=1;i<=n;i++)cin>>h[i];
	while(m--){
		ll x,y;
		cin>>x>>y;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	for(ll i=1;i<=n;i++){
		ll f=1;
		for(ll j=0;j<adj[i].size();j++){
			if(h[adj[i][j]]>=h[i]) f=0;
		}
		ans+=f;
	}
	cout<<ans;
}

Measured memory_bytes: 12584
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    n = int(input())
    K = int(input())
    i = 1
    cnt = 0
    for _ in range(n):
        if i<K:
            i+=i
        else:
            i+=K
    print(i)

    """while i < K:
        i *= 2
        cnt += 1
    print(i+K*(n-cnt))"""


resolve()

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

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) {
        ll d = euclid(b, a % b, y, x);
        return y -= a / b * x, d;
    }
    return x = 1, y = 0, a;
}

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    cin >> skipws;

    vector<pii> v;
    rep(i, 1, 201) rep(j, i + 1, 201) v.push_back({i, j});
    sort(all(v), [](const pii a, const pii b) {
        if (a.first * a.first + a.second * a.second != b.first * b.first + b.second * b.second)
            return a.first * a.first + a.second * a.second < b.first * b.first + b.second * b.second;
        return a.first < b.first;
    });

    map<pii, pii> m;
    rep(i, 0, v.size() - 1)
        m[v[i]] = v[i + 1];

    while (true) {
        int h, w; cin >> h >> w;
        if (!h && !w) break;

        auto p = m[{h, w}];
        cout << p.first << " " << p.second << endl;
    }
}


Measured memory_bytes: 4404
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;


typedef long long LL;
const string NO = "Miserable Hokusai!";
const int SIZE = 101;
const int G_SIZE = 17;

int gx, gy;
LL T[G_SIZE][G_SIZE];
bool G[G_SIZE][G_SIZE][G_SIZE][G_SIZE];

void init() {
    fill( (LL*)T, (LL*)T+G_SIZE*G_SIZE, 0LL );
    fill( (bool*)G, (bool*)G+G_SIZE*G_SIZE*G_SIZE*G_SIZE, false );
}

void input() {
    cin >> gx >> gy;
    int p;
    cin >> p;
    for ( int i = 0; i < p; ++ i ) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        G[x1][y1][x2][y2] = true;
        G[x2][y2][x1][y1] = true;
    }
}

LL solve() {
    T[0][0] = 1;
    for ( int i = 0; i+1 <= gx; ++ i ) {
        int x = i, y = 0, nx = i+1, ny = 0;
        T[0][nx] = G[x][y][nx][ny] ? 0 : T[0][x];
    }
    for ( int i = 0; i+1 <= gy; ++ i ) {
        int x = 0, y = i, nx = 0, ny = i+1;
        T[ny][0] = G[x][y][nx][ny] ? 0 : T[y][0];
    }
    const int dr[2] = { -1, 0 };
    const int dc[2] = { 0, -1 };
    for ( int i = 1; i <= gy; ++ i ) {
        for ( int j = 1; j <= gx; ++ j ) {
            for ( int k = 0; k < 2; ++ k ) {
                int x = j, y = i, nx = j+dc[k], ny = i+dr[k];
                T[y][x] += G[x][y][nx][ny] ? 0 : T[ny][nx];
            }
        }
    }
    return T[gy][gx];
}

void output( LL n ) {
    if ( n == 0 ) {
        cout << NO << endl;
    } else {
        cout << n << endl;
    }
}

int main() {
    int tests;
    cin >> tests;
    for ( int i = 0; i < tests; ++ i ) {
        init();
        input();
        LL ret = solve();
        output(ret);
    }
    return 0;
}

Measured memory_bytes: 1280
// 1 apel = 3 potongan;
	// 1 pie = 2 potongan
	// berapa banyak pie yang bisa dibikin?

#include <stdio.h>

int main ()
{
	int apel;
	int potongan;
	
	scanf("%d %d", &apel, &potongan);
	
	
	int rumus = (((apel*3) + (potongan))/2);
	
	printf("%d", rumus);
	
	return 0;
}

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

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

    int N = scanner.nextInt();
    String[] s = new String[N];
    for (int i = 0; i < N; i++) {
      char[] ch = scanner.next().toCharArray();
      Arrays.sort(ch);
      s[i] = new String(ch);
    }
    Arrays.sort(s);

    long count = 0;
    for (int i = 0; i < N - 1;) {
      int j = i;
      while (j < N && s[i].equals(s[j])) j++;
      long n = j - i;
      count += n * (n - 1) / 2;
      i = j;
    }
    System.out.println(count);
  }
}


Measured memory_bytes: 52300
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
#define REP(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for(ll (i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for(ll (i) = (m); (i) < (n); (i)++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG

template <uint MD> struct ModInt {
    using M = ModInt;
    const static M G;
    uint v;
    ModInt(ll _v = 0) { set_v(uint(_v % MD + MD)); }
    M& set_v(uint _v) {
        v = (_v < MD) ? _v : _v - MD;
        return *this;
    }
    explicit operator bool() const { return v != 0; }
    M operator-() const { return M() - *this; }
    M operator+(const M& r) const { return M().set_v(v + r.v); }
    M operator-(const M& r) const { return M().set_v(v + MD - r.v); }
    M operator*(const M& r) const { return M().set_v(uint(ull(v) * r.v % MD)); }
    M operator/(const M& r) const { return *this * r.inv(); }
    M& operator+=(const M& r) { return *this = *this + r; }
    M& operator-=(const M& r) { return *this = *this - r; }
    M& operator*=(const M& r) { return *this = *this * r; }
    M& operator/=(const M& r) { return *this = *this / r; }
    bool operator==(const M& r) const { return v == r.v; }
    M pow(ll n) const {
        M x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    M inv() const { return pow(MD - 2); }
    friend ostream& operator<<(ostream& os, const M& r) { return os << r.v; }
};
using Mint = ModInt<1000000007>;

const double PI = 3.14159265358979323846;

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

map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  ret[2] = 0;
  ret[3] = 0;
  ret[5] = 0;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}


void rec(ll d, ll val, vector<ll> &all){

    all.push_back(val);

    //目的の桁数になれば終了
    if(d == 10) return;

    FOR(i, -1, 2){
        //加える数は末尾に±1した数
        ll add = (val % 10) + i;
        if(add >= 0 && add <= 9){
            rec(d+1, val*10 + add, all);
        }
    }
}

int main()
{	
    int k;
    cin >> k;
    vector<ll> v;
    REP(i, 9) rec(1, i+1, v);
    sort(ALL(v));
    cout << v[k-1] << endl;
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    string s;cin>>s;
    cout<<count(all(s),'+')*2-4<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  string a,b,c;
  cin>>a>>b>>c;
  string ans=a.substr(0,1)+b[1]+c[2];
  cout(ans);
  return 0;
}

Measured memory_bytes: 125696
use std::io::{stdin, stdout, BufReader, BufRead, StdinLock, Write, BufWriter};

fn main() {
    let (std_in, std_out) = (stdin(), stdout());
    let mut br = BufReader::new(std_in.lock());
    let mut bw = BufWriter::new(std_out.lock());
    
    let __ = rvn::<i32>(&mut br);
    let (k, x) = (__[0], __[1]);

    for i in -1000000..1000001 {
        if (x - i).abs() + 1 <= k {
            write!(&mut bw, "{} ", i);
        }
    }
}


//////////////////////////////////////////////////////////////////////////////////
#[allow(dead_code)]
fn rs(br: &mut BufReader<StdinLock>) -> Vec<char> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().chars().collect()
}

#[allow(dead_code)]
fn rn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> T {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn rvs(br: &mut BufReader<StdinLock>) -> Vec<Vec<char>> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.chars().collect()).collect()
}

#[allow(dead_code)]
fn rvn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> Vec<T> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
#include <iostream>
using namespace std;
typedef long long ll;
ll N;
ll s;


int main(void) {
    // insert code here...
    cin >> N;
    ll n = N;
    
//    cout << 5/10;
    while(n != 0){
        s += n % 10;
        n = n/10;
    }
    
    if(N%s==0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
import sys
import math
from functools import reduce
import bisect


def getN():
    return int(input())


def getNM():
    return map(int, input().split())


def getList():
    return list(map(int, input().split()))


def input():
    return sys.stdin.readline().rstrip()


# input = sys.stdin.buffer.readline

def index(a, x):
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    return False


#############
# MAIN CODE #
#############

a, b, c = getNM()
print(len({a, b, c}))


Measured memory_bytes: 68188
/* Dynamic Programming implementation of LCS problem */
#include<bits/stdc++.h>
using namespace std; 
  
/* Returns length of LCS for X[0..m-1], Y[0..n-1] */
void lcs( char *X, char *Y, int m, int n ) 
{ 
   int L[m+1][n+1]; 
  
   /* Following steps build L[m+1][n+1] in bottom up fashion. Note 
      that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] */
   for (int i=0; i<=m; i++) 
   { 
     for (int j=0; j<=n; j++) 
     { 
       if (i == 0 || j == 0) 
         L[i][j] = 0; 
       else if (X[i-1] == Y[j-1]) 
         L[i][j] = L[i-1][j-1] + 1; 
       else
         L[i][j] = max(L[i-1][j], L[i][j-1]); 
     } 
   } 
  
   // Following code is used to print LCS 
   int index = L[m][n]; 
  
   // Create a character array to store the lcs string 
   char lcs[index+1]; 
   lcs[index] ='\0'; // Set the terminating character 
  
   // Start from the right-most-bottom-most corner and 
   // one by one store characters in lcs[] 
   int i = m, j = n; 
   while (i > 0 && j > 0) 
   { 
      // If current character in X[] and Y are same, then 
      // current character is part of LCS 
      if (X[i-1] == Y[j-1]) 
      { 
          lcs[index-1] = X[i-1]; // Put current character in result 
          i--; j--; index--;     // reduce values of i, j and index 
      } 
  
      // If not same, then find the larger of two and 
      // go in the direction of larger value 
      else if (L[i-1][j] > L[i][j-1]) 
         i--; 
      else
         j--; 
   } 
  
   // Print the lcs 
   cout << lcs << "\n"; 
} 
  
/* Driver program to test above function */
int main() 
{
	ios::sync_with_stdio(0);
	char X[3002];
	char Y[3002];
	scanf("%s",X);
	scanf("%s",Y);
	int m = strlen(X); 
	int n = strlen(Y); 
	lcs(X, Y, m, n); 
	return 0; 
} 

Measured memory_bytes: 35456
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <climits>
#include <functional>
#include <array>

using namespace std;

vector<array<int, 10>> tblMaxSubNot;
vector<int> s;

int maxsub(const int eqval, int n);

int maxsubnot(const int notval, int n) {
	if (tblMaxSubNot[n][notval] >= 0)
		return tblMaxSubNot[n][notval];

	const int smod = s[n] % 10;
	if (n == 0) {
		if (smod != notval) {
			return tblMaxSubNot[n][notval] = s[0];
		}
		else {
			return tblMaxSubNot[n][notval] = 0;
		}
	}
	else {
		int newmod = (10 + notval - smod) % 10;
		int i1 = maxsubnot(newmod, n - 1) + s[n];
		int i2 = maxsub(newmod, n - 1);

		if (i1 % 10 == notval) i1 = 0;
		if (i2 % 10 == notval) i2 = 0;
		
		return tblMaxSubNot[n][notval] = (std::max)(i1, i2);
	}
}

int maxsub(const int eqval, int n) {
	int maxsub = INT_MIN;
	for (int i = 0; i < 10; ++i) {
		if (i == eqval) continue;
		maxsub = (std::max)(maxsub, maxsubnot(i, n));
	}
	return maxsub;
}

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

	s.resize(N);
	for (auto& i : s) cin >> i;

	//sort(s.begin(), s.end());
	array<int, 10> arr;
	arr.fill(-1);
	tblMaxSubNot.resize(N, arr);

	cout << maxsubnot(0, N - 1) << endl;

	return 0;
}



Measured memory_bytes: 256
N,P = map(int,input().split())

# n以下の素数列を返す (eratostenes)
def prim(n):
    flg = [True for i in range(n+1)]
    flg[0] = False
    flg[1] = False
    sosuu = []
    for i in range(2,n+1):
        if flg[i]:
            sosuu.append(i)
            counter =2*i
            while counter <=n:
                flg[counter] = False
                counter += i
    return sosuu


# n の素因数分解 prim必要
    
def primdiv(n):
    """
    24 = 2^3 * 3^1
    primdiv(24) >> [[2, 3], [3, 1]]    
    """
    ans = []
    sosuu = prim(int(n**0.5)+1)
    for i in sosuu:
        if n%i == 0:
            counter = 1
            n = n//i 
            while n%i == 0:
                counter += 1
                n = n//i           
            ans.append([i,counter])
    if n != 1:
        ans.append([n,1])
    return ans

slis = primdiv(P)
ans = 1
for k in slis:
    ans *= k[0]**(k[1]//N)
print(ans)

Measured memory_bytes: 113904
use std::io::*;
use std::str::FromStr;

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 main() {
    let a: u32 = read();
    let b: u32 = read();
    let ans = if(a*b)%2 ==0 {"Even"} else {"Odd"};
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  int N = a + b + c;
  int minans = 10000;
  int ans = 10000;
  for(int i = 0; i <= 2000; i++){
    int oddcounter = 0;
    if(i % 3 == 0 && N % 2 == i/3 % 2 && i / 3 >= max(a,max(b,c))){
      vector<int> d(3);
      d[0] = i/3 - a;
      d[1] = i/3 - b;
      d[2] = i/3 - c;
      for(int j = 0; j < 3; j++){
        if(d[j] % 2 == 1) oddcounter++;
      }
      if(oddcounter == 0){
        ans = d[0]/2 + d[1]/2 + d[2] /2;
      }else if(oddcounter == 1){
        continue;
      }else if(oddcounter == 2){
        ans = 1 + (d[0] % 2 == 0 ? d[0] / 2 : (d[0] - 1) / 2) + (d[1] % 2 == 0 ? d[1] / 2 : (d[1] - 1) / 2) + (d[2] % 2 == 0 ? d[2] / 2 : (d[2] - 1) / 2);
      }else if(oddcounter == 3){
        continue;
      }
    }
    if(ans <= minans) minans = ans;
  }
  cout << minans;
}









Measured memory_bytes: 256
//#include <iostream>
//#include <algorithm>
//
//using namespace std;
//
//long long l, r, m = 9223372036854775807LL;
//const int p = 2019;
//
//int main()
//{
//	ios::sync_with_stdio(0);
//	cin.tie(0), cout.tie(0);
//	cin >> l >> r;
//	
//	for (long long i = l; i <= r; i++)
//	{
//		for (long long j = i + 1; j <= r; j++)
//		{
//				m = min(i*j%p, m);
//		}
//	}
//
//	cout << m;
//	system("pause");
//	return 0;
//}

//看神仙

#include <iostream>
#include <algorithm>
using namespace std;
const int p = 2019;
typedef long long ll;
ll l, r, mini = 0x3f3f3f3f;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cin >> l >> r;
	if (l / p != r / p) cout << 0;
	else {
		for (ll i = l; i <= r; ++i) {
			for (ll j = i + 1; j <= r; ++j) {
				mini = min(i*j%p, mini);
			}
		}
		cout << mini;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		int a = sc.nextInt();
		int b = sc.nextInt();

		if (a == 1) {
			a = 14;
		}
		if (b == 1) {
			b = 14;
		}

		String ans;

		if (a > b) {
			ans = "Alice";
		} else if (b > a) {
			ans = "Bob";
		} else {
			ans = "Draw";
		}

		System.out.println(ans);

		sc.close();
	}

}


Measured memory_bytes: 23124
s = str(input())
ans = int(0)
if s == "SUN":
    ans = 7
elif s == "MON":
    ans = 6
elif s == "TUE":
    ans = 5
elif s == "WED":
    ans = 4
elif s == "THU":
    ans = 3
elif s == "FRI":
    ans = 2
elif s == "SAT":
    ans = 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <math.h>
#include <map>
#include <stack>
using namespace std;
static const int INF = 1e9+7;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, a, b) for (int i =a; i < b; i++)
#define all(a) a.begin(), a.end()
#define PI 3.14159265359

int main(){
    string s; cin >> s;
    int alphabet[123] = {};
    rep(i, s.size()){
        alphabet[int(s[i])]++;
    }
    bool flg = true;
    repr(i, 97, 122){
        if(alphabet[i] > 1){
            flg = false;
            break;
        }
    }
    if(flg){
        cout << "yes" << endl;
    }else{
        cout << "no" << endl;
    }
        

    return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int can[5][110];
int n,memo[5][150];
int dp(int x,int y)
{
	if(x>1 || y>n-1) return -10000000;
	if(x==1&&y==n-1) return can[x][y];
	if(memo[x][y]!=-1)return memo[x][y];
	int ret=dp(x,y+1)+can[x][y];
	if(x==0){
		ret=max(ret,dp(x+1,y)+can[x][y]);
	}
	return memo[x][y]=ret;
}
int main(){
	memset(memo,-1,sizeof(memo));
	scanf("%d",&n);
	for(int i=0;i<2;i++){
		for(int j=0;j<n;j++){
			scanf("%d",&can[i][j]);
		}
	}
	cout<<dp(0,0)<<endl;
	return 0;
}

Measured memory_bytes: 256
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;
ll chk[200001] = {0};
ll ans[200001] = {0};

int main(){
  string s;
  cin >> s;
  if(s[2] == s[3] && s[4] == s[5]){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 256
// --------------
// Tejas Pandey  |
// 05 - 07 - 20  |
// Atcoder BC 173|
// --------------

#include <bits/stdc++.h>
using namespace std;
     
#define mod 1000000007
#define vi vector<int>
typedef long long int ll;
     
int main (void){
  //freopen("in.txt","r",stdin);
  //freopen("out.txt","w",stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  //cin >> t;
  while(t--){
	int h,w,req;
	cin >> h >> w >> req;
	char c[h][w];
	for(int i = 0;i < h;i++)
	for(int j = 0;j < w;j++)
		cin >> c[i][j];
	int ans = 0;
	for(int i = 0;i < (1LL<<h);i++)
		for(int j = 0;j < (1LL<<w);j++){
			int cter = 0;
				for(int k = 0;k < h;k++)
					for(int l = 0;l < w;l++)
						if((i&(1LL<<k)) && (j&(1LL<<l)) && c[k][l] == '#') cter++;
			//cout << i << " " << j << " " << cter << "\n";
			if(cter == req) ans++; 
		}
	cout << ans << "\n";
  }
  return 0;
}


Measured memory_bytes: 3648
#include<stdio.h>
int main(){
    int n,m,c,a[20][20],b[20],count=0,sum;
    scanf("%d%d%d",&n,&m,&c);
    for(int i=0;i<m;i++){
        scanf("%d",&b[i]);
    }
    for(int i=0;i<n;i++){
        sum=c;
        for(int j=0;j<m;j++){
            scanf("%d",&a[i][j]);
            sum+=a[i][j]*b[j];
        }
        if(sum>0)
        count++;
    }
    printf("%d",count);
    return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {

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

        boolean exist = false;
        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n; j++) {
                if (n == (i*4) + (j*7)) {
                    exist = true;
                    break;
                }
            }
        }

        if (exist) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> A;
  for (int i=0; i<H; i++) {
    string input;
    cin >> input;
    if (input.find("#") != -1)
      A.push_back(input);
  }

  vector<string> temp;
  for (int i=0; i<W; i++) {
    string str = "";
    for (int j=0; j<A.size(); j++) {
      str += A[j][i];
    }
    if (str.find("#") != -1)
      temp.push_back(str);
  }

  for (int i=0; i<temp[0].size(); i++) {
    for (int j=0; j<temp.size(); j++) {
      cout << temp[j][i];
    }
    cout << endl;
  }

  return 0;
}


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

typedef long long int ll;
#define INF 1999999999
#define MODA 1000000007

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    if((a+b)%3 == 0 || a % 3 == 0 || b % 3 == 0)
        cout << "Possible" << endl;
    else
        cout << "Impossible" << endl;
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)

int main() {

	int N;
	scanf("%d", &N);

	if (N == 1) printf("Hello World\n");
	else {
		int a, b;
		scanf("%d%d", &a, &b);
		printf("%d\n", a + b);

	}

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
#include <string.h>
#include <algorithm>

using namespace std;

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

  int bit=0;
  for (int bit=0;bit<(1<<3);bit++) {
    int sum=0;
    for(int i=0 ;i<3;++i){
      if(bit&(1<<i))sum+=stoi(A.substr(3-i,1));
      else sum-=stoi(A.substr(3-i,1));
    }
    sum+=stoi(A.substr(0,1));
    if(sum==7){
      string ans_str="";
      for(int i=0 ;i<3;++i){
        if(bit&(1<<i))ans_str="+"+A.substr(3-i,1)+ans_str;
        else ans_str="-"+A.substr(3-i,1)+ans_str;
      }
      cout<<A.substr(0,1)+ans_str+"=7"<<"\n";
      return 0;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(), (x).end()
int main() {
  int a, b, c, d ;
  cin >> a >> b >> c >> d;
  int ab = abs(a-b);
  int bc = abs(b-c);
  if (abs(a-c) <= d) cout << "Yes" << endl;
  else if (ab > d || bc > d) cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n+1];
    int c=0;
    for(int i=1;i<=n;i++)
    {
       cin>>a[i];
       if(a[i]%2==1 && i%2==1)
       c++;
    }
    cout<<c<<endl;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define rep2(i,m,n) for (int i = (m); i < (n); ++i)
#define rep(i,n) rep2(i,0,n)
typedef long long int ll;
typedef long double ld;
typedef pair<int, int> P;
template<typename T> struct V : vector<T> { using vector<T>::vector; };
V() -> V<int>;
V(size_t) -> V<int>;
template<typename T> V(size_t, T) -> V<T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
const int INF = 1<<30;
const ll LINF = 1LL<<61;

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

int main()
{
    int h, w, sy, sx, gy, gx;
    cin >> h >> w >> sy >> sx >> gy >> gx;
    sy--; sx--; gy--; gx--;
    vector<string> field(h);
    rep(i,h) cin >> field[i];

    auto t = make_vec(h, w, -1); //塗り分け
    int cnt = 0;
    rep(i,h) rep(j,w)
    {
        if(t[i][j] != -1) continue;
        if(field[i][j] == '#') continue;
        queue<P> que;
        que.emplace(i, j);
        t[i][j] = cnt;

        while(!que.empty())
        {
            auto [y, x] = que.front();
            que.pop();
            rep(i,4)
            {
                int ny = y + dy[i];
                int nx = x + dx[i];
                if(ny < 0 || ny >= h || nx < 0 || nx >= w) continue;
                if(field[ny][nx] == '#') continue;
                if(t[ny][nx] != -1) continue;
                que.emplace(ny, nx);
                t[ny][nx] = cnt;
            }
        }
        cnt++;
    }

    //グラフ生成
    int n = cnt+1;
    vector<vector<int>> G(n, vector<int>(0));
    rep(y,h) rep(x,w) rep2(dy,-2,3) rep2(dx,-2,3)
    {
        int ny = y + dy;
        int nx = x + dx;
        if(ny < 0 || ny >= h || nx < 0 || nx >= w) continue;
        int u = t[y][x];
        int v = t[ny][nx];
        if(u == v || u == -1 || v == -1) continue;
        G[u].emplace_back(v);
        G[v].emplace_back(u);
    }
    //多重辺の削除(いらない)
    // rep(i,n)
    // {
    //     sort(G[i].begin(), G[i].end());
    //     G[i].erase(unique(G[i].begin(), G[i].end()), G[i].end());
    // }

    //グラフ上でBFS
    vector<int> dist(n, INF);
    int s = t[sy][sx], g = t[gy][gx];
    queue<int> que;
    que.emplace(s);
    dist[s] = 0;
    while(!que.empty())
    {
        auto v = que.front();
        que.pop();
        for(auto w:G[v])
        {
            if(dist[w] != INF) continue;
            que.emplace(w);
            dist[w] = dist[v] + 1;
        }
    }

    int ans = dist[g];
    if(ans == INF) ans = -1;
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 31956
#include <cstdio>
using namespace std;

long long a, b, c, k;

long long ans;

int main()
{
    scanf("%lld%lld%lld%lld", &a, &b, &c, &k);
    if(k <= a)
    {
        printf("%lld", k);
        return 0;
    }
    if(k <= a + b)
    {
        printf("%lld", a);
        return 0;
    }
    printf("%lld", a - (k - a - b));
    return 0;
}

Measured memory_bytes: 1728
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        String line1 = sc.nextLine();
        String[] line2 = line1.split(" ");
        int[] ary = new int[n];
        for(int i = 0; i < n; i++)
        ary[i] = Integer.parseInt(line2[i]);
        int count = 0;
        for(int i = 0; i < n - 2; i++){
            if(ary[i] < ary[i + 1]){
                if(ary[i + 1] < ary[i + 2])
                count++;
            }
            else if(ary[i] > ary[i + 1]){
                if(ary[i + 1] > ary[i + 2])
                count++;
            }
        }
        System.out.println(count);
    }
}

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  
  string result = "No";
  if (B > A) {
    if (A < C && C < B) {
      result = "Yes";
    }
  } else {
    if (B < C && C < A) {
      result = "Yes";
    }
  }
  cout << result << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline

n = int(input())
A = list(map(int, input().split()))
S = sum(A)

D = [0]*(10**5+1)
for a in A:
    D[a] += 1

q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    S -= D[b]*b
    S += D[b]*c
    D[c] += D[b]
    D[b] = 0
    print(S)


Measured memory_bytes: 84692
import itertools
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
P_int = "".join(map(str, P))
Q_int = "".join(map(str, Q))

l = range(1, N+1)
p = itertools.permutations(l)
c_p = 0
c_q = 0
for ele in p:
    if "".join(map(str, ele)) < P_int:
        c_p += 1
    if "".join(map(str, ele)) < Q_int:
        c_q += 1
print(abs(c_p-c_q))

Measured memory_bytes: 3064
import collections
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
M=collections.Counter(A)
ans=0
for j in M.items():
  ans+=j[0]*j[1]
for i in range(Q):
  B,C=map(int,input().split())
  ans+=(C-B)*M[B]
  M[C]+=M[B]
  M[B]=0
  print(ans)

Measured memory_bytes: 24168
#include <bits/stdc++.h>
#include <math.h>
#define ALL(a)    a.begin(), a.end() 
#define rep(i, K, N)  for(long long int i = K; i < N; i++)
#define ll long long int
#define PP 1000000007
using namespace std;

ll N, K, M = 0, Ans = 0;
string S;

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

if(N == 1){cout << 0;exit(0);}

rep(i, 0, N - 1){

  if(S[i] == 'R' && S[i + 1] == 'L')M++;

}

bool A = S[0] != S.back(), B = S[0] == 'R';

Ans = N - 2*M;

if(A && B){

  if(K < M)cout << Ans + 2*K;
  
  else cout << N - 1;
  exit(0);

}

if(A && !B){

  ll a = 2;

  if(K <= M)cout << Ans - 2 + 2*K;

  else cout << N - 1;
  exit(0);

}

if(!A){

  if(K <= M)cout << Ans - 1 + 2*K;

  else cout << N - 1;
  exit(0);

}

}

Measured memory_bytes: 3736
#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>;

int main(){
	int n;
	cin >> n;
	int ans = 0;
	rep(i, n){
		int a, b;
		cin >> a >> b;
		ans += b - (a-1);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int D, N, ans = 0, step = 1;
  	scanf("%d%d", &D, &N);
  	for (int i = 0; i < D; i++){
    	step *= 100;
    }
  	for (int j = 0; j < N; j++){
    	ans += step;
      	if (ans % (step * 100) == 0){
        	ans += step;
        }
    }
  	printf("%d", ans);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main() {

    int i,K,N;
//    ios::sync_with_stdio(0);
//    cin.tie(0);
    long long a[200000],sum=0;

    cin>>N>>K;

    for(i=0;i<N;i++)
    {
        cin>>a[i];
    }
    sort(a,a+N);

    for(i=0;i<N-K;i++)
    {
        sum += a[i];
    }

    cout<<sum;



}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define co(i) cout << i << endl;
#define co2(i,j) cout << i << " " << j << endl;
#define co3(i) cout << i << " ";
#define po(i) cout << i.first << " " << i.second << endl;
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod, digitDP, treeDP//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv, doubling//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal, RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007, INF = 1LL << 60, ans = 0, z = 0, o = 1;
vpll flag, D; vll path;
//***********//
int main() {
	ll D;
	cin >> D;
	vl C(26);
	for (i = 0; i < 26; i++) cin >> C[i];
	vll S(D, vl(26));
	for (i = 0; i < D; i++) {
		for (j = 0; j < 26; j++) {
			cin >> S[i][j];
		}
	}
	vl T(D);
	vl last(26, -1);
	for (i = 0; i < D; i++) {
		ll pre = 0;
		for (j = 0; j < 26; j++) {
			if (S[i][j]-C[j]*(i-last[j])*0 > S[i][pre] - C[pre] * (i - last[pre])*0) {
				pre = j;
			}
		}
		T[i] = pre;
		last[T[i]] = i;
		co(T[i] + 1);
	}
	exit(0);
	//debug用
	ans = 0;
	vl last2(26, -1);
	for (i = 0; i < D; i++) {
		ans += S[i][T[i]];
		for (j = 0; j < 26; j++) {
			ans -= C[j]*(i - last2[j]);
		}
		debug(ans);
	}
}

Measured memory_bytes: 3720
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
tmp = 0
for a in range(1, k+1):
  for b in range(a, k+1):
    for c in range(b, k+1):
      #print('a='+str(a)+', b='+str(b)+', c='+str(c))
      if a == b and a == c:
        tmp += gcd_list([a, b, c]) 
      elif a == b and a != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      elif b == c and a != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      elif a == c and b != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      else:
        tmp += gcd_list([a, b, c]) * 6
#        tmp += gcd_list([a, c, b])
#        tmp += gcd_list([b, a, c])
#        tmp += gcd_list([b, c, a])
#        tmp += gcd_list([c, a, b])
#        tmp += gcd_list([c, b, a])
print(tmp)


Measured memory_bytes: 9616
import bisect
n = int(input())
A = tuple(map(int,input().split()))
q = int(input())
Q = tuple(map(int, input().split()))
dp = [0]*(2**n)

for i in range(n):
    for j in range(1<<i):
        dp[j+(1<<i)] = dp[j] + A[i]
dp.sort()

for n in Q:
    i = bisect.bisect(dp, n)
    print("yes" if i>0 and n==dp[i-1] else "no")

Measured memory_bytes: 49116
#include <bits/stdc++.h>
#define FOR(i, l, r) for(ll i = l; i < r; i++)
#define rep(i, N) FOR(i, 0, N)
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll MOD = round(1e9+7);

int main() {
    int n; cin >> n;
    vi fib(45, 1);
    FOR(i,2,45){
        fib[i] = fib[i-1] + fib[i-2];
    }

    cout << fib[n] << endl;
    return 0;
}



Measured memory_bytes: 3100
#include <stdio.h>
int main(void){
	int n,hito[200001]={},a,i;
	scanf("%d",&n);
	for(i=2;i<=n;i++){
		scanf("%d",&a);
		hito[a]++;
	}
	for(i=1;i<=n;i++){
		printf("%d\n",hito[i]);
	}
	
	return 0;
}

Measured memory_bytes: 2516
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#define maxn 140010
#define inf 999999999999999
using namespace std;
typedef long long ll;
int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n;
int ch[maxn][2],val[maxn][2],leaf[maxn];
struct P{
    ll a,b;
};
bool cmp1(P x,P y)
{
    return x.a<y.a;
}
bool cmp2(P x,P y)
{
    return x.b<y.b;
}
vector<P>e[maxn];
ll res;
void solve(int x,ll mid)
{
    e[x].clear();
    if(leaf[x])
    {
        e[x].push_back((P){0,0});
        return;
    }
    solve(ch[x][0],mid);
    solve(ch[x][1],mid);

    int l=ch[x][0],r=ch[x][1],v1=val[x][0],v2=val[x][1];
    if(e[l].size()>e[r].size())  swap(l,r),swap(v1,v2);
    int l1=e[l].size(),l2=e[r].size();

    sort(e[l].begin(),e[l].end(),cmp2);
    sort(e[r].begin(),e[r].end(),cmp1);
    int pos=-1;
    ll mn=inf;
    for(int i=l1-1;i>=0;i--)
    {
        while(e[l][i].b+e[r][pos+1].a<=mid-v1-v2&&pos<l2-1)  pos++,mn=min(mn,e[r][pos].b);
        if(pos!=-1)  e[x].push_back((P){e[l][i].a+v1,mn+v2});
    }

    sort(e[l].begin(),e[l].end(),cmp1);
    sort(e[r].begin(),e[r].end(),cmp2);
    pos=-1;
    mn=inf;
    for(int i=l1-1;i>=0;i--)
    {
        while(e[l][i].a+e[r][pos+1].b<=mid-v1-v2&&pos<l2-1)  pos++,mn=min(mn,e[r][pos].a);
        if(pos!=-1)  e[x].push_back((P){mn+v2,e[l][i].b+v1});
    }
}
int main()
{
    n=read();
    for(int i=2;i<=n;i++)
    {
        int x=read(),y=read();
        if(!ch[x][0])  ch[x][0]=i,val[x][0]=y;
        else           ch[x][1]=i,val[x][1]=y;
    }
    for(int i=1;i<=n;i++)
      if(!ch[i][0])  leaf[i]=1;
    ll l=0,r=1000000000000ll;
    while(l<=r)
    {
        int mid=(l+r)/2;
        solve(1,mid);
        if(e[1].size()!=0)
        {
            res=mid;
            r=mid-1;
        }
        else l=mid+1;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 28148