akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <set>
#include <algorithm>
#include <iomanip>

typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL<<60;
const double PI=3.14159265358979323846;
const int NMAX=100005;
using namespace std;


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

    int ans = t.length();
    for(int i = 0; i < s.length(); i++){
        int cnt = 0;
        if(i+t.length() > s.length()) break;
        for(int j = 0; j < t.length(); j++){
            if(s[i+j] != t[j]) cnt++;
        }
        ans = min(ans, cnt);
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int n;
double p[3030], dp[3030][3030];
double solve(int toss, int heads){
    if(dp[toss][heads] != -1)
        return dp[toss][heads];

    if(toss == 0 && heads == 0)
        return dp[toss][heads] = 1.0 - p[0];

    if(toss == 0 && heads == 1)
        return dp[toss][heads] = p[0];

    if(toss < 0 || heads < 0 || heads > toss + 1)
        return 0;

    return dp[toss][heads] = (1.0 - p[toss]) * solve(toss - 1, heads) + p[toss] * solve(toss - 1, heads - 1);
}
int main(){
    //freopen("test.in", "r+", stdin);
    cout.precision(50);
    for(int i=0;i<3030;i++)
        for(int j=0;j<3030;j++)
            dp[i][j] = -1.0;

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

    double final_res = 0.0;
    for(int i = 0;i <= n; i++){
        if(i > n - i)
            final_res += solve(n - 1, i);
    }
    cout<<final_res<<endl;
}


Measured memory_bytes: 72192
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int main() {
    int H, W;
    cin >> H >> W;
    char s[60][60];

    for (int i=0; i<60; i++){
        for (int j=0; j<60; j++) {
            s[i][j] = '.';
        }
    }

    for (int i=1; i<=H; i++) {
        for (int j=1; j<=W; j++) {
            cin >> s[i][j];
        }
    }

    for (int i=1; i<=H; i++) {
        for (int j=1; j<=W; j++) {
            if (s[i][j] == '#') {
                if ((s[i-1][j] == '.') &&
                    (s[i][j-1] == '.') &&
                    (s[i+1][j] == '.') &&
                    (s[i][j+1] == '.') ) {
                        cout << "No" << endl;
                        return 0;
                }
            }
        }
    }
    cout << "Yes" << endl;

}


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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

void solve(){

}
int main(){
    int N;
    cin >> N;
    string s,t;
    cin >> s >> t;
    int cnt = 0;
    for (int i = N; i >= 0; i--) {
        if (s.substr(N-i, i) == t.substr(0, i)) {
            cout << 2 * N - i << endl;
            break;
        }
    }


    return 0;
}


Measured memory_bytes: 256
(n, a, b) = STDIN.gets.chomp.split(' ').map(&:to_i)
x = STDIN.gets.chomp.split(' ').map(&:to_i)

t = 0
(x.length - 1).times do |i|
  t += [(x[i + 1] - x[i]) * a, b].min
end

STDOUT.puts t.to_s

Measured memory_bytes: 12036
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;

ll fat[200005], inv[200005];
ll mod = 1e9+7;

ll modpow(ll b, ll e){
    if(b == 0 or e == 0) return 1LL;
    if(e == 1) return b%mod;
    ll res = modpow(b, e/2);
    res = (res*res)%mod;
    if(e%2 == 1)
        res = (res * (b%mod))%mod;
    return res;
}

ll solve(ll n, ll k){
    ll up = fat[n];
    ll down = (inv[n-k]*inv[k])%mod;
    return (up*down)%mod;
}

int main(){
    
    fat[0] = inv[0] = 1;
    for(ll i = 1; i <= 2e5; i++){
        fat[i] = (fat[i-1] * i)%mod;
        inv[i] = modpow(fat[i], mod-2);
    }
    
    ll n, m, k; cin >> n >> m >> k;

    ll res = solve(n*m-2, k-2);
    // cout << res << endl;
    ll sumX = 0, sumY = 0;
    for(ll i = 1, aux = n-1; i <= n; i++, aux--)
        for(ll j = 1; j <= m; j++){
            sumX += m*aux*(aux+1)/2;
            sumX %= mod;
            // cout << sumX << endl;
        }
    for(ll j = 1, aux = m-1; j <= m; j++, aux--)
        for(ll i = 1; i <= n; i++){
            sumY += n*aux*(aux+1)/2;
            sumY %= mod;
        }
    
    // cout << sumX << " " << sumY << endl;
    // cout << sumX + sumY << endl;
    ll aux = (sumX + sumY)%mod;
    res = (aux * res)%mod;
    cout << res << endl;
	return 0;
}


Measured memory_bytes: 3456
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long>>;
using pii = pair<int, int>;
using psi = pair<string, int>;

int g(vector<vc> &datao, vb &checkrow, vb &checkcol, int H, int W, int K, int n) {
    if (n == 0) {
        vector<vc> data = datao;
        for (int i = 0; i < H; i++) {
            if (!checkrow.at(i)) {
                continue;
            }
            for (int j = 0; j < W; j++) {
                if (data.at(i).at(j) == '#') {
                    data.at(i).at(j) = '.';
                }
            }
        }
        for (int j = 0; j < W; j++) {
            if (!checkcol.at(j)) {
                continue;
            }
            for (int i = 0; i < H; i++) {
                if (data.at(i).at(j) == '#') {
                    data.at(i).at(j) = '.';
                }
            }
        }
        int count = 0;
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (data.at(i).at(j) == '#') {
                    count++;
                }
            }
        }
        if (K == count) {
            return 1;
        }
        return 0;
    }
    checkcol.at(W - n) = true;
    int a = g(datao, checkrow, checkcol, H, W, K, n - 1);
    checkcol.at(W - n) = false;
    int b = g(datao, checkrow, checkcol, H, W, K, n - 1);
    int ans = a + b;
    return ans;
}

