akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, s, n)    for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...)  type __VA_ARGS__; read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream& operator>> (istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x): x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    var(int, N, M);

    vector<unordered_map<int,int>> g(M);
    vector<int> cnt(M);
    rep(i, 0, N) {
        var(int, a);
        g[a % M][a] += 1;
        cnt[a % M] += 1;
    }

    i64 ans = 0;
    for (int i = 0; i <= M / 2; ++i) {
        if ((i + i) % M == 0) {
            ans += cnt[i] / 2;
        } else {
            int x = i;
            int y = M - i;

            // make cnt[x] >= cnt[y]
            if (cnt[x] < cnt[y]) swap(x, y);

            for (auto &e : g[x]) {
                const int rem = cnt[x] - cnt[y];
                const int use = min<i64>(rem / 2, e.second / 2);
                e.second -= use * 2;
                cnt[x] -= use * 2;
                ans += use;
            }

            ans += cnt[y];
        }
    }

    print(ans);


    return 0;
}


Measured memory_bytes: 12416
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

void main()
{
    long N, A, B;
    scan(N, A, B);
    writeln(min(N * A, B));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	
	char str[10];
	string in;
	map<string,int> maps;
	map<string,int>::iterator iter;
	for(int i=0;i<n;i++)
	{
		cin>>str>>in;
		if(str[0]=='i')
		{
			maps.insert(pair<string,int>(in,i));
		}else if(str[0]=='f')
		{
			iter  = maps.find(in);
			if(iter==maps.end()) printf("no\n");
			else printf("yes\n");
		}
	}
	return 0;
}


Measured memory_bytes: 36900
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a, b, c;
		int count = 0;
		a = scan.nextInt();
		b = scan.nextInt();
		c = scan.nextInt();

		if (a > b) {
			throw new RuntimeException("error:You must write a<=b");
		}
		if (a < 1 || 10000 < a || b < 1 || 10000 < b || c < 1 || 10000 < c) {
			throw new RuntimeException("error:You must write 1<=a,b,c<=10000");
		}
		for (int i = a; i <= b; i += 1) {
			if (c % i == 0) {
				count++;
			}
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 17356
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define all(x) x.begin(),x.end()
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
#define PI 3.1415926535897932384626
#define mod 1000000007
#define modd 998244353

void io() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
}

int main() {
	io();
	
	int n;
	cin>>n;
	int ac=0,wa=0,tle=0,re=0;
	for(int i=0;i<n;i++) {
		string s;
		cin>>s;
		if(s=="AC") ac++;
		if(s=="WA") wa++;
		if(s=="TLE") tle++;
		if(s=="RE") re++;
	}
	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tle<<endl;
	cout<<"RE x "<<re<<endl;
	return 0;
}


Measured memory_bytes: 3660
r = list(map(int,input().split()))
r = r + list(map(int,input().split()))
r = r + list(map(int,input().split()))
flag = True
for i in [1,2,3,4]:
    n = r.count(i)
    if n == 3:
        flag = False
