akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include <set>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}


signed main(void) {
	int N, K;
	cin >> N >> K;
	vector<int>a(N, 0);
	rep(i, K) {
		int d;
		cin >> d;
		int snack;
		rep(j, d) {
			cin >> snack;
			a[snack - 1]++;
		}
	}
	int ans = 0;
	rep(i, N) {
		if (a[i] == 0)ans++;
	}
	print(ans);
}


Measured memory_bytes: 3632
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 61
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={0,0,1,-1},dy[]={1,-1,0,0};

signed main(void)
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int A,B,C;
    cin>>A>>B>>C;
    int S=3*C;
    int ans[4][4];
    ans[1][1]=A;
    ans[2][2]=C;
    ans[1][2]=B;
    ans[3][2]=S-B-C;
    ans[3][3]=S-A-C;
    ans[1][3]=S-A-B;
    ans[2][3]=S-ans[1][3]-ans[3][3];
    ans[2][1]=S-C-ans[2][3];
    ans[3][1]=S-A-ans[2][1];
    for(int i=1;i<=3;i++){
        for(int j=1;j<=3;j++){
            if(j!=1) cout<<" ";
            cout<<ans[i][j];
        }
        cout<<endl;
    }
}


Measured memory_bytes: 256
n=int(input())

dp=[[float('-inf') for i in range(n+1)] for j in range(3)]

for i in range(3):
	dp[i][0]=0

for i in range(1,n+1):
	a,b,c=map(int,input().split())
	dp[0][i]=max(a+dp[1][i-1],a+dp[2][i-1])
	dp[1][i]=max(b+dp[0][i-1],b+dp[2][i-1])
	dp[2][i]=max(c+dp[0][i-1],c+dp[1][i-1])

res=0
for i in range(3):
	res=max(res,dp[i][-1])
print(res)

Measured memory_bytes: 64804
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,N) for(int i = 0;i < (int)(N);i++)
int main(){
  int x,a;
  cin>>x>>a;
  int ans=10;
  if(x<a) ans=0;
  cout<<ans<<endl;
}

Measured memory_bytes: 256
from sys import stdin
from collections import deque
input = stdin.readline

N, K = map(int, input().split())
A = list(map(int, input().split()))

q = deque([])

for i in range(K):
    q.append(A[i])

for i in range(K, N):
    tmp = q.popleft()
    if A[i] <= tmp:
        print("No")
    else:
        print("Yes")
    q.append(A[i])


Measured memory_bytes: 93476
#include <iostream>
#include <vector>

using namespace std;

const int MOD = 1000000007;