int f(vector<vc> &data, vb &checkrow, vb &checkcol, int H, int W, int K, int n) {
    if (n == 0) {
        int ans = g(data, checkrow, checkcol, H, W, K, W);
        return ans;
    }
    checkrow.at(H - n) = true;
    int a = f(data, checkrow, checkcol, H, W, K, n - 1);
    checkrow.at(H - n) = false;
    int b = f(data, checkrow, checkcol, H, W, K, n - 1);
    int ans = a + b;
    return ans;
}

int main() {
    int H, W, K;
    cin >> H >> W >> K;
    int count = 0;
    vector<vc> data(H, vc(W));
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> data.at(i).at(j);
        }
    }
    vb checkrow(H, true);
    vb checkcol(W, true);
    int ans = f(data, checkrow, checkcol, H, W, K, H);
    cout << ans << endl;
}

Measured memory_bytes: 3496
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yes(int n){
    cout << "Yes" << endl;
}

void no (int n){
    cout << "No" << endl;
}

int ggcd(int a, int b){
    int c = a % b;
    while (c > 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int main() {
    int n; cin >> n;
    int ans = 1;
    int mo = 7 % n;
    while (mo != 0 && ans < 1500000){
        mo *= 10;
        mo += 7;
        mo %= n;
        ans++;
    }
    if (ans < 1000000) cout << ans << endl;
    else cout << -1 << endl;
}

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

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//main
//------------------------------------------

signed main(){
    // 入力
    string a,b;
    cin >> a >> b;
    cout << b + a;
}


Measured memory_bytes: 256
INF = 10**10

n,ma,mb = map(int, input().split())
dp = [[[INF] * 500 for i in range(500)] for i in range(n+1)]
dp[0][0][0] = 0
for i in range(n):
    a,b,c = map(int, input().split())
    for w_a in range(500):
        for w_b in range(500):
            dp[i+1][w_a][w_b] = dp[i][w_a][w_b]
    for w_a in range(500):
        for w_b in range(500):
            if dp[i][w_a][w_b] == INF : continue
            dp[i+1][w_a+a][w_b+b] = min(dp[i][w_a+a][w_b+b], dp[i][w_a][w_b]+c)

a = 0
b = 0
dp[n][0][0] = INF
# ma.mbは互いに素
ans = INF
while a < 500 and b < 500:
    ans = min(ans,dp[n][a][b])
    a += ma
    b += mb
if ans == INF:
    print(-1)
else:print(ans)

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

int main(void)
{
	int h, w;
	string str;
	while (cin >> h >> w){
		if (h == 0 && w == 0) break;
		for (int i = 0; i < h; i++){
			if (i == 0 || i ==  h-1){
				str = string(w, '#');
			}else{
				str = '#' + string(w-2, '.') + '#';
			}
			cout << str << endl;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef vector<int> vii;
typedef vector<double> vdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef set<int> sii;
typedef set<double> sdd;
typedef set<ll> sll;
typedef set<ld> sld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef pair<double, double> pdd;

#define feach(i, a) for(auto  &i : a)
#define allo(a, n) (a), (a) + (n)
#define all(a) (a).begin(), (a).end()

const int MAXN = 2e3 + 1;
const int mod = 1e9;
const double PI = atan2(0, -1);
const int INF32 = 2e9 + 1;
const ll INF64 = 1e18 + 1;
random_device rd;
mt19937_64 rnd(rd());
uniform_int_distribution<ll> uid(-1e9, 1e9);

typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

void time() {
    cerr << (double) clock() / CLOCKS_PER_SEC << '\n';
}

void solve() {
    int n;
    cin >> n;
    int a[n];

    for (int i = 0; i < n; i++) {
        cin >> a[i];
        //a[i] = uid(rnd);
        //cout << a[i] << ' ';
    }
    cout << endl;

    vii ans_odd, ans_even;
    ll sum_odd = 0, sum_even = 0;

    for (int i = 0; i < n; i++) {
        if (i % 2) {
            if (a[i] > 0) {
                sum_odd += a[i];
                ans_odd.push_back(i);
            }
        } else {
            if (a[i] > 0) {
                sum_even += a[i];
                ans_even.push_back(i);
            }
        }
    }

    ll sum;
    vii ans;

    if (sum_even == 0 and sum_odd == 0) {
        sum = -INF64;
        ans.push_back(-1);

        for (int i = 0; i < n; i++) {
            if (a[i] > sum) {
                sum = a[i];
                ans.back() = i;
            }
        }

    } else if (sum_odd > sum_even) {
        sum = sum_odd;
        ans = ans_odd;
    } else {
        sum = sum_even;
        ans = ans_even;
    }

    cout << sum << '\n';
    vii to_print;
    for (int i = n - 1; i > ans.back(); i--)
        to_print.push_back(i + 1);

    for (int i = int(ans.size()) - 2; i >= 0; i--) {
        for (int j = 0; j < (ans[i + 1] - ans[i] - 2) / 2; j++)
            to_print.push_back(ans[i] + 3);
        to_print.push_back(ans[i] + 2);
    }

    for (int i = 1; i - 1 < ans.front(); i++)
        to_print.push_back(1);

    cout << to_print.size() << '\n';
    feach(i, to_print)
        cout << i << '\n';
}

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

    solve();
    //time();

    return 0;
}


Measured memory_bytes: 3576
#include <iostream>
//#include <cstdio>
using namespace std;
#define SENTINEL 2000000000

struct card{char flower; int num;};

struct card A[100000], B[100000];
int  n;

void swap_test(struct card &a,struct card &b)
{
	struct card t = a; a = b; b = t; 
}

int partition(struct card A[], int p, int r)
{
	int x = A[r].num;
	int i = p - 1;
	int j;
	for(j=p; j < r; j++)
	{
		if(A[j].num <= x) swap(A[++i], A[j]);
	}
	swap(A[i+1], A[r]);
	return i+1;
}

struct card L[100000/2 + 2], R[100000/2 + 2];

void merge(struct card A[], int left, int mid, int right)
{
	int n1 = mid - left;
	int n2 = right - mid;
	for(int i=0; i < n1; i++) L[i] = A[left + i];
	for(int i=0; i < n2; i++) R[i] = A[mid + i];	
	L[n1].num = SENTINEL;
	R[n2].num = SENTINEL;
	
	int k, i = 0, j = 0; 
	for(k = left; k < right; k++)
	{
		if(L[i].num <= R[j].num) A[k] = L[i++];
		else A[k] = R[j++]; 
	}
} 

void merge_sort(struct card A[], int left, int right)
{
	if(left + 1 < right)
	{
		int mid = (left + right)/2;
		merge_sort(A, left, mid);
		merge_sort(A, mid, right);
		merge(A, left, mid, right);
	}
}
void quick_sort(struct card A[], int p, int r)
{
	if(p < r)
	{	
		int q = partition(A, p, r);
		quick_sort(A, p, q-1);
		quick_sort(A,q+1, r);	
	}

}

int main() {
	
	char S[10];
	int v;
	
	cin >> n;
	for(int i=0; i < n; i++)
	{
		cin >> S;
		cin >> v;
		A[i].flower = B[i].flower = S[0];
		A[i].num = B[i].num = v;
	}
	
	quick_sort(A, 0, n-1);
	merge_sort(B, 0, n);
	
	
	int stable = 1;
	for(int i=0; i < n; i++)
	{
		if(A[i].flower != B[i].flower)
		{
			stable=0;
			break;		
		}
	}
	
	if(stable) cout << "Stable" << endl;
	else cout << "Not stable" << endl;

	for(int i=0; i < n; i++)
	{
			cout << A[i].flower << " " << A[i].num << endl;
	}
	
//	system("pause");
	return 0;
}



Measured memory_bytes: 5368
N = int(input())
la, lb, lc = [0] * 3

for i in range(N):
    a, b, c = [int(x) for x in input().split()]
    aa = a + max(lb, lc)
    bb = b + max(lc, la)
    cc = c + max(lb, la)
    la = aa
    lb = bb
    lc = cc

print(max(la, lb, lc))


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

int a[2000];

signed main() {
  int x;
  cin >> x;

  a[1] = 1;
  for (int i = 2; i <= x; i++) {
    int v = i;
    while(true) {
      v *= i;
      if(v > x) break;
      a[v] = 1;
    }
  }

  int ans = 0;
  for (int i = x; i >= 0; i--) {
    if(a[i]) {
      ans = i;
      break;
    }
  }

  cout << ans << "\n";

}

Measured memory_bytes: 3620
S = input()

N = len(S)
first = (N-1) // 2
second = (N+3) // 2
#print("first, second", N, first, second)
ans = 'Yes'
for i in range(first):
  #print("i", i)
  if not(S[i] == S[first-1-i]):
    ans = 'No'
for i in range(second -1, N):
  #print("i", i)
  #print(i - (second - 1))
  if not(S[i] == S[N-1 - (i - (second - 1))]):
    ans = 'No'
for i in range(N):
  #print(N-1-i)
  if not(S[i] == S[N-1-i]):
    ans ='No'
print(ans)

Measured memory_bytes: 3188
import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws NumberFormatException, IOException {
        try (Scanner sc = new Scanner(System.in);) {
            String a = sc.next();
            String[] b = a.split("");

            String c = a.toUpperCase();
            String[] d = c.split("");

            String flag = "WA";

            int countC = 0;
            for (String st : b) {
                if (st.equals("C")) {
                    countC++;
                }
            }

            int countLower = 0;
            for (int i = 0; i < d.length; i++) {
                if (b[i].equals(d[i])) {
                    countLower++;
                }
            }

            boolean cc = false;
            for (int i = 2; i < d.length-1; i++) {
                if (b[i].equals("C")) {
                    cc = true;
                }
            }


            if (b[0].equals("A")) {
                if (cc) {
                    if (countC == 1) {
                        if (countLower == 2) {
                            flag = "AC";
                        }
                    }
                }
            }
            System.out.println(flag);
        }

    }

}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
int main(){
  int l[10],v1,v2,len,point,now;
  while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)!=EOF){
    len=0;
    for(int i=0;i<10;i++){
      len+=l[i];
    }
    point=(v1*len)/(v1+v2)+((v1*len)%(v1+v2)>0);
    now=0;
    for(int i=0;i<10;i++){
      now+=l[i];
      if(now>=point){
        printf("%d\n",i+1);
        break;
      }
    }
  }
  return 0;
}



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

int	main()
{
	int	K;
	cin >> K;
	int	gcd_ab[200][200];
	for (int i = 0; i < K; ++i) {
		for (int j = 0; j < K; ++j) {
			gcd_ab[i][j] = __gcd(i + 1, j + 1);
		}
	}
	int64_t	sum = 0;
	for (int i = 0; i < K; ++i) {
		for (int j = 0; j < K; ++j) {
			for (int k = 0; k < K; ++k) {
				sum += __gcd(gcd_ab[i][j], k + 1);
			}
		}
	}
	cout << sum << endl;
}


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

template <typename T>
void print(const T &v);

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

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}


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

