akhauriyash/Code-Regression huggingface dataset:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
A = LIST()
for cnt in range(K):
	tmp = [0]*(N+1)

	for i, a in enumerate(A):
		tmp[max(0, i-a)] += 1
		tmp[min(N, i+a+1)] -= 1
	tmp = list(accumulate(tmp))
	A = tmp[:-1]
	if all(x==N for x in A):
		break

print(*A)


Measured memory_bytes: 185376
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;


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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

using P=pair<ll,ll>;
void solve(){
	ll n;
	cin>>n;
	vector<P>p(n);
	rep(i,n){
		cin>>p[i].first>>p[i].second;
	}
	sort(all(p));
	ll ans=0;
	vector<ll>left(n),right(n),rleft(n),rright(n);
	ll l=0,r=1e9;
	rep(i,n){
		chmax(l,p[i].first);
		chmin(r,p[i].second);
		left[i]=l;
		right[i]=r;
	}
	l=0,r=1e9;
	for(int i=n-1;i>=0;--i){
		chmax(l,p[i].first);
		chmin(r,p[i].second);
		rleft[i]=l;
		rright[i]=r;
	}
	rep(i,n-1){
		chmax(ans,max(right[i]-left[i]+1,0LL)+max(rright[i+1]-rleft[i+1]+1,0LL));
	}
	rep(i,n){
		chmax(ans,max(0LL,min(right[i-1],rright[i+1])-max(left[i-1],rleft[i+1])+1)+p[i].second-p[i].first+1);
	}
	cout<<ans<<"\n";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


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


int main() {
	
	int N, cnt=0;
	cin >> N;
	for(int i=1; i<=N; i++){
		if(to_string(i).size()%2) cnt++;
		
	}
	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int main(){
    ll n,k;
    cin>>n>>k;
    ll ans=0;
    for(ll i=k;i<=n+1;i++){
        ll l=i*(i-1)/2;
        ll r=(n+n-i+1)*i/2;
        ans=(ans+r-l+1)%mod;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3632
N,M=map(int,input().split())
scores=[]
bai=[(1,1,1),(1,1,-1),(1,-1,1),(-1,1,1),(1,-1,-1),(-1,1,-1),\
         (-1,-1,1),(-1,-1,-1)]
scores=[[] for i in range(8)]
for i in range(N):
    a,b,c=map(int,input().split())
    for j in range(8):
        scores[j].append(a*bai[j][0]+b*bai[j][1]+c*bai[j][2])

for i in range(8):
    scores[i].sort(reverse=True)

ans=0
for i in range(8):
    ans=max(ans,sum(scores[i][:M]))
print(ans)


Measured memory_bytes: 43756
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;
using P = pair<int, int>;
int main() {
    int N;
    cin >> N;
    vector<int> L(N), R(N);
    vector<P> A(N);
    for (int i = 0; i < N; i++) {
        cin >> L[i] >> R[i];
        A[i] = P(L[i], -R[i]);
    }
    sort(A.begin(), A.end());
    for (int i = 0; i < N; i++) {
        A[i].second *= -1;
    }

    vector<P> U(N + 1, P(0, INF)), D(N + 1, P(0, INF));
    for (int i = 0; i < N; i++) {
        chmax(U[i + 1].first, max(U[i].first, A[i].first));
        chmin(U[i + 1].second, min(U[i].second, A[i].second));
    }
    for (int i = N - 1; i >= 0; i--) {
        chmax(D[i].first, max(D[i + 1].first, A[i].first));
        chmin(D[i].second, min(D[i + 1].second, A[i].second));
    }

    int ans = 0;
    for (int i = 1; i < N; i++) {
        int u = max(U[i].second - U[i].first + 1, 0);
        int d = max(D[i].second - D[i].first + 1, 0);
        chmax(ans, u + d);
    }
    for (int i = 0; i < N; i++) {
        chmax(ans, A[i].second - A[i].first + 1 + max(0, min(U[i].second, D[i + 1].second) - max(U[i].first, D[i + 1].first) + 1));
    }
    cout << ans << endl;
}


Measured memory_bytes: 6412
import java.util.*

fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val a = sc.nextLong()
    val b = sc.nextLong()

    if (a == 1L && b == 1L) {
        println(1)
    } else if (a == 1L || b == 1L) {
        println(a * b - 2)
    } else {
        println(a * b - a * 2 - b * 2 + 4)
    }
}

Measured memory_bytes: 31400
#include<stdio.h>
int main(){
   int n,m;
   scanf("%d %d",&n,&m);
   int a[n];
   int i;
   double sum=0;
   int count=0;
   for(i=0;i<n;i++){
      scanf("%d",&a[i]);
      sum+=a[i];
   }
   double x=sum/(4*m);
   for(i=0;i<n;i++){
      if(a[i]>=x){
         count++;
      }
   }
   if(count>=m){
      printf("Yes");

   }else{
      printf("No");
   }

   return 0;
   
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
	int  n;
	cin >> n;
	vector<string> v;
	map<string, int> cnt;
	for(int i=0; i<n; i++){
		string s;
		cin >> s;
		v.push_back(s);
		cnt[s]++;
	}
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());

	int c_max=0;
	for(int i=0; i<v.size(); i++) c_max=max(c_max, cnt[v[i]]);
	for(int i=0; i<v.size(); i++){
		if(cnt[v[i]]==c_max) cout << v[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 26736
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
signed main(void){
    int n; cin>>n;
    vector <int> d(n);
    rep(i,n) 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;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    string s;
    cin >> s;
    map<char,ll> mp;
    rep(i,s.size()){
        mp[s[i]]++;
    }
    bool ok = true;
    for(auto x:mp){
        if(abs(mp['a']-mp['b']) > 1) ok = false;
        if(abs(mp['b']-mp['c']) > 1) ok = false;
        if(abs(mp['c']-mp['a']) > 1) ok = false;
    }
    if(ok) puts("YES");
    else puts("NO");
    return 0;
}

Measured memory_bytes: 3752
#include "bits/stdc++.h"
#define hhh cerr<<"hhh"<<endl
#define see(x) cerr<<(#x)<<'='<<(x)<<endl
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
inline int read() {int x=0,f=1;char c=getchar();while(c!='-'&&(c<'0'||c>'9'))c=getchar();if(c=='-')f=-1,c=getchar();while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return f*x;}

const int maxn = 2e5+7;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;

int n, m, k;
int a[maxn];
ll fac[maxn], inv[maxn];
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll qpow(ll a,ll k){ll s=1;while(k){if(k&1)s=s*a%mod;a=a*a%mod;k>>=1;}return s;}
ll comb(int n, int m) {
    if(n<m||m<0||n<0) return 0;
    return fac[n]*inv[m]%mod*inv[n-m]%mod;
}

int main() {
    fac[0]=fac[1]=inv[0]=inv[1]=1;
    for(int i=2; i<maxn; ++i) fac[i]=i*fac[i-1]%mod;
    for(int i=2; i<maxn; ++i) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
    for(int i=2; i<maxn; ++i) inv[i]=inv[i]*inv[i-1]%mod;
    n=read(), m=read(), k=read();
    ll ans=0;
    ll tmp=m;
    for(int i=n-1; i>=0; --i) {
        if(i<=k) ans=(ans+tmp*comb(n-1,i))%mod;
        tmp=tmp*(m-1)%mod;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 6768
#include<bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef ONLINE_JUDGE
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;
const ll nax = 1e18L+5;
int main() {
	int n;
	cin>>n;
	vector<int> a(n);
	for(int &i:a) {
		cin>>i;
	}
	vector<vector<ll>> dp(n,vector<ll> (n));
	auto sum = [&](int x, int y) {
		ll k=0;
		for(int i=x;i<=y;i++) {
			k+=a[i];
		}
		return k;
	};
	for(int i=n-1;i>=0;--i) {
		for(int j=i;j<n;j++) {
			if(i==j) {
				dp[i][j] = 0;
			} else {
				dp[i][j] = nax;
				ll s = sum(i,j);
				for(int l=i;l<j;l++) {
					dp[i][j] = min(dp[i][j], dp[i][l] + dp[l+1][j] + s);
				}
			}
		}
	}
	
	//debug()<<imie(dp[0][n-1]);
	cout<<dp[0][n-1];
}


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

const int mod = 1000000007;

int frac(int n){
  if (!n) return 1;
  int ret = (int64_t) n * frac(n - 1) % mod;
  return ret;
}
int comb(int n, int i){
  int a = frac(n), b = frac(i), c = frac(n - i);
  int d = (int64_t) b * c % mod;
  for (int j = 0; j < mod; j++){
    if (a == (int64_t) j * d % mod) return j;
  }
}
int main(){
  int x, y; cin >> x >> y;
  if ((x + y) % 3){
    cout << 0 << endl;
    return 0;
  }
  int m = (2 * x - y) / 3;
  int n = (2 * y - x) / 3;
  if (m < 0 || n < 0){
    cout << 0 << endl;
    return 0;
  }
  cout << comb(m + n, m) << endl;
}

Measured memory_bytes: 10624
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); 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 FORS(i, m, n) for (int i = m; i <= n; i++)
#define bit(n) (1LL << (n))
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int N = S.size();
    vector<bool> flg;
    flg.push_back(false);
    REP(i, N)
    {
        flg.push_back(S[i] == 'A' || S[i] == 'T' || S[i] == 'G' || S[i] == 'C');
    }
    flg.push_back(false);
    int ans = 0, tmp = 0;
    REP(i, (int)flg.size())
    {
        if (flg[i])
        {
            tmp++;
        }
        else
        {
            ans = max(ans, tmp);
            tmp = 0;
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
using namespace std;
using ll = long long;
const int mod = 1000000007;

int main(){
    ll N;
    cin>>N;
    vector<ll> L(N);
    for(ll i=0;i<N;i++){
        cin>>L[i];
    }
    ll res=0;
    sort(L.begin(),L.end());
    for(ll c=N-1;c>=2;c--){
        for(ll b=c-1;b>=1;b--){
            ll ind = upper_bound(L.begin(),L.end(),L[c]-L[b])-L.begin();
            // cout<<ind<<":"<<b<<":"<<c<<endl;
            if(b>ind)res += b-ind;
        }
    }

    cout<<res<<endl;

}


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

void solve()
{
    float a, b, c;
    cin >> a >> b >> c;
    if ((a / b) <= c)
        cout << "Yes\n";
    else
        cout << "No\n";
}

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


    return 0;
}


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

using namespace std;
//using ll = long long;

//cout << std::fixed << std::setprecision(15) << y << endl;

int main() {
    int n = 0;
    cin >> n;
    if(n < 105){
        cout << 0 << endl;
        return 0;
    }
    int r = 0;
    for(int i = 105;i <= n;i += 2){
        int cnt = 0;
        for(int j = 1;j * j < i;j++){
            if(i % j == 0){
                //cout << j << endl;
                cnt++;
                if(i / j != j){
                    //cout << j << endl;
                    cnt++;
            }
            }
        }
        //cout << cnt << endl;
        if(cnt == 8){
            r++;
        }
    }
    cout << r << endl;
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

vvi a;

vi b;
int cnt=0,h,w,K;
void dfs(int c){
    if(c<h){
        rep(i,2){
            b[c]=b[c-1]+i;
            dfs(c+1);
        }
    }
    else{
        rep(i,h){
            a[cnt].PB(b[i]);
        }
        cnt++;
    }
}

char s[10][1000];

int main(){
    cin>>h>>w>>K;
    b.resize(h,0);
    int ce=0;
    rep(i,h)rep(j,w){cin>>s[i][j];if(s[i][j]=='1'){ce++;}}
    if(ce<=K){cout<<0<<endl;return 0;}
    int sum[h+1][w+1];
    mem(sum,0);
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='1'){
                sum[i][j+1]=sum[i][j]+1;
            }
            else sum[i][j+1]=sum[i][j];
        }
    }
    int n=1;
    rep(i,h-1)n*=2;
    a.resize(n);
    dfs(1);
    int ans=10000;
    rep(i,n){
        int count=0,p=0;
        rep(j,h-1){
            if(a[i][j]!=a[i][j+1])count++;
        }
        bool x=true;
        rep(j,w){
            int sum2[h];
            mem(sum2,0);
            rep(k,h){
                sum2[a[i][k]]+=sum[k][j+1]-sum[k][p];
            }
            rep(k,h){
                if(sum2[k]>K){
                    count++;
                    p=j;
                    mem(sum2,0);
                    rep(l,h){
                        sum2[a[i][l]]+=sum[l][j+1]-sum[l][p];
                    }
                    break;
                }
            }
            rep(k,h){
                if(sum2[k]>K)x=false;
            }
            if(!x)break;
        }
        if(x)ans=min(ans,count);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
ll gcd(ll a , ll b) { return b==0?a: gcd( b, a%b); }
ll lcm(ll a , ll b) { return a/gcd(a,b) * b ; }
 /*struct cmp{ bool operator() ( const, const )const{}};
  use as set<ll> ,cmp> a*/
int main()
{
  ios::sync_with_stdio(false);cin.tie(0);
  //freopen("input.txt" , "r" , stdin );
  ll a,b,h,m;
  cin>>a>>b>>h>>m;
  ld rad = 2*M_PI*(abs((ld)h/12 + ((ld)m/60)/12 - (ld)m/60 ));
  ld ans = sqrt((ld)(a*a + b*b)- (ld)2*a*b*(cos(rad)));
  cout<<setprecision(19)<<ans;

  return 0;
}


Measured memory_bytes: 4156
def main():
    a, b = map(int, input().split())

    height = [0] * 1000

    for i in range(999):
        height[i+1] = height[i] + i + 1

    for i in range(1,999):
        diff_a = height[i] - a
        diff_b = height[i+1] - b
        if diff_a >= 0 and diff_b >= 0 and diff_a == diff_b:
            print(diff_a)
            exit()

main()

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  string s,t;cin >> s >> t;
  cout << t + s << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main(){
    
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    int turn = 1;
    
    while(A > 0 && C > 0){
        if (turn % 2 == 1)
            C -= B;
        else
            A -= D;
        turn++;
    }
    if(A<=0)
        cout << "No";
    if(C<=0)
        cout << "Yes";
    
    
    return 0;
}

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

int main(){
  int N; cin >> N;
  vector<int>  card(N);
  for(int i=0; i<N; i++){
    cin >> card.at(i);
  }
  sort(card.begin(), card.end());
  reverse(card.begin(), card.end());
  int res=0;
  for(int i=0;i<N;i=i+2){
    res += card.at(i);
  }
  for(int i=1;i<N;i=i+2){
    res -= card.at(i);
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
import * as fs from "fs";

function main(lines: string[][]) {
  const number = lines[0][0];
  const numbers = number.toString().split("");
  const included = numbers.some((n) => parseInt(n) === 7);
  console.log(included ? "Yes" : "No");
}

const lines = fs
  .readFileSync("/dev/stdin", "utf8")
  .split("\n")
  .map((l) => l.split(" "))
  .filter((input) => !(input.length === 1 && input[0] === ""));

main(lines);


Measured memory_bytes: 29628
X = input()

"""
Tの左側にSがあるなら操作をする
最終的に
TTTT....TSSSS....S
となる
"""

cnt = 0
Scnt = 0
for x in X:
    if x == "S":
        Scnt += 1
    else:
        if Scnt > 0:
            Scnt -= 1
            cnt += 2

print(len(X) - cnt)

Measured memory_bytes: 3540
#include<bits/stdc++.h>
using namespace std;
char b;
int main()
{
	scanf("%c",&b);
	if(b=='A')
	{
		printf("T");
	}
	if(b=='T')
	{
		printf("A");
	}
	if(b=='G')
	{
		printf("C");
	}
	if(b=='C')
	{
		printf("G");
	}
	return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cassert>
#include<climits>
#include<cmath>
#include<cstring>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using 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())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << endl

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-8;

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};

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

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

void print(double x){
    int t = 0;
    if(x < 0.0){
        t = ceil(x);
    }else{
        t = floor(x);
    }
    cout << t << endl;
    return;
}

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

    int d, a;
    char c;
    double x = 0.0;
    double y = 0.0;
    double kaku = M_PI * 0.5;
    while(cin >> d >> c >> a){
        x += (double)d * cos(kaku);
        y += (double)d * sin(kaku);
        kaku -= (double)a * M_PI / 180.0;
    }

    print(x);
    print(y);

    return 0;
}


Measured memory_bytes: 3336
def kton(S):
    r = 0
    m = 0
    for s in S:
        r += 1 if s == '(' else -1
        m = min(m, r)
    return r, m
        
def main():
    N = int(input())
    RM = [kton(input()) for _ in range(N)]
    pos = 0
    negp = []
    negn = []
    posn = []
    for r, m in RM:
        if m < 0:
            if r >= 0:
                negp.append((-m, r))
            else:
                negn.append((-(r-m), -r, m))
        else:
            pos += r

    negp.sort()
    for m, r in negp:
        if pos - m < 0:
            return False
        pos += r
    negn.sort()
    for _, r, m in negn:
        if pos + m < 0:
            return False
        pos -= r
    return pos == 0

print('Yes' if main() else 'No')


Measured memory_bytes: 115980
#include <iostream>

using namespace std;
typedef long long ll;

int main(int argc, char *argv[]) {
	ll N, M;
	while(cin >> N >> M) {
		ll ans = 0;
		if(M >= 2 * N) {
			M -= 2 * N;
			ans += N + M / 4;
		}
		else {
			ans += M / 2;
		}
		cout << ans << endl;
	}	
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin >> n;
  ll mod = pow(10,9) + 7;
  ll res = 1;
  vector<ll> a(3);
  a[0] = 0,a[1] = 0,a[2] = 0;
  for(int i = 0;i < n;i++){
    ll in;
    cin >> in;
    ll k = 0;
    ll same = -1;
    for(int j = 0;j < 3;j++){
      if(in == a[j])k++,same = j;
    }
    if(k == 0){
      cout << 0 << endl;
      return 0;
    }
    res *= k,res %= mod;
    a[same]++;
  }
  cout << res << endl;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define revrep(i, s) for (int i = s-1; i > 0; i--)
#define revrrep(i, s) for (int i = s-1; i >= 0; i--)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

int main()
{
    int H, W, h, w; cin >> H >> W >> h >> w;
    cout << H*W  - W*h - (H-h)*w << endl;
}

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

using namespace std;
using ll =long long;
using db = double;

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

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(v) SORT(v);(v).erase(unique((v).begin(),(v).end()),(v).end())
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;

ll ans;
//ここから書き始める
int main()
{
	cout << setprecision(10);
	ll n; cin >> n;
	ll ans = n - 1;
	for(ll i = 1 ; i * i <= n; i++){
		//iをintで回すと壊れる
		if(n%i != 0) continue;
		ll j = n / i;
		ans = min(ans, i+ j - 2);
	}
	cout << ans << endl;

}


Measured memory_bytes: 256
S = input()
T = input()

offset = len(S) - len(T)

ans = []
for d in range(offset + 1):
    A = ''
    Td = '?' * d + T
    for i in range(len(S)):
        if i < len(Td) and S[i] != Td[i] and '?' not in [S[i], Td[i]]:
            break
        else:
            c = Td[i] if i < len(Td) and Td[i] != '?' else S[i]
            A += c
    else:
        ans.append(A.replace('?', 'a'))

if len(ans):
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')


Measured memory_bytes: 3064
#include <stdio.h>

main(){
  int x, y, r;

  scanf("%d%d", &x, &y);

  if( x < y ){
    r = x;
    x = y;
    y = r;
  }

  while( y > 0 ){
    r = x % y;
    x = y;
    y = r;
  }
  
  printf("%d\n", x);

  return 0;
  
}

Measured memory_bytes: 592
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<stdio.h>
#include<iostream>
#include<numeric>
using namespace std;

int main() {
	int n;
	double s = 0, x[20];
	string u[20];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> u[i];
	}
	for (int i = 0; i < n; i++) {
		if (u[i] == "JPY") {
			s += x[i];
		}
		else {
			s += 380000.0 * x[i];
		}
	}
	cout << fixed;
	cout << setprecision(5) << s << endl;
}

Measured memory_bytes: 256
s = input()

while True:
  for i, n in enumerate(s):
    if n == "A":
      inda = i
      break
  break

while True:
  for i, n in enumerate(s[::-1]):
    if n == "Z":
      indz = i
      break
  break

indz = len(s) - indz - 1
print(indz - inda + 1)

Measured memory_bytes: 3516
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

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

struct MyStruct {
	int num, honsu;
};

bool comp(const MyStruct& s, const MyStruct& t) {
	if (s.honsu != t.honsu)
		return s.honsu < t.honsu; // 昇順
	return s.num > t.num;
}



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

	ANS(min(b / a, c));
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		for(int i = 0; i <= K; i++) {
			for(int j = 0; j <= K - i; j++) {
				if(A < B * Math.pow(2, i) && B * Math.pow(2, i) < C * Math.pow(2, j)) {
					System.out.println("Yes");
					return;
				}
			}
		}
		System.out.println("No");
	}

}

Measured memory_bytes: 35696
/// Thank you tanakh!!!
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

const MOD: usize = 1e9 as usize + 7;

fn main() {
    input!(n: usize, m: usize);

    let map = {
        let mut map = vec![];
        let mut m = m;
        for p in 2..100000 {
            if m % p != 0 {
                continue;
            }
            let mut count = 0;
            while m % p == 0 {
                m /= p;
                count += 1;
            }
            map.push(count);
        }
        if m > 1 {
            map.push(1);
        }
        map
    };

    let combination = Combination::new(1000000, MOD);

    let mut ans = 1;
    for &count in map.iter() {
        ans *= combination.fact[n - 1 + count];
        ans %= MOD;
        ans *= combination.inv_fact[n - 1];
        ans %= MOD;
        ans *= combination.inv_fact[count];
        ans %= MOD;
    }

    println!("{}", ans);
}

pub struct Combination {
    fact: Vec<usize>,
    inv_fact: Vec<usize>,
    modulo: usize,
}

impl Combination {
    pub fn new(max: usize, modulo: usize) -> Combination {
        let mut inv = vec![0; max + 1];
        let mut fact = vec![0; max + 1];
        let mut inv_fact = vec![0; max + 1];
        inv[1] = 1;
        for i in 2..(max + 1) {
            inv[i] = inv[modulo % i] * (modulo - modulo / i) % modulo;
        }
        fact[0] = 1;
        inv_fact[0] = 1;
        for i in 0..max {
            fact[i + 1] = fact[i] * (i + 1) % modulo;
        }
        for i in 0..max {
            inv_fact[i + 1] = inv_fact[i] * inv[i + 1] % modulo;
        }
        Combination {
            fact: fact,
            inv_fact: inv_fact,
            modulo: modulo,
        }
    }

    pub fn get(&self, x: usize, y: usize) -> usize {
        assert!(x >= y);
        self.fact[x] * self.inv_fact[y] % self.modulo * self.inv_fact[x - y] % self.modulo
    }
}


Measured memory_bytes: 28924
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<long> vl;
typedef vector<vector<long> > vvl;
typedef vector<string> vs;

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

template<typename T>
T input(){
    T t;
    cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

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

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

long long mul(const long long& a, const long long& b, const long long& mod) {
    return ((a % mod) * (b % mod)) % mod;
}

long long power(const long long& x, const long long& y, const long long& mod) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else {
        long long value = power(x, y / 2, mod);
        if (y % 2 == 0) {
            return mul(value, value, mod);
        } else {
            return mul(value, value, mod) * x % mod;
        }
    }
}

long long div(const long long& a, const long long& b, const long long& mod) {
    return mul(a, power(b, mod - 2, mod), mod);
}

map<long long, long long> factorials;
long long factorial(const long long& n, const long long& mod) {
    if (n == 0 || n == 1) {
        return 1;
    }
    if (factorials[n] != 0) {
        return factorials[n];
    }
    factorials[n] = n * factorial(n - 1, mod) % mod;
    return factorials[n] % mod;
}

long long combination(const long long& n, const long long& x, const long long& mod) {
    long long numerator = 1;
    long long denominator = 1;
    repeat(i, x) {
        numerator *= (n - i) % mod;
        numerator %= mod;
        denominator *= (i + 1) % mod;
        denominator %= mod;
    }
    return div(numerator, denominator, mod);
}

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

    vi totalNumbers(100000 + 2, 0);

    repeat (i, N) {
        int number;
        cin >> number;
        totalNumbers[number] += 1;
        totalNumbers[number + 1] += 1;
        totalNumbers[number + 2] += 1;
    }

    int maxCount = 0;
    repeat (i, totalNumbers.size()) {
        if (maxCount < totalNumbers[i]) {
            maxCount = totalNumbers[i];
        }
    }
    cout << maxCount << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(long long i = 0; i < (long long)(N); i++)
#define repr(i,N) for(long long i = (long long)(N) - 1; i >= 0; i--)
#define rep1(i,N) for(long long i = 1; i <= (long long)(N) ; i++)
#define repr1(i,N) for(long long i = (N) ; (long long)(i) > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; template<class T = ll> using V = vector<T>;
using vi = V<int>; using vl = V<>; using vvi = V< V<int> >;
constexpr int inf = 1001001001; constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif

#define in2(N,s,t) rep(i,N){in(s[i] , t[i]);}
#define in3(N,s,t,u) rep(i,N){in(s[i] , t[i] , u[i]);}
using vd = V<double>; using vs = V<string>; using vvl = V< V<> >;
template<typename T>using heap = priority_queue< T , V<T> , greater<T> >;

using P = pair<int,int>; using vp = V<P>;
constexpr int MOD = /** 1000000007; //*/ 998244353;
//////////////////

void solve(){
  ini(A , B , C);
  if(A == B && B == C) die((A & 1) ? 0 : -1); 
  int ans = 0;
  while(A % 2 == 0 && B % 2 == 0 && C % 2 == 0){
    ans++;
    int D = (A + B) / 2;
    int E = (B + C) / 2;
    int F = (C + A) / 2;
    swap(A , D); swap(B , E); swap(C , F);
  }

  out(ans);

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  cout << setprecision(10);
  string S;
  cin >> S;
  if(S=="Sunny")  cout<<"Cloudy"<<endl;
  if(S=="Cloudy") cout<<"Rainy"<<endl;
  if(S=="Rainy")  cout<<"Sunny"<<endl;
  return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<tuple<string, int, int>> a;
    rep(i,n) {
        string s; int p;
        cin >> s >> p;
        p*=-1;
        a.emplace_back(s, p, i);
    }
    sort(all(a));
    rep(i,n) {
        cout << get<2>(a[i]) + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
A=[list(map(int,input().split())) for _ in range(3)]
n=int(input())
B=[int(input()) for _ in range(n)]

bingo=[[0]*3 for _ in range(3)]
for i in range(n):
  for ai in range(3):
    for aj in range(3):
      if A[ai][aj]==B[i]:
        bingo[ai][aj]=1
flag=False
if bingo[0][0]==bingo[0][1]==bingo[0][2]==1: flag=True
if bingo[1][0]==bingo[1][1]==bingo[1][2]==1: flag=True
if bingo[2][0]==bingo[2][1]==bingo[2][2]==1: flag=True
  
if bingo[0][0]==bingo[1][0]==bingo[2][0]==1: flag=True
if bingo[0][1]==bingo[1][1]==bingo[2][1]==1: flag=True
if bingo[0][2]==bingo[1][2]==bingo[2][2]==1: flag=True
  
if bingo[0][0]==bingo[1][1]==bingo[2][2]==1: flag=True
if bingo[0][2]==bingo[1][1]==bingo[2][0]==1: flag=True
if flag:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
{
  const Main = input => {
    input = input.split("\n")
    let [h, w] = input[0].split(" ").map(v => parseInt(v))

    const list = []
    for (let i = 1; i <= h; i++) {
      list.push(input[i].split(''))
    }

    const result = list.every((raw, rawI) => {
      return raw.every((v, i) => {
        return v === '.' ||
          // 無駄多いけど...
          (list[rawI][i - 1] != null && list[rawI][i - 1] === '#') ||
          (list[rawI][i + 1] != null && list[rawI][i + 1] === '#') ||
          (list[rawI - 1] != null && list[rawI - 1][i] === '#') ||
          (list[rawI + 1] != null && list[rawI + 1][i] === '#')
      })
    })
    if (result) {
      console.log('Yes')
    } else {
      console.log('No')
    }
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


Measured memory_bytes: 29780
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 100000000
#define INFLL 100000000000
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

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

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



int N, K;
string s;
vector<int> a;
vector<int> b;

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

  int pos = 0;
  char now = '1';
  int now_num = 0;

  while (pos != N) {
    char tmp = s[pos];

    if (tmp != now) {
      if (tmp == '0') {
        a.push_back(now_num);
        now = '0';
      } else {
        b.push_back(now_num);
        now = '1';
      }

      now_num = 1;
    } else {
      now_num++;
    }

    ++pos;
  }

  if (now == '0') {
    b.push_back(now_num);
    a.push_back(0);
  } else {
    a.push_back(now_num);
  }

  int n = b.size();
  int ans = 0;

  if (n < K) {
    ans = N; 
  } else {
    int tmp = 0;

    Rep(i, K) {
      tmp += a[i];
      tmp += b[i];
    }
    tmp += a[K];

    ans = tmp;
    //cout << tmp << "\n";

    Rep(j, n-K) {
      tmp -= a[j];
      tmp -= b[j];
      tmp += a[K+1+j];
      tmp += b[K+j];

      //cout << tmp << "\n";

      ans = max(ans, tmp);
    }
  }


  cout << ans << "\n";
}

Measured memory_bytes: 1020
#include <stdio.h>
int main()
{
	long long int a, b, c, d, e, f, g, h;
	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
	e = a * c;
	f = a * d;
	g = b * c;
	h = b * d;
	if (e >= f && e >= g && e >= h)
		printf("%lld\n", e);
	else if (f >= e && f >= g && f >= h)
		printf("%lld\n", f);
	else if (g >= f && g >= e && g >= h)
		printf("%lld\n", g);
	else if (h >= f && h >= g && h >= e)
		printf("%lld\n", h);
	return 0;
}


Measured memory_bytes: 1732
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

ll dp[110][100010];
int v[100010], w[100010];
int main()
{
	int N, W;
	cin >> N >> W;
	for (int i = 0; i < N; i++) {
		cin >> w[i] >> v[i];
	}
	dp[0][0] = 0;
	for (int i = 1; i <= 100000; i++) {
		dp[0][i] = INF;
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= 100000; j++) {
			if (j - v[i] < 0) {
				dp[i + 1][j] = dp[i][j];
			}
			else {
				dp[i + 1][j] = min(dp[i][j], dp[i][j - v[i]] + w[i]);
			}
		}
	}
	int ans = 0;
	for (int i = 0; i <= 100000; i++) {
		if (dp[N][i] <= W) {
			ans = max(ans, i);
		}
	}
	cout << ans << endl;
}

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

using namespace std;

int N, M, dp[1009][1009];
char a[1009][1009];

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d\n", &N, &M);
for (int i=1; i<=N; i++)
    scanf ("%s\n", a[i] + 1);
dp[1][1] = (a[1][1] == '#');
for (int i=1; i<=N; i++)
    for (int j=1; j<=M; j++)
        if (i + j > 2)
        {
            dp[i][j] = N + M + 3;
            if (i > 1 && dp[i - 1][j] + (a[i - 1][j] != a[i][j]) < dp[i][j])
                dp[i][j] = dp[i - 1][j] + (a[i - 1][j] != a[i][j]);
            if (j > 1 && dp[i][j - 1] + (a[i][j - 1] != a[i][j]) < dp[i][j])
                dp[i][j] = dp[i][j - 1] + (a[i][j - 1] != a[i][j]);
        }
int curr = dp[N][M] + (a[N][M] == '#');
assert (curr % 2 == 0);
printf ("%d\n", curr / 2);
return 0;
}


Measured memory_bytes: 768
using System;
class Program
 {
        static void Main(string[] args)
        {
          	string s,t;
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
          	s = str[0];
          	t = str[1];
            Console.WriteLine("{1}{0}", s, t);//改行付き出力
        }
 }

Measured memory_bytes: 13140
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<vector>
#include<set>

using namespace std;

typedef long long ll;
typedef double db;

const int maxn=(int)2e5+9;
const db eps=1e-6;
const int mp=72;

int mx[1009][1009];

int main(){
	int h,w,a,b;
	scanf("%d%d%d%d",&h,&w,&a,&b);
	for(int i=0;i<w;i++){
		for(int j=0;j<b;j++){
			mx[j][i]=1;
		}
	}
	for(int j=0;j<h;j++){
		for(int i=0;i<a;i++){
			mx[j][i]^=1;
		}
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			printf("%d",mx[i][j]);
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 5120
a = list(map(int, input().split()))

i5 = 0
i7 = 0

for i in a:
    if i == 5:
        i5 += 1
    if i == 7:
        i7 += 1
if i5==2 and i7==1:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 2940
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

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

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

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll A, B;
    cin >> A >> B;
    REP(i, 100000){
        if(floor(0.08*i)==A && floor(0.10*i)==B){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;

    return 0;
}


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

int main() {
    int n;
    cin>>n;
    if(n%10==0|| n%10==1||n%10==6||n%10==8){
        cout<<"pon"<<"\n";
    }
    else if(n%10==3){
        cout<<"bon"<<"\n";
    }
    else{
        cout<<"hon"<<"\n";
    }
	return 0;
}


Measured memory_bytes: 3632