if flag:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 3060
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;
typedef pair< ll, int > pli;
typedef pair< int, ll > pil;

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int n;
  cin >> n;

  for(int i = 1; i <= 9; i++){
    for(int j = 1; j <= 9; j++){
      if(n == i * j){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;

  return 0;
}


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

int n, nextpos[200010][26];
unsigned int memo[200010];

unsigned int getMinimumLength(int i)
{
    if (i>n) return 0;
    auto& res=memo[i];
    if (~res) return res;
    for(int c=0; c<26; ++c)
        res=min(res, getMinimumLength(nextpos[i][c]+1)+1);
    return res;
}

int main()
{
    string s; cin>>s;
    n=s.size();

    for(int c=0; c<26; ++c) nextpos[n][c]=n+1;
    for(int i=n-1; i>=0; --i)
        for(int c=0; c<26; ++c)
            nextpos[i][c]=s[i]==c+'a' ? i : nextpos[i+1][c];

    memset(memo, -1, sizeof(memo));

    string res(n+1, '~');
    for(int i=0; i<26; ++i) {
        string t(1, i+'a');
        int k=nextpos[0][i]+1;
        while (k<=n) {
            int L=n+n, c;
            for(int j=0; j<26; ++j) {
                if (L>getMinimumLength(nextpos[k][j]+1)+1) {
                    L=getMinimumLength(nextpos[k][j]+1)+1;
                    c=j;
                }
            }
            t+=char(c+'a');
            k=nextpos[k][c]+1;
        }
        if (res.size()>t.size() || res>t) res=t;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 22148
n,k = map(int,input().split())
s = input()
ss = s.lower()
if k == 1:
  print(ss[0]+s[1:n])
elif k == n:
  print(s[0:n-1]+ss[n-1])
else:
  print(s[0:k-1]+ss[k-1]+s[k:n])

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
using namespace std;

int main()
{
	vector<ll> N(2);
	cin >> N[0] >> N[1];
	sort(ALL(N));
	ll ans = 0;
	if (N[0]==1)
	{
		if (N[1] == 1)ans = 1;
		else ans = N[1] - 2;
	}
	else if (N[0]>=2)
	{
		ans = (N[0] - 2) * (N[1] - 2);
	}
	co(ans);
}

Measured memory_bytes: 256
n, k = map(int, input().split())
ans = [False] * n
for i in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        ans[a-1] = True
cnt = 0
for i, a in enumerate(ans):
    if not a:
        cnt += 1
print(cnt)


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

using namespace std;

vector<string> split(const string& s, char c) {
    vector<string> v; stringstream ss(s); string x;
    while (getline(ss, x, c)) v.emplace_back(x); return move(v);
}
template<typename T, typename... Args>
inline string arrStr(T arr, int n) {
    stringstream s; s << "[";
    for(int i = 0; i < n - 1; i++) s << arr[i] << ",";
    s << arr[n - 1] << "]";
    return s.str();
}

#define ANTHRO(args...) {__anthro_begin(__LINE__); __anthro(split(#args, ',').begin(), args);}

inline void __anthro_begin(int line) { cerr << "#" << line << ": "; }
template<typename T> inline void __anthro_out_var(vector<T> val) { cerr << arrStr(val, val.size()); }
template<typename T> inline void __anthro_out_var(T* val) { cerr << arrStr(val,2); } //Change the values in case you want to debug something
template<typename T> inline void __anthro_out_var(T val) { cerr << val; }
inline void __anthro(vector<string>::iterator it) { cerr << endl; }

template<typename T, typename... Args>
inline void __anthro(vector<string>::iterator it, T a, Args... args) {
    cerr << it->substr((*it)[0] == ' ', it->length()) << "=";
    __anthro_out_var(a);
    cerr << "; ";
    __anthro(++it, args...);
}
//Simple Debugger

#define ll long long
#define MOD 1000000007
#define EPS 1e-9
int const INF = (int)1e9 + 1e3;
ll const INFL = (ll)1e18 + 1e6;
/*
    This is Frog1 from educational DP AtcoderJP
*/

int main(){
    ll n; cin>>n;
    vector<ll> dp(n+1,INF),ar(n+1);
    for(ll i=1;i<=n;i++) cin>>ar[i];
    dp[1]=0;
    for(ll i=1;i<=n;i++){
        for(ll j=1;j<=2;j++){
            if(i+j<=n){
                dp[i+j]=min(dp[i+j],dp[i]+abs(ar[i]-ar[j+i]));
            }
        }
    }
    cout<<dp[n];
    return 0;
}


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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

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

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

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int N, K;
  cin >> N >> K;
  vector< int > A(N, 1);
  cin >> A;
  for(int i = 0; i < K; i++) {
    vector< int > B(N + 1);
    for(int j = 0; j < N; j++) {
      B[max(0, j - A[j])]++;
      B[min(N, j + A[j] + 1)]--;
    }
    for(int j = 1; j <= N; j++) {
      B[j] += B[j - 1];
    }
    B.pop_back();
    if(A == B) break;
    A.swap(B);
  }
  cout << A << "\n";
}


Measured memory_bytes: 4784
// in the name of God
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define God ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main() {
    God;
    int n;
    cin >> n;
    vector<vector<int>> c(20, vector<int>(20));
    vector<pair<int, int>> a;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        ll x = 0;
        bool found = false;
        for (int i = 0; i < (int)s.size(); i++) {
            if (s[i] != '.') (x *= 10) += s[i] - '0';
            else found = true;
        }
        if (!found)  x *= (ll)1e9;
        else {
            int cur = 0;
            while (s.back() != '.')
                ++cur,s.pop_back();
            for (int it = 0; it < 9 - cur; it++) x *= 10;
        }
        int c2=0,c5=0;
        ll y = x;
        while (y % 2 == 0)
            ++c2,y /= 2;
        y = x;
        while (y % 5 == 0)
            ++c5,y /= 5;
        ++c[min(18, c2)][min(18, c5)];
        a.emplace_back(min(18, c2), min(18, c5));
    }
    for (int i = 18; i >= 0; i--)
        for (int j = 18; j >= 0; j--)
            c[i][j] += c[i + 1][j] + c[i][j + 1] - c[i + 1][j + 1];
    ll w = 0;
    for (auto x : a)
        w += c[18 - x.first][18 - x.second] - (x.first >= 9 && x.second >= 9);
    w /= 2;
    cout <<w;
    return 0;
}

Measured memory_bytes: 5340
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


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


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


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


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat[i])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    X, Y, A, B, C = MI()
    p = LI()
    q = LI()
    r = LI()
    ans = 0
    p = sorted(p, reverse=True)
    q = sorted(q, reverse=True)
    r = sorted(r, reverse=True)
    p = p[:X]
    q = q[:Y]
    hp = []
    hq = []
    hr = []

    for i in p:
        heappush(hp, i)

    for i in q:
        heappush(hq, i)

    for i in r:
        heappush(hr, -i)

    while len(hr) != 0:
        vr = -heappop(hr)
        vp = heappop(hp)
        vq = heappop(hq)

        if vp < vq and vr > vp:
            heappush(hp, vr)
            heappush(hq, vq)
        elif vp >= vq and vr > vq:
            heappush(hp, vp)
            heappush(hq, vr)
        else:
            heappush(hp, vp)
            heappush(hq, vq)

    print(sum(hp) + sum(hq))

if __name__ == '__main__':
    main()


Measured memory_bytes: 121372
h, w = map(int, input().split())
mass = [list(input()) for _ in range(h)]

ans = "Yes"
for i in range(h):
    for j in range(w):
        if mass[i][j] == "#":
            if i < h-1:
                if mass[i+1][j] == "#":
                    continue
            if 0 < i:
                if mass[i-1][j] == "#":
                    continue
            if j < w-1:
                if mass[i][j+1] == "#":
                    continue
            if 0 < j:
                if mass[i][j-1] == "#":
                    continue
            ans = "No"
            break

print(ans)



Measured memory_bytes: 3064
#n = 候補の数
n = int(input())
#t - h[i] * 0.006
#a = 基準温度
t,a = map(int,input().split())
h = list(map(int,input().split()))
#o = 計算結果格納
o = []

for i in range(n):
    o.append(t - h[i] * 0.006)

#p = 基準温度に最も近い場所の差
p = abs(a - o[0])
#q = 基準地点の番号
q = 0
for i in range(n)[1:]:
    if abs(a - o[i]) < p:
        p = abs(a - o[i])
        q = i

print(q + 1)

Measured memory_bytes: 9196
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  /* code */
  string c ;
  cin >> c;
  
  if (c== "Sunny") {
    c= "Cloudy";
  }else if(c=="Cloudy"){
    c= "Rainy";
  }else if(c=="Rainy"){
    c="Sunny";
  }
  cout << c << "\n";
  
  return 0;
}


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