int main() {
    int c[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin >> c[i][j];
        }
    }
    int a[3],b[3];
    a[0]=0;
    for(int i=0;i<3;i++){
        b[i]=c[0][i];
    }
    for(int i=1;i<3;i++){
        a[i]=c[i][0]-b[0];
    }
    bool ans=true;
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            if(c[i][j]!=a[i]+b[j]) ans=false;
        }
    }
    if (ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}


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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  if (a >= 13) {
    cout << b << endl;
  } else if (a >= 6) {
    cout << b / 2 << endl;
  } else {
    cout << 0 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 1 << 21;
using pii = std::pair<int, int>;
#define SORT(v) std::sort(v.begin(), v.end())
int main(void) {
	int N, M;
	;
	long long ans = 0;
	std::cin >> N;
	std::vector<long long> a(N), b;
	for (int i = 0; i < N; ++i) {
		std::cin >> a[i];
	}

	std::sort(a.begin(), a.end(), std::greater<int>());
	int count = 1;
	for (int i = 0; i <N-1; ++i) {
		if (a[i] == a[i + 1]) {
			b.push_back(a[i]);
			i++;
		}
		

		if (b.size() == 2) {
			std::cout << b[0] * b[1] << std::endl;
			return 0;
		}
	}
	std::cout << 0 << std::endl;
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;


long long gcd(long long x,long long y){
    while(x%y!=0){
        long long tmp;
        tmp=x;
        x=y;
        y=tmp%y;
    }
    return y;
}

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

int main(){
    long long a,b;
    while(scanf("%lld %lld",&a,&b)!=EOF){
        long long g,l;
        if(a<b){
            swap(a,b);
        }
        g=gcd(a,b);
        l=lcm(a,b);
        printf("%lld %lld\n",g,l);
    }
    return 0;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define lsc(x)      scanf("%lld",&x)
#define sc(x)       scanf("%d",&x)
#define lpr(x)      printf("%lld ",(long long)x)
#define pr(x)       printf("%d ",x)
#define n_l         printf("\n")
#define VI          vector<int>
#define VII         vector<long long int>
#define m_p         make_pair
#define pb          push_back
#define fi           first
#define se           second
#define mset(x,y)   memset(x,y,sizeof(x))
#define sz(v)       (int)v.size()
#define all(v)      v.begin(), v.end()
#define fr(i, a, n) for(int i=a;i<=n;i++)
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
const int N=(int)1e6+5;
const int mod = 1000000007;
typedef long long ll;
// order_of_key (val): returns the no. of values strictly less than val
// find_by_order (k): returns the kth largest element iterator.(0-based)
// vector<int>::iterator itr=lower_bound(v.begin(),v.end(),x);
// s.substr(pos[0-indexed], len(default=till end))
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

ll fmod(ll x){if (x<mod) return x;return x%mod;}
ll mul(ll a, ll b, ll c){
	ll ret=0;while(b){if (b%2) ret=(ret+a)%c;a=(a*2)%c;b>>=1;}
    return ret;
}
int modpow(ll a, ll b){
    ll ret=1;while(b){if (b%2) ret=(ret*a)%mod;a=(a*a)%mod;b>>=1;}
    return (int)ret;
}
inline int inv(int x){ return modpow(x, mod-2);}
int isprime[N];
void calc_prime(){
	isprime[1]=1;for(ll i=2;i<N;i++) if (!isprime[i]) for(ll j=i*i;j<N;j+=i) isprime[j]=1;
}

struct edge
{
    int a, b, cost;
};
edge e[N];
VI adj[N];
int vis[N];
void dfs(int u){
    vis[u]=1;
    for(auto v: adj[u])
        if (!vis[v]) dfs(v);
}
int main(){
    int n, m, p;
    sc(n);sc(m);sc(p);
    fr(i, 1, m){
        int x;
        sc(e[i].a);sc(e[i].b);sc(x);
        adj[e[i].b].pb(e[i].a);
        e[i].cost = -(x-p);
    }
    dfs(n);
    // fr(i, 1, n)
    // trace(i, vis[i]);
    vector<int> d (n, mod);
    d[1] = 0;
    VI tmp;
    for (int i=0; i<n; ++i){
        tmp.clear();
        for (int j=1; j<=m; ++j)
            if (d[e[j].a] < mod){
                if (d[e[j].b] > d[e[j].a] + e[j].cost)
                {
                    d[e[j].b] = max(-mod, d[e[j].a] + e[j].cost);
                    tmp.pb(e[j].b);
                }
            }
    }
    int f = 0;
    for(auto u: tmp) if (vis[u]) f=1;
    pr(f==1?-1:-d[n]);

    return 0;
}



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

using namespace std;

typedef long long int ll;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

const ll L = 1e5+5;

// vector <ll> a(L);
// vector <ll> b(L);

vector < pair <ll, ll> > v;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    ll N, M;
    cin >> N >> M;

    for(ll i=0; i<N; i++)
    {
        ll a, b;
        cin >> a >> b;
        // cin >> a[i] >> b[i];

        v.pb(mp(a, b));
    }

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

    ll ans = 0;
    for(ll i=0; i<N; i++)
    {
        if(M<=0)
        {
            break;
        }

        ans+=v[i].ff*min(v[i].ss, M);
        M-=v[i].ss;
    }

    cout << ans << endl;


    

    return 0;
}

Measured memory_bytes: 2420
#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
using namespace std;

int prime[10000000];
bool isprime[10000001];

int sieve(int n){
	int p=0;
	for(int i=0;i<=n;i++)isprime[i]=true;
	isprime[0]=isprime[1]=false;
	for(int i=0;i<=n;i++){
		if(isprime[i]){
			prime[p++]=i;
			for(int j=i*2;j<=n;j+=i)isprime[j]=false;
		}
	}
	return p;
}

int main(){
	sieve(1e+7);
	int n;
	while(cin>>n){
		if(!n)return 0;
		do{
			if(isprime[n]&&isprime[n-2]&&isprime[n-6]&&isprime[n-8]){
				cout<<n<<endl;
				break;
			}
		}while(n--);
	}
}

Measured memory_bytes: 12000
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    from copy import deepcopy
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    h,w,k=MI()
    lis=[list(map(int,list(SI()))) for i in range(h)]
    #print(lis)
    #print()
    if k==1:
        ans=0
        for i in range(h):
            ans+=sum(lis[i])
        print(ans)
        sys.exit()
    def process(board):
        res=0
        for i in range(w):
            plus=[]
            for j in range(h):
                m=h-1-j
                if board[m][i]>0:
                    plus.append(board[m][i])
            for j in range(h):
                if j<len(plus):
                    board[h-1-j][i]=plus[j]
                else:
                    board[h-1-j][i]=0
                '''m=h-1-j
                pos=0
                print(board[m][i])
                z=board[m][i]
                if z>0:
                    board[h-1-pos][i]=z
                    if pos!=j:
                        board[m][i]=0
                    pos+=1
                print(board)'''
                    
        #print(board)
        #print()
        for i in range(h):
            seq=1
            for j in range(w-1):
                if board[i][j]==board[i][j+1]:
                    seq+=1
                else:
                    if seq>=k:
                        res+=seq*board[i][j]
                        for l in range(j+1-seq,j+1):
                            board[i][l]=0
                    seq=1
            if seq>=k:
                res+=seq*board[i][j]
                for l in range(w-seq,w):
                    board[i][l]=0
        #print(board)
        return res
    process(lis)
    ans=0
    for i in range(w):
        for j in range(h):
            boardx=deepcopy(lis)
            boardx[j][i]=0
            flag=True
            z=0
            res=0
            while flag==True:
                x=process(boardx)
                if x==0:
                    flag=False
                else:
                    res+=x*(2**z)
                    #print(z,x,x*(2**z))
                    z+=1
            #print(res)
            #print()
            ans=max(ans,res)
    print(ans)


    
        
    
    
if __name__=="__main__":
    main()


Measured memory_bytes: 77272
#include <iostream>
#include<bits/stdc++.h>
#define lli long long
using namespace std;

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

   if(d<=(a+b))
    cout <<min(a,d)<<endl;
   else
   {
    a-=(d-(a+b));
       cout <<a<<endl;

   }




}


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

int main(){
    string s;
    cin>>s;
    int r=0,cnt=3;
    //while(cnt--){
    if(s[0]=='R'){r++; }
    if(s[1]=='R'){r++;}
   // else if(s[1]=='S' && r>0){ r=0;}
     if(s[2]=='R' && s[1]=='R'){r++;}
     if(s[2]=='R' && r==0) r++;
    
         
    cout<<r<<"\n";
}

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

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

    if (a % k == 0) cout << "OK" << endl;
    else if (a + (k - a % k) <= b) cout << "OK" << endl;
    else cout << "NG" << endl;

}

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

