akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <list>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;

int main() {
  int n, w;
  cin >> n >> w;

  int all_values = 0;
  vector<pair<int, int>> v(n);
  for (auto& e : v) {
    cin >> e.first >> e.second;
    all_values += e.second;
  }

  vector<vector<int>> dp(all_values + 1, vector<int>(n + 1, w + 1));
  for (int i = 0; i <= n; i++) dp[0][i] = 0;

  for (int i = 1; i <= all_values; i++) {
    for (int j = 1; j <= n; j++) {
      dp[i][j] = dp[i][j - 1];
      if (v[j - 1].second > i) continue;
      dp[i][j] = min(dp[i][j], dp[i - v[j - 1].second][j - 1] + v[j - 1].first);
    }
  }
  
  int best = 0;
  for (int i = all_values; i >= 0; i--) {
    if (dp[i][n] <= w) {
      best = i;
      break;
    }
  }
  cout << best << endl;

  return 0;
}


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

#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define all(x) (x).begin(), (x).end()

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int MOD = 1000000007;
int start[100001], endi[100001];
int main() {
    IOS;
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int l, r;
        cin >> l >> r;
        start[l]++;
        endi[r]++;
    }
    int active = 0, ans = 0 ;
    for(int i = 1; i <= n; i++) {
        active += start[i];
        if(active == m) ans++;
        active -= endi[i];
    }
    cout<<ans<<"\n";
    return 0;
}

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

const int SIZE = 200007;

int main() {
    int N, K;
    cin >> N >> K;
    vector<long> H(N);
    for(auto i = 0; i < N; i++) cin >> H[i];
    sort(H.begin(), H.end());
    long sum = 0;
    for(auto i = 0; i < N - K; i++) {
        sum += H[i];
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 1792
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect
from operator import itemgetter
from heapq import heappush, heappop
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N, C = na()
D = [na() for _ in range(C)]
c = [na() for _ in range(N)]

z = {}
o = {}
t = {}
for i in range(1, N+1):
    for j in range(1, N+1):
        q = (i + j) % 3
        now = c[i - 1][j - 1] - 1
        if q == 0:
            if now not in z.keys():
                z[now] = 1
            else:
                z[now] += 1
        if q == 1:
            if now not in o.keys():
                o[now] = 1
            else:
                o[now] += 1
        if q == 2:
            if now not in t.keys():
                t[now] = 1
            else:
                t[now] += 1

ans = inf
for i, j, l in itertools.permutations(range(C), 3):
    tmp = 0
    for k, v in z.items():
        tmp += v * D[k][i]
    for k, v in o.items():
        tmp += v * D[k][j]
    for k, v in t.items():
        tmp += v * D[k][l]
    ans = min(tmp, ans)
print(ans)



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

int main(){
	string s,t;
	cin >> s >> t;
	int ans = 0;
	rep(i,s.size()){
		if(s[i] != t[i]) ans++;
	}
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3840
#include <bits/stdc++.h>
#include <unordered_map>
#include <queue>

using namespace std;

int N,A,B,C;
int obj[3];
int stick[8];
int Min=99999999;
int dp(int a,int b,int c,int used) {
    int res=99999999;
    if(used==N){
        if(a>0&&b>0&&c>0){
            res = abs(A-a)+abs(B-b)+abs(C-c)-30;
        }else{
            return 99999999;
        }
        if(res>Min)return 99999999;
        return res;
    }

    res=min(res,dp(a,b,c,used+1));
    res=min(res,dp(a+stick[used],b,c,used+1) + 10);
    res=min(res,dp(a,b+stick[used],c,used+1) + 10);
    res=min(res,dp(a,b,c+stick[used],used+1) + 10);

    Min=min(Min,res);
    return res;
}

int main() {
    int i;
    cin>>N>>A>>B>>C;

    for(i=0;i<N;i++){
        cin>>stick[i];
    }
    int ans = dp(0,0,0,0);
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <cassert>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8

bool solve(){
	LL a, b, c;
	cin >> a >> b >> c;
	LL t = c - a - b;
	if(t <= 0){ return false; }
	return 4 * a * b < t * t;
}

void mainmain(){
	puts(solve() ? "Yes" : "No");
}



}
int main() try{
//	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}
catch(...){
	throw;
}


Measured memory_bytes: 256
module.exports=function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var o in r)t.d(n,o,function(e){return r[e]}.bind(null,o));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){t(1)(t(2).readFileSync("/dev/stdin","UTF-8").split("\n"))},function(r,e,t){"use strict";r.exports=function(r){for(var e=Number(r[0]),t=[],n=0;n<e;n++)t.push(Number(r[n+1]));t.sort(function(r,e){return r-e});var o=e%2==0?e/2-1:Math.floor(e/2),u=e%2==0?e/2:Math.floor(e/2),f=new Array(e);f[u]=t[0];for(var a=1;a<=o;a++)a%2==0?(f[u-a]=t[a-1],f[u+a]=t[a]):(f[u-a]=t[e-a],f[u+a]=t[e-a-1]);e%2==0&&(f[0]=e/2%2==0?t[o]:t[u]);for(var i=0,l=1;l<e;l++)i+=Math.abs(f[l]-f[l-1]);var c=new Array(e);c[u]=t[e-1];for(var s=1;s<=o;s++)s%2==0?(c[u-s]=t[e-s-1],c[u+s]=t[e-s]):(c[u-s]=t[s],c[u+s]=t[s-1]);e%2==0&&(c[0]=e/2%2==0?t[o]:t[u]);for(var p=0,d=1;d<e;d++)p+=Math.abs(c[d]-c[d-1]);p>i&&(i=p),console.log(i)}},function(r,e){r.exports=require("fs")}]);