const int INF = 1001001001;

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  int ans = 0, cc = INF, x;
  repe(i, 1, N) {
    cin >> x;
    int d = abs((T * 1000 - x * 6) - A * 1000);
    if (d < cc) cc = d, ans = i;
  };

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3540
n,m = map(int, input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        flag = True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] != b[k][l]:
                    flag = False
            if not flag:
                break
        if flag:
            print("Yes")
            exit()
print("No")

Measured memory_bytes: 3064
<?php
fscanf(STDIN,'%d%d%d',$W,$H,$N);
$Hmax=$H;
$Hmin=0;
$Wmax=$W;
$Wmin=0;
for ($i=0; $i <$N ; $i++) {
  // code...
  fscanf(STDIN,'%d%d%d',$X,$Y,$A);
  if($A==1){
    $Wmin=max($X,$Wmin);
  }elseif($A==2){
    $Wmax=min($X,$Wmax);
  }elseif($A==3){
    $Hmin=max($Hmin,$Y);
  }else{
    $Hmax=min($Hmax,$Y);
  }
}
echo max(0,($Hmax-$Hmin))*max(0,($Wmax-$Wmin));
echo "\n";


 ?>


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

using namespace std;

int main()
{   
    string s;
    int k, n;
    map<string, int> mp;
    
    cin >> s >> k;
    n = s.size();
        
    for(int i = 0;i < n;++i){
        for(int j = 1;j <= 5;j++){
            mp[s.substr(i, j)] = 1;
        }
    }
    
    int kk = 0;
    string ans;
    for(auto it = mp.begin(); it != mp.end();it++){
        ans = it->first;
        kk++;
        if(kk == k) break;
    }
    
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1920
import sys
sys.setrecursionlimit(1000000)  # RecursionError対策

def fibonacci(n):
    if n == 0:
        return 0 # F0
    elif n == 1:
        return 1 # F1
    return fibonacci_sub2(n-2, 1, 0) #F2以降

def fibonacci_sub2(n, fibo_minus1, fibo_minus2):
    return fibo_minus1 if n==0 else fibonacci_sub2(n-1, fibo_minus1+fibo_minus2, fibo_minus1)

N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
a.append(N+1)
anser = 1
start = 0
for i in range(M+1):
    Bre = a.pop(0)
    if Bre == start:
        anser = 0
        break
    anser = anser * fibonacci(Bre - start + 1)
    start = Bre + 1

print(anser % 1000000007)

Measured memory_bytes: 545140
from fractions import gcd
N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
g = A[0]
for a in A[1:]:
    g = gcd(a, g)
for a in A:
    if a >= K and (a - K) % g == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


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

int main() {
   int a, b;
   cin >> a >> b;

   if (a + b < 10) {
       cout << a + b << endl;
   } else {
       cout << "error" << endl;
   }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

int main(){
    char a,b;
    cin >> a >> b;
    if (a>b){
        cout << ">" << endl;
    }else if(a<b){
        cout << "<" << endl;
    }else{
        cout << "=" << endl;
    }
}


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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define IOS             ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define read            freopen("in.txt","r",stdin)
#define write           freopen("out.txt","w",stdout)
#define loop(i,a,b)     for (ll i = a; i <= b; i++)
#define rloop(i,a,b)    for (ll i = a; i >= b; i--)
#define ms(a,x)         memset(a,x,sizeof a)
#define ll              long long int
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define pb              push_back
#define nl              cout<<"\n"
#define gcd(a,b)        __gcd((a),(b))
#define lcm(a,b)        ((a)*(b))/(gcd(a,b))
#define sq(a)           (a)*(a)
#define sz(a)           a.size()
#define mod             1000000007
#define PI              2*acos(0.0)


int main()
{
    IOS
    int T=1;
    //cin>>T;
    while(T--)
    {
        ll n,k;
        cin>>n>>k;
        ll a[n],dp[n];
        loop(i,0,n-1) cin>>a[i],dp[i]=1e9;
        dp[0]=0;
        loop(i,0,n-1)
        {
            for(ll j=i+1;j<=i+k and j<n;j++)
            dp[j]=min(dp[j],dp[i]+abs(a[j]-a[i]));
        }
        cout<<dp[n-1];
    }
    return 0;
}


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

int main(){
    int w, h, x, y, r;
    std::cin >> w >> h >> x >> y >> r;

    int top = y + r, bottom = y - r, right = x + r, left = x - r;
    bool flg = true;
    if(h < top){
        flg = false;
    }
    if(bottom < 0){
        flg = false;
    }
    if(left < 0){
        flg = false;
    }
    if(w < right){
        flg = false;
    }

    if(flg){
        std::cout << "Yes";
    }else{
        std::cout << "No";
    }
    std::cout << std::endl;
    
    return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, a, b) for (int64_t i = (a); i < (b); ++i)
const int MOD = 1e9 + 7;
typedef long long ll;
const long long INF = 1LL << 60;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  vector<double> q;
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) {
    double t = double((1 + p[i]) * p[i] / 2);
    q.push_back(double(t / p[i]));
  }
  double now = 0;
  for (int i = 0; i < k; i++) {
    now += q[i];
  }
  double ans = now;
  for (int i = k; i < n; i++) {
    now = now - q[i - k] + q[i];
    ans = max(ans, now);
  }
  printf("%6f", ans);
}


