akhauriyash/Code-Regression huggingface dataset:
// SmartCoder
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define oo INT_MAX
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007

const double pi = acos(-1.0);
const double eps = 1e-11;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

int main() {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, a;
    cin >> n;
    bool res = true;
    for (int i = 0; i < n; i++) {
        cin >> a;
        if (a % 2 != 0) continue;
        res &= (a % 2 == 0 && (a % 3 == 0 || a % 5 == 0));
    }
    cout << (res ? "APPROVED" : "DENIED") << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main () {
  ll X, K, D;
  cin >> X >> K >> D;
  X = abs(X);
  ll k = min(K, X/D);
  X -= k*D;
  K -= k;
  if (K & 1) X = D-X;
  cout << X << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long N;
    cin>>N;
    long long a[N]={0};
    long long b[N]={0};
    long long c[N]={0};
    for(long long i=0;i<N;i++){
    cin>>a[i];}
    for(long long i=0;i<N;i++){
    cin>>b[i];}
    for(long long i=0;i<N;i++){
    cin>>c[i];}
    sort(a,a+N);
    sort(b,b+N);
    sort(c,c+N);
    long long counter=0;
    long long acount=0;
    long long ccount=0;
    for(long long i=0;i<N;i++){
    acount=lower_bound(a, a + N, b[i]) - a;
    ccount=c+N - upper_bound(c, c + N, b[i]);
    counter+=acount*ccount;}
    

    
    cout << counter << endl; // 10 (場外)
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#define FOR(i, j, k, in) for (int i=j ; i<(k) ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=(k) ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define REP1(i,j) FOR(i, 1, j+1, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define ALL(_a) _a.begin(),_a.end()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define X first
#define Y second
#ifdef tmd
#define TIME(i) Timer i(#i)
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,deque<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
class Timer {
private:
    string scope_name;
    chrono::high_resolution_clock::time_point start_time;
public:
    Timer (string name) : scope_name(name) {
        start_time = chrono::high_resolution_clock::now();
    }
    ~Timer () {
        auto stop_time = chrono::high_resolution_clock::now();
        auto length = chrono::duration_cast<chrono::microseconds>(stop_time - start_time).count();
        double mlength = double(length) * 0.001;
        debug(scope_name, mlength);
    }
};
#else
#define TIME(i)
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
#endif

const ll MOD = 1000000007;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int iNF = 0x3f3f3f3f;
const ll MAXN = 200005;

int n;
ll a[MAXN], sum;
/********** Good Luck :) **********/
int main () {
    TIME(main);
    IOS();

    cin >> n;
    REP (i, n) {
        cin >> a[i];
        sum += a[i];
    }

    ll ans = INF;
    ll pre = 0;
    REP (i, n-1) {
        pre += a[i];
        ans = min(ans, abs((sum-pre)-pre));
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

bool func(int k, vector<int> w, int p){
  int j = 0;
  for(int i=0; i<k; i++){
    int sum = 0;
    while( sum + w[j] <= p ){
      sum += w[j];
      j++;
      if( j >= w.size() ) return true;
    }
  }
  return j >= w.size();
}

int main(void) {

  int n, k;
  cin >> n >> k;
  vector<int> w(n);
  for(int i=0; i<n; i++) cin >> w[i];

  long long int l = 0, r = n * 10000;
  while( r - l > 1 ){
    int m = (l + r) / 2;

    if( func(k, w, m) ) r = m;
    else l = m;
  }
  cout << r << endl;

  return 0;
}

// EOF

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;

int main(){
  int n;
  cin >> n;
  ll all = 1, no1or9 = 1, no1and9 = 1;
  for(int i=0; i<n; ++i){
    all *= 10;
    all %= MOD;
    no1or9 *= 9;
    no1or9 %= MOD;
    no1and9 *= 8;
    no1and9 %= MOD;
  }
  ll ans = all -no1or9 *2 +no1and9;
  while(ans < 0) ans += MOD;
  ans %= MOD;
  cout << ans << endl;
}

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

const int INF = 1e9+7;
typedef pair<int,int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int H,W,i,j,c=0;
    cin >> H >> W;
    vector<string> f(H);
    queue<P> q;
    vector<vector<int>> d(H, vector<int>(W, INF));

    for(i=0; i<H; i++) {
        cin >> f.at(i);
        for(j=0; j<W; j++)
            if(f.at(i).at(j) == '.')
                c++;
    }
    
    q.push(P(0,0));
    d.at(0).at(0) = 0;

    while(!q.empty()) {
        P p = q.front();
        q.pop();
        if(p.first+p.second == H+W-2)
            break;

        for(i=0; i<4; i++) {
            int nx=p.first+dx[i], ny=p.second+dy[i];
            if(nx<0 || nx>=H || ny<0 || ny>=W)
                continue;
            if(f.at(nx).at(ny)=='.' && d.at(nx).at(ny)==INF) {
                q.push(P(nx,ny));
                d.at(nx).at(ny) = d.at(p.first).at(p.second)+1; 
            }
        }
    }

    if(d.at(H-1).at(W-1) == INF)
        cout << -1;
    else
        cout << c-d.at(H-1).at(W-1)-1;
    cout << endl;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
h=[0 for _ in range(n)]
for i in range(n):
    h[i]=int(input())
h.sort()
m=sum(h)
for i in range(n-k+1):
    m=min(h[i+k-1]-h[i],m)
print(m)    



Measured memory_bytes: 7432
#include <cstdio>

int N;
char s[100];
int f[30], a[30];

int main() {
    scanf("%d", &N);
    for (int i = 0; i < 26; i++) a[i] = 1e9;
    for (int n = 0; n < N; n++) {
        scanf(" %s", s);
        for (int i = 0; s[i]; i++) {
            f[s[i]-'a']++;
        }
        for (int i = 0; i < 26; i++) {
            if (f[i] < a[i]) a[i] = f[i];
            f[i] = 0;
        }
    }
    for (int i = 0; i < 26; i++) for (int j = 0; j < a[i]; j++) printf("%c", i+'a');
    printf("\n");
}

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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define FOR(i, start, end) for(int i = (start); i < (end); i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int M; cin >> M;
    cout << 48 - M << endl;
}

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}

Measured memory_bytes: 256
import math
x1,y1,x2,y2 = map(int, input().split())
dx=x2-x1
dy=y2-y1
x3 = x2-dy
y3 = y2+dx
x4 = x3-dx
y4 = y3-dy
print("{} {} {} {}".format(x3, y3, x4, y4))

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

#define MaxN 300005
#define INF 2140000000

using namespace std;

int N,v[MaxN],S,L,fr[MaxN],s[MaxN];
long long Ans;
int main()
{
    cin>>N;
    for(int i=1;i<=N;i++)
        cin>>s[i];
    S=0;
    v[0]=-1;
    for(int i=1;i<=N;i++)
    {
        if(s[i]==0)
        {
            if(v[S]!=0)
            {
                v[++S]=0;
                fr[S]=1;
            }
            else fr[S]++;
        }
        else v[++S]=s[i],fr[S]=1;
    }
    N=S;
    for(int i=1;i<=N;i++)
    {
        long long Add=0;
        int XOR=v[i]^v[i+1],SUM=v[i]+v[i+1],p=1;
        while(XOR==SUM&&i+p<=N)
        {
            Add+=fr[i+p];
            Ans+=fr[i+p];
            p++;
            XOR^=v[i+p];
            SUM+=v[i+p];
        }
        Ans+=1LL*fr[i]*(fr[i]+1)/2;
        Add+=1LL*fr[i]*(fr[i]+1)/2;
        if(v[i-1]==0)
            Ans+=1LL*(fr[i-1]-1)*Add;
    }
    cout<<Ans;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
using ll = long long;


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int R, G, B, N; 
    int ans = 0;
    cin >> R >> G >> B >> N;
    for (int i = 0; i <= N/R; i++) {
        for (int j = 0; j <= N/G; j++) {
            int need = (N - i*R - j*G)/B;
            if (0 <= need && i*R + j*G + need*B == N) {
                //cout << i << ' ' << j << ' ' << need << '\n';
                ans++;
            }
        }
    }
    cout << ans << '\n';

    return 0;
}



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

int main(){
    int n,m,a,h,p,q;
    while(cin>>n>>m>>a,n){
        vector<pair<int, int> > v;
        vector<vector<pair<int,int> > > vec;
        for(int i=0;i<n+2;i++)vec.push_back(v);
        for(int i=0;i<m;i++){
            cin>>h>>p>>q;
            vec[p].push_back(make_pair(h,q));
            vec[q].push_back(make_pair(h,p));
        }
        for(int i=0;i<n+2;i++)
            sort(vec[i].begin(),vec[i].end());
        int mh=1001;
        while(mh>0){
            for(long i=vec[a].size()-1;i>=0;i--){
                if(vec[a][i].first==mh){
                    a=vec[a][i].second;
                    break;
                }
                else if(vec[a][i].first<mh)break;
            }
            mh--;
        }
        cout<<a<<endl;
    }
}

Measured memory_bytes: 1244
#include <iostream>
#include <string>
#include <strstream>

using namespace std;

int main() {
	string a, b;

	cin >> a >> b;

	if (a.size() > b.size()) {
		cout << "GREATER" << endl;
	}
	else if (a.size() < b.size()) {
		cout << "LESS" << endl;
	}
	else if (a.size() == b.size()) {
		for (int i = 0; i <(int) a.size(); i++) {
			if (a[i]-'0' > b[i]-'0') {
				cout << "GREATER" << endl;
				break;
			}
			else if (a[i]-'0' < b[i]-'0') {
				cout << "LESS" << endl;
				break;
			}
			else if (i ==(int) a.size()-1 && a[i]-'0' == b[i]-'0') {
				cout << "EQUAL" << endl;
				break;
			}
		}
	}
}


Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
//typedef tuple<pii,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	int out=0;
	vi in(n);
	rep(i,n)cin>>in[i];
	sort(all(in));
	rep(i,n){
		int a=in[n-1-i];
		if(i%2==0)out+=a;
		else out-=a;
	}
	cout<<out<<endl;
}








Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
using namespace std;
int main(){
string s;cin>>s;int ok=0;
if(s[0]!=s[1]&&s[1]!=s[2]) ok=1;
else if(s[0]!=s[1]&&s[0]!=s[2]) ok=1;
else if(s[2]!=s[1]&&s[2]!=s[0]) ok=1;
if(ok) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}


Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int a = Integer.parseInt(stdin.next());
		String s = stdin.next();
		
		if(a>=3200) {
			out.println(s);
		}
		else {
			out.print("red");
		}
		
		out.flush();
	}
	
}