int count_division (const vector<int>& numbers) {
    for (auto& num : numbers) {
       if (num % 2 == 1) {
           return 0;
       }
    }
    vector<int> half_nums(numbers.size());
    for (int i = 0; i < numbers.size(); i++) {
       half_nums[i] = numbers[i] / 2;
    }
    return count_division(half_nums) + 1;
}

int main () {
    int n;
    cin >> n;
    vector<int> numbers(n);
    for (auto& num : numbers) {
        cin >> num;
    }
    cout << count_division(numbers) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int S;
    scanf("%d", &S);

    int h = S / 3600;

    S = S % 3600;

    int m = S / 60;

    int s = S % 60;

    printf("%d:%d:%d\n", h, m, s);

    return 0;
}

Measured memory_bytes: 592
<?php
  list($n) = explode(" ", trim(fgets(STDIN)));

  $ans = 0;
  $m = new SplMaxHeap();

  $a = explode(" ", trim(fgets(STDIN)));
  rsort($a);

  $ans += $a[0];
  $min = [min($a[0], $a[1]), $a[0], $a[1]];
  $m->insert($min);
  $m->insert($min);
  for ($i=2; $i<$n; $i++) {    
    $max = $m->extract();
//    echo $max[0]." ".$max[1]." ".$max[2].PHP_EOL;
    $ans += $max[0];
    $m->insert([min($a[$i], $max[1]), $a[$i], $max[1]]);
    $m->insert([min($a[$i], $max[2]), $a[$i], $max[2]]);
  }
  echo $ans;

  class H extends SplHeap{
    function compare($v1, $v2){
      if($v1[0] > $v2[0]){
        return 1;
      }else{
        return -1;
      }
    }
  }
  

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