Measured memory_bytes: 30420
#define _CRT_SECURE_NO_WARNINGS

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

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

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

signed main() {
	int N = 0;
	vector<ll> A;

	cin >> N;
	REP(i, N) {
		ll num = 0;
		cin >> num;
		A.push_back(num - (i + 1));
	}
	sort(A.begin(), A.end());
	ll b = 0;

	if (N % 2) {
		b = A[N / 2];
	}
	else {
		b = A[N / 2 - 1];
	}
	ll sum = 0;
	REP(i, N) {
		sum += (abs(A[i] - b));
	}
	cout << sum;
	system("pause");
	return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
char a[503][503],b[503][503];
int main(){
	int h,w;
	scanf("%d%d",&h,&w);
	for(int i=1;i<=h;i++)
		scanf("%s",a[i]+1),strcpy(b[i]+1,a[i]+1);
	for(int i=1;i<=h;i++)
		a[i][1]='#',b[i][w]='#';
	for(int i=1;i<=w;i++)
		a[h][i]='#',b[1][i]='#';
	a[1][1]='.',b[h][w]='.';
	for(int i=2;i<h;i+=2)
		for(int j=2;j<w;j++)
			a[i][j]='#';
	for(int i=3;i<h;i+=2)
		for(int j=2;j<w;j++)
			b[i][j]='#';
	for(int i=1;i<=h;i++)
		puts(a[i]+1);
	puts("");
	for(int i=1;i<=h;i++)
		puts(b[i]+1);
}

Measured memory_bytes: 1280
#include <cstdio>

int main()
{
	int n, m, k; scanf("%d%d%d", &n, &m, &k);
	for (int i = 0, a = n; i <= n; ++i, --a)
		for (int j = 0, c = i * m; j <= m; ++j, c += a - i)
			if (c == k) return puts("Yes"), 0;
	puts("No");
	return 0;
}

Measured memory_bytes: 128
#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() {
  ll a, b, c;
  cin >> a >> b >> c;
  if(c-a-b<0) cout << "No" << endl;
  else {
    ll d = (c-a-b)*(c-a-b);
    ll e = 4*a*b;
    if(d > e) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)

int main() {
    ll N, K; cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) {
        cin >> A[i];
        A[i]--;
    }
    vector<ll> ans(N+1, -1);
    ans[0] = 0;
    set<ll> memo = {0};
    ll i = 1, tmp = 0;
    while(!memo.count(A[tmp])) {
        memo.insert(A[tmp]);
        ans[i] = A[tmp];
        i++;
        tmp = A[tmp];
    }
    //rep(j, i) cout << ans[j] << endl;
    ll s;
    rep(j, i) {
        if (ans[j] == A[tmp]) {
            s = j;
            break;
        }
    }
    /*cout << endl;
    cout << A[tmp] << endl;
    cout << s << endl;
    cout << endl;*/
    if (K < i) cout << ans[K] + 1 << endl;
    else {
        int now = (K-s) % (i-s) + s;
        //cout << i-s << endl;
        cout << ans[now] + 1 << endl;
    }

}


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

static const int N=100;
static const int WHITE=0;
static const int GRAY=1;

int n,M[N][N],color[N];
int d[N];
void bfs(int s){
    queue<int> q;
    for(int i=0;i<n;i++){
        d[i]=0;
        color[i]=WHITE;
    }
    color[s]=GRAY;
    q.push(s);
    int u;
    while(!q.empty()){
        u=q.front();q.pop();
        for(int v=0;v<n;v++){
            if(M[u][v]==0)continue;
            if(color[v]==WHITE){
                d[v]=d[u]+1;
                color[v]=GRAY;
                q.push(v);
            }
        }
    }
    for(int i=0;i<n;i++){
        if(i==0)
            cout<<i+1<<" " <<"0"<<endl;
        else
            cout<<i+1<<" "<<((d[i]==0)?(-1):d[i])<<endl;
    }
}
int main()
{
    int u,v,k,i,j;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        for(j=0;j<n;j++){
            M[i][j]=0;
        }
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        u--;
        for(j=0;j<k;j++){
            scanf("%d",&v);
            v--;
            M[u][v]=1;
        }


    }
    bfs(0);
}


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