Measured memory_bytes: 21204
import java.util.Scanner;

class Main{
	public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
	        String str1 = sc.next();  
			String moji = str1.toUpperCase();
        	if(str1 == moji){
            	System.out.println("A");
            }else{
            	System.out.println("a");
            }
    }
}

Measured memory_bytes: 35668
import math
def dis(a,b,D):
  t = 0
  for i in range(D):
    t += (a[i] -b[i])**2
  t = t**0.5
  return t
N,D = map(int,input().split())
X = []
C =[]
for i in range(N):
  X.append(list(map(int,input().split())))
for i in range(N-1):
  for j in range(i+1,N):
    C.append(dis(X[i],X[j],D))
ans = 0
for i in C:
  if math.floor(i) == math.ceil(i):
    ans += 1
print(ans)


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

int main() {
  int N, A, d = 9999999999999;
  cin >> N;
  for (int i = 0; i < N; i++){
    cin >> A;
    int b = 0, c = 1;
    for (int j = 0; c > 0; j++){
      if (A % 2 == 0){
        A /= 2;
        b++;
      }
      else{
        c -= 2;
      }
    }
    if (b < d){
      d = b;
    }
  }
  cout << d << endl;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  float N, K;
  cin >> N >> K;
  cout << ceil(N / K) - floor(N / K) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = INT_MAX;
const ll LLINF = INT64_MAX;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

ll dp[50];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    dp[0] = 1;
    dp[1] = 1;
    for (ll i = 2; i <= n; i++)
    {
        dp[i] = dp[i - 1] + dp[i - 2];
    }
    cout << dp[n] << endl;
}