int main() {
  int x;
  cin >> x  ;
  vector<int> v(x);
  for (int i=0;i<x;i++){
    cin >>v.at(i);
  }
  sort(v.begin(),v.end());
  cout << v.at(x-1)-v.at(0);
}


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

using namespace std;

typedef long long ll;
typedef double dd;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

#define FOR(i,a,b) for (int (i) = (a); (i) < (b); (i)++)
#define DOW(i,b,a) for (int i = (b); i >= (a); i--)
#define pb(a) push_back(a)
#define ALL(a) (a).begin(),(a).end()
#define fi first
#define se second

template<typename T>
void print_array(T* arr, int num) {
   FOR(i, 0, num) cout << arr[i] << ' ';
   cout << endl;
}

template<typename T> 
void print_vector(vector<T> vec) {
   FOR(i,0,vec.size()) cout << vec[i] << ' ';
   cout << endl;
}

int mi,mx,x,n;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
   // freopen("test.txt", "r", stdin);
    cin >> n;
    mi = 99999, mx = -1;
    FOR(i,0,n) {
        cin >> x;
        mi = min(mi, x);
        mx = max(mx, x);
    }
    cout << mx - mi;
}

Measured memory_bytes: 256
class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n + 1)]
        self.size = [1 for i in range(n + 1)]

    def find(self, x):
        if x == self.par[x]:
            return x
        self.par[x] = self.find(self.par[x])
        return self.par[x]
    
    def same(self, x, y):
        return self.find(x) == self.find(y)

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

    def unite(self, x, y):
        if self.same(x, y):
            return

        xr = self.find(x)
        yr = self.find(y)
        if self.size[xr] > self.size[yr]:
            xr, yr = yr, xr    
        self.size[yr] = self.size[xr] + self.size[yr]
        self.par[xr] = yr
        return