using namespace std;

#define forn(i,n) for (int i = 0; i < int(n); i++)
#define ford(i,n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i,l,r) for (int i = int(l); i < int(r); i++)
#define all(a) a.begin(), a.end()
#define sz(a) int(a.size())
#define mp make_pair
#define pb push_back
#define x first
#define y second

template<typename X> inline X abs(const X& a) { return a < 0 ? -a : a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9;
const ld PI = acosl(ld(-1));

mt19937 mt(time(NULL));

const int N = 30 + 3;
int n, m;
string s;

inline char getChar (int id)
{
	if (id >= 0 && id <= 8)
		return '1' + id;
		
	return (id - 8) + 'A';
}

inline bool read()
{
	if (scanf ("%d%d", &n, &m) != 2)
		return false;
		
	forn(i, n)
		forn (j, m)
		{
			assert(cin >> s);
			
			if (s == "snuke")
			{
				//cerr << i << ' ' << j << endl;
				printf ("%c%d\n", char('A' + j), i + 1);
				return true;
			}
		}
		
	return true;
}

inline void solve()
{
}

int main()
{
#ifdef SU2_PROJ
	assert(freopen("input.txt", "r", stdin));
	assert(freopen("output.txt", "w", stdout));
#endif

	cout << setprecision(25) << fixed;
	cerr << setprecision(10) << fixed;

	assert(read());
	solve();

#ifdef SU2_PROJ
	cerr << "TIME: " << clock() << endl;
#endif

	return 0;
}


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

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

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

#define endl "\n"

void use_cio() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
    os << "[";
    for (auto x : V) os << x << ", ";
    return os << "]";
}
//--------------------------------------------------//

int main() {
    use_cio();
    int n, k;
    cin >> n >> k;
    if (n % 2) {
        if (n / 2 >= k - 1)
            cout << "YES\n";
        else
            cout << "NO\n";
    } else {
        if (n / 2 >= k)
            cout << "YES\n";
        else
            cout << "NO\n";
    }
}


Measured memory_bytes: 256
def coder(n):
    return int(n)//400
n=int(input())
aList=list(map(coder,input().split()))
Max=0
Min=0
c=0
C=0
tmp=[]
for i in range(n):
    if aList[i]<=7 and tmp.count(aList[i])==0:
        tmp.append(aList[i])
    elif aList[i]>=8:
        C+=1
c=len(tmp)
Max=c+C
if c>0:
    Min=c
else:
    Min=1
print("{} {}".format(Min,Max))

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