Measured memory_bytes: 3140
#include<stdio.h>
int main()
{
	long long int a,b,c,d,s,s1,m,m1,t,c1;
	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
   s=a*c,s1=a*d;
   m=s>s1?s:s1;
   t=b*c,c1=b*d;
   m1=t>c1?t:c1;
   s=m>m1?m:m1;
	printf("%lld\n",s);

}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
int main( void ){
	char str[ 100 ];
	if (!scanf( "%s", str )){
		return -1;
	}
	int length = strlen( str );
	int count = 0;
	rep( i, 0, length / 2 ){
		if (str[ i ] != str[ length - i - 1 ])
			count++;
	}
	printf( "%d\n", count );
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main(void){
	int ans=1,i,n,k;
	cin>>n>>k;
	int a[n];
	for(i=0;i<n;i++)cin>>a[i];
	n-=k;
	while(n>0){
		n-=(k-1);
		ans++;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 640
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#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 REVERSE(x) reverse((x).begin(), (x).end())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << '\n'
#define endl '\n'

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

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr 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;
}

template<typename T>
T meguru_search(T ok, T ng, function<bool(T)> check){
    while(max(ok, ng) - min(ok, ng) > T(1)){
        T mid = (ok + ng) / T(2);
        if(check(mid)){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    return ok;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    double v;
    while(cin >> v){
        double t = v / 9.8;
        double y = 4.9 * t * t;
        int ans = ceil(y * 0.2 + 1.0);
        cout << ans << endl;
    }

    cout << flush;

    return 0;
}


Measured memory_bytes: 3208
using System;

namespace D___Powerful_Discount_Tickets
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] temp1 = Console.ReadLine().Split(' ');
            var NumberOfItems = int.Parse(temp1[0]);
            var NumberOfTickets = int.Parse(temp1[1]);

            var Price = Console.ReadLine().Split(' ');
            int[] PriceOfItem = new int[NumberOfItems];

            for (int i = 0; i < NumberOfItems; i++)
            {
                PriceOfItem[i] = int.Parse(Price[i]);
            }


            Array.Sort(PriceOfItem);
            Array.Reverse(PriceOfItem);

            while (NumberOfTickets>0)
            {
                PriceOfItem[0] /= 2;
                NumberOfTickets--;
                if (NumberOfTickets <= 0) break;

                for (int i = 1; i < NumberOfItems; i++)
                {
                    if(PriceOfItem[0] > PriceOfItem[i])
                    {
                        Array.Sort(PriceOfItem);
                        Array.Reverse(PriceOfItem);
                        break;
                    }

                    PriceOfItem[i] /= 2;
                    NumberOfTickets--;
                    if (NumberOfTickets <= 0) break;
                }

            }

            Int64 TotalCost = 0;
            foreach (int cost in PriceOfItem)
            {
                TotalCost += cost;
            }
            Console.WriteLine(TotalCost);

        }
    }
}