Measured memory_bytes: 3188
#include <stdio.h>
int main(void){
	char s[1001] = { '\0' };
	char t[1001] = { '\0' };
	int l_s = 0;
	int l_t = 0;
	int max_match = 0;
	scanf("%s", s);
	scanf("%s", t);
	while(s[l_s] != '\0'){
		l_s++;
	}
	while(t[l_t] != '\0'){
		l_t++;
	}
	for(int i=0; i<l_s - l_t + 1; i++){
		int match = 0;
		for(int j=0; j<l_t; j++){
			if(s[i+j] == t[j]){
				match++;
			}
		}
		if(match>max_match){
			max_match = match;
		}
	}
	printf("%d\n", l_t-max_match);
	return 0;
}


Measured memory_bytes: 1732
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"basic.hpp"
#else
template <class... T> void printl(T&&...){ }
template <class... T> void printc(T&&...){ }
template <class... T> void prints(T&&...){ }
#endif

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    int prev; cin >> prev;
    ll ans = 0;
    for(int i=1;i<n;i++){
        ll x; cin >> x;
        ll c = (x - prev) * a;
        if(c < b){
            ans += c;
        }else{
            ans += b;
        }
        prev = x;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 888
'''
参考
https://qiita.com/u2dayo/items/98917c94c89c77b9b3a1#c%E5%95%8F%E9%A1%8Cubiquity
'''

MOD = 10 ** 9 + 7

N = int(input())

ans = pow(10, N)
ans -= 2 * pow(9, N)
ans += pow(8, N)
ans %= MOD

print(ans)


Measured memory_bytes: 10996
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;
#define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;}
#define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;}
#define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cout << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cout << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1ll << 60;
// const int mod = 1e9 + 7;
const int mod = 100000;
using Graph = vector<vector<int>>;

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

    int n, m, s;
    while (cin >> n >> m >> s, n) {
        n *= n;
        vvi dp(n + 1, vi(s + 1));
        dp[0][0] = 1;
        rep2(t, 1, m + 1) {
            rrep2(i, n + 1, 1) {
                rep2(j, t, s + 1) {
                    (dp[i][j] += dp[i - 1][j - t]) %= mod;
                }
            }
        }
        cout << dp.back().back() << endl;
    }
}