def submit():
    n, m = map(int, input().split())
    bridge = [tuple(map(int, input().split())) for _ in range(m)]

    uf = UnionFind(n)
    curr = n * (n - 1) // 2
    ans = []
    for a, b in reversed(bridge):
        ans.append(curr)
        if not uf.same(a, b):
            curr -= uf.union_size(a) * uf.union_size(b)
            uf.unite(a, b)


    for a in reversed(ans):
        print(a)


submit()
    
        



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

int main()
{
  	long long int a,b,count=0;
  	cin>>a>>b;
  	if(a<=0&&b>=0)
      cout<<"Zero";
  	else if(a>0&&b>0)
      cout<<"Positive";
    else
    {
  		for(int i=a;i<=b;i++)
          count++;
  		if(count%2==0)
     	 cout<<"Positive";
  		else
      	 cout<<"Negative";
    }
}

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

using namespace std;
int main(){
	long long n,sum=0;
	cin>>n;
	map<long long,long long> l;
	for(long long i=0;i<n;i++){
		long long t;
		cin>>t;
		sum+=t;
		l[t]+=1;
	}
	long long  k;
	cin>>k;
	for(long long i=0;i<k;i++){
		long long x,y;
		cin>>x>>y;
		long long a=l[x];
		long long b=l[y];
		l[y]+=l[x];
		l[x]=0;
		sum=sum-x*a-y*b+y*l[y];
		cout<<sum<<endl;
	}
}