Measured memory_bytes: 26972
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000

int main(){
	
	long long N;
	cin>>N;
	long long K;
	cin>>K;
	vector<long long> A(N);
	
	for(int i=0;i<N;i++){
		cin>>A[i];
	}
	
	sort(A.begin(),A.end());
	K = (N * (N-1)/2) -K;
	long long ok = -1000000000000000000;
	long long ng = -ok + 1;
	
	while(ng-ok > 1){
		long long mid = (ok+ng)/2;
		long long cnt = 0;
		for(int i=0;i<N-1;i++){
			long long a = A[i];
			long long k = mid;
			
			long long num = 0;
			if(a==0){
				if(k<=0)num = -1000000000000000001;
				else num = 1000000000000000001;
				cnt += distance(lower_bound(A.begin()+i+1,A.end(),num),A.end());
			}
			else if(k>=0){
				num = (k + abs(a) - 1)/abs(a);
				if(a<0)num *= -1;
				if(a>0)cnt += distance(lower_bound(A.begin()+i+1,A.end(),num),A.end());
				else cnt += distance(A.begin()+i+1,upper_bound(A.begin()+i+1,A.end(),num));
			}
			else{
				num = abs(k) / abs(a);
				if(a>0)num *= -1;
				if(a>0)cnt += distance(lower_bound(A.begin()+i+1,A.end(),num),A.end());
				else cnt += distance(A.begin()+i+1,upper_bound(A.begin()+i+1,A.end(),num));
			}
			
			
			
		}
		if(cnt > K){
			ok = mid;
		}
		else{
			ng = mid;
		}
	}
	
	cout<<ok<<endl;
    return 0;
}



Measured memory_bytes: 1792
import fractions as math

a, b, c, d = map(int, input().split())

a -= 1
cd = (c * d) // math.gcd(c, d)

a_d_c = a // c
b_d_c = b // c

a_d_d = a // d
b_d_d = b // d

a_d_cd = a // cd
b_d_cd = b // cd

b_d = b_d_c + b_d_d - b_d_cd
a_d = a_d_c + a_d_d - a_d_cd

ans =  b - b_d - a + a_d

print(ans)

Measured memory_bytes: 5076
/* -------------------------------- Template -------------------------------- */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = std::min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = std::max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

// template<typename T> constexpr T inf = [](){ assert(false); };
// template<> constexpr int inf<int> = 1e9;
// template<> constexpr ll inf<ll> = 1e18;
// template<> constexpr ld inf<ld> = 1e30;

struct yes_no : std::numpunct<char> {
  string_type do_truename()  const { return "Yes"; }
  string_type do_falsename() const { return "No"; }
};

void solve();