int main(){
  ll L,R;
  cin >> L >> R;
  
  int ans = 2019 * 2019;
  
  for(int i = L; i<= min(L + 2019,R) ; i++){
    for(int j = L; j<= min(L + 2019,R); j++){
      
      if(i == j)continue; //等しいときは制約でダメ
      int a = i % 2019;
      int b = j % 2019;
      ans = min(ans, (a * b)% 2019);   
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3616
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    String ret = "Yes";
    if (a == b && b == c) {
      ret = "No";
    } else if(a != b && b != c && c != a) {
      ret = "No"; 
    }
    System.out.println(ret);
  }
}

Measured memory_bytes: 21844
#include<stdio.h>
main(){
	int l,a,b,c,d;
	scanf("%d",&l);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	int j,m;
	j=a/c;
	if(a%c!=0){
		j++;
	}
	m=b/d;
	if(b%d!=0){
		m=b/d+1;
	}
	if(j>m){
		printf("%d\n",l-j);
	}
	else{
		printf("%d\n",l-m);
	}
	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define INF_MAX INT_MAX
using namespace std;
#define int long long
class Segtree{
    vector<int> tree;
    int n=1,m,Inf;
    void Set(vector<int> vec){
        rep(i,n*2-2)tree[i+1]=Inf;
        rep(i,vec.size())tree[i+n]=vec.at(i);
        update(0,n-1);
    }
    int sum(int a,int b){
        if(m==0)return max(a,b);
        else if(m==1)return min(a,b);
        else if(m==2)return a+b;
        else return a*b;
    }
    int query(int a,int b,int x,int l,int r){
        if(r<a||b<l)return Inf;
        if(a<=l&&b>=r)return tree[x];
        return sum(query(a,b,x*2,l,(l+r)/2),query(a,b,x*2+1,(l+r)/2+1,r));
    }
    void update(int l,int r){
        l+=n,r+=n;
        l/=2,r/=2;
        while(1){
            if(l==0)break;
            int xl=l;
            for(;xl<=r;xl+=2){
                tree[xl]=sum(tree[xl*2],tree[xl*2+1]);
            }
            l/=2,r/=2;
        }
    }
public:
    void Max(vector<int> vec){
        m=0;
        Inf=INT_MAX;
        Set(vec);
    }
    void Min(vector<int> vec){
        m=1;
        Set(vec);
    }
    void Add(vector<int> vec){
        m=2;
        Inf=0;
        Set(vec);
    }
    void Multiply(vector<int> vec){
        m=3;
        Inf=1;
        Set(vec);
    }
    void Min(){
        m=1;
        Inf=((int)1<<31)-1;
        rep(i,n*2-1)tree[i+1]=((int)1<<31)-1;
    }
    Segtree(int in){
        for(;in>n;n*=2);
        tree.resize(n*2);
    }
    void Set(int a,int b){
        tree[a+n]=b;
        update(a,a);
    }
    int query(int a,int b){
        return query(a,b,1,0,n-1);
    }
};
class Union_Find{
private:
    vector<int> t,s;
public:
    Union_Find(int max_length){
        rep(i,max_length+1){
            t.push_back(i);
            s.push_back(1);
        }
    }
    void Union(int x,int y){
        if(same(x,y))return;
        int tx=Find(x),ty=Find(y);
        if(s[tx]<s[ty]){
            s[ty]+=s[tx];
            t[tx]=ty;
        }
        else if(s[tx]>s[ty]){
            s[tx]+=s[ty];
            t[ty]=tx;
        }
        else if(tx>ty){
            t[tx]=ty;
            s[ty]+=s[tx];
        }
        else{
            t[ty]=tx;
            s[tx]+=s[ty];
        }
    }
    int Find(int n){
        if(t[n]==n)return n;
        else return t[n]=Find(t[n]);
    }
    bool same(int x,int y){
        return Find(x)==Find(y);
    }
};
signed main(){
    int n,q;
    cin>>n>>q;
    Segtree seg(n);
    seg.Min();
    rep(i,q){
        int a,b,c;
        cin>>a>>b>>c;
        if(a)cout<<seg.query(b,c)<<endl;
        else seg.Set(b,c);
    }
    return 0;
}


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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,n) for(int i=1; i<(n); i++)
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define int long long
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1000000007;
using namespace std;
long long h[10000010],x[10000010];

signed main(){
      
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int x,y;
  cin>>x>>y;
  
  if(x==1 || x==3 || x==5 || x==7 || x==8 || x==10 || x==12){
      if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12){
          cout<<"Yes"<<'\n';
      }else cout<<"No"<<'\n';
  }else if(x==4 || x==6 || x==9 || x==11 ){
      if(y==4 || y==6 || y==9 || y==11){
          cout<<"Yes"<<'\n';
         }else cout<<"No"<<'\n';
  }else if(x==2 && y==2) cout<<"Yes"<<'\n';
  else cout<<"No"<<'\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  for(int i=1;i<999;i++){
    if(i*(i+1)/2-a ==(i+1)*(i+2)/2-b){
      cout << i*(i+1)/2-a <<endl;
      break;
    }
  }
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;
#define ll long long
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using namespace std;
ll n,m,x,c[20],a[20][20],r = 90000000000,tmp[20];
int main() {
    cin >> n >> m >> x;
    REP(i,n) {
        cin >> c[i];
        REP(j,m) {
            cin >> a[i][j];
        }
    }
    
    for (int bit = 0; bit < (1<<n); ++bit) {
        ll tmpR = 0,tmp[20] = {0};
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { // 列挙に i が含まれるか
                tmpR += c[i];
                REP(j,m) {
                    tmp[j] += a[i][j];
                }
            }
        }
        
        bool chk = true;
        REP(j,m) {
            if(tmp[j] < x) {
                chk = false;
            }
        }
        if(chk) {
            chmin(r,tmpR);
        }
    }
    if(r == 90000000000) {
        r = -1;
    }
    cout << fixed << r;
}

Measured memory_bytes: 3640
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	private final static int MOD = 1000000007;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] L = new int[N];
		sc.fill(L);

		int count = 1;
		long current = 0;
		for (int i = 0; i < N; i++) {
			current += L[i];
			if (current > X) {
				break;
			}

			count++;
		}

		System.out.println(count);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	private static int add(int a, int b) {
		return (a + b) % MOD;
	}

	private static int sub(int a, int b) {
		return (a - b % MOD) % MOD;
	}

	private static int mul(int a, int b) {
		return ((a % MOD) * (b % MOD)) % MOD;
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}


Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define test ll t; cin>>t; while(t--)
#define ll long long 
#define pb push_back
int main(){    
    fast;
    	ll n; cin>>n;
    	ll p=n/500;
    	n-=(500*p);
    	ll m=n/5;
    	cout<<(p*1000)+(m*5);
    	}

    