int main(){
    int N; cin >> N;
    string S; cin >> S;
    vector<long long> cnt(26, 1);
    for(auto& c : S) cnt[c-'a']++;
    long long res = 1;
    for(auto& v : cnt) res = (res * v) % MOD;
    res = (res + MOD - 1) % MOD;
    cout << res << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>

using namespace std;

int main(){
    int N;
    int A;
    int B;

    cin>>N>>A>>B;

    int buff=N*A;
    if(N*A>B){
        cout<<B<<endl;
    }else{
        cout<<N*A<<endl;
    }
    return 0;
}


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

#define Fast            ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define fWrite          freopen ("out.txt","w",stdout);
#define TC              int t;cin >> t;FOR(tc,1,t)
#define LL              long long
#define ULL             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define all(a)          a.begin(),a.end()
#define MEM(a,x)        memset(a,x,sizeof(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)

int main()
{
    double r;
    cin >> r;
    cout << fixed << setprecision(5) << 3.14159*2.0*r;
}


Measured memory_bytes: 3776
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<map>
#include<string>
using namespace std;

map<char,string>a;
map<string,char>b;

void init(){
    a['A']="00000";
    a['B']="00001";
    a['C']="00010";
    a['D']="00011";
    a['E']="00100";
    a['F']="00101";
    a['G']="00110";
    a['H']="00111";
    a['I']="01000";
    a['J']="01001";
    a['K']="01010";
    a['L']="01011";
    a['M']="01100";
    a['N']="01101";
    a['O']="01110";
    a['P']="01111";
    a['Q']="10000";
    a['R']="10001";
    a['S']="10010";
    a['T']="10011";
    a['U']="10100";
    a['V']="10101";
    a['W']="10110";
    a['X']="10111";
    a['Y']="11000";
    a['Z']="11001";
    a[' ']="11010";
    a['.']="11011";
    a[',']="11100";
    a['-']="11101";
    a['\'']="11110";
    a['?']="11111";

    b["101"]=' ';
    b["000000"]='\'';
    b["000011"]=',';
    b["10010001"]='-';
    b["010001"]='.';
    b["000001"]='?';
    b["100101"]='A';
    b["10011010"]='B';
    b["0101"]='C';
    b["0001"]='D';
    b["110"]='E';
    b["01001"]='F';
    b["10011011"]='G';
    b["010000"]='H';
    b["0111"]='I';
    b["10011000"]='J';
    b["0110"]='K';
    b["00100"]='L';
    b["10011001"]='M';
    b["10011110"]='N';
    b["00101"]='O';
    b["111"]='P';
    b["10011111"]='Q';
    b["1000"]='R';
    b["00110"]='S';
    b["00111"]='T';
    b["10011100"]='U';
    b["10011101"]='V';
    b["000010"]='W';
    b["10010010"]='X';
    b["10010011"]='Y';
    b["10010000"]='Z';
}


int main(){
    init();
    string in;
    while(getline(cin,in)){
        string s,index,ans;
        for(int i=0;i<in.size();i++) s += a[in[i]];
        while(s.size()%5) s += '0';
        for(int i=0;i<s.size();i++){
            index += s[i];
            if(b.find(index)!=b.end()){
                ans += b[index]; index.clear();
            }
        }
        cout<<ans<<endl;
    }
}

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

using namespace std;

template<class T>
T fastpow(T a, long long p, int MOD){
	T tmp = a;
	T ret = 1;
	while(p){
		if(p & 1)ret = (ret*tmp)%MOD;
		p >>= 1;
		tmp = (tmp * tmp)%MOD;
	}
	return ret;
}

int inv(int a, int p){
	return fastpow(a, p-2, p);
}

class Solution {
public:
	void solve() {
		int n, p;
		string s;
		cin >> n >> p >> s;
		if(p==2 || p==5){
			long long ans = 0;
			for(int i=0; i < n; i++){
				if(((s[i] - '0') % p) == 0){
					ans += i + 1;
				}
			}
			cout << ans << endl;
			return;
		}
		vector<long long> dp(p, 0);
		dp[0] = 1;
		int a = 1, b = 0;
		long long ans = 0;
		for(int i=0; i < n; i++){
			int x = (s[i] - '0')%p;
			a = (a * 10) % p;
			b = (b * 10 + x) % p;
			int idx = ((p-b)*inv(a,p))%p;
			ans += dp[idx]++;
		}
		cout << ans << "\n";
		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

int main() {

    int A, B;
    int ans = 0;

    cin >> A >> B;

    if(A > 12)
        ans = B;
    else if(A < 13 && A > 5)
        ans = B / 2;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
# https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_c

H, W, K = map(int, input().split())
S = [input() for _ in range(H)]

A = []
color = 1
for s in S:
    c = s.count("#")
    if c == 1:
        A.append([color] * len(s))
        color += 1
    elif c >= 2:
        l = []
        i = -1
        j = s.find("#")
        while j != -1:
            l += [color] * (j - i)
            color += 1
            i, j = j, s.find("#", j + 1)
        l += [color - 1] * (len(s) - i - 1)
        A.append(l)
    else:
        A.append(s)
exist = 0
for i, s in enumerate(S):
    if "#" in s:
        exist = i
        break

for i in reversed(range(exist)):
    if "." in A[i]:
        A[i] = A[i + 1]

for i in range(exist + 1, len(A)):
    if "." in A[i]:
        A[i] = A[i - 1]

for a in A:
    print(*a)


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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET    (26)
#define INF         INT_MAX
#define MOD         (1000000007LL)
#define EPS         (1e-10)
#define EQ(a, b)    (abs((a)-(b)) < EPS)

using LL  = long long;

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

int main() {
    std::ios::sync_with_stdio(false);
    int n, m;cin >> n >> m;
    vector<bool> ok(n, false);
    string ans = "IMPOSSIBLE";
    for(int i=0;i<m;i++){
        int a, b;cin >> a >> b;a--;b--;
        int c = -1;

        if(a == 0) c = b;
        if(b == n-1) c = a;

        if(c == -1) continue;

        if(ok[c]){
            ans = "POSSIBLE";
        }else{
            ok[c] = true;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,x,n) for(int i=x; i<(int)(n); i++)
#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
using namespace std;

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

using ll=long long;

using vi=vector<int>;
using vll=vector<ll>;
using vvi=vector<vi>;
using vs=vector<string>;

const ll INF=LLONG_MAX;

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

  int N; cin >>N;
  vll h(N);
  rep(i,0,N) {cin >>h[i];}
  vll dp(N,INF);
  dp[0]=0;
  rep(i,1,N) {
    chmin(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
    if (1<i) {
      chmin(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
    }
  }
  cout <<dp.back() <<'\n';
}


Measured memory_bytes: 4792
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
using ll = long long;
const ll INF = 10e9;
ll MOD=1000000007;

int main(){
  int h,w; cin>>h>>w;
  char A[h][w];
  rep(i,h) rep(j,w) cin>>A[i][j];
  vector<bool>R(h,false), C(w,false);
  rep(i,h){
    rep(j,w){
      if (A[i][j]=='#') R[i]=true;
    }
  }
  rep(i,w){
    rep(j,h){
      if (A[j][i]=='#') C[i]=true;
    }
  }

  rep(i,h){
    if (R[i]){
      rep(j,w){
        if (C[j]) cout << A[i][j];
      }
      cout << endl;
    }
  }
}

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

using ll = long long;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int N; cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<ll> pref(N+1);
  for (int i = 0; i < N; i++) pref[i+1] = pref[i] + A[i];
  ll ans = pref[N];
  auto getHalf = [&](const multiset<ll>& ms, ll v) {
    auto it = ms.lower_bound((v+1)/2);
    ll res = 0;
    if (it != ms.end()) res = max(res, v - *it);
    if (it != ms.begin()) res = max(res, *(--it));
    return res;
  };
  multiset<ll> prefs;
  multiset<ll> suffs;
  prefs.insert(pref[1]);
  for (int i = 2; i <= N-1; i++) suffs.insert(pref[N]-pref[i]);
  for (int i = 2; i <= N-2; i++) {
    suffs.erase(suffs.find(pref[N]-pref[i]));
    ll p = pref[i];
    ll s = pref[N]-pref[i];
    ll ph = getHalf(prefs, p);
    ll sh = getHalf(suffs, s);
    ans = min(ans, max(s-sh,p-ph) - min(ph, sh));
    prefs.insert(pref[i]);
  }
  cout << ans << '\n';
}

Measured memory_bytes: 12800
//AYUSH GUPTA
//IIITDMJ
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define for0(i, n) for (ll i = 0; i < n; i++)
#define for1(i, n) for (ll i = 1; i <= n; i++)
#define loop(i, a, b) for (ll i = a; i <= b; i++)
#define bloop(i, a, b) for (ll i = a; i >= b; i--)
#define all(v) v.begin(), v.end()
#define fastio               \
	ios::sync_with_stdio(0); \
	std::cin.tie(0);         \
	std::cout.tie(0)
#define go_t   \
	int tt;    \
	cin >> tt; \
	for (int ttt = 1; ttt <= tt; ttt++)
#define set_ar(arr, v) memset(arr, v, sizeof(arr))
#define mod 1000000007
#define trace2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z) cout << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;


int main(){
  ll n;
  cin>>n;
 if(n%1000==0)
    cout<<"0"<<endl;

  else {
    ll y=n/1000;
    cout<<(y+1)*1000-n<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3628
import std.stdio, std.string, std.array, std.conv, std.algorithm.iteration, std.functional;

void main()
{
    auto ip = readln.chomp.split(" ").map!(pipe!((c => c.to!int), (i => i == 1 ? 14 : i))).array;
    auto a = ip[0];
    auto b = ip[1];

    writeln(
        a > b ? "Alice"
        : a < b ? "Bob"
        : "Draw"
    );
}

Measured memory_bytes: 256
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()
#define pb push_back

#define error(x) cout << #x << " = " << x << endl

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

const int N = 200 + 10 ;
int n ;
string g[N] ;

int ans ;
int h[N] ;

void bfs (int S) {
	memset(h , 0 , sizeof h) ;

	h[S] = 1 ;
	queue <int> que ;

	que.push(S) ;
	while (_sz(que)) {
		int v = que.front() ;
		que.pop() ;

		ans = max(ans , h[v]) ;

		for (int u = 0 ; u < n ; u ++)
			if (g[v][u] == '1') {
				if (!h[u]) {
					h[u] = h[v] + 1 ;
					que.push(u) ;
				}
				else if ((h[u] & 1) == (h[v] & 1)) {
					cout << "-1\n" ;
					exit(0) ;
				}
			}
	}
}

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

	cin >> n ;
	for (int i = 0 ; i < n ; i ++) cin >> g[i] ;

	for (int i = 0 ; i < n ; i ++) bfs(i) ;

	cout << ans << '\n' ;
}


Measured memory_bytes: 256
n,m = map(int,input().split())

p,y = [],[]
city = [ [] for i in range(n+1) ]
for i in range(m):
    pp,yy = map(int,input().split())
    p.append(pp)
    y.append(yy)
    city[pp].append(yy)

for i in range(n+1):
    city[i].sort()

for i in range(m):
    ok,ng = 0,len(city[p[i]])
    while ng-ok > 1:
        mid = (ok+ng)//2
        if city[p[i]][mid] <= y[i]:
            ok = mid
        else:
            ng = mid

    print('{:06d}{:06d}'.format(p[i], ok+1))


Measured memory_bytes: 24116
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll max3(ll a, ll b, ll c){return max(a, max(b, c));};
ll min3(ll a, ll b, ll c){return min(a, min(b, c));};
ll max4(ll a, ll b, ll c, ll d){return max(max(a, b), min(c, d));};
ll min4(ll a, ll b, ll c, ll d){return min(min(a, b), min(c, d));};
ll max5(ll a, ll b, ll c, ll d, ll e){return max(max(a, b), max3(c, d, e));};
ll min5(ll a, ll b, ll c, ll d, ll e){return min(min(a, b), min3(c, d, e));};

const ll INFL = 1LL << 60;//10^18 = 2^60
const int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//ll MOD = 998244353;

vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};


ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
ll pow_mod(ll x, ll k){
  x %= MOD; x += MOD; x %= MOD;
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

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

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

ll kai_mod(ll x){
  if(x == 0) return 1;
  return x * kai_mod(x-1) % MOD;
}

/*
//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAXcomb; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
ll comb(int n, int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * finv[k] % MOD * finv[n-k] % MOD;
}
*/

int main(){
  int N;
  cin >> N;
  vector<ll> A(N), B(N), C(N-1);
  rep(i, N) cin >> A[i];
  rep(i, N) cin >> B[i];
  rep(i, N-1) cin >> C[i];
  ll ans = 0;
  rep(i, N){
    ans += B[i];
  }
  rep(i, N-1){
    if(A[i] + 1 == A[i+1]) ans += C[A[i]-1];
  }

  cout << ans << endl;
}


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

XYs = [list(map(int, input().split())) for _ in range(N)]

ans = 0

for XY in XYs:
    if((XY[0] ** 2 + XY[1] ** 2) ** 0.5 <= D):
        ans += 1

print(ans)

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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n, k;
    cin >> n >> k;

    int ret = 0;
    while (n > 0) {
        ret++;
        n /= k;
    }

    cout << ret << "\n";

    return 0;
}


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

int main() {
  string a,b;
  cin >> a >> b;
  for(int i=0;i<a.size();i++){
    if(a.at(i)!=b.at(i)){
      cout << "No" << endl; 
      return 0;
    } 
  }
  cout << "Yes" << endl;  
}

Measured memory_bytes: 3644
#include<iostream>
using namespace std;
int n,k,a[12121],sum;
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=n-1;i++)
	{
		for(int j=1;j<=n-i;j++)
		{
			if(a[j]<a[j+1])
			{
				swap(a[j],a[j+1]);
			}
			
		}
	}
	for(int i=1;i<=k;i++)sum+=a[i];
	cout<<sum;
	return 0;
}

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

int find(int , int);

int main()
{
	long long a,b,gcd;
	long long ans;
	cin>>a>>b;
	gcd=find(a,b);
	ans=(a*b)/gcd;
	cout<<ans;
	
	return 0;
}
int find(int a, int b)
{
	if(b==0) return(a) ;
	else return(find(b,a%b)) ;
}

Measured memory_bytes: 256
N_K = input().split()
N = int(N_K[0])
K = int(N_K[1])

R_S_P = input().split()
R = int(R_S_P[0])
S = int(R_S_P[1])
P = int(R_S_P[2])

T = input()

win_strategy = {
    "r": "p",
    "s": "r",
    "p": "s"
}

decision = ""
for index, value in enumerate(T):
    if (index >= K and win_strategy[value] == decision[index-K]):
        decision += "X"
    else:
        decision += win_strategy[value]

point_acquire = {
    "r": R,
    "s": S,
    "p": P
}

points = decision.count('r')*R + decision.count('s')*S + decision.count('p')*P
print(points)


Measured memory_bytes: 3444
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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



int main(){

  int n;
  cin>>n;
  int h[n];
  REP(i,n){
    cin>>h[i];
  }
  int minScore[n];

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

  cout<<minScore[n-1]<<endl;



  return 0;
}

Measured memory_bytes: 1024
#pragma comment(linker,"/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include <unordered_set>
#include<set>
#include<time.h>
#include<queue>
#include<map>
#include<vector>
#define inf 1000000000
#define LL long long
#define ULL unsigned long long
#define dinf ~0uLL>>1
#define FO(i,n) for(LL i=0;i<n;i++)
#define FOD(i,n) for(LL i=n-1;i>=0;i--)
#define FOR(i,a,b,c) for(LL i=a;i<=b;i+=c)
#define FORD(i,a,b,c) for(LL i=a;i>=b;i-=c)
#define clr(a,b) memset(a,b,sizeof(a))
#define pi acos(-1.0)
#define H_J(a) ((a)*180.0/pi)
#define J_H(a) ((a)*pi/180.0)
#define lson l,mid,rt<<1
#define rson mid+1,r,(rt<<1)+1
#define eps 1e-8
#define zero(x) (abs(x)<eps?0:(x<0?-1:1))
#define printime printf("%.3lf\n",(double)clock() / CLOCKS_PER_SEC)

using namespace std;

const int maxn = 1e3+5;

int a[maxn],v[maxn];

struct H{
    int x,y;
}num[maxn];

bool cmp(H x,H y){
    return x.y > y.y || (x.y == y.y && x.x < y.x);
}


int main() {


    char str[104];
    cin>>str;
    for(int i = 0;i<3;i++){
        if(str[i] == '1'){
            cout<<"9";
        }
        else {
            cout<<"1";
        }
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
ab = [0]*n
for i in range(n):
    ab[i] = list(map(int,input().split()))
ab.sort(key= lambda val : val[1])
ans = 1
t = 0
for i in range(n):
    t += ab[i][0]
    if ab[i][1] < t:
        ans = 0
if ans == 0:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 53720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
	int n;cin>>n;
	string s[n];
	rep(i,n){
		int alpha[26]={};
		string a;cin>>a;
		rep(j,10) alpha[a[j]-'a']++;
		rep(j,26) s[i]+=(char)(alpha[j]+'0');
		//rep(j,26) cout<<alpha[j];
	}
	sort(s,s+n);
	// rep(i,n)cout<<s[i]<<"\n";
	ll cnt=0;
	rep(i,n-1){
		auto itr=lower_bound(s,s+n,s[i]);
		auto itr2=upper_bound(s,s+n,s[i]);
		ll d=distance(itr,itr2);
		cnt+=d*(d-1)/2;
		i+=d-1;
	}

	cout<<cnt<<"\n";
}

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

const long long INF = 1LL << 60;

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

int main(){
  int N; cin >> N;
  vector<long long>dp(N+1,INF);
  dp.at(0) = 0;
  for(int i=1;i<=N;i++){
    for(int j=1;j<=i;j *= 6){
      chmin(dp.at(i),dp.at(i-j)+1);
    }
    for(int j=1;j<=i;j *= 9){
      chmin(dp.at(i),dp.at(i-j)+1);
    }
  }
  cout << dp.at(N) << endl;
}


Measured memory_bytes: 1024
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[float('inf')]*n
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i],dp[i-j]+abs(a[i]-a[i-j]))
print(dp[-1])

Measured memory_bytes: 55392
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=nxt[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
using namespace std;
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

typedef long long ll;
const int INF=1<<30;

int len(int x){
	int ret=0;
	while(x) ++ret,x/=10;
	return ret;	
}

int getfirst(int i){
	int ret=0;
	while(i) ret=i,i/=10;
	return ret;		
}

int cnt[20][20];

int main()
{
//	freopen("std.in","r",stdin);
	int n;cin>>n;

	rep(i,1,n){
		int a=getfirst(i);
		int b=i%10;
		++cnt[a][b];
	}
	
	ll ans=0;
	rep(i,1,n){
		int a=getfirst(i);
		int b=i%10;	
		if(b==0) continue;
		ans+=cnt[b][a];
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let m: usize = sc.read();
    let q: usize = sc.read();
    let mut uf = UnionFind::new(n);
    let mut multi = vec![];
    for _ in 0..q {
        let a: usize = sc.read();
        let b: usize = sc.read();
        let c: usize = sc.read();
        if c == 0 {
            uf.unite(a, b);
        } else {
            multi.push((a, b));
        }
    }

    for &(a, b) in multi.iter() {
        if uf.find(a) == uf.find(b) {
            println!("No");
            return;
        }
    }

    let s = uf.size;
    if s <= 2 {
        if m == n - 1 && multi.is_empty() {
            println!("Yes");
        } else {
            println!("No");
        }
    } else {
        let used_edges = uf
            .sizes
            .into_iter()
            .filter(|&s| s > 0)
            .map(|s| s - 1)
            .sum::<usize>();
        let max = s * (s - 1) / 2 + used_edges;
        let min = if multi.is_empty() { s - 1 } else { s } + used_edges;
        if min <= m && m <= max {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}

pub struct UnionFind {
    parent: Vec<usize>,
    sizes: Vec<usize>,
    size: usize,
}

impl UnionFind {
    pub fn new(n: usize) -> UnionFind {
        UnionFind {
            parent: (0..n).map(|i| i).collect::<Vec<usize>>(),
            sizes: vec![1; n],
            size: n,
        }
    }

    pub fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let px = self.parent[x];
            self.parent[x] = self.find(px);
            self.parent[x]
        }
    }

    pub fn unite(&mut self, x: usize, y: usize) -> bool {
        let parent_x = self.find(x);
        let parent_y = self.find(y);
        if parent_x == parent_y {
            return false;
        }

        let (large, small) = if self.sizes[parent_x] < self.sizes[parent_y] {
            (parent_y, parent_x)
        } else {
            (parent_x, parent_y)
        };

        self.parent[small] = large;
        self.sizes[large] += self.sizes[small];
        self.sizes[small] = 0;
        self.size -= 1;
        return true;
    }
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 10492
#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> d(n);
    for(int i = 0; i < n; i++)
        cin >> d[i];
    int ans = 0;
    for(int i = 0; i < n; i++)
    {
        for(int j = i + 1; j < n; j++)
        {
            ans += d[i] * d[j];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>

using namespace std;

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

  if ((int) s.size() % 2 == 1) {
    cout << "No" << endl;
    return 0;
  }

  for (int i = 0; i < (int) s.size(); i += 2) {
    if (s[i] != 'h' || s[i + 1] != 'i') {
      cout << "No" << endl;
      return 0;      
    }
  }

  cout << "Yes" << endl;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
a_=max(a)
con=[0]*(a_+1)
tou=[0]*(a_+1)
ans=[]
for i in range(len(a)):
    u=a[i]
    if u==0:
        con[0]+=1
        tou[0]+=1
        ans.append(4-con[0])

    else:
        con[u]+=1 
        tou[u]+=1  
        ans.append(min(tou[u-1]-con[u]+1,4-con[u]))
c=1
for i in range(len(ans)):
    c*=ans[i]
    c=c%(10**9+7)
print(c%(10**9+7))   



Measured memory_bytes: 20688
#include<stdio.h>
#include<math.h>
int main(void){
	int i, j, k, n,v;
	int A[1000]={0};
	
	scanf("%d", &n);
	
	for(i=0; i<n; i++){
		scanf("%d", &A[i]);
	}
	
		for(k=0; k<n; k++){
			if(k != n-1) printf("%d ", A[k]);
			else printf("%d\n", A[n-1]);
		}
		
	for(i=1; i<n; i++){
		v = A[i];
		j = i-1;
		while(j>=0 && A[j] > v){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
		for(k=0; k<n; k++){
			if(k != n-1) printf("%d ", A[k]);
			else printf("%d\n", A[n-1]);
		}
	}
	
	
return 0;
}

Measured memory_bytes: 604
#include<cstdio>
#include<cmath>
int n, T;
int c[105], t[105];
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	int s = sqrt(m);
	int i;
	int ans = 0;
	for (i = n; i <= s; i++) {
		if (m%i == 0) {
			ans = m / i; break;
		}
	}
	if (ans == 0) {
		for (i = s; i >= 1; i--) {
			if (m%i == 0 && m / i >= n) {
				ans = i; break;
			}
		}
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 128
/**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ==
*/
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#define F first
#define S second
#define endl '\n'
#define deb(x) cout<<#x<<' '<<x<<endl;
#define pb push_back

/*
#ifdef IZI_KATKA
#define int __int64_t
#else
#define int __int64
#endif
*/

const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 1;
using namespace std;

typedef long long ll;

long long readInt() {
    bool minus1 = false;
    long long result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus1 = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus1)
        return -result;
    else
        return result;
}

map <char, int> cnt;

int main() {
	#ifdef IZI_KATKA
	assert(freopen("input", "r", stdin));
    assert(freopen("output", "w", stdout));
    #endif
    string s;
    cin >> s;
    ll n = s.size();
    ll ans = (n * (n - 1)) / 2;
	for (char i : s) {
		cnt[i]++;
	}
	for (pair<char,int> i : cnt) {
		ans -= (i.S) * 1ll * (i.S - 1ll) / 2;	
	}
   	cout << ans + 1;
    return 0;
}

Measured memory_bytes: 764
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    a,b,c = i_map()
    if a > c or b > c:
        print("No")
        exit()
    if 4*a*b < (c-a-b)**2:
    # if sqrt(a) + sqrt(b) < sqrt(c):
        print("Yes")
    else:
        print("No")


if __name__=="__main__":
    main()


Measured memory_bytes: 9476
//In the name of Allah
#include <bits/stdc++.h>
using namespace std;

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

int main() { 
	ios::sync_with_stdio(false); cin.tie(0); 
	string s; cin >> s; 
	int k; cin >> k; 
	for( int i = 0 ; i < s.size() ; i++ ) { 
		int rem = 26 - ( s[i] - 'a' ) ; 
		if( rem == 26 ) rem = 0; 
		if( k >= rem ) { 
			k -= rem; 
			s[i] = 'a'; 
		}
	}
	int v = s[int(s.size())-1] - 'a'; 
	v = ( v + k ) % 26; 
	s[int(s.size())-1] = v + 'a'; 
	cout << s << endl;
}


Measured memory_bytes: 720
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n;
vs a;
vi b;
string s;

int main(){
	cin>>n;
	a=vs(n);
	b=vi(n);
	for(int i=0;i<n;i++) cin>>a[i]>>b[i];
	cin>>s;
	int res=0;
	for(int i=0;i<n;i++) if(s==a[i]){
		for(int j=i+1;j<n;j++) res+=b[j];
		break;
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256
N = int(input())
list_price = [int(input()) for i in range(N)]
minv = list_price[0]
maxv = list_price[1] - list_price[0]
for x in list_price[1:]:
    maxv = max(maxv, x - minv)
    minv = min(minv, x)        
print(maxv)

Measured memory_bytes: 19016
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    int n; cin >> n;
    vector<P> red(n), blue(n);
    rep(i, n)
    {
        int a, b; cin >> a >> b;
        red[i] = make_pair(a, b);
    }
    rep(i, n)
    {
        int a, b; cin >> a >> b;
        blue[i] = make_pair(a, b);
    }

    sort(ALL(blue));
    vector<bool> seen(n);

    int ans = 0;
    rep(i, n)
    {
        int tmp = -1, maxy;
        bool f = false;
        rep(j, n)
        {
            if (red[j].first < blue[i].first && red[j].second < blue[i].second &&
            red[j].second > tmp && !seen[j])
            {
                tmp = red[j].second;
                maxy = j;
                f = true;
            }
        }
        if (f)
        {
            seen[maxy] = true;
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<vector>
#include<cmath>
#include<math.h>
#include<string>
using namespace std;

int main()
{
	int n;
	cin >> n;
	char m;
	int s;
	vector <int> S(13);
	vector <int> H(13);
	vector <int> C(13);
	vector <int> D(13);
	for (int i = 0; i < 13; i++)
	{
		S[i] = 0;H[i] = 0;C[i] = 0;D[i] = 0;
	}
	for (int i = 0; i < n; i++)
	{
		cin >> m >> s;
		if (m == 'S')S[s - 1] = 1;
		if (m == 'H')H[s - 1] = 1;
		if (m == 'C')C[s - 1] = 1;
		if (m == 'D')D[s - 1] = 1;
	}
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j < 13; j++)
		{
			if (i == 0)
			{
				if (S[j] != 1)cout << "S " << j + 1 << endl;
			}
			else if (i == 1)
			{
				if (H[j] != 1)cout << "H " << j + 1 << endl;
			}
			else if (i == 2)
			{
				if (C[j] != 1)cout << "C " << j + 1 << endl;
			}
			else if (i == 3)
			{
				if (D[j] != 1)cout << "D " << j + 1 << endl;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;

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

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		int k = sc.nextInt();
		int s = sc.nextInt();
		
		int cnt = 0;
		for (int i = 0; i <= k; i++) {
			for (int j = 0; j <= k; j++) {
				int last = s - i - j;
				if (last >= 0 && last <= k) cnt++;
			}
		}
		
		System.out.println(cnt);
		
		
		
	}
}

Measured memory_bytes: 21972
n, a, b, c, d = map(int, input().split())
s = list(input())
jud = True

for i in range(min(a, b) - 1, max(c, d) - 1):
    if s[i] == "#":
        if s[i + 1] == "#":
            jud = False
            break

if (a < b and c > d and jud) or (a > b and c < d and jud):
    jud = False
    for i in range(max(a, b) - 2, min(c, d) - 1):
        if s[i] == ".":
            if s[i + 1] == "." and s[i + 2] == ".":
                jud = True

if jud:
    print("Yes")
else:
    print(("No"))

Measured memory_bytes: 82268
n = int(input())

sitigosan_list = [3, 5, 7]
count = 0

if n < 357:
    print(0)
    exit()

def make_753(num):
    global count
    b = str(num) + '3'
    c = str(num) + '5'
    d = str(num) + '7'
    if int(b) > n:
        return
    elif '3' in str(b) and '5' in str(b) and '7' in str(b):
        count += 1
        make_753(b)
    else:
        make_753(b)
    if int(c) > n:
        return
    elif '3' in str(c) and '5' in str(c) and '7' in str(c):
        count += 1
        make_753(c)
    else:
        make_753(c)
    if int(d) > n:
        return
    elif '3' in str(d) and '5' in str(d) and '7' in str(d):
        count += 1
        make_753(d)
    else:
        make_753(d)


make_753('')

print(count)




Measured memory_bytes: 3064
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<algorithm>
#include<iterator>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#define lli long long int
#define mp make_pair
#define ULTRA_INSTINCT ios_base::sync_with_stdio(false); cin.tie(0)
#define PI  3.141592653589793
#define fo(i,n) for(lli i=0;i<(n);i++)
#define FO(i,x,n) for(lli i=(x);i<(n);i++)
#define pb push_back
#define FI first
#define SE second
#define vi vector<lli>
#define pi pair<lli,lli>
#define vii vector<pi >
#define Endl endl
#define ITA 200005
#define ROH 100005
using namespace std;
lli mod = 1e9 +7,test; 
lli max(lli a,lli b){return a>b?a:b;}
lli min(lli a,lli b){return a>b?b:a;}

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

lli n,m;
string s , t;
vector<vi >dp(3001 , vi(3001 , -1));
lli f(lli i,lli j){
  if(i==n || j==m){ return 0;}
  if(dp[i][j]!=-1){return dp[i][j];}
  if(s[i] == t[j]){
    return dp[i][j] =  1 + f(i+1 , j+1);
  }
  return dp[i][j] = max( f(i+1 , j) , f(i,j+1) );
}
string ans = "";
void fill(){
  lli i = 0 , j = 0;
  while(i<n && j<m ){
    // cout<<i<<" "<<j<<endl;
    if(s[i] == t[j]){
      ans += s[i];
      i++;j++;
      continue;
    }
    if(f(i+1,j) > f(i,j+1)){
      i++;
    }else{
      j++;
    }
  }

}

void solve(){

cin>>s>>t;
n = s.length();
m = t.length();

f(0,0);
fill();
cout<<ans<<Endl;

}

int main(){
    ULTRA_INSTINCT;
    lli t =1;
    // cin>>t;
    fo(i,t){
        solve();
    }
    return 0;

}

Measured memory_bytes: 71160
N=int(input())
box=[0]*N
ans=[]
a_list=list(map(int,input().split(' ')))
for i in range(N,0,-1):
    sum=0
    for j in range(1,N+1):
        #print("{}:{}".format(i,j))
        if j*i<= N:
            sum+=box[j*i-1]
        else:
            break
    if sum%2 != a_list[i-1]:
        box[i-1]=1
        ans.append(str(i))
sum=0
print(len(ans))
print(" ".join(ans))


Measured memory_bytes: 17204
#include <stdio.h>

int main(void) {
	int a,b;
	scanf("%d %d",&a,&b);
	if(a<b){
		printf("a < b\n");
	}else if(a>b){
		printf("a > b\n");
	}else{
		printf("a == b\n");
	}
	return 0;
}



Measured memory_bytes: 2052
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		double w,h,x,y;

		Scanner sc = new Scanner(System.in);

		w = sc.nextDouble();
		h = sc.nextDouble();

		x = sc.nextDouble();
		y = sc.nextDouble();

		double result = w * h /2;

		int ans ;

		if(w/2 == x && h/2 == y) {
			ans = 1;
			}else {
			ans = 0;
		}

		System.out.println(result + " " + ans);

	}

}


Measured memory_bytes: 23124
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;


int main() {
    int n, w,mins = 10000000;
    cin >> n;
    vector<int>rui(n + 1, 0);
    rep(i, n) {
        cin >> w;
        rui[i + 1] = rui[i] + w;
    }
    REP(i, n-1) {
        mins = min(mins, abs((rui[n] - rui[i]) - rui[i]));
    }
    cout << mins << endl;
    return 0;
}


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

int main() {
  int m, f, r;

  for(int i = 0; i < 50; i++){

  cin >> m >> f >> r;
  int A = m+f;

  if(m == -1 && f == -1 && r == -1){
    break;
  }
  else if(m == -1 || f == -1) cout << "F" << endl;

  else if(A >= 80) cout << "A" << endl;

  else if(65 <= A && A < 80) cout << "B" << endl;

  else if(50 <= A && A < 65) cout << "C" << endl;

  else if(30 <=A && A < 50){
    if(r >= 50){
      cout << "C" << endl;
    }
    else cout << "D" << endl;
  }

  else cout << "F" << endl;
  }

}


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

int main(){
  long long a , b , v , w , t ;
  cin >> a >> v >> b >> w >> t ;
  long long c = abs(a-b) ;
  
  if(c+w*t<=v*t) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 3592
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <bits/stdc++.h>
#include <string>

using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;

#define rep(i, n) for(int i = 0; i < n ; i++ )
#define For(i, a, b) for(int i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

const int MAX_N = 100000;

int _gcd(int m, int n){
    int a = max(m, n);
    int b = min(m, n);

    while(b != 1 && b != 0){
        a %= b;
        swap(a, b);
    }
    return b == 1 ? 1 : a;
}

int main(void){
    int N;
    int A[MAX_N];
    
    cin >> N;
    
    rep(i, N) cin >> A[i];

    int answer = A[0];

    rep(i, N - 1){
        answer = _gcd(answer, A[i + 1]); 
    }

    cout << answer << endl;

    return 0;
}

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

int main()
{
	int n, *h, i, count, max;

	scanf("%d", &n);

	if ((h = (int *)malloc(sizeof(int) * n)) == NULL)
		return 1;

	for (i = 0; i < n; i++)
		scanf("%d", h + i);

	for (i = 1, count = 1, max = h[0]; i < n; i++) {
		if (max <= h[i]) {
			count++;
			max = h[i];
		}
	}

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

	free(h);

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
const int INF = 1 << 29;
const ll LINF = 1l << 61;
const ld PI = abs(acos(-1));
#define pq priotity_queue
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define cbuf(buf, init) memset(buf, init, sizeof(buf))

template <class T>
constexpr T modp(T x, T y)
{
    return (y + x % y) % y;
}
template <class T>
constexpr T sq(T x)
{
    return x * x;
}
template <class T>
constexpr double divd(T x, T y)
{
    static_cast<double>(x) / static_cast<double>(y);
}

template <class T>
T nextInput()
{
    T t;
    cin >> t;
    return t;
}

#define netint nextInput<ll>()
#define netstr nextInput<string>()

template <class T>
void print(T&& t)
{
    cout << forward<T&&>(t) << endl;
}

void print(double t) { cout << fixed << setprecision(14) << t << endl; }

//

int main()
{
    //
    ll N = netint, K = netint;
    ll ans = 0;
    rep(b, K + 1, N + 1)
    {
        ans += (N / b) * (b - K) + max((N % b) - K + 1, 0ll);
        if (K == 0) ans--;
    }

    print(ans);
}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



int main(){
  
  ll n,t;
  cin >> n >> t;
  vector<ll> v(n);
  rep(i,n)cin >> v[i];
  vector<ll> mx(n+1,0);
  for(int i = n-1;i >= 0;i--)mx[i] = max(mx[i+1],v[i]);
  ll k = 0;
  ll res = 0;
  rep(i,n){
    if(mx[i]-v[i] <= 0)continue;
    if(mx[i]-v[i] == k)res++;
    else if(k < mx[i+1]-v[i])k = mx[i+1]-v[i],res = 1;
  }
  cout << res << endl;




  return 0;
}

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

#define select(_1, _2, x, ...) x

#define repn(i, n) for (int i = 0; i < (n); i++)
#define repr(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, ...) select(__VA_ARGS__, repr, repn)(i, __VA_ARGS__)

#define rrepn(i, n) for (int i = (n - 1); i >= 0; i--)
#define rrepr(i, a, b) for (int i = (b - 1); i >= (a); i--)
#define rrep(i, ...) select(__VA_ARGS__, rrepr, rrepn)(i, __VA_ARGS__)

#define umax(m, x) (m = max(m, x));
#define umin(m, x) (m = min(m, x));

#define rng(v) v.begin(), v.end()
#define rrng(v) v.rbegin(), v.rend()

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

using namespace std;

using ll = long long int;

using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vb = vector<bool>;

using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvs = vector<vector<string>>;
using vvb = vector<vector<bool>>;

const int INF = 1e9;
const ll LINF = 1e18;

inline void yn(bool f) { cout << (f ? "Yes" : "No") << endl; }


int main() {
    int x, y, z;
    cin >> x >> y >> z;

    cout << z << " " << x << " " << y << endl;

    return 0;
}


Measured memory_bytes: 384