int main() {
  std::locale loc(std::locale(), new yes_no);
  std::cout << std::boolalpha << std::setprecision(12) << std::fixed;
  std::cout.imbue(loc);
  solve();
  return 0;
}

using namespace std;

/* -------------------------------- Library -------------------------------- */

/* ---------------------------------- Main ---------------------------------- */

int a[16];

void solve() {
  cin >> a[0] >> a[1] >> a[4];
  int sum = a[4] * 3;
  a[2] = sum - a[0] - a[1];
  a[8] = sum - a[0] - a[4];
  a[5] = sum - a[2] - a[8];
  a[3] = sum - a[4] - a[5];
  a[6] = sum - a[0] - a[3];
  a[7] = sum - a[1] - a[4];
  cout << a[0] << " " << a[1] << " " << a[2] << endl;
  cout << a[3] << " " << a[4] << " " << a[5] << endl;
  cout << a[6] << " " << a[7] << " " << a[8] << endl;
  return;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  int a, b, t;
  cin >> a >> b >> t;

  int times = t / a;
  cout << times * b << endl;
}


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

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

  // ここにプログラムを追記
  string a ;
  
  for(int i=1; i<=N; i++){
    cin>> a ;
    
    if(a=="Y"){
      cout << "Four" << endl ;
      break ;
    }
    if(i==N){
      cout << "Three" << endl ;
    }
  }
      
  
}