Measured memory_bytes: 4080
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 200005
#define INF 1e18
lli n;
lli dp[3000][3000];
vector <pair <lli,lli> > arr;
bool compare(pair <lli,lli> a, pair <lli,lli> b){
    if(a.first > b.first)
        return true;
    else if(a.first == b.first && a.second > b.second)
        return true;
    return false;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    lli temp;
    for(lli i = 0; i<n; i++){
        cin>>temp;
        arr.push_back({temp,i+1});
    }
    sort(arr.begin(),arr.end(), compare);
    dp[0][0] = 0;
    for(lli i = 1; i<=n; i++){
        dp[i][0] = dp[i-1][0] + arr[i-1].first*(abs(arr[i-1].second-i));
    }
    for(lli i = 1; i<=n; i++){
        dp[0][i] = dp[0][i-1] + arr[i-1].first*(abs(arr[i-1].second-(n-i+1)));
    }
    lli candi1, candi2;
    for(lli i = 1; i<=n; i++){
        for(lli j = 1; j+i <=n; j++){
            candi1 = dp[i-1][j] + arr[i+j-1].first*(abs(arr[i+j-1].second-i));
            candi2 = dp[i][j-1] + arr[i+j-1].first*(abs(arr[i+j-1].second-(n-j+1)));
            dp[i][j] = max(candi1,candi2);
        }
    }
    lli ans = LONG_LONG_MIN;
    for(lli i = 0; i<=n; i++){
            lli j = n-i;
            ans = max(ans,dp[i][j]);
        //cout<<endl;
    }
    cout<<ans<<endl;
}
    

Measured memory_bytes: 27288
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mod = 1000000007;
const int INF = 1001001001;

struct UnionFind {
  vector<int> d;
  UnionFind(int n = 0): d(n, -1) {}
  int find(int x) {
    if(d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if(x == y) return false;
    if(d[x] > d[y]) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) {return -d[find(x)];}
};

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  UnionFind uf(n);
  vector<vector<int>> to(n);
  vector<int> deg(n);
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    deg[a]++;
    deg[b]++;
    uf.unite(a, b);
  }
  rep(i, k) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  rep(i, n) {
    int ans = uf.size(i) - 1 - deg[i];
    for (int v : to[i]) {
      if(uf.same(i, v)) --ans;
    }
    printf("%d%c", ans, i==n-1?'\n':' ');
  }
}

Measured memory_bytes: 6784
#include <stdio.h>

typedef struct{
  double x, y;
} Point;

void kock(int, Point, Point);

int main(){
  int n;
  Point p1, p2;

  p1.x = 0;
  p1.y = 0;
  p2.x = 100;
  p2.y = 0;

  scanf("%d", &n);

  printf("%.8f %.8f\n", p1.x, p1.y);

  kock(n, p1, p2);

  printf("%.8f %.8f\n", p2.x, p2.y);
  
  return 0;
}