Measured memory_bytes: 256
# A = [list(map(int, input().split())) for _ in range(3)]
# n = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
n, m = map(int, input().split())
S = []
C = []
for i in range(m):
    s, c = map(int, input().split())
    S.append(s)
    C.append(c)
for i in range(1000):
    d = list(str(i))
    if len(d) != n:
        continue
    else:
        judge = True
        for i in range(m):
            if d[S[i]-1] != str(C[i]):
                judge = False
        if judge:
            print("".join(d))
            exit()
print(-1)


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

int main() {
  int H, W;
  cin >> H >> W;
  char c;

  for (int i = 0; i < H + 2; i++) {
    if (i == 0 || i == H + 1) {
      for (int j = 0; j < W + 2; j++) {
        cout << '#';
      }
      cout << endl;
      continue;
    }

    for (int j = 0; j < W + 2; j++) {
      if (j == 0 || j == W + 1) {
        cout << '#';
      } else {
        cin >> c;
        cout << c;
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
#define PI 3.14159265359
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))

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

  cout << 800 * N - N / 15 * 200 << endl;

  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<set>
#include<fstream>
#include<map>
#include<string>
#include <stdio.h>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>
#include<stack>
#include<climits>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll>vl;
typedef vector<int>vi;
typedef vector<bool>vb;
typedef vector<double>vd;
typedef vector<char>vc;
typedef vector<string>vs;
#define MP make_pair
#define all(v) v.begin(),v.end()
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll mod = 1000000007;
const int OO = (int)1e8;
const int dx[] = { 0, 1, -1, 0 };
const int dy[] = { 1, 0, 0, -1 };
ll gcd(ll a, ll b){ if (b == 0){ return a; }return gcd(b, a % b); }

//#pragma warning (disable : 4996)
void in_out_txt()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
}
ll arr[10][10];
ll dijkstra(ll num)
{
	vl dis(10, 1e18);
	dis[num] = 0;
	queue<pair<ll, ll>>q;
	q.push(MP(num, 0LL));
	ll from, t, mn = 1e18;
	while (!q.empty())
	{
		from = q.front().first;
		t = q.front().second;
		q.pop();
		for (int to = 0; to <= 9; to++)
		{
			if (to == from) 
				continue;
			if (dis[to] >= t + arr[from][to])
				q.push(MP(to, t + arr[from][to])), dis[to] = t + arr[from][to];
		}
	}
	return dis[1];
}
int main()
{
	IO;
	//in_out_txt();
	int h, w;
	cin >> h >> w;
	for (int i = 0; i <= 9; i++)
	{
		for (int j = 0; j <= 9; j++)
		{
			cin >> arr[i][j];
		}
	}
	int vec[10];
	for (int i = 0; i <= 9; i++)
	{
		vec[i] = dijkstra(i);
	}
	ll x = 0, y;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			cin >> y;
			if (abs(y) == 1)
				continue;
			x += vec[y];
		}
	}
	cout << x << endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