Measured memory_bytes: 256
//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <string>
using namespace std;
int main() {
	string s;
	cin>>s;
	int ans=0;
	int a0,a1,a2,a3;
	for(a0=0;a0<s.size();a0=a3){
		for(a1=a0;s[a1]=='J';a1++);
		for(a2=a1;s[a2]=='O';a2++);
		for(a3=a2;s[a3]=='I';a3++);
		if(a1-a0>=a2-a1&&a2-a1<=a3-a2)ans=max(ans,a2-a1);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3992
#include <stdio.h>

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define N 200010
#define MAX 1000000000000000000
#define MOD 1000000007

#include <stdio.h>


int main (void) {
    int x, n, p[100], i, j, c, flg = 0;

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

    for (i = 0; i < n; i++) {
        scanf("%d", &(p[i]));
    }


    for (i = 0; i < 210; i++) {
        flg = 0;
        c = (int)pow(-1, i) * (int)((i + 1) / 2);

        for (j = 0; j < n; j++) {
            if (x + c == p[j]) {
                flg = 1;
                break;
            }
        }

        if (flg == 0) break;
    }

    printf("%d", x + c);

    return 0;
}



Measured memory_bytes: 2372
#include<cstdio>
int main()
{
    int r,g,b;
    while(scanf("%d %d %d",&r,&g,&b)==3)
    {
        int num=r*100+g*10+b;
        if(num%4==0)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


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

typedef long long ll;
using namespace std;

int main (){
    int n;
    cin >> n;
    int p[n],q[n];
    for (int i = 0; i < n; i++){
        cin >> p[i];
    }
    for (int i = 0; i < n; i++){
        cin >> q[i];
    }
    int ex[n];
    ex[0]=1;
    for (int i = 1; i < n; i++){
        ex[i]=ex[i-1]*i;
    }
    int porder=0;
    int qorder=0;
    for (int i = 0; i < n; i++){
        porder+=(p[i]-1)*ex[n-1-i];
        qorder+=(q[i]-1)*ex[n-1-i];
        for (int j = i; j < n; j++){
            if(p[j]>p[i]) p[j]--;
            if(q[j]>q[i]) q[j]--;
        }
    }
    cout << abs(porder-qorder) << "\n";

}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <limits>
#include <ios>
#include <iomanip>
#include <stdio.h>
#include <iomanip>
#include <queue>
#include <set>
using namespace std;

#define rep(i,N) for(int (i)=0; (i)<(N); (i)++)
#define revrep(i,N) for(int (i)=(N)-1; (i)>=0; (i)--)
#define dump(vec) for(int i = 0; i < (vec).size(); i++){cout << vec.at(i) << ",";}cout << endl

typedef long long ll;

int main(void)
{
    int N,Q;
    cin >> N >> Q;

    typedef pair<int,int> P;
    set<P> q;

    vector<int> x(N);
    vector<int> s(N);
    vector<int> t(N);
    vector<tuple<int,int,int>> a(N);

    rep(i,N) {
        cin >> s.at(i) >> t.at(i) >> x.at(i);
        s.at(i) -= x.at(i);
        t.at(i) -= x.at(i);
        a.at(i) = tuple<int,int,int>(x.at(i), s.at(i), t.at(i));
    }
    

    rep(i,Q){
        int d;
        cin >> d;
        q.insert(P(d,i));
    }

    sort(a.begin(), a.end());
    //for (auto ea : a){cout << get<0>(ea) << "," << get<1>(ea) << "," << get<2>(ea) << endl;}

    map<int,int> ans;
    for(auto ea : a){
        int l,r,x;
        tie(x,l,r) = ea;

        auto itr = q.lower_bound(P(l,-1));
        while(itr != q.end()) {
            if (itr->first >= r) break;
            ans[itr->second] = x;
            q.erase(itr++);
        }
    }    

    for(auto eq : q){
        ans[eq.second] = -1;
    }

    for(auto eans : ans){
        cout << eans.second << endl;
    }
    
    

    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  cin >> v[0];
  int ans = 0;
  int dir = 0;
  rep(i, n){
    cin >> v[i];
    if (dir == 0){
      if (v[i-1] < v[i]){
        dir = 1;
      } else if (v[i-1] > v[i]){
        dir = -1;
      }
    }

    if ((dir == 1) && (v[i-1] > v[i])){
      dir = 0;
      ++ans;
    } else if ((dir == -1) && (v[i-1] < v[i])){
      dir = 0;
      ++ans;
    }
  }
  cout << ans + 1 << endl;

  return 0;
}

Measured memory_bytes: 3784
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
typedef long long ll;

int main(){
    int s, w;
    cin >> s>>  w;
    if (w >= s) cout << "unsafe" << endl;
    else cout << "safe" << endl;
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, n) for(int i = (a); i < (n); i++)

template<typename T,typename U>
void Printarray(T f,U n){for(U i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i]<<endl;}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n;cin>>n;
  int h[n];rep(i,n)cin>>h[i];

  int dp[n];

  dp[0]=0;
  dp[1]=abs(h[1]-h[0]);

  rep2(i,2,n){
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
  }
  cout<<dp[n-1]<<endl;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> p(n), q(n);
  rep(i,n)cin >> p[i];
  rep(i,n)cin >> q[i];
  vector<int> a(n);
  rep(i,n) a[i]=i+1;
  map<vector<int>,int> mp;
  do{
    mp[a] = mp.size();
  }while(next_permutation(a.begin(),a.end()));

  int ans = abs(mp[p]-mp[q]);
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 8600
from collections import Counter

input()
ans = []
for k, v in Counter([int(i) for i in input().split()]).items():
  if v >= 2:
    if v >= 4:
      ans.extend([k, k])
    else:
      ans.append(k)
ans.sort()
print(0 if len(ans) < 2 else ans[-1]*ans[-2])

Measured memory_bytes: 68760
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}

use input::*;

fn main() {
    let n: usize;
    input!(n);
    let mut v = input_vector::<usize>();
    let mut flag = true;
    let mut prev = 0;

    for z in &mut v {
        if prev < *z {
            *z -= 1;
        }
        if prev > *z {
            flag = false;
            break;
        }
        prev = *z;
    }
    if flag {
        p("Yes");
    } else {
        p("No");
    }
}

Measured memory_bytes: 8444
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100010;
const int N = 100010;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; 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;
    }
}


int main() {
	int n;cin>>n;
	ll x[N];
	rep(i,n) cin>>x[i];
	COMinit();
	ll d[N],e[N];
	d[1]=1;e[1]=1;
	for(int i=2;i<=n-1;i++){
		d[i]=(d[i-1]*i+fac[i-1])%MOD;
		e[i]=(d[i]*finv[i])%MOD;
	}
	ll ans=0;
	for(int i=1;i<=n-1;i++){
		ll tmp=((x[i]-x[i-1])*e[i])%MOD;
		tmp=(tmp*fac[n-1])%MOD;
		ans+=tmp;
		ans%=MOD;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 4992
//2019.7.18 by ljz
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define LL long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f
#define eps 1e-10
#define RG register
#define db long double
#define lb long db
#define pc(x) __builtin_popcount(x)
typedef pair<int,int> Pair;
#define mp make_pair
#define fi first
#define se second
#define pi acos(-1.0)
#define pb push_back
#define gc getchar
//inline char gc() {
//    static char buf[100000],*p1,*p2;
//    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
inline int read() {
    res s=0,ch=gc();
    while(ch<'0'||ch>'9')ch=gc();
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
    return s;
}
//inline int read() {
//    res s=0,ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
inline LL Read() {
    RG LL s=0;
    res ch=gc();
    while(ch<'0'||ch>'9')ch=gc();
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
    return s;
}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline void write(RG __int128 x){
//    if(x>10)write(x/10);
//    putchar(x%10+'0');
//}
inline void swap(res &x,res &y) {
    x^=y^=x^=y;
}
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
namespace MAIN{
    int n,a[18+10];
    LL dfs(res l,res r,RG LL L,RG LL R){
        if(r-l==1)return 0;
        RG LL ret=INF;
        for(res i=l+1;i<=r-1;i++)
            ret=min(ret,dfs(l,i,L,L+R)+dfs(i,r,L+R,R)+(L+R)*a[i]);
        return ret;
    }
    inline void MAIN(){
        n=read();
        for(res i=1;i<=n;i++)a[i]=read();
        printf("%lld\n",a[1]+a[n]+dfs(1,n,1,1));
    }
}
int main() {
//    srand((unsigned)time(NULL));
//    freopen("route.in","r",stdin);
//    freopen("route.out","w",stdout);
    MAIN::MAIN();
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define X first
#define Y second

using namespace std;
typedef long long llint;

const int maxn = 2e5+10;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;

int main() {
	for (int i = 1; i <= 5; i++) {
		int x;
		scanf("%d", &x);
		if (x == 0) {
			printf("%d\n", i);
		}
	}
	return 0;
}



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

inline int f(int x) {
	if (!x) return 0;
	return f(x % __builtin_popcount(x)) + 1;
}

int main() {
	cin.tie(0)->sync_with_stdio(false);

	int n; cin >> n;
	string X; cin >> X;
	vector<int> x(n);
	REP(i, n) x[i] = X[i] - '0';

	int pc = 0;
	REP(i, n) pc += x[i];

	vector<int> res(n);
	REP(bit, 2) {
		int next_pc = pc;
		if (!bit) next_pc++;
		else next_pc--;
		if (next_pc <= 0) continue ;
		int rem0 = 0;
		REP(i, n) {
			rem0 = (rem0 * 2) % next_pc;
			rem0 += x[i];
		}
		int b = 1;
		for (int i = n - 1; i >= 0; i--) {
			if (x[i] == bit) {
				int rem = rem0;
				if (!bit) rem = (rem + b) % next_pc;
				else rem = (rem - b + next_pc) % next_pc;
				res[i] = f(rem) + 1;
			}
			b = (b * 2) % next_pc;
		}
	}

	REP(i, n) cout << res[i] << '\n';
	return 0;
}

Measured memory_bytes: 5196
import java.util.*;
import java.math.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[][] A = new int[3][3];
    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++)
        A[i][j] = sc.nextInt();
    int N = sc.nextInt();
    int[] b = new int[N];
    for (int i = 0; i < N; i++)
      b[i] = sc.nextInt();
    sc.close();

    Set<Integer> bset = new HashSet<>();
    for (int i = 0; i < N; i++)
      bset.add(b[i]);

    boolean[][] bingo = new boolean[3][3];
    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++)
        if (bset.contains(Integer.valueOf(A[i][j]))) bingo[i][j] = true;

    boolean ans = bingo[0][0] && bingo[0][1] && bingo[0][2]
        || bingo[1][0] && bingo[1][1] && bingo[1][2]
        || bingo[2][0] && bingo[2][1] && bingo[2][2]
            
        || bingo[0][0] && bingo[1][0] && bingo[2][0]
        || bingo[0][1] && bingo[1][1] && bingo[2][1]
        || bingo[0][2] && bingo[1][2] && bingo[2][2]
            
        || bingo[0][0] && bingo[1][1] && bingo[2][2]
        || bingo[0][2] && bingo[1][1] && bingo[2][0];
    System.out.println(ans ? "Yes" : "No");
  }
}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll start_h,start_m,end_h,end_m,k;
    cin>>start_h>>start_m>>end_h>>end_m>>k;
    ll x;
    if(start_h==end_h)
    {
        x=end_m-start_m;
    }
    else
    {
        x=(60-start_m);
        for(int i=(start_h+1); i<end_h; i++)
        {
            x+=60;
        }
        x+=end_m;
    }
    cout<<abs(x-k)<<endl;
    return 0;
}


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