void kock(int n, Point p1, Point p2){
  Point s, t, u;
  double cos60 = 0.5;
  double sin60 = 0.8660254037844386;
  
  if(n == 0) return;

  s.x = (2 * p1.x + 1 * p2.x) / 3;
  s.y = (2 * p1.y + 1 * p2.y) / 3;
  
  t.x = (1 * p1.x + 2 * p2.x) / 3;
  t.y = (1 * p1.y + 2 * p2.y) / 3;

  u.x = (t.x - s.x) * cos60 - (t.y - s.y) * sin60 + s.x;
  u.y = (t.x - s.x) * sin60 + (t.y - s.y) * cos60 + s.y;

  kock(n-1, p1, s);
  printf("%.8f %.8f\n", s.x, s.y);
  kock(n-1, s, u);
  printf("%.8f %.8f\n", u.x, u.y);
  kock(n-1, u, t);
  printf("%.8f %.8f\n", t.x, t.y);
  kock(n-1, t, p2);
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(),a.end()
#define rep(i,m) for(int i=0;i<m;i++)
#define pb(n) push_back(n)

#define int long long

signed main() {
    int a,b,c;cin >>a>>b>>c;
    cout <<(a+b+c>=22?"bust":"win")<<endl;
}


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

ll mod_pow(ll n, ll p, ll mod){
    n %= mod;
    // return (n^p) % mod
    if(p==0) return 1;
    ll res = mod_pow(n*n%mod, p/2, mod);
    if(p%2==1) res = res * n % mod;
    return res;
}

int main(){
    ll n, a, b;  cin >> n >> a >> b;
    ll mod = 1e9 + 7;
    ll ans = mod_pow(2, n, mod);
    ans = (ans + mod - 1)%mod;  // 全体

    vector<ll> comb(b+1, 0);
    comb[0] = 1;
    for(int i=0; i<b; i++){
        comb[i+1] = (comb[i]*(n-i))%mod;
        comb[i+1] = (comb[i+1] * mod_pow(i+1, mod-2, mod))%mod;
    }

    ans -= comb[a] + comb[b];
    while(ans < 0){
        ans += mod;
    }
    cout << ans%mod << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include<stdio.h>
#include<string.h>

using namespace std;

char s[100005];
int d[100005];

int main() {
    scanf("%s", s);
    int nr = strlen(s);
    for(int i = 4; i < nr; i++){
        if(s[i - 4] == 'd' && s[i - 3] == 'r' && s[i - 2] == 'e' && s[i - 1] == 'a' && s[i] == 'm' && (i == 4 || d[i - 5]))
            d[i] = 1;
        if(s[i - 4] == 'e' && s[i - 3] == 'r' && s[i - 2] == 'a' && s[i - 1] == 's' && s[i] == 'e' && (i == 4 || d[i - 5]))
            d[i] = 1;
        if(i >= 5 && s[i - 5] == 'e' && s[i - 4] == 'r' && s[i - 3] == 'a' && s[i - 2] == 's' && s[i - 1] == 'e' && s[i] == 'r' && (i == 5 || d[i - 6]))
            d[i] = 1;
        if(i >= 6 && s[i - 6] == 'd' && s[i - 5] == 'r' && s[i - 4] == 'e' && s[i - 3] == 'a' 
        && s[i - 2] == 'm' && s[i - 1] == 'e' && s[i] == 'r' && (i == 6 || d[i - 7]))
            d[i] = 1;
    }
    if(d[nr - 1])
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <string>
#define REP(i,n) for(int i=0;i<(n);++i)
#define MIN(a,b) ((a)<(b)?(a):(b))
using namespace std;

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  int p1 = 0, p2 = 0, p3 = 0;
  REP(i, N) {
    int P;
    cin >> P;
    if(P <= A) {
      p1++;
    } else if(P <= B) {
      p2++;
    } else {
      p3++;
    }
  }
  int ret = MIN(p1, MIN(p2, p3));
  cout << ret << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import itertools

n, m = map(int, input().split())

all = [0] *n
temp = [1] *m
all.extend(temp)

count = 0
for v in itertools.combinations(all, 2):
    ans = v[0]+v[1]
    #print(ans)
    if ans%2 == 0:
        count += 1
print(count)


Measured memory_bytes: 3060
#include <stdio.h>

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

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

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

    // start
    vector<int> rings(3);
    rep(i, 3) cin >> rings.at(i);
    sort(all(rings));
    cout << rings.at(0) + rings.at(1) << endl;
    // end

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;
#include<algorithm>
#include<math.h>
#include<map>
#include<queue>

int main() {
	ll n;
	cin >> n;
	vector<ll>a(n + 1);
	vector<ll>b(n);
	rep(i, n + 1) {
		cin >> a[i];
	}
	rep(i, n) {
		cin >> b[i];
	}
	ll c(0);
	ll k(0);
	ll q(0);
	rep(i, n) {
		q =min(a[i] - k, b[i]);
		c += q;
		k = min(a[i + 1], b[i] - q);
		c += k;
	}
	cout << c;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, a, n) for(int i=(a); i<(n); i++)
using namespace std;

int main(){
    int n;
    cin >> n;
    string ans = n/100 == n%10 ? "Yes" : "No";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// ABC 119

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        double ans = 0;
        for (int i = 0; i < n; i++)
        {
            string[] s = Console.ReadLine().Split();
            double x = double.Parse(s[0]);
            if (s[1] == "JPY")
                ans += x;
            else
                ans += x * 380000.0;
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 13268
import java.io.*;
import java.util.function.*;
import java.util.stream.*;

class Main
{
    /**
     * ABC 062 B: Picture Frame
     *     (周囲1ピクセルを'#'で囲む)
     */ 
    public static void main(String[] args) throws IOException
    {
        // 入力
        BufferedReader br = new BufferedReader(
                new InputStreamReader(System.in));
        int[] HW = Stream.of(br.readLine().split(" ")).mapToInt(
                item -> new Integer(item)).toArray();
        Stream<String> lines = br.lines();
        
        // データ部分を抽出
        Stream<String> a = lines.filter(item -> item.indexOf(" ") < 0);

        // 枠線を決める
        // Streamは同じインスタンスで2度処理を実行できないため、Supplierを通す
        Supplier<Stream<String>> frame = () ->
                Stream.of(new String(new char[HW[1]]).replace("\0", "#"));
        Stream<String> out = Stream.concat(frame.get(), Stream.concat(a, frame.get())).map(
                item -> "#" + item + "#") ;        

        // 出力(末尾は改行を入れない)
        System.out.print(out.collect(Collectors.joining("\n")).replaceFirst("\n$", ""));
    }
}


Measured memory_bytes: 26448
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
	int n,f=0,c;
	cin>>n;
	for(int i=1;i<=n;i=i+2){
		c=0;
		for(int j=1;j<=i;j++){
			if(i%j==0)c++;
			
		}
		
		if(c==8)f++;
	}
	cout<<f<<'\n';
	return 0;
}

Measured memory_bytes: 256
// @author: arch_

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)

array<array<long, 100 + 1>, 100> a, b, c;

int main(void) {
    int n, m, l;
    cin >> n >> m >> l;
    REP(i, n) REP(j, m) cin >> a[i][j];
    REP(i, m) REP(j, l) cin >> b[i][j];
    REP(i, n) REP(j, m) REP(k, l) c[i][k] += a[i][j] * b[j][k];
    REP(i, n) {
        REP(j, l) {
            cout << c[i][j];
            if (j < l - 1) cout << " ";
        }
        cout << "\n";
    }
    return 0;
}

Measured memory_bytes: 3340
#include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

#define TRACE(x) cerr << #x << " = " << x << endl

typedef long long ll;
typedef pair<int, int> P;
#define X first
#define Y second

int main()
{
  int n;
  ll a=1, b=1;

  scanf("%d%lld%lld", &n, &a, &b); n--;
  for (; n--; ) {
    int x, y;
    scanf("%d%d", &x, &y);
    ll tmp = max((a-1) / x + 1, (b-1) / y + 1);
    a = tmp * x;
    b = tmp * y;
  }

  printf("%lld\n", a + b);

  return 0;
}


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

int main(){
  int a,b,c,t;
  cin >> a >> b >> c;

  if(a>b){
    t = a;
    a = b;
    b = t;
  }

  if(b>c){
    t = b;
    b = c;
    c = t;
  }

  if(a>b){
    t = a;
    a = b;
    b = t;
  }

  cout << a << " " << b << " " << c << endl;

  return 0;
}

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

int main() {
  int N, s =0, t, A = 0, B = 0;
  cin >> N;
  vector<int> card(N);
  for (int i = 0; i < N; i++) {
    cin >> card.at(i);
  }
  for (int j = 0; j < N; j++) {
    for (int k = 0; k < N; k++) {
      if (card.at(k) > s) {
        s = card.at(k);
        t = k;
      }
    }
    card.at(t) = 0;
    if (j % 2 == 0) {
      A += s;
    }
    else {
      B += s;
    }
    s = 0;
  }
  cout << A - B << endl;
}

Measured memory_bytes: 256
// Created by new_sm
//
#include<bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
s.find_by_order(x) xth element in set
x.order_of_key(x) number of elements <x*/
#define ll long long
#define vi vector<int>
#define si set<int>
#define mii map<int,int>
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define extract_word(s)  stringstream str(s); while(str>>word)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define SET(s) cout<<fixed<<setprecision(s)
#define chotu 1000000007
#define set0(a) memset(a,0,sizeof(a))
#define endl "\n"
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define lower_string(s) transform(all(s),s.begin(),::tolower())
#define upper_string(s) transform(all(s),s.begin(),::toupper())
#define size(s) s.size()
template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }
template<typename T,typename U>
bool compare(T x,U y){return(abs(x-y)<=1e-9);}
void solve()
{
fastio
char x;
cin>>x;
x++;
cout<<x;
}
int main()
{
//code
fastio

int t;
t=1;
while(t--)
{
solve();
cout<<endl;
}
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin >> a >> b;
  if((a+b) % 2 == 0)cout << (a + b) / 2;
  if((a+b) % 2 == 1)cout << (a + b) / 2 + 1;
  
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#define maxn 2010
#define maxm 100005
#define maxd 5000000
#define inf 2000000000ll
#define ll long long 
using namespace std;

int n,i,j,k,S,T;
int em,e[maxm],nx[maxm],ls[maxn],ec[maxm];
ll cost[maxm];

void insert(int x,int y,int z,ll c){
	em++;e[em]=y;nx[em]=ls[x];ls[x]=em;ec[em]=z;cost[em]=c;
	em++;e[em]=x;nx[em]=ls[y];ls[y]=em;ec[em]=0;cost[em]=-c;
}

ll ans,sum,dis[maxn];
int d[maxd],vis[maxn],fa[maxn];
int SPFA(){
	for(int i=1;i<=T;i++) dis[i]=-1e15,vis[i]=fa[i]=0;
	int t=0,w=1;d[1]=S,dis[S]=0,vis[S]=1;
	while (t<w){
		int x=d[++t]; vis[x]=0;
		for(int i=ls[x];i;i=nx[i]) if (ec[i]&&dis[x]+cost[i]>dis[e[i]]){
			dis[e[i]]=dis[x]+cost[i],fa[e[i]]=i;
			if (!vis[e[i]]) {
				vis[e[i]]=1,d[++w]=e[i];
				if (dis[d[w]]<dis[d[t+1]]) swap(d[w],d[t+1]);
			}
		}
	}
	return dis[T]>-1e15;
}

void maxflow(){
	while (SPFA()){
		int mi=inf;
		for(int x=T;x!=S;x=e[fa[x]^1]) mi=min(mi,ec[fa[x]]);
		sum+=mi;
		for(int x=T;x!=S;x=e[fa[x]^1]) 
			ec[fa[x]]-=mi,ec[fa[x]^1]+=mi,ans+=cost[fa[x]]*mi;
	}
}

int main(){
	scanf("%d",&n);
	S=2*n+5,T=2*n+6,em=1;
	for(i=1;i<=n;i++){
		int x,y,c,nm=2*n;scanf("%d%d%d",&x,&y,&c);
		insert(S,i,c,0);
		for(j=0;j<=1;j++) for(k=0;k<=1;k++)
			insert(i,++nm,inf,inf+x*(j?1:-1)+y*(k?1:-1));
	}
	for(i=1;i<=n;i++){
		int x,y,c,nm=2*n;scanf("%d%d%d",&x,&y,&c);
		insert(n+i,T,c,0);
		for(j=0;j<=1;j++) for(k=0;k<=1;k++)
			insert(++nm,n+i,inf,inf+x*(j?-1:1)+y*(k?-1:1));
	}
	maxflow();
	printf("%lld",ans-inf*sum*2);
}

Measured memory_bytes: 2204
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, l, r, i, x;
  cin >> N;
  for (i = 0; i < N; i++){
    cin >> l >> r;
    x += (r - l + 1);
  }
      cout << x << endl;
}
  

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

#define ll long long

int main(){
    ll n,a,b,ans;
    cin >>n>>a>>b;

    ans = n/(a+b)*a;
    if(n%(a+b)<=a){
        ans+=n%(a+b);
    }else{
        ans+=a;
    }
    cout <<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
using namespace std;
typedef pair<ll,ll> pll;

ll n;
vector<pll> v;
int main()
{
        cin >> n;
        for(ll i=1;i<=n;i++) {
                ll x, y;
                cin >> x >> y;
                v.pb(make_pair(y, x));
        }
        sort(v.begin(), v.end());
        ll t = 0;
        for(auto &i : v) {
                if(t + i.second > i.first) {
                        cout << "No\n"; return 0;
                }
                t += i.second;
                //cout <<
        }
        cout << "Yes\n";
}


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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

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

//print
#define pv(val) cerr << #val << '=' << (val) << endl

const int INF = 1e9;

int main(void){

	ll N, K; cin >> N >> K;
	vector<int> A(N);

	REP(i,N) cin >> A[i];
	REP(i,N) A[i]--;

	vector<bool> was(N, false);
	int loop = -1;

	int idx = 0;
	int cnt = 0;
	vector<int> l;
	set<int> st;

	REP(i,N){
		if(!was[idx]){
			was[idx] = true;
			l.push_back(idx);
			idx = A[idx];
			cnt++;
		}else{
			loop = idx;
			break;
		}
	}

	REP(i,l.size()){
		if(l[i] == loop){
			idx = i;
			break;
		}
	}

	int ans;
	if(K < idx) ans = l[K];
	else{
		K -= idx;
		K %= (l.size() - idx);
		ans = l[K + idx];
	}
	ans++;
	
	cout << ans << endl;
	



	return 0;

}


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

using namespace std;

#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) ((int)(x).size())
#define whole(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

const int N = int(2e5) + 2;
const int LG = 20;
const ll mod = 998244353;
const int INF = (int)1e9 + 7;
const ll linf = 1e18;
const ld pi = acos(-1);
const int base = 10;
const ld EPS = 1e-9;

string s;
int main (){
    cin >> s;
    sort (whole(s));
    if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) return !printf ("Yes\n");
    return !printf ("No\n");
}


Measured memory_bytes: 256
from itertools import product
from heapq import heappush, heappop

class Dijkstra:
    def __init__(self, N):
        self.N = N # #vertices
        self.E = [[] for _ in range(N)]

    def add_edge(self, init, end, weight, undirected=False):
        self.E[init].append((end, weight))
        if undirected: self.E[end].append((init, weight))
    
    def distance(self, s):
        INF = float('inf')
        self.dist = [INF] * self.N # the distance of each vertex from s
        self.prev = [-1] * self.N # the previous vertex of each vertex on a shortest path from s
        rem = self.N # #(remaining vertices)
        heap = []
        heappush(heap, (0, -1, s))
        while heap and rem:
            d, p, v = heappop(heap)
            if d >= self.dist[v]: continue # (s,v)-shortest path is already calculated
            self.dist[v] = d; self.prev[v] = p
            rem -= 1
            for u, c in self.E[v]:
                temp = d + c
                if self.dist[u] > temp: heappush(heap, (temp, v, u))
        return self.dist

H, W = map(int, input().split())
dijkstra = Dijkstra(H * W)

def vtx(i, j): return i*W + j
def coord(n): return divmod(n, W)

grid = [input() for _ in range(H)] # |string| = W
E = [[] for _ in range(H * W)]
ans = 0 if grid[0][0] == '.' else 1
for i, j in product(range(H), range(W)):
    v = vtx(i, j)
    check = [vtx(i+dx, j+dy) for dx, dy in [(1, 0), (0, 1)] if i+dx <= H-1 and j+dy <= W-1]
    for u in check:
        x, y = coord(u)
        if grid[i][j] == '.' and grid[x][y] == '#':
            dijkstra.add_edge(v, u, 1)
        else:
            dijkstra.add_edge(v, u, 0)
dist = dijkstra.distance(0)
ans += dist[vtx(H-1, W-1)]
print(ans)

Measured memory_bytes: 7028
def resolve():
	n, k = map(int, input().split())
	B = [0]*10**5
	for _ in range(n):
		a, b = map(int, input().split())
		B[a-1] += b
	cnt = 0
	for i in range(len(B)):
		cnt += B[i]
		if cnt >= k:
			print(i+1)
			break
resolve()

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


int main() {
  set <int> S;
  int N;
  cin >> N;
  
  for(int i = 0; i < N; i++){
    int d;
    cin >> d;
    S.insert(d);
  }
  cout << S.size() << endl;
}

Measured memory_bytes: 256