double p(int x,int k){
	int cnt=0;
	while (x<k){
		x*=2;
		cnt++;
	}
	return pow(0.5,cnt);
}
int main(){
	int n,k;
	cin>>n>>k;
	double sum=0;
	rep(i,n){
		sum+=p(i+1,k);
	}
	printf("%.15f",sum/n);
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;

#define INF 1001001001

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

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

    int h, w;
    cin>>h>>w;
    vector<string> grid(h);
    rep(i, h) cin>>grid[i];

    vector<vector<int>> dp(h, vector<int>(w, INF));
    dp[0][0] = 0;

    rep(i, h) {
        rep(j, w) {
            if (j + 1 < w) {
                if (grid[i][j] != grid[i][j + 1]) chmin(dp[i][j + 1], dp[i][j] + 1);
                else chmin(dp[i][j + 1], dp[i][j]);
            }
            if (i + 1 < h) {
                if (grid[i][j] != grid[i + 1][j]) chmin(dp[i + 1][j], dp[i][j] + 1);
                else chmin(dp[i + 1][j], dp[i][j]);
            }
        }
    }
    int temp = 0;
    if (grid[0][0] == '#') temp++;
    if (grid[h - 1][w - 1] == '#') temp++;
    dp[h - 1][w - 1] = (dp[h - 1][w - 1] - temp) / 2 + temp;
    cout<<dp[h - 1][w - 1]<<endl;
}

Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main(void){
  int s;
  int simoni,kamini;
  scanf("%d",&s);

  kamini=s/100;
  simoni=s-kamini*100;
  //printf("%d\n%d\n",kamini,simoni);

  if((kamini>13&&(simoni>=13||simoni==0))||(kamini==0&&simoni>=13)||(kamini==0&&simoni==0)||(kamini==0&&simoni>=13)){
    printf("NA");
  }
  else if((kamini>=13||kamini==0)&&(simoni>0&&simoni<=12)){
    printf("YYMM");
  }
  else if((kamini>=1&&kamini<=12)&&(simoni>=1&&simoni<=12)){
    printf("AMBIGUOUS");
  }
  else if((kamini>0&&kamini<=12)&&(simoni>13||simoni==0)){
    printf("MMYY");
  }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
#define PI (acos(-1))
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ll,ll>;
//--GLOBAL---------------------------------


//--MAIN-----------------------------------
void Main() {
    ll N,X; cin>>N>>X;
    if(X==1 or X==2*N-1){ cout<< "No" <<"\n"; return;}
    cout<< "Yes" <<"\n";
    ll ans[2*N-1]={};
    vector<bool> A(2*N-1,false);
    if(N==2){
        ans[0]=1;
        ans[1]=2;
        ans[2]=3;
    }
    else{
        ans[N-1]=X;
        ans[N-2]=1;
        ans[N]=2*N-1;
        A[X-1]=A[0]=A[2*N-2]=true;
        if(X>=N){
            ans[N+1]=2;
            A[1]=true;
        }
        else{
            ans[N-3]=2*N-2;
            A[2*N-3]=true;
        }
    }
    ll x=0;
    rep(i,2*N-1){
        if(ans[i]!=0) continue;
        while(A[x]==true) ++x;
        ans[i]=++x;
    }
    rep(i,2*N-1){
        cout<< ans[i] <<"\n";
    }
}
//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


Measured memory_bytes: 3072
N = int (input())
x = []*N
y = []*N
for i in range (N):
    a,b = list(map(int,input().split()))
    x.append(a)
    y.append(b)
syou = x[0]+y[0]
dai = x[0]+y[0]
for i in range (N):
    if x[i]+y[i]>dai:
        dai = x[i]+y[i]
    if x[i]+y[i]<syou:
        syou = x[i]+y[i]
ans = dai - syou
gyakusyou = 10**9 -x[i] +y[i]
gyakudai = 10**9 -x[i] + y[i]
for i in range (N):
    if 10**9 -x[i] +y[i]>gyakudai:
        gyakudai = 10**9 -x[i] +y[i]
    if 10**9 -x[i] +y[i]<gyakusyou:
        gyakusyou = 10**9 -x[i] +y[i]
if gyakudai - gyakusyou > ans:
    ans = gyakudai - gyakusyou
print (ans)

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

int main(){
	int n;
	string s,t;
	cin>>n;
	cin>>s;
	cin>>t;
	string ans;
	
	for(int i=0;i<n;i++){
		cout<<s[i];
		cout<<t[i];
	}	
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc107_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]);
            int i = int.Parse(input[1]);
            Console.WriteLine(n-i+1);
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) (UB(c,x)-LB(c,x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DEL(v) decltype(v)().swap(v)
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
using namespace std;
template<typename T1, typename T2> using P = pair<T1,T2>;
template<typename T> using V = vector<T>;
struct edge { int from, to; int cost; };
bool operator< (const edge &edge1, const edge &edge2) { return edge1.cost < edge2.cost; };
const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const V<T>& v) {
   s << "[";
   for (int i = 0; i < v.size(); i++) { s << v[i]; if (i < v.size() - 1) s << " "; }
   s << "]";
   return s;
}

signed main()
{
   int N; cin >> N;
   string s1, s2; cin >> s1 >> s2;

   int count; bool wasVertical;
   REP(i, N) {
      if (i == 0) {
         if (s1[0] == s2[0]) {
            count = 3;
            wasVertical = true;
         } else {
            count = 6;
            wasVertical = false; i++;
         }
      } else {
         if (s1[i] == s2[i]) {
            if (wasVertical) count = mod(count * 2);
            else             count = mod(count * 1);
            wasVertical = true;
         } else {
            if (wasVertical) count = mod(count * 2);
            else             count = mod(count * 3);
            wasVertical = false; i++;
         }
      }
   }
   cout << count << endl;
   
   return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

before = a[0]
c_sum = 0
for i in range(1, n):
    if a[i] == before+1:
        c_sum += c[before-1]
    before = a[i]
print(sum(b) + c_sum)

Measured memory_bytes: 9112
numBox, numClild = [int(i) for i in input().split()]
numCandies = [int(i) for i in input().split()]

subsequences = {}
acc = 0
for i in range(0, numBox):
    acc += numCandies[i]
    if (acc % numClild) in subsequences:
        subsequences[acc % numClild].append(i)
    else:
        subsequences[acc % numClild] = [i]

count = 0
for k, v in subsequences.items():
    count += int(len(v) * (len(v) - 1) / 2)
    if k == 0:
        count += len(v)
print(count)

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

int main() {
  int A, B, C, biggest, middle, smallest;
  cin >> A >> B >> C;
  biggest=max(max(A,B),C);
  smallest=min(min(A,B),C);
  middle=A+B+C-biggest-smallest;
  cout << (middle-smallest)+(biggest-middle) <<endl;
}

Measured memory_bytes: 256
/** 
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

#include <bits/stdc++.h>
using namespace std;

/* see https://github.com/pllk/cphb/
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
    tree_order_statistics_node_update> indexed_set;
 **/

typedef long long ll;
#define endl "\n"
#define fori(n) for(ll i=0; i<(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinall(a, n) vll a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }

//typedef __int128 lll;
typedef pair<int, int> pii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;
typedef vector<ll> vll;

int main() {
cin.tie(nullptr);
std::ios::sync_with_stdio(false);
    cini(n);
    cini(q);
    vvi tree(n+1);
    for(int i=0; i<n-1; i++) {
        cini(a);
        cini(b);
        tree[a].push_back(b);
        tree[b].push_back(a);
    }

    vll cnt(n+1);
    for(int i=0; i<q; i++) {
        cini(p);
        cini(x);
        cnt[p]+=x;
    }

    vll ans(n+1);
    function<void(int, int)> dfs=[&](int node, int p) {
        ans[node]=ans[p]+cnt[node];
        for(int c : tree[node])
            if(c!=p)
                dfs(c, node);
    };

    dfs(1, 0);

    for(int i=1; i<=n; i++)
        cout<<ans[i]<<" ";
    cout<<endl;
}



Measured memory_bytes: 28928
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String[] spl = S.split(" ");
		int N = Integer.parseInt(spl[0]);
		int M = Integer.parseInt(spl[1]);
		String Si = "";
		int[] L = new int[M];
		int[] R = new int[M];
		for(int i = 0;i < M;i++){
			 Si = sc.nextLine();
			String[] Sispl = Si.split(" ");
			L[i] = Integer.parseInt(Sispl[0]);
			R[i] =Integer.parseInt(Sispl[1]);
			Si = "";
		}
		sc.close();
		int Lmax = 1;
		int Rmin = N;
		int cnt = 0;
		for(int j = 0;j < M;j++){
			Lmax = Math.max(L[j], Lmax);
			Rmin = Math.min(R[j], Rmin);
		}
		for(int k = 1;k <= N;k++){
			if(k >= Lmax && k <= Rmin){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 111796
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    let s = read::<String>().chars().collect::<Vec<char>>();
    let t = read::<String>().chars().collect::<Vec<char>>();

    let mut count = 0;
    for i in 0..3 {
        if s[i] == t[i] {
            count += 1;
        }
    }
    println!("{}", count);
}


Measured memory_bytes: 4352
use proconio::input;

fn main() {
    input! {
        mut x: i64,
    }

    solve(x);
}

fn solve(x: i64) {
    let x_500 = x / 500;
    let x_5 = (x - x_500 * 500) / 5;

    println!("{}", x_500 * 1000 + x_5 * 5);
}


Measured memory_bytes: 2120
import math
h,w=map(int,input().split())
ans,cnt=h*w,0
if h%3==0 or w%3==0:
  ans=0
else:
  for i in range(1,h//3+2):
    cnt=max((h-i)*(w%2),abs(math.floor(w/2)*(h-i)-w*i),abs(math.ceil(w/2)*(h-i)-w*i))
    ans=min(ans,cnt,h,w)
  for i in range(1,w//3+2):
    cnt=max((w-i)*(h%2),abs(math.floor(h/2)*(w-i)-h*i),abs(math.ceil(h/2)*(w-i)-h*i))
    ans=min(ans,cnt,h,w)
print(ans)


Measured memory_bytes: 66752
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) REP(i, 0, n)
#define REP(i, l, r) for (int i = l; i < r; i++)
#ifdef DEBUG
#define dout cout
#else
std::stringstream dout;
#endif
#define all(vec) vec.begin(), vec.end()
#define MOD (int) (1e9 + 7)
using namespace std;
typedef pair<int, int> P;
struct edge {
	int to, cost;
};

class dijkstra {
  private:
	int V;
	int d[100002];
	priority_queue<P, vector<P>, greater<>> que;

  public:
	dijkstra(int v, int s, vector<edge> G[]) {
		V = v;
		update(s, G);
	}

	void update(int s, vector<edge> G[]) {
		fill(d, d + V + 1, 100000000000ll);
		d[s] = 0;
		que.push(make_pair(0, s));
		while (!que.empty()) {
			P p = que.top();
			que.pop();
			int v = p.second;
			if (d[v] < p.first)
				continue;
			rep(i, G[v].size()) {
				edge e = G[v][i];
				if (d[e.to] > d[v] + e.cost) {
					d[e.to] = d[v] + e.cost;
					que.push(make_pair(d[e.to], e.to));
				}
			}
		}
	}

	int find(int e) {
		return d[e];
	}
};

int gcd(int a, int b) {
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}

int lcm(int a, int b) {
	return a * b / gcd(a, b);
}

bool prime(int a) {
	if (a == 1)
		return false;
	for (int i = 2; i * i <= a; i++) {
		if (a % i == 0)
			return false;
	}
	return true;
}

class Union_Find {
  private:
	vector<int> t, s;

  public:
	Union_Find(int max_length) {
		rep(i, max_length + 1) {
			t.push_back(i);
			s.push_back(1);
		}
	}

	void Union(int x, int y) {
		if (same(x, y))
			return;
		int tx = Find(x), ty = Find(y);
		if (s[tx] < s[ty]) {
			s[ty] += s[tx];
			t[tx] = ty;
		}
		else if (s[tx] > s[ty]) {
			s[tx] += s[ty];
			t[ty] = tx;
		}
		else if (tx > ty) {
			t[tx] = ty;
			s[ty] += s[tx];
		}
		else {
			t[ty] = tx;
			s[tx] += s[ty];
		}
	}

	int Find(int n) {
		if (t[n] == n)
			return n;
		else
			return t[n] = Find(t[n]);
	}

	bool same(int x, int y) {
		return Find(x) == Find(y);
	}

	int get_Size(int a) {
		return s[a];
	}
};

set<int> prime_num_factor(int n) {
	if (n < 2)
		return set<int>();
	set<int> prime;
	prime.insert(2);
	for (int i = 3; i <= n; i++) {
		for (int it : prime) {
			if (it * it > i) {
				prime.insert(i);
				break;
			}
			if (i % it == 0)
				break;
		}
	}
	return prime;
}
vector<int> primeFactorization(int n) {
	vector<int> re;
	int cnt = 2;
	while (n != 1) {
		if (n % cnt != 0) {
			cnt++;
			continue;
		}
		n /= cnt;
		re.push_back(cnt);
	}
	return re;
}
signed main() {
	int a, b;
	cin >> a >> b;
	if((a+b)%2==0)
		cout << (a + b) / 2 << endl;
	else
		cout << "IMPOSSIBLE" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
#define ll long long

using namespace std;

vector<int> t(101010,0);
int main(){
  int n;
  cin >> n;
  int p[] = {100,101,102,103,104,105};
  t[100] = 1;
  t[101] = 1;
  t[102] = 1;
  t[103] = 1;
  t[104] = 1;
  t[105] = 1;
  for( int i = 100 ; i <= n ; i++ ){
    if( t[i] == 0 ) continue;
    for( int j = 0 ; j < 6 ; j ++ ){
      t[ i + p[j] ] = 1;
    }
  }
  if( t[n] == 1 ) cout << "1" << endl;
  else cout << "0" << endl;

  return 0;

}


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

int main(){
    std::cout<<std::fixed<<std::setprecision(10);
    double L;
    cin >> L;
    double L1 = L/3;
    // double L2 = L1;
    // double L3 = L - L1 - L2;
    cout << pow(L1,3)  << endl;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N;
    cin >> N;
    vector<P>x(N);
    for(int i = 0; i < N; i++) {
        cin >> x[i].first;
        x[i].second = i;
        x[i].first--;
    }
    sort(x.begin(),x.end());
    vector<int>ans(N*N);
    for(int i = 0; i < N; i++) {
        ans[x[i].first] = x[i].second+1;
        int X = x[i].second;
        for(int j = 0; j < x[i].first; j++) {
            if(!X) {
                break;
            }
            if(ans[j]) {
                continue;
            }
            ans[j] = x[i].second+1;
            X--;
        }
    }
    for(int i = N-1; i >= 0; i--) {
        int X = N-x[i].second-1;
        for(int j = N*N-1; j > x[i].first; j--) {
            if(!X) {
                break;
            }
            if(ans[j]) {
                continue;
            }
            ans[j] = x[i].second+1;
            X--;
        }
    }
    for(int i = 1; i <= N; i++) {
        int X = 0;
        bool ok = false;
        for(int j = 0; j < N*N; j++) {
            if(ans[j] == x[i-1].second+1) {
                X++;
            }
            if(X == x[i-1].second+1) {
                if(j == x[i-1].first) {
                    ok = true;
                }
            }
        }
        if(X != N) {
            ok = false;
        }
        if(!ok) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    for(int i = 0; i < N*N; i++) {
        if(i) {
            cout << " ";
        }
        cout << ans[i];
    }
    cout << endl;
}

Measured memory_bytes: 5336
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;

int main() {
	int i, j;
	for (i = 1; i < 10; i++) {
		for(j = 1; j < 10; j++) {
			cout << i << "x" << j << "=" << i * j << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1116