using LL = long long int;

int main() {

  int n;
  cin >> n;
  map<string, LL> mp;

  for(int i = 0; i < n; ++i){
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }

  LL ans = 0;

  for(auto p : mp) ans += p.second*(p.second-1)/2;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 11428
n, ma, mb = map(int, input().split())

INF = 10**10
dp = [[[INF for _ in range(400+5)] for _ in range(400+5)] for _ in range(n+5)]

dp[0][0][0] = 0

for i in range(n):
    a, b, c = map(int, input().split())
    for ta in range(400+5-a):
        for tb in range(400+5-b):
            dp[i+1][ta][tb] = min(dp[i+1][ta][tb], dp[i][ta][tb])
            dp[i+1][ta+a][tb+b] = min(dp[i+1][ta+a][tb+b], dp[i][ta][tb]+c)

ans = INF
for i in range(1, n+1):
    t = 1
    while max(ma, mb)*t <= 400:
        ans = min(ans, dp[i][ma*t][mb*t])
        t += 1

if ans == INF:
    print(-1)
else:
    print(ans)

Measured memory_bytes: 103644
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), ((a) + (n))
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define MODNUM (static_cast<int>(1e9 + 7))
#define MOD(x) ((x) % MODNUM)

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

const int INF = 2e9;
const double EPS = 1e-10;
const double PI = acos(-1.0);

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