Measured memory_bytes: 9544
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define ALL(n) begin(n),end(n)

int main(){
    int h,w;
    
    while(1){
        cin>>h>>w;
        if(h==0&&w==0) break;
        REP(i,h){
            REP(j,w){
                cout<<"#";
                if(j==w-1){
                    cout<<endl;
                }
            }
        }
        cout<<endl;
    }
    
    
}


Measured memory_bytes: 3080
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int menor(const void * x, const void * y){
	int a = *((int *) x), b = *((int *) y);
 
	if (a<b)
		return -1;
	if (a>b)
		return 1;
 
	return 0;
 
}

int main(){
	int n, k, soma=0, eq=0;
	scanf("%d %d", &n, &k);
	int vet[n];
	for(int i =0; i<n; ++i)
		scanf("%d", &vet[i]);

	qsort(vet, n, sizeof(vet[0]), menor);	

	for(int i=0; i < k; ++i)
		soma+=vet[i];
	printf("%d\n", soma);
	return 0;	
}

Measured memory_bytes: 1744
#include <bits/stdc++.h>
using namespace std;
#define ALL(A) (A).begin(),(A).end()
#define ll long long
const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

string s[100005];
map<string,int> mp;
int main(void){
	int N;
	cin >> N ;
	ll ans = 0;
	for(int i=0;i<N;i++){
		cin >> s[i];
		sort(ALL(s[i]));
		mp[s[i]]++;
	}
	for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
		ll t = itr->second;
		ans += (t*(t-1))/2;
    }
	cout << ans << endl;
}

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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = int(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = int(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = int(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = int(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = int(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = (1 << 30) - 1;
const long long LLINF = 1LL << 61;
const long long MOD = 1000000007LL;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

double power(int x, int n){
    int t = 1;
    while(n > 0){
        if(n & 1){
            t *= x;
        }
        x *= x;
        n >>= 1;
    }
    return (double)t;
}

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

    double n, k;
    cin >> n >> k;

    double ans = 0.0;
    reps(i, n){
        int now = i, cnt = 0;
        while(now < k){
            now *= 2;
            ++cnt;
        }
        ans += 1.0 / (power(2, cnt) * n);
    }

    cout << fixed << setprecision(10) << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
void solve() {}
int main() {
  IOS;
  ll n;
  cin >> n;
  if (n & 1) {
    cout << 0 << endl;
    return 0;
  }
  ll cnt = 0;
  ll cur = 10;
  while (cur <= n) {
    cnt += n / cur;
    cur *= 5;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <math.h>
#include <iomanip>
#include <algorithm>

int main()
{
	int N = 0;
	std::cin >> N;

	std::vector<long double> X(N), Y(N);
	for (int i = 0; i < N; i++){
		std::cin >> X[i] >> Y[i];
	}

	long double ans = 0, T = 0;
	std::vector<int> P(N);
	for (int i = 0; i < N; i++){
		P[i] = i;
	}
	do{
		for (int i = 1; i < N; i++){
			long double dx = X[P[i]] - X[P[i - 1]];
			long double dy = Y[P[i]] - Y[P[i - 1]];
			T += sqrt(dx * dx + dy * dy);
		}
	}while(std::next_permutation(P.begin(), P.end()));
	
	long double DEN = 1;
	for (int i = N; i > 0; i--)
	{
		DEN *= i;
	}

	ans = T / DEN;
	std::cout << std::fixed <<std:: setprecision(10) << ans << std::endl;

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>

using namespace std;

typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;


int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);

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

  int a,b,c,k;
  cin>>a>>b>>c>>k;
  while(k > 0 && b <= a) {b *= 2;k--;}
  while(k > 0) {c *= 2;k--;}

  if(c > b && b > a) cout<<"Yes";
  else cout<<"No";













 return 0;
}


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

int main() {
    
    int a,b,c;
    
    cin >> a >> b >> c;
    
    if(a <= c && c <= b){
        cout << "Yes" << endl;
        return 0;
    }
    
    cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;

int main(){
    string S;
    cin >> S;
    if(S[2]==S[3]&&S[4]==S[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
}


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

using namespace std;

#define int long long 

int n,ans;

signed main(){
	cin>>n;
	if(n&1){
		cout<<0<<endl;
		return 0;
	}
	int nn=n/10;
	ans+=n/10;
	while(nn!=0){    
		ans+=nn/5;  
		nn=nn/5;
	}
	cout<<ans<<endl;
	return 0;
}

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

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

stringstream ss;

string prd(int a,char c) {
  ss.str("");
  ss<<a;
  return ss.str() + string(1,c);
}
    

string rlm(string s) {
  int a=0;
  char prev = s.at(0);
  string res="";

  REP(i,s.length())
    if( prev != s.at(i) ) {
      res += prd(a,prev);
      prev = s.at(i);
      a = 1;
    }else
      a++;

  res += prd(a,prev);
  return res;
}
      

int main() {

  int d;
  string s;
  while(true) {
    cin>>d;
    if(!d) break;
    cin>>s;

    REP(i,d)
      s = rlm(s);

    cout<<s<<endl;
  }
}

Measured memory_bytes: 1060
#include<iostream>
#include<algorithm>
#include<array>

int main(){

    int w, h, x, y, r;
    std::cin >> w >> h >> x >> y >> r;

    h -= r;
    w -= r;

    if(x >= r && x <= w && y >= r && y <= h){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }

    return 0;
}



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

// i+ a[i]== j- a[j] なるペアを数える。
// 上が成り立つ場合,制約より
// i- a[i]= j- 2*a[j]≠ j+ a[j]
// なので、各ペアの重複度は1.
int main(){
  int N;
  cin >> N;

  vector<int> data(N);
  vector<int> idx_val(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
    idx_val.at(i)= i- data.at(i);
  }
  sort(idx_val.begin(), idx_val.end());

  int64_t ans= 0;
  for(int i=0; i<N; i++){
    auto itr1= lower_bound(idx_val.begin(), idx_val.end(), i+data.at(i));
    auto itr2= upper_bound(idx_val.begin(), idx_val.end(), i+data.at(i));

    ans+= distance(itr1, itr2);
  }

  cout << ans << endl;
}

Measured memory_bytes: 4840
n = int(input())
a = list(map(int, input().split()))
ball = [0] * n

for i in range(n)[::-1]:
    m = n//(i+1)
    count = 0
    for j in range(1, m+1):
        count += ball[j*(i+1)-1]
    ball[i] = (a[i]%2)^(count%2)

print(sum(ball))
for i in range(n):
    if ball[i] == 1:
        print(i+1)

Measured memory_bytes: 12124
#include<stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <sstream>
#include<math.h>
#include <algorithm>
using namespace std;



int main(void)
{
  double a,b,c;
  int d;
  double Max,Min,ans;
  vector<int> array;
  int i=0;
  cin>>d;

  while(i<d)
    {
	cin>>a>>b>>c;
	 if(!cin)break;
	 Max=max(a,b);
	 Max=max(Max,c);
	 Min=min(a,b);
	 Min=min(Min,c);
     Max=pow(Max,2.0);
     Min=pow(Min,2.0);
    ans=sqrt((Max-Min));
    if(ans==a||ans==b||ans==c)array.push_back(0);	
    else array.push_back(1);
	i++;
    }
  i=0;
  while(i<array.size())
    {
	d=array[i];
	if(!d) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;	
	i++;
    }
  array.clear();
}

Measured memory_bytes: 1256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <iostream>


using namespace std;

int main()
{
	char s[1024];
	fgets(s, 1024, stdin);
	for (int i = 0; s[i] != '\0'; ++i)
		s[i] = toupper(s[i]);
	printf("%s", s);

	return 0;
}

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

using namespace std;

int main()
{
    long long n;
    cin >> n ;
    long long s=0;
    long long min=100000000;
    long long max= -100000000;
    for (long long i=0; i< n;i++){
        long long a;
        cin >> a;
        s=s+a;
        if (a < min) min = a;
        if (a > max) max = a;
    }
    cout << min << " " << max <<" " <<s << endl;
}



Measured memory_bytes: 3084
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s,t=LS()
  return t+s

# main()
print(main())


Measured memory_bytes: 6860
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string(string(s)); }
string to_string(bool b) { return to_string(int(b)); }
string to_string(char b) { return "'" + string(1, b) + "'"; }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(A v) {
	string res = "{";
	for (const auto& x : v) res += (res == "{" ? "" : ", ") + to_string(x);
	return res + "}";
}
void debug() { cerr << endl; }
template <typename Head, typename... Tail>
void debug(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug(T...);
}
#define db(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define db(...) 42
#endif
typedef long long ll;
typedef long double ld;
int main() {
	int n;
	scanf("%d", &n);
	bool yes = false;
	int row = 0;
	for (int i = 0; i < n; ++i) {
		int a, b;
		scanf("%d%d", &a, &b);
		if (a != b) row = 0;
		else ++row;
		if (row >= 3) {
			yes = true;
		}
	}
	printf(yes ? "Yes\n" : "No\n");
}


Measured memory_bytes: 3820
#https://atcoder.jp/contests/abc152/tasks/abc152_c
# -*- coding: utf-8 -*-
N = int(input())
P = input().split()
T = []
L =0
T.insert(0,int(P[0]))
P[0] = int(P[0])
for i in  range(1,len(P)):
  P[i] = int(P[i])
  if T[-1]>=P[i]:
    L =+ 1
    if T[-1]>P[i]:
      T.append(P[i])
print(len(T))

Measured memory_bytes: 86580