akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N (800)

struct edge{
	int to;
	long long dis;
};

bool es[N][N];
vector<int>a;
bool b1[2 * N + 1];
bool b2[2 * N + 1];
int n, m;
vector<int>e[N];
int c[N];
bool v;
int nc;

void col(int k, int d){
	c[k] = d + 1;
	if (d == 0)nc++;
	else nc--;
	d = (d + 1) % 2;
	f(i, e[k].size()){
		if (!v)return;
		if (c[e[k][i]] == 0)col(e[k][i], d);
		else{
			if (c[e[k][i]] != d + 1){
				v = false;
				return;
			}
		}
	}
	return;
}

int main(void){

	int k;
	int x, y;
	long long z;
	long long s, ans;
	scanf("%d %d", &n, &m);
	f(i, N)c[i] = 0;
	f(i, N){
		f(j, N){
			if (i == j)es[i][j] = true;
			else es[i][j] = false;
		}
	}
	f(i, m){
		scanf("%d %d", &x, &y);
		x--;
		y--;
		es[x][y] = true;
		es[y][x] = true;
	}
	f(i, n){
		f(j, n){
			if (!es[i][j])e[i].push_back(j);
		}
	}
	v = true;
	f(i, n)c[i] = 0;
	f(i, n){
		if (v&&c[i] == 0){
			nc = 0;
			col(i, 0);
			a.push_back(nc);
		}
	}
	if (!v){
		printf("-1\n");
		return 0;
	}

	f(i, 2 * N + 1){
		b1[i] = false;
		b2[i] = false;
	}
	b1[N] = true;
	f(i, a.size()){
		f(j, 2 * N + 1)b2[j] = false;
		f(j, 2 * N + 1){
			if (b1[j]){
				b2[j + a[i]] = true;
				b2[j - a[i]] = true;
			}
		}
		f(j, 2 * N + 1)b1[j] = b2[j];
	}
	for (int i = N; i <(N+n+1); i++){
		if (b1[i]){
			k = i - N;
			break;
		}
	}
	x = (n + k) / 2;
	y = (n - k) / 2;
	x = (x*(x - 1)) / 2;
	y = (y*(y - 1)) / 2;
	printf("%d\n", x + y);

	return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <random>
#include <ctime>
#include <sstream>
#include <numeric>
#include <queue>
using namespace std;

int64_t dp(int n, int64_t x, vector<int64_t> &all, vector<int64_t> &p){
    if (x < 1)
    {
        return 0 ;
    }
    int64_t ans ;
    if (x > all.at(n) -2 )
    {
        ans = p.at(n) ;
    }else if (x > all.at(n-1)+1 )
    {
        ans = dp(n-1, x - all.at(n-1) -2, all ,p) + p.at(n-1) + 1 ;
    }else
    {
        ans = dp(n-1, x-1, all, p) ;
    }
    
    return ans ;
    
    
}

int main(){
    int64_t n ;
    int64_t x ;
    cin >> n >> x;
    vector<int64_t> all(n+1) ;
    vector<int64_t> p(n+1) ;
    all.at(0) = 1 ;
    p.at(0) = 1 ;
    for (size_t i = 1; i < n+1; i++)
    {
        all.at(i) = 2 * all.at(i-1) + 3 ;
        p.at(i) = 2 * p.at(i-1) + 1 ;
    }

    int64_t ans = dp(n, x, all, p) ;
    cout << ans << endl ;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A,B;
  cin >> A >> B;
  for(int C = 1;C<=3;C++){
    if((A*B*C) % 2 == 1){
      cout <<"Yes"<<endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
import sys

def solve():
    n = int(raw_input())
    R = []

    for i in xrange(n):
        R.append(int(raw_input()))

    #for i in xrange(n):
    #    print R[i]

    max_profit = -sys.maxint
    min_R = R[0]

    for i in xrange(1, n):
        if R[i] - min_R > max_profit:
            max_profit = R[i] - min_R
        if min_R > R[i]:
            min_R = R[i]

    print max_profit


if __name__ == "__main__":
    solve()

Measured memory_bytes: 12480
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var HA = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
            var H = HA[0];var A = HA[1];
            var count = 0;
            while(H>0)
            {
                H -= A;
                count++;
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char *argv[]) {
	int n;
	cin >> n;
	string s;
	cin >> s;
	int dp[2] = {};
	for (char c : s) {
		int a = dp[0], b = dp[1];
		if (c == '.') {
			dp[0] = a;
			dp[1] = b + 1;
		} else {
			dp[0] = a + 1;
			dp[1] = min(a, b);
		}
	}
	int ans = min(dp[0], dp[1]);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
N = int(input())
L=input().split(' ')
NL = [int(i) for i in L]

counter=0
start = 0
end = N

for i in range(N):
    try:
        index = NL.index(i+1, start, end)
        start = index+1
    except:
        break
    else:
        counter += 1


if(counter == 0):
    print(-1)
else:
    print(N - counter)

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
//const ll INF = 1e18;
const double EPS = 1e-10;
const int MOD = 1e9+7;
const double PI = acos(-1.0);

int main()
{
	int n,m,x;
	cin >> n >> m >> x;
	vector<int> a(110,0);
	for(int i = 0; i < m; i++){
		int aa; cin >> aa;
		a[aa]++;
	}
	int ans1 = 0,ans2 = 0;
	for(int i = 0; i < x; i++){
		if(a[i]) ans1++;
	}
	for(int i = x; i < n; i++){
		if(a[i]) ans2++;
	}
	cout << min(ans1,ans2) << endl;
	return 0;
}

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

using namespace std;



int main(int argc, char *argv[])
{


    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int A, B, K, cnt = 0;
    cin >> A >> B >> K;
    
    if (A > B) {
        swap(A,B);
    }
    
    for (int i = A; i > 0; i--) {
        if (A % i == 0 && B % i == 0) {
            cnt++;
            if (cnt == K) {
                cout << i << endl;
                break;
            }
        }
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include<algorithm>
#include <vector>
#include<stack>
#include<queue>
#include<list>
#include<set>
#include<map>
#include<numeric>
using namespace std;

typedef long long ll;
int modulo = 1000000007; // 10^9 + 7


int main() {
	int N; cin >> N;
	vector<int> v(N);
	for (int i = 0; i < N; i++) cin >> v[i];
	sort(v.begin(), v.end());
	int ans = 0;
	for (int i = 0; i < N - 1; i++) ans += v[i];
	ans += v[N - 1] / 2;
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;

int N, M, R;
int r[10];
int dist[205][205];

int main()
{
    int dp[1 << 10][10];
    int ans = INF;
    fill_n(*dp, 10 * (1 << 10), INF);
    fill_n(*dist, 205 * 205, INF);
    cin >> N >> M >> R;
    for(int i = 0; i < R; i++) { cin >> r[i]; r[i]--; }
    for(int i = 0; i < N; i++) dist[i][i] = 0;
    for(int i = 0; i < M; i++) {
        int a, b, c;
        cin >> a >> b >> c; --a, --b;
        dist[a][b] = dist[b][a] = c;
    }
    for(int k = 0; k < N; k++) {
        for(int i = 0; i < N; i++) {
            for(int j = 0; j < N; j++) {
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }
    for(int i = 0; i < R; i++) dp[1 << i][i] = 0;
    for(int i = 0; i < (1 << R); i++) {
        for(int j = 0; j < R; j++) {
            if(dp[i][j] == INF) continue;
            for(int k = 0; k < R; k++) {
                dp[i | (1 << k)][k] = min(dp[i | (1 << k)][k], dp[i][j] + dist[r[j]][r[k]]);
            }
        }
    }
    for(int i = 0; i < R; i++) ans = min(ans, dp[(1 << R) - 1][i]);
    cout << ans << endl;
    return (0);
}

Measured memory_bytes: 512
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <cstdio>
#include <cmath>
#include <time.h>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n)
#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.begin(),v.end(),greater<int>())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
int n;
int a[100000];
int main() {
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	int ans = 1;
	int st = 0;
	for (int i = 1; i < n; i++) {
		if (st == 0) {
			if (a[i] - a[i - 1] > 0) {
				st = 1;
			}
			else if (a[i] - a[i - 1] < 0) {
				st = 2;
			}
		}
		else if (st == 1) {
			if (a[i] - a[i - 1] < 0) {
				st = 0;
				ans++;
			}
		}
		else {
			if (a[i] - a[i - 1] > 0) {
				st = 0;
				ans++;
			}
		}
	}
	cout << ans << endl;
}

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

int main(){
	int H, W, i, j;
	
	while(1){
		cin >> H >> W;
		if (H == 0 && W == 0){
			break;
		}
		for (i = 0; i < H; i++){
			for(j = 0; j < W; j++){
				if(j == 0 || j == W - 1 || i == 0 || i == H - 1){
					cout << '#';
				}else{
					cout << '.';
				}
			}
			cout << endl;
		}
		cout << endl;
	}
    return 0;
}

Measured memory_bytes: 3064
using System;
using System.Linq;
using System.Collections.Generic;

namespace program
{
    class Program
    {
        static void Main()
        {
          int NN = (int)Math.Pow(Input.ScanInt(),2);
          Console.WriteLine(NN-Input.ScanInt());
        }
    }

    static class Input
    {
        static public int ScanInt() { return int.Parse(Console.ReadLine()); }
        static public uint ScanUint() { return uint.Parse(Console.ReadLine()); }
        static public long ScanLong() { return long.Parse(Console.ReadLine()); }
        static public ulong ScanUlong() { return ulong.Parse(Console.ReadLine()); }
        static public int[] ScanIntArray() { return Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); }
        static public uint[] ScanUintArray() { return Console.ReadLine().Split(' ').Select(x => uint.Parse(x)).ToArray(); }
        static public long[] ScanLongArray() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray(); }
        static public ulong[] ScanUlongArray() { return Console.ReadLine().Split(' ').Select(x => ulong.Parse(x)).ToArray(); }

        static public string ScanStr() { return Console.ReadLine(); }
        static public string[] ScanStrArray() { return ScanStr().Split(' '); }
    }

    static class MyMath
    {
        public static int GCD(int a, int b)
        {
            Func<int, int, int> gcd = null;
            gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
            return a > b ? gcd(a, b) : gcd(b, a);
        }
        public static ulong GCD(ulong a, ulong b)
        {
            Func<ulong, ulong, ulong> gcd = null;
            gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
            return a > b ? gcd(a, b) : gcd(b, a);
        }
        public static int LCM(int a, int b)
        {
            return a * b / GCD(a, b);
        }
        public static ulong LCM(ulong a, ulong b)
        {
            return a * b / GCD(a, b);
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<cassert>
#include<map>
#include<set>

typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP(i,n) for(int i=1;i<=signed(n);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
//#define EVEL 1
#ifdef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const int MOD = 1000000007;
const ll INF = 5000000000000;
//typedef std::pair<int, int> P;
struct edge { int to;double cost; };
#define VMAX 1010

     ll N,K;
     ll A,B,C;
     ll P[11];
     ll ans;
     std::priority_queue<std::pair<ll,string>> Q;
     std::priority_queue<string,vector<string>,greater<string>> Q1;
     std::map<string, ll> M;
int main() {
    cin>>N;
    REP(i,N){
        string s;
        cin>>s;
        M[s]++;
    }
    for(auto x:M){
        DEB(x.first)END
        Q.push({x.second,x.first});
    }
    ll ma=Q.top().first;
    while(!Q.empty()){
        if(Q.top().first==ma)Q1.push(Q.top().second);
        Q.pop();
    }
    while(!Q1.empty()){
        cout<<Q1.top()<<endl;
        Q1.pop();
    }
    //cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 32112
//
//  second.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); i++)
#define rep1(i,n) for(int (i) = 1; (i) <= (int)(n); i++)
#define INF 1000000
#define MOD 998244353



int main()
{
    double R;
    cin >> R;
    
    cout << setprecision(9) << 2*R*M_PI << endl;
    
    
    
    return 0;
}




Measured memory_bytes: 3788
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e15;

int main(){
    string s;
    cin >> s;
    ll n=s.length();
    ll ans=0;
    rep(i,n-1){
        if(s[i+1]!=s[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;


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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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


int main() {
  string S;
  cin >> S;
  S = string("000") + S;
  auto dp = make_v< int >(S.size(), 2);
  fill_v(dp, -1);
  auto rec = MFP([&](auto rec, int idx, int put) -> int {
    if(idx == -1) return put ? inf : 0;
    if(~dp[idx][put]) return dp[idx][put];
    int ret = inf;
    for(int i = 0; i <= 9; i++) {
      int d = i - (S[idx] - '0') - put;
      if(d < 0) {
        chmin(ret, rec(idx - 1, true) + i + (i + 10 - put - (S[idx] - '0')));
      } else {
        chmin(ret, rec(idx - 1, false) + i + d);
      }
    }
    return dp[idx][put] = ret;
  });
  // えっなにこれは......
  for(int i = 0; i < S.size(); i++) rec(i, 0);
  for(int i = 0; i < S.size(); i++) rec(i, 1);
  cout << rec(S.size() - 1, 0) << endl;
}




Measured memory_bytes: 55880
n,h=map(int,input().split())
a=[0]*n
b=[0]*n
maxa=0
minb=10**9+1
for i in range(n):
  a[i],b[i]=map(int,input().split())
  maxa=max(maxa,a[i])
for i in range(len(b)):
  if b[i]<maxa:
    b[i]=0
b=sorted(b)[::-1]
ans=0
for i in range(len(b)):
  if b[i]==0:
    break
  h-=b[i]
  ans+=1
  if h<=0:
    print(ans)
    exit(0)
print(ans+h//maxa+(h%maxa!=0))

Measured memory_bytes: 12532
#include <bits/stdc++.h>
#include <set>
using namespace std;
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define fill(x, y)     memset(x, y, sizeof(y))
#define all(x)         (x).begin(), (x).end()
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;

const int INF = 1e9 + 5;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vi h(N+1);
  h[0] = INF;
  for (int i = 1; i <= N; i++) {
    cin >> h[i];
  }
  vi dp(N, 0);
  dp[0] = 0;
  dp[1] = 0;
  for (int i = 2; i <= N; i++) {
    dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]));
  }
  cout << dp[N] << "\n";
  
  return 0;
}

Measured memory_bytes: 3952
s = input()[::-1]
a = 'maerd'
b = 'remaerd'
c = 'esare'
d = 'resare'
lens = len(s)
cnt = 0
while(cnt < lens):
  if s[cnt:cnt+5] == a or s[cnt:cnt+5] == c:
    cnt += 5
  elif s[cnt:cnt+6] == d:
    cnt += 6
  elif s[cnt:cnt+7] == b:
    cnt += 7
  else:
    print('NO')
    exit()
print('YES')

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MAX_N = 100010;
const ll mod = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/
int main(){
    int x, y; cin >> x >> y;

    for(int i = 0; i <= 100; i++){
        if(2 * i == 4 * x - y and 0 <= x - i){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3648
import kotlin.math.*
import java.util.*

fun main(args: Array<String>) {
  val (_, m) = readLine()!!.split(' ').map(String::toInt)
  val a = readLine()!!.split(' ').map(String::toDouble)
  val b = a.sum() / (4 * m)
  println(if (m <= a.count { b <= it }) "Yes" else "No")
}


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

int main() {
  
  int N; cin >> N;
  
  for (int i = 1; i <= N; i++) {
    
    double p = i * 1.08;
    
    if (int(p) == N) {
      cout << i << endl;
      return 0;
    }
    
  }
  
  cout << ":(" << endl;
  
}

Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
 
int a,b;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>a>>b;
	if(max(a,b) * 2 <= 14)
		cout<<"Yay!";
	else{
		if(abs(a-b) > 1)
			cout<<":(";
		else
			cout<<"Yay!";
	}
	return 0;
}

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

int f(int x) {
    int a = 0, i = 1;
    while (x) {
        a += (x % 10);
        x /= 10;
    }
    return a;
}

int main() {
    int n, a, b, sum = 0;
    cin >> n >> a >> b;
    rep(i, n+1) {
        if (a <= f(i) && f(i) <= b) {
            sum += i;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const double INF = 1e10;
const double EPS = 1e-10;
int N;
ll xs, ys, xt, yt;
ll x[1010], y[1010], r[1010];
double cost[1010][1010];
double dis[1010];

double calcCost(int s, int t) {
  double d = hypot(x[s]-x[t], y[s]-y[t]);
  return max(0.0, d - r[s] - r[t]);
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> xs >> ys >> xt >> yt >> N;
  for (int i = 0; i < N; i++) {
    cin >> x[i] >> y[i] >> r[i];
  }
  x[N] = xs; y[N] = ys; r[N] = 0;
  x[N+1] = xt; y[N+1] = yt; r[N+1] = 0;
  
  for (int i = 0; i < N+2; i++) {
    for (int j = 0; j < N+2; j++) {
      cost[i][j] = calcCost(i, j);
    }
  }
  fill_n((double*)dis, 1010, INF);
  dis[N] = 0;
  using P = pair<double, int>;
  priority_queue<P, vector<P>, greater<P>> que;
  que.emplace(0, N);
  while (!que.empty()) {
    double d;
    int cur;
    tie(d, cur) = que.top(); que.pop();
    if (d + EPS < dis[cur]) continue;
    for (int i = 0; i < N+2; i++) {
      if (i == cur) continue;
      if (dis[i] > dis[cur] + cost[cur][i]) {
        dis[i] = dis[cur] + cost[cur][i];
        que.emplace(dis[i], i);
      }
    }
  }
  cout << dis[N+1] << endl;

  return 0;
}

Measured memory_bytes: 14448
a,b,c,k=map(int,input().split())
'''l=[]
for _ in range(a):
    l.append(1)
for _ in range(b):
    l.append(0)
for _ in range(c):
    l.append(-1)
print(sum(l[:k]))'''
su=0
if a>=k:
    print(k)
else:
    su=su+a
    tem=k-a
    if b>=tem:
        print(su)
    else:
        tem1=tem-b
        print(su-tem1)

Measured memory_bytes: 9120
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int member = in.nextInt();
		int sum,cnt = 0;
		int[][] num = new int [member][3];
		for(int i = 0;i < member;i++){
			for(int j = 0;j < 3;j++){
				num[i][j] = in.nextInt();
			}
		}
		for(int k = 0;k < 3;k++){
			for(int i = 0;i < member;i++){
				for(int j = 0;j < member;j++){
					if(i == j){
						if(j == member-1)break;
						else j++;
					}
					if(num[i][k] == num[j][k]){
						num[j][k] = 0;
						cnt++;
					}
				}
				if(cnt > 0)num[i][k] = 0;
				cnt = 0;
			}
		}
		for(int i = 0;i < member;i++){
			sum = num[i][0] + num[i][1] + num[i][2];
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 20832
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
typedef long long ll;

#define MAX_N 200000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

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

//--------------------------

int main() {

  ll n, m;
  cin >> n >> m;
  ll a[m];
  rep(i, m) {
    cin >> a[i];
    n-=a[i];
  }

  if(n>=0) cout << n << endl;
  else cout << -1 << endl;

  return 0;
}


Measured memory_bytes: 3716
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  int t,x;
  cin >> t >> x;
  printf("%.5f\n",(double)t/x);
  return 0;
}


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

int main()
{
  string s;
  cin >> s;
  if ((s[0] == s[1] && s[1] == s[2]) || (s[1] == s[2] && s[2] == s[3])) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

int Arr[50] = {0};

void arr_output(void)  {
  int k;
  for ( k = 0; k < 50; k++ ){
    printf("%d ", Arr[k]);
  }
  puts("");
}

void arr_init(int n) {
  int k;
  for ( k = 0; k < n; k++  ) {
    Arr[k] = n - k;
  }

}

void shuffle(int n, int start, int num) {
  int k1, k2;
  int m = 0;
  int swap[50] = {0};
  int end = start+num;

  for ( k1 = start; k1 < end; k1++ ){
    swap[m] = Arr[k1];
    m++;
  }

  m = end-1;

  for ( k1 = start-1; k1 >= 0; k1-- ) {
    Arr[m] = Arr[k1];
    m--;
  }


  for ( k1 = 0; k1 < num; k1++ ){
    Arr[k1] = swap[k1];
  }
}

int main(void) {
  int n, r;
  int p, c;
  int k;

  while ( 1 ) {
    scanf("%d %d", &n, &r);

    arr_init(n);

    if ( !n && !r ) { break; }

    for ( k = 0; k < r; k++ ) {
      scanf("%d %d", &p, &c);

      shuffle (n, p-1, c);
    }
    printf("%d\n", Arr[0]);

  }

  return 0;
}

Measured memory_bytes: 600
#define MAXP 998244353
#include<bits/stdc++.h>

using namespace std;

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

void fastio() {
	ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
}

int main() {
	fastio();
	int a, b, c;
	cin >> a >> b >> c;
	for (int i=b; i<=c; i++) {
		if (i%a == 0) {
			printf("OK");
			return 0;
		}
	}
	printf("NG");
	return 0;
}

Measured memory_bytes: 3708
using System;

public static class Program
{
    public static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var woodNum = int.Parse(input[0]);
        var canKanshi = (int.Parse(input[1]) * 2) + 1;
        var result = 0;
        Amari(ref result, woodNum, canKanshi);
        Console.WriteLine(result);
    }

    public static void Amari(ref int result, int warareru, int waru)
    {
        result++;
        if (warareru <= waru)
        {
            return;
        }
        else
        {

        }
       var yojyou = warareru - waru;
        Amari(ref result ,yojyou,waru);
    }
}

Measured memory_bytes: 11220
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#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 {
#ifdef LOCAL
~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__) << "] "
typedef long long ll;

ll mod = 998244353;

void solve()
{
	int n,s;
	cin>>n>>s;
	vector<int> a(n+1);
	for (int i=1; i<=n; i++) {
		cin>>a[i];
	}
	vector<vector<ll>> dp(n+1, vector<ll> (s+1));
	dp[0][0] = 1;
	for (int i=1; i<=n; i++) {
		for (int j=0; j<=s; j++) {
			dp[i][j] = (dp[i][j] + 2*dp[i-1][j])%mod;
			if (j+a[i]<=s) {
				dp[i][j + a[i]] = (dp[i][j + a[i]] + dp[i-1][j])%mod;
			}
		}
	}
	debug() << imie(dp);
	cout << dp[n][s] << "\n";
}

int main()
{
	int t=1;
	// cin>>t;
	while (t--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 73744
import collections as cl
N, M = map(int, input().split())
dic = cl.defaultdict(lambda:-1)
num = 0
for i in range(0, M):
    s, c = map(int, input().split())
    if N - s in dic and dic[N-s] != c:
        print(-1)
        exit(0)
    else:
        dic[N-s] = c
if dic[N-1] == -1:
    if N == 1:
        dic[N-1] = 0
    else:
        dic[N-1] = 1
for j in dic.keys():
    num += dic[j] * (10 ** j)
if N > 1 and num < 10 ** (N - 1):
    print(-1)
else:
    print(num)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
int main(){
	int a,b,r=0;double x=0,y=0;
	while(scanf("%d,%d",&a,&b),a||b){
		x+=a*cos(r*M_PI/180.0);
		y+=a*sin(r*M_PI/180.0);
		r+=b;
	}
	printf("%d\n%d\n",(int)y,(int)x);
}

Measured memory_bytes: 3580
# A - ∴ (Therefore)
def main():
    N = int(input())
    if N % 10 in {2, 4, 5, 7, 9}:
        print("hon")
    elif N % 10 in {0, 1, 6, 8}:
        print("pon")
    else:
        print("bon")


if __name__ == "__main__":
    main()


Measured memory_bytes: 9108
#include <iostream>
#include <iomanip> // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple> // get<n>(xxx)
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set> // S.insert(M);
// if (S.find(key) != S.end()) { }
// for (auto it=S.begin(); it != S.end(); it++) { }
// auto it = S.lower_bound(M);
#include <random> // random_device rd; mt19937 mt(rd());
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib> // atoi(xxx)
using namespace std;
 
#define DEBUG 0 // change 0 -> 1 if we need debug.
// insert #if<tab> by my emacs. #if DEBUG == 1 ... #end
 
typedef long long ll;
 
const int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
 
// const int C = 1e6+10;
// const ll M = 1000000007;
 
int H, W;
string S[100];
 
int valid(int x, int y) {
  if (0 <= x && x < H && 0 <= y && y < W && S[x][y] == '#') {
    return 1;
  } else {
    return 0;
  }
}
 
int main () {
  cin >> H >> W;
  for (auto i = 0; i < H; ++i) {
    cin >> S[i];
  }
  for (auto i = 0; i < H; ++i) {
    for (auto j = 0; j < W; ++j) {
      if (S[i][j] == '.') {
        int cnt = 0;
        for (auto k = 0; k < 8; ++k) {
          int nx = i + dx[k];
          int ny = j + dy[k];
          cnt += valid(nx, ny);
        }
        S[i][j] = (char)('0' + cnt);
      }
    }
  }
  for (auto i = 0; i < H; ++i) {
    cout << S[i] << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

ll fac[200007],finv[200007],inv[200007];
void cominit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<200007;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
ll com(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}


///////modint
struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cominit();
    ll n, k; 
    cin >> n >> k;
    vector<mint> sum(k+1, 0);
    for(int i=0;i<=k;i++){
    	if(i) sum[i] += sum[i-1];
    	sum[i] += finv[i] * (i&1? -1: 1);
    }
    mint ans = 0;
    for(ll i=0;i<=k;i++){
    	ans += sum[k-i] * finv[i] * modpow(i, n);
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 7916
n,q=gets.split.map(&:to_i)
t=Array.new(n){[]}
(n-1).times{a,b=gets.split.map(&:to_i);a-=1;b-=1;t[a]<<b;t[b]<<a}
o=Array.new(n,0)
q.times{i,x=gets.split.map(&:to_i);o[i-1]+=x}
q=[[0,0]];a=[]
while !q.empty?;d,c=q.shift;a[d]=c+o[d];t[d].map{|b|q<<[b,c+o[d]]if !a[b]}if !t[d].empty?;end
puts a


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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) (a).begin(),(a).end()
int cnt;
void buble_sort(int a[], int n){
    int flag = 1;
    while(flag){
        flag = 0;
        for(int j=n-1;j>0;j--)if(a[j] < a[j-1]){
            swap(a[j], a[j-1]);
            cnt++;
            flag = 1;
        }
    }
}

int main(){
    int n;
    cin >> n;
    int r[n];
    rep(i,n)cin >> r[i];
    buble_sort(r, n);
    rep(i,n){
        cout << r[i];
        if(i < n-1)printf(" ");
        else printf("\n");
    }
    cout << cnt << endl;
    return 0;
}


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

//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
typedef pair<int, int> P;
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
//const ll INF = LONG_LONG_MAX / 100;
//const ll INF = (1ll << 31) - 1;
const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
//typedef pair<int, int> P;
//typedef pair<double, double> P;

bool contain(set<ll> &s, ll a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
const int mod = 1000000007;
typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;


ll gcd(ll x, ll y) {
    if (x > y) swap(x, y);
    ll m = 1;
    while (m != 0) {
        m = y % x;
        y = x;
        x = m;
    }
    return y;
}

int main() {
    ll n, x;
    cin >> n >> x;

    vector<ll> numbers(n);
    rep(i, n) cin >> numbers[i];
    rep(i, n) numbers[i] = abs(x - numbers[i]);

    ll ans = numbers.front();
    rep(i, n) ans = gcd(ans, numbers[i]);
    cout << ans << endl;

}



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

int main() {
  int64_t n, ans=0;
  cin >> n;
  int64_t a[n+1];
  map<int64_t, int64_t> m;
  for(int64_t i=1; i<=n; i++){
    cin >> a[i];
    if(!m.count(a[i]+i)) m[a[i]+i]=1;
    else m[a[i]+i]++;
    if(m.count(-a[i]+i)) ans+=m[-a[i]+i];
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 17552
from collections import deque


def i_to_b(n, N):
    A = [0] * N
    for i in range(N):
        A[i] = (n // 2**i) % 2
    return A


def b_to_i(A):
    ret = 0
    for i in range(len(A)):
        ret += i**2*A[i]
    return ret


def rm_bit(n, i):
    return n // (2**(i+1)) * (2**i) + (n % (2**i))


def ins_bit(n, i, b):
    return n // (2**i) * (2**(i+1)) + (n % (2**i)) + b * (2**i)


def solve(N, A, B):
    if N == 1:
        return [A, B]
    idx = -1
    for i in range(N):
        if (A ^ B) & (2**i):
            idx = i
            break
    ra = rm_bit(A, idx)
    rb = rm_bit(B, idx)
    a = list(map(lambda x: ins_bit(x, idx, (A >> idx) & 1), solve(N-1, ra, ra ^ 1)))
    b = list(map(lambda x: ins_bit(x, idx, (B >> idx) & 1), solve(N-1, ra ^ 1, rb)))
    return a + b


def main():
    N, A, B = map(int, input().split())
    binA = i_to_b(A, N)
    binB = i_to_b(B, N)
    if abs(sum(binA) - sum(binB)) % 2 == 0:
        print("NO")
        return
    print("YES")
    print(*solve(N, A, B))


if __name__ == "__main__":
    main()


Measured memory_bytes: 66004
#include <bits/stdc++.h>
using namespace std;
int main() {
  string N;
  cin >> N;
  string ans = "No";
  for (int i = 0; i < 3; i++) {
    if (N.at(i) == '7') {
      ans = "Yes";
      break;
    }
  }
  cout << ans << endl;
}

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

using namespace std;

int main() {
  
  int N;
  while(cin >> N && N) {
    
    vector<pair<int, int> > v1, v2;
    
    for(int i=0; i<N; i++) {
      int h, r; cin >> h >> r;
      v1.push_back(make_pair(h, r));
    }

    int M; cin >> M;
    
    for(int i=0; i<M; i++) {
      int h, r; cin >> h >> r;
      v1.push_back(make_pair(h, r));
    }
    
    sort(v1.begin(), v1.end());
    
    int size = N+M;
    int dp1[size];
    int ans = 1;
    for(int i=0; i<size; i++) {
      dp1[i] = 1;
      for(int j=0; j<i; j++)
        if(v1[i].first > v1[j].first &&
           v1[i].second > v1[j].second) { dp1[i] = max(dp1[i], dp1[j]+1); }
      ans = max(ans, dp1[i]);
    }
    
    cout << ans << endl;
    
  }
  
  return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count = 0;
  for(int i = 0;i < 3;i++) {
    if(s.at(i) == 'o') {
      count++;
    }
  }
  cout << 700 + count * 100 << endl;
}

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

using namespace std;

void solve(){
    int n;
    cin >> n;
    vector<int> d(n);
    for(auto&& i : d){
        cin >> i;
    }
    sort(begin(d), end(d));
    cout << d[n / 2] - d[n / 2 - 1] << "\n";
}

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

Measured memory_bytes: 640
card = []

for _ in range(3):
  card.append(list(map(int, input().split())))
  
N = int(input())

for _ in range(N):
  b = int(input())
  for i in range(3):
    for j in range(3):
      if card[i][j] == b:
        card[i][j] = -1
        
def bingo(card):
  for row in card:
    if all(x == -1 for x in row):
      return True
  
  for j in range(3):
    if card[0][j] == -1 and card[1][j] == -1 and card[2][j] == -1:
      return True
    
  if card[0][0] == -1 and card[1][1] == -1 and card[2][2] == -1:
    return True
  
      
  if card[0][2] == -1 and card[1][1] == -1 and card[2][0] == -1:
    return True

  return False

if bingo(card):
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  
  ll N;
  ll Y;
  cin >> N >> Y;
  bool flag=0;
  ll a,b,c;
  for (ll i=0;i<=Y/10000;i++){
    for (ll j=0; j<=Y/5000; j++){
      if (9000*i+4000*j+1000*N==Y && i+j<=N){
        flag=1;
        a=i;
        b=j;
        break;
      }
 
    }
  }
  
  if (flag) cout << a << " "<< b <<" " << N-a-b << endl;
  else cout << -1 << " " << -1 <<" " << -1 << endl;
	
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
   int d[10],i,j,tmp;
   for(i=0;i<10;i++)
        cin >> d[i]; 
   for(i=0;i<9;i++)
     {
        for(j=i+1;j<10;j++)
          { 
             if(d[i]<d[j])
                {
                   tmp=d[i];
                   d[i]=d[j];
                   d[j]=tmp;
                }
           }
     }
    for(i=0;i<3;i++)
       cout << d[i] <<endl;
    return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main(){

    while(1){
        int h,w;
        scanf("%d %d",&h,&w);
    //int rect[h][w];
        if(h == 0 && w == 0){break;}
        
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){

                printf("#");
            }
            printf("\n");
        }
            printf("\n");
    }

}


Measured memory_bytes: 2140
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value != 0>::type
fill_v(U& u, const V... v) { u = U(v...); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value == 0>::type
fill_v(U& u, const V... v) { for (auto& e : u) fill_v<T>(e, v...); }
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 (a > b) { a = b; return 1; } return 0; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int r;
	cin >> r;
	cout << 3 * r * r << endl;
	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 m = sc.nextInt();
        int n = sc.nextInt();

        int res = (m - 1) * m / 2 + (n - 1) * n / 2;

        System.out.println(res);
    }
}

Measured memory_bytes: 23124
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;

using Graph = vector<vector<int>>;

int main()
{
    int n, x, y;
    cin >> n >> x >> y;
    x--;
    y--;
    vector<int> ans(n, 0);

    vector<vector<int>> a(n, vector<int>());
    for (int i = 0; i < n; i++)
    {
        if (i == 0)
        {
            a[i].push_back(i + 1);
        }
        else if (i == n - 1)
        {
            a[i].push_back(i - 1);
        }
        else
        {
            a[i].push_back(i - 1);
            a[i].push_back(i + 1);
        }
    }
    a[x].push_back(y);
    a[y].push_back(x);

    for (int v = 0; v < n; v++)
    {
        queue<int> que;
        vector<int> dist(n, -1);
        que.push(v);
        dist[v] = 0;
        while (!que.empty())
        {
            int v = que.front(); // キューから先頭頂点を取り出す
            que.pop();

            // v から辿れる頂点をすべて調べる
            for (int nv : a[v])
            {
                if (dist[nv] != -1)
                    continue; // すでに発見済みの頂点は探索しない

                // 新たな白色頂点 nv について距離情報を更新してキューに追加する
                dist[nv] = dist[v] + 1;
                que.push(nv);
            }
        }
        for (int i = 0; i < n; i++)
        {
            ans[dist[i]]++;
        }
    }
    for (int i = 1; i < n; i++)
    {
        cout << ans[i] / 2 << endl;
    }

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
//const ll MOD=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);
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 (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};


void solve(int ca){
    ll a,v,b,w,t; cin>>a>>v>>b>>w>>t;

    if(v<=w){
        cout<<"NO"<<endl;
        return;
    }

    if((v-w)*t>=abs(a-b)){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }

}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define db double
#define ld long double
#define IOS  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#pragma GCC optimize(2)
#define ull unsigned long long
#define maxn 200005
ll lcm(ll a,ll b){return a*b/__gcd(a,b);}
void dfs(){}
int l[maxn],r[maxn];
signed main()
{
    IOS
    int n,k,c;
    string s;
    cin>>n>>k>>c;
    cin>>s;
    int cnt=0;
    memset(l,-1, sizeof(l));
    memset(r,-1, sizeof(r));
    for (int i = 0; i <n&&cnt<k ; ++i) {
        if(s[i]=='x')continue;
        else{
            l[cnt++]=i;
            i+=c;
        }
    }
    cnt=k-1;
    for (int j = n-1; j >=0&&cnt>=0 ; --j) {
        if(s[j]=='x')continue;
        else{
            r[cnt--]=j;
            j-=c;
        }
    }
    for (int m = 0; m <k ; ++m) {
        if(l[m]==r[m]&&l[m]!=-1)cout<<l[m]+1<<endl;
    }
    return 0 ;
}


Measured memory_bytes: 3348
import math
a, b, c = map(float, input().split())
deg = math.radians(c)
h = b * abs(math.sin(deg))
S = 0.5 * a * h

L = math.sqrt((b * math.sin(deg))**2 + (b * math.cos(deg) - a)**2) + a + b

print(S)
print(L)
print(h)



Measured memory_bytes: 5696
# -*- coding: utf-8 -*-

N, X, Y = map(int, input().split())

mid = (X + Y + 1) * 0.5

# GUCHOKU

ans = [0] * N

for i in range(1, N):
    for j in range(i, N + 1):
        # (i, j)について距離を調べる
        # if j >= mid:
        #    dis = X - i + 1 + abs(j - Y)
        # else:
        #    j - i
        dis = min(abs(i - X) + abs(j - Y) + 1, j - i)
        ans[dis] += 1

print(*ans[1:], sep='\n')


Measured memory_bytes: 3444
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll x,sum=0,tmp;
  cin >> x;
  tmp = x/500;
  sum += tmp*1000;
  x%=500;

  tmp = x/5;
  sum += tmp*5;
  
  cout << sum << endl;
}


Measured memory_bytes: 256