template <typename T>
int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T>
T square(T x) {
	return x * x;
}

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	int n;
	scanf("%d", &n);
	VI a(n);
	EACH(e, a) { scanf("%d", &e); }

	int result = 0;
	REP(i, n) {
		if(a[i] == result + 1) {
			result++;
		}
	}

	if(result == 0) {
		puts("-1");
	} else {
		printf("%d\n", n - result);
	}
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <utility>


using namespace std;
typedef long long ll;

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; }
template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); } return a; }


constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;


int main()
{

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int H, W; cin >> H >> W;
	vector<int> L(H), R(H);
	for (int i = 0; i < H; i++) cin >> L[i] >> R[i], L[i]--, R[i]--;
	map<int, int> mp; for (int i = 0; i < W; i++) mp[i] = i;
	vector<int> cnt(W + 1); cnt[0] = W;
	int res = 0;
	for (int i = 0; i < H; i++) {
		auto itr = mp.lower_bound(L[i]);
		int r = -1;
		while (itr != mp.end() and itr->first <= R[i] + 1) {
			cnt[itr->first - itr->second]--;
			chmax(r, itr->second);
			itr = mp.erase(itr);
		}
		if (r >= 0 and R[i] + 1 < W) {
			mp[R[i] + 1] = r;
			cnt[R[i] + 1 - r]++;
		}
		while (res < W and cnt[res] == 0) res++;
		if (res == W) cout << -1 << "\n";
		else cout << i + 1 + res << "\n";
	}
	return 0;
}

Measured memory_bytes: 15084
#include <iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)




int main() {
	string S;
	cin >> S;
	if ((S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(2))|| (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1))|| (S.at(0) == S.at(3) && S.at(2) == S.at(1) && S.at(0) != S.at(2))) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}



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

int main(){
  int n, k;
  cin >> n >> k;
  int count = 0;
  int x = 1;
  while(1){
    count++;
    if (n < pow(k, x)) break;
    x++;
  }
  cout << count << endl;
  
  return 0;
}

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

typedef int in;
#define int long long
int MAX=1e8;
int MAXEST=1e18;
int MOD=1e9+7;

int h,w;
int dp[1005][1005];
string grid[1005];

int f(int idx1,int idx2)
{
    if(idx1==h-1&&idx2==w-1)
        return 1;
    int &ret=dp[idx1][idx2];
    if(ret!=-1)
        return ret;
    ret=0;
    if(grid[idx1+1][idx2]=='.'&&idx1+1<=h-1)
        ret=f(idx1+1,idx2);
    if(grid[idx1][idx2+1]=='.'&&idx2+1<=w-1)
        ret+=f(idx1,idx2+1);
    return ret%MOD;
}

in main()
{
    int tc=1;
//    cin>>tc;
    while(tc--)
    {
        cin>>h>>w;
        for(int i=0;i<h;i++){
            cin>>grid[i];
        }
        memset(dp,-1,sizeof dp);
        cout<<f(0,0)<<endl;
    }
    return 0;
}


Measured memory_bytes: 13552
import sys
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IS(): return str(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

A = LI()

print(A[0]*A[1])

Measured memory_bytes: 9256
from math import floor

A, B = map(int, input().split())
ans = -1
x = 1
while True:
    a = floor(x * 0.08)
    b = floor(x * 0.10)
    if a > A and b > B:
        break
    if a == A and b == B:
        ans = x
        break
    x += 1
print(ans)


Measured memory_bytes: 3064