akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
	public static void main(String args[]) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			int x = Integer.parseInt(br.readLine());
			System.out.printf("%d\n",x*x*x);
		} catch(IOException e) {
			e.printStackTrace();
		}
	}
}


Measured memory_bytes: 24516
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e16;
#define int long long

const int MAX_N = 1010;


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int h, w; cin >> h >> w;
	int ans = INF;
	int sx, sy, sz;
	rep(i, w - 1) {
		sx = (i + 1)*h;
		sy = (h / 2)*(w - i - 1);
		sz = ((h + 1) / 2)*(w - i - 1);
		ans = min(ans, max({ sx,sy,sz }) - min({ sx,sy,sz }));
	}
	rep(i, h - 1) {
		sx = (i + 1)*w;
		sy = (w / 2)*(h - i - 1);
		sz = ((w + 1) / 2)*(h - i - 1);
		ans = min(ans, max({ sx,sy,sz }) - min({ sx,sy,sz }));
	}
	ans = min(ans, min(((w + 2) / 3)*h - (w / 3)*h, ((h + 2) / 3)*w - (h / 3)*w));
	cout << ans << endl;
	return 0;
}


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


// typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>  ordered_set;
#define ll long long
 
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl
 
#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
ll dp[200105][105];
ll MOD=1000000007;
#define INF 1000000000000000000
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<setprecision(11);
    long double pi= 3.14159265358979323846;
    // ll n;
    ll n,k;
    cin>>n>>k;
    ll ar[n];
    rep(i,n)
    {
        cin>>ar[i];
    }
    for(ll i=k;i>=max(k-ar[0],0ll);i--)
    {
        
        dp[i][0]=1+dp[i+1][0];
        // debug(dp[i][0]);
    }
    for(ll i=k-ar[0]-1;i>=0;i--)
    {
        dp[i][0]+=dp[i+1][0];
    }
    for(ll i=1;i<n;i++)
    {
        for(ll j=k;j>=0;j--)
        {
            dp[j][i]+=(dp[j+1][i]+dp[j][i-1]-dp[j+ar[i]+1][i-1])%MOD;
            // debug(dp[j][i]);
        }
        // debug("A");
    }
    cout<<(dp[0][n-1]-dp[1][n-1]+MOD)%MOD;
    return 0;
}

Measured memory_bytes: 84224
#include <cstdio>

using namespace std;

int v[200010];

int main()
{
    //freopen("file.in","r",stdin);
    //freopen("file.out","w",stdout);
    int n,t;
    long long sol=0;
    scanf("%d%d",&n,&t);
    for(int i=1;i<=n;i++)
        scanf("%d",&v[i]);
    v[n+1]=2e9+1;
    for(int i=1;i<=n;i++)
        if(v[i]+t<v[i+1]) sol+=t;
        else sol+=v[i+1]-v[i];
    printf("%lld",sol);
    return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
  for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
  for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
  return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
  os<<"{ ";for(auto m:M)os<<"("<<m.first<<":"<<m.second<<")";
  return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
//For multiset use less_equal operator but it does support erase operations for multiset
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mp make_pair
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 
const int N = 2e5 + 100;
int pre[N];

int main(){
  fio; cout<<fixed<<setprecision(25);	
  int n; cin >> n;
  string s; cin >> s;
  ll inv = 0; 
  ll a = 0 , b= 0;
  for(int i =1 ;i <= n ; ++i){
    if(s[i-1] == 'W') ++ a;
    else ++b;
  }
  ll ans = a;
  ll z = b;
  for(int i = 1;i <= b ; ++i){
    if(s[i-1] == 'R') --z;
  }
  ans = min(ans, z);
  cout << ans << endl;
  
  
}


Measured memory_bytes: 3752
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	int n,d;
	cin >> n >> d;
	int x[n][d];
	int ans =0;
	for (int i =0;i<n;i++) {
		for (int j =0; j<d;j++) {
			cin >> x[i][j];
		}
	}
	for (int i =0;i<n -1;i++) {
		for (int j =i+1; j<n;j++) {
			int sum = 0;
			for (int k =0; k< d ;k++) {
				sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
			}
			int sq = sqrt(sum);
			for (int l =0;l < sq + 1; l++) {
				if (sum == (l * l)) {
					ans++;
					break;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

static const int  vx[ ] = { 1, 0, -1, 0 }
               ,  vy[ ] = { 0, 1, 0, -1 };
static const char sn[ ] = { 'R', 'D', 'L', 'U' };

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  char hz[ 5 ][ 8 ]
     , vc[ 4 ][ 8 ];
  int x, y, s;
  int i;

  scanf ( "%s", hz[ 0 ] );
  for ( i = 0; i < 4; ++i )
  {
    scanf ( " %s %s", vc[ i ], hz[ i + 1 ] );
  }

  putchar ( 'R' );
  x = 1; y = 0; s = 0;
  while ( !!( x | y ) )
  {
    //if ( s == 3 ) break ;
    switch ( s )
    {
      case 0:
        if      ( y > 0 && vc[ y - 1 ][ x ] == '1' ) s += 3;
        else if ( x < 4 && hz[ y ][ x ]     == '1' ) ;
        else if ( y < 4 && vc[ y ][ x ]     == '1' ) s += 1;
        else                                         s += 2;
        break ;
      case 1:
        if      ( x < 4 && hz[ y ][ x ]     == '1' ) s += 3;
        else if ( y < 4 && vc[ y ][ x ]     == '1' ) ;
        else if ( x > 0 && hz[ y ][ x - 1 ] == '1' ) s += 1;
        else                                         s += 2;
        break ;
      case 2:
        if      ( y < 4 && vc[ y ][ x ]     == '1' ) s += 3;
        else if ( x > 0 && hz[ y ][ x - 1 ] == '1' ) ;
        else if ( y > 0 && vc[ y - 1 ][ x ] == '1' ) s += 1;
        else                                         s += 2;
        break ;
      case 3:
        if      ( x > 0 && hz[ y ][ x - 1 ] == '1' ) s += 3;
        else if ( y > 0 && vc[ y - 1 ][ x ] == '1' ) ;
        else if ( x < 4 && hz[ y ][ x ]     == '1' ) s += 1;
        else                                         s += 2;
        break ;
    }

    s %= 4;
    x += vx[ s ]; y += vy[ s ];
    putchar ( sn[ s ] );
  }
  puts ( "" );

  return ( 0 );
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define vi vector<int>
#define Sort(v) sort(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

void rect(int x,int y){
    rep(i,x){
        rep(j,y){
            if((i+j)%2 == 0) cout << "#";
            else cout << ".";
        }
        cout << endl;
    }
    cout << endl;
}

int main(){
    while(true){
        int a,b;
        cin >> a >> b;
        
        if(a==0 and b==0) break;
        
        rect(a,b);
    }
    
    
}








Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 * 1000;
struct arc
{
	int id , voisin;
};
vector <arc> adj[MAXN];

int cMax = 0;
int couleur[MAXN];
void recursion(int noeud , int pere , int c)
{
	int iA = 1;
	for (int i = 0 ; i < adj[noeud].size() ; i++)
	{
		if (adj[noeud][i].voisin != pere)
		{
			if (iA == c) iA++;
			couleur[adj[noeud][i].id] = iA;
			iA++;
			cMax = max(cMax , iA - 1);
			recursion(adj[noeud][i].voisin , noeud , iA - 1);
		}
	}
}
int main()
{
	int nbNoeuds;
	cin >> nbNoeuds;
	for (int i = 0 ; i < nbNoeuds - 1 ; i++)
	{
		int a,b;
		cin>>a>>b;
		a--;
		b--;
		adj[a].push_back({i , b});
		adj[b].push_back({i,a});
	}
	recursion( 0 , 0 , 0);
	cout<<cMax<<endl;
	for (int i = 0 ; i < nbNoeuds - 1 ; i++)
	{
		cout<<couleur[i]<<endl;
	}
}

Measured memory_bytes: 9344
x=list(map(int, input().split()))
a=1
b=x[0]
for i in range(x[1]):
	c,d=list(map(int, input().split()))
	if a<c:
		a=c
	if b>d:
		b=d

if b-a>=0:
	print(b-a+1)
else:
	print(0)

Measured memory_bytes: 3060
#binary sertch
n = int(input())
T = list(map(int, input().split()))
q = int(input())
cnt = 0
def midle(left, right):
    return int((left + right)/2)

for i in input().split():
    right = n
    left = 0
    while left - right < 0:
        mid = midle(left, right)
        if T[mid] == int(i):
            cnt += 1
            break
        elif T[mid] < int(i):
            left = mid +1
        else:
            right = mid

print(cnt)    


Measured memory_bytes: 16712
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> a(N);
  rep(i, N) cin >> a[i].second >> a[i].first;
  sort(a.begin(), a.end(), [](pair<int, int> x, pair<int, int> y) {
    if(x.second == y.second)
      return x.first < y.first;
    return x.second < y.second;
  });
  priority_queue<pair<int, int>> pque;
  int p = 0;
  ll ans = 0;
  for(int i=1; i<=M; i++) {
    while(p<N) {
      if(a[p].second <= i) {
        pque.push(a[p]);
        p++;
      }
      else
        break;
    }
    if(!pque.empty()) {
      pair<int, int> tmp = pque.top();
      pque.pop();
      ans += tmp.first;
    }
  }
  cout << ans << endl;
  return 0;
}

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

long func(long b, long n)
{
  long sum = 0;
  while (n > 0) {
    sum += n % b;
    n /= b;
  }
  return sum;
}

int main()
{
  long n,s;
  cin >> n >> s;
  // input

  long ans = -1;

  if (s > n) {
    goto END;
  }
  if (s == 1) {
    //    ans = n;
  }
  // 各和がnとなるのは,b進数への変換後1桁になる場合のみ.
  if (s == n) {
    ans = n+1;
    goto END;
  }

  // b進数への変換後,3桁以上になる.
  for (long b = 2; (b*b <= n); b++) {
    if (func(b,n) == s) {
      ans = b;
      break;
    }
  }

  if (ans != -1) goto END;
  
  // b進数への変換後,2桁になる.
  for (long p = 1; (p*p < n); p++) {
    if ((n-s)%p == 0 && func((n-s)/p + 1, n) == s) {
      ans = (n-s)/p + 1;
      //      cout << "p = " << p << endl;
    }
  }

 END:
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<cstdio>
//reference

using namespace std ;

typedef long long ll ;

int a[105] ;
int b[105] ;

int main()
{
    ll n; scanf("%lld",&n);
    n++ ;
    int m = 100 ;
    int p1 = 0 , p2 = 0 ;

    while( n > 1 )
    {
        if( n % 2 == 1)
        {
            a[++p1] = m-- ;
            n -- ;
        }
        else
        {
            b[++p2] = m-- ;
            n = n / 2 ;
        }

    }

    printf("%d\n",2*(p1+p2)) ;

    for ( int i = 1 ; i <= p1 ; i++ )
        printf("%d ",a[i]) ;
    for ( int i = p2 ; i >= 1 ; i-- )
        printf("%d ",b[i]) ;
    for ( int i = 101 - p1 - p2 ; i <= 100 ; i++ )
        printf("%d ",i) ;

    return 0 ;
}


Measured memory_bytes: 128
class ModWorld:
    def __init__(self, mod):
        self.mod = mod

    def prepare_factorial(self, N):
        self.f = [1] # f[n] := n!
        p = 1
        for i in range(1,N+1):
            p = (p*i) % self.mod
            self.f.append(p)

    def modpow(self, x, k):
        x %= self.mod
        k %= self.mod-1 # a^(p-1) = 1
        retval = 1
        while k:
            if k&1: retval *= x
            k>>=1
            x = x*x % self.mod
        return retval % self.mod

    def modcomb(self, n, k):
        return self.f[n] * self.modpow(self.f[n-k], -1) * self.modpow(self.f[k], -1) % self.mod

mw = ModWorld(mod=10**9+7)
mw.prepare_factorial(N=10**5)

N, M = list(map(int, input().split()))
d = 2 if N==M else 1 if abs(N-M)==1 else 0
print(d * mw.f[N] * mw.f[M] % mw.mod)

Measured memory_bytes: 7084
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;

int main(){
int N,L;
cin>>N>>L;
int min_p=-1,min_=1000;
int A[N+1];
rep3(i,N){
    A[i]=L+i-1;
    if(min_>abs(A[i])){
        min_p=i;
        min_=abs(A[i]);
    }
}
int sum=0;
rep3(i,N){
    if(i==min_p)continue;
    sum+=A[i];
}
cout<<sum<<endl;



return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define fr(i,a,b) for (long long int i = (a), _b = (b); i <= _b; i++)
#include<ratio>
#include <set> 
#include <iterator>
using namespace std;
#define ll long long
#define VV vector
#define vi vector <int>
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
#define inf 200000000000000
#define MAXN 100001
#define eps 0.0000000001
#define prime 1000000007
#define ll long long
#define int ll int
using namespace std;
#define S second
#define F first
#define float double 
int MOD=1e9+7;
#define rep(i,n) for (long long i = 0, _n = (n); i < _n; i++)
char cs[1001][1001];
int ks[1001][1001];
int dp (int h,int w){
    for(int i=0;i<=h;i++)
        for(int j=0;j<=w;j++)
            if((i==0)||(j==0))
            ks[i][j]=0;
            else if((i==1)&&(j==1))
                ks[i][j]=1;
            else
               if(cs[i][j]=='.')
               ks[i][j]=(ks[i-1][j]%MOD+ks[i][j-1]%MOD)%MOD;
    return ks[h][w];
 }
 int32_t main()
{   
    int h,w;
    cin>>h;
    cin>>w;     
    for(int i=1;i<=h;i++)
        for(int j=1;j<=w;j++)
            cin>>cs[i][j]; 
    cout<<dp(h,w)%MOD;
}

Measured memory_bytes: 9088
/*
 * Author : Sadi
 * Wed 08/07/2020
 * 20:15:18.86
 */
#include <iostream>
#include <cstdio>
#include <cmath>
#include <climits>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>

using namespace std;

#define    watch(x); cout << "\n" <<  #x << " is: " << x << "\n";
#define    all(a) (a).begin(), (a).end()
#define    fi first
#define    se second

template<class A, class B>
ostream& operator << (ostream& output, const pair<A, B>& p) {
    output << "(" << p.first << ", " << p.second << ")";
    return output;
}

template<class A>
ostream& operator << (ostream& output, const vector<A>& a) {
    output << "[";
    for(auto it = a.begin(); it != a.end(); ++it) {
        if(it != a.begin()) {
            output << ", ";
        }
        output << *it;
    }
    output << "]";
    return output;
}

using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;

//const int inf = 1e9;
//const int mod = 1e9 + 7;
//const double PI = acos(-1.0);
//const int mx = 1e5 + 5;



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE

    int a, b;
    cin >> a >> b;
    cout << max({a + b, a - b, a * b}) << endl;

    return 0;
}


Measured memory_bytes: 3592
import java.util.Scanner;

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

		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		for (int i = 0; i < S.length(); i++) {
			if(i%2 == 0) {
				System.out.print(S.charAt(i));
			}
		}
	}
}


Measured memory_bytes: 31712
n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
b=sorted(a,key=lambda x:x[1])
time=0
ans=0
for i in range(n):
    time+=b[i][0]
    if time<=b[i][1]:
        continue
    else:
        ans+=1
        print('No')
        break
if ans==0:
    print('Yes')


Measured memory_bytes: 55264
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for (int i=a; i<b; ++i)

// Based on official editorial
vector <ll> factorials, inv_factorials;
ll mod=1e9+7;
ll modExp(ll x, ll n)
{
    if (n==0) return 1;
    if (n==1) return x%mod;
    ll ans = modExp(x,n/2);
    ans = (ans*ans)%mod;
    if (n%2) ans*=x;
    return ans%mod;
}

ll modInv(ll a)
{
    return modExp(a, mod-2);
}

void calculate(ll N)
{
    factorials.resize(N+1);
    inv_factorials.resize(N+1);
    factorials[0]=1;
    for (int i=1; i<=N; ++i) factorials[i]=(factorials[i-1]*i)%mod;
    inv_factorials[N]=modInv(factorials[N]);
    for (int i=N-1; i>=0; --i) inv_factorials[i]=((i+1)*inv_factorials[i+1])%mod;
}

ll choose(ll N, ll K)
{
    if (N<0 || K<0) return 0;
    if (K>N) return 0;
    return (((factorials[N]*inv_factorials[N-K])%mod)*inv_factorials[K])%mod;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll K; cin >> K;
    string S; cin >> S;
    ll N=S.length();
    calculate(N+K);
    ll total=S.length()+K;
    /*
    * Total length of resulting string = total
    * N = S.length()
    * S = S_1...S_N (S_i = character at ith position)
    * resulting string T looks like <S_1*>S_1<S_2*>S_2...<S_N*>S_N<*>
    * here <S_i*> denotes inserted characters between S_{i-1} (or start of string) and S_i
    * Length of <S_1*>+...+<S_N*>+<*> = K
    * To count distinct string, let us count number of strings such that S_i is first occurence of 
    * (whichever character is there at S_i) after S_{i-1}.
    * This means <S_i*> cannot contain the character S_i.
    * But <*> at the end of T, can have any character. 
    * This leads to the formula in the editorial
    * Ans for a particular arrangement = 25^( Sum i=1 to N (|<S_i*>|) ) * 26^(K - (Sum i=1 to N (|<S_i*>|)) )
    * Now let's iterate over all possible values for Sum i=1 to N (|<S_i*>|)
    */
    ll ans=0;
    for (int i=0; i<=K; ++i) // i = len(<*>) = number of characters after S_N
    {
        // Since i is fixed, since means position of S_N must be already fixed as well.
        // Only the places for rest N-1 characters can be chosen.
        ll waysToSelectPlacesForStringS= choose(N+K-(i+1), N-1);
        ll waysToSelectCharactersInRemainingPlaces = (modExp(25, K-i)*modExp(26,i))%mod;
        ans=(ans+(waysToSelectPlacesForStringS*waysToSelectCharactersInRemainingPlaces)%mod)%mod;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 35628
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define bug1( x ) {cerr << (#x) <<"="<< x << endl;}
#define bug2( x , y ) {cerr << (#x) <<"="<< (x) << "    " << (#y) << "="<< (y) << endl;}
#define bug3( x , y , z ) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << endl;}
#define bug4( x , y , z , w) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << endl;}
#define bug5( x , y , z , w ,p) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << endl;}
#define bug6( x , y , z , w ,p , q) {cerr << (#x) <<"="<<(x) << "    " << (#y) <<"="<< (y) << "    " << (#z) <<"="<< (z) << "    " << (#w) <<"="<< w << "    " << (#p) <<"="<< p << "    " << (#q) <<"="<< q << endl;}
#define bugn( x , n ) {cerr << (#x) <<":";for(int i=0;i<n;i++)cerr << x[i] <<"  "; cerr << endl;}
#define bugnm( x , n , m ) {cerr << (#x)<<endl;for(int i=0;i<n;i++){cerr << "Row #" << i<< ":";for(int j=0;j<m;j++)cerr << x[i][j] << "   ";cerr << endl;}}
typedef long long ll;
typedef long double ld;
using namespace std;

const int maxn = 1005, maxm = 2005;
vector<vector<pair<int,int>>>g(maxn),gr(maxn);
vector<int>a(maxm),b(maxm),w(maxm),alive(maxm);
int n,m,neg_cycle=0;

vector<int>bfs(int s,vector<vector<pair<int,int>>>&g){
	vector<int>vis(n+1);
	queue<int>q;
	q.push(s);
	vis[s]=1;
	while( q.size() ){
		int u = q.front(); q.pop();
		for(auto[v,i]:g[u]){
			if( !vis[v] ){
				q.push(v);
				vis[v]=1;
			}
		}
	}
	return vis;
}

vector<int>spfa(int s,vector<vector<pair<int,int>>>&g){
	vector<int>dis(n+1,1e18);
	vector<int>inq(n+1);
	vector<int>cnt(n+1);
	queue<int>q;
	dis[s]=0;
	q.push(s);
	inq[s]=1;
	while( q.size() ){
		int u = q.front(); q.pop();inq[u]=0;
		for(auto [v,i]:g[u]){
			if( !alive[i] )continue;
			if( dis[v] > dis[u] + w[i] ){
				dis[v] = dis[u] + w[i];
				cnt[v] += 1;
				if( cnt[v] > n+m ){
					neg_cycle = 1;
					return dis;
				}
				if( !inq[v] ){
					q.push(v);
					inq[v]=1;
				}
			}
		}
	}
	return dis;
}
				
int32_t main(){
	IOS
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>a[i]>>b[i]>>w[i];w[i]*=-1;
		g[a[i]].push_back({b[i],i});
		gr[b[i]].push_back({a[i],i});
	}
	vector<int>vis1 = bfs(1,g);
	vector<int>visn = bfs(n,gr);
	for(int i=1;i<=m;i++){
		alive[i] = vis1[a[i]] && visn[ b[i] ];
		//bug4(i,a[i],b[i],alive[i]);
	}
	vector<int> dis = spfa(1,g);
	if( neg_cycle ){
		cout << "inf" << endl; return 0;
	}
	cout << -dis[n] << endl;
	
	
	
}
/*
 * long long or int?
 * index out of bound?
 * Tested on own test case?corner?
 * Make more general solution.
 * Read Read Read Read ....
 */


Measured memory_bytes: 3844
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int h = saori.saori_hayami();
		int w = saori.saori_hayami();
		String[] c = new String[h];
		for(int i = 0;i < h;i++){
			c[i] = saori.nextHayami();
		}
		for(int i = 0;i < h;i++){
			System.out.println(c[i]);
			System.out.println(c[i]);
		} 

		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 22100
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long int n,ans=0;
  cin >>n;
  long long int kari=n/15;
  ans+=(kari-1)*kari*120/2+kari*60;
  if(n%15==1)ans+=kari*15+1;
  if(n%15==2)ans+=kari*15*2+3;
  if(n%15==3)ans+=kari*15*2+3;
  if(n%15==4)ans+=kari*15*3+7;
  if(n%15==5)ans+=kari*15*3+7;
  if(n%15==6)ans+=kari*15*3+7;
  if(n%15==7)ans+=kari*15*4+14;
  if(n%15==8)ans+=kari*15*5+22;
  if(n%15==9)ans+=kari*15*5+22;
  if(n%15==10)ans+=kari*15*5+22;
  if(n%15==11)ans+=kari*15*6+33;
  if(n%15==12)ans+=kari*15*6+33;
  if(n%15==13)ans+=kari*15*7+46;
  if(n%15==14)ans+=kari*15*8+60;
  cout << ans <<endl;
}

Measured memory_bytes: 3592
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

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

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

double todeg(double ang){
    return ang * 180 / pi;
}

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

    int n; cin>>n;
    vector<int> x(n), y(n);
    for(int i=0; i<n; i++) cin>>x[i]>>y[i];
    vector<int> perm(n);
    iota(perm.begin(), perm.end(), 0);

    double ans = inf;
    do{
        vector<P> points;
        points.emplace_back(0, 0);
        for(auto i : perm) points.emplace_back(x[i], y[i]);
        points.emplace_back(0, 0);

        double theta = 0, sum = 0;
        for(int i=0; i<=n; i++){
            int dx = points[i+1].first - points[i].first;
            int dy = points[i+1].second - points[i].second;

            double cur_theta = atan2(dy, dx);

            sum += todeg(min(abs(theta - cur_theta), 2 * pi - abs(theta - cur_theta)));
            theta = cur_theta;
        }

        chmin(ans, sum);
    }while(next_permutation(perm.begin(), perm.end()));

    printf("%.10f\n", ans);

    return 0;
}


Measured memory_bytes: 3408
#include <stdio.h>
int judge (int );

int main()
{
  int n,x,i,count;

  scanf("%d",&n);
  
  for(i=0;i<n;i++)
    {
      scanf("%d",&x);      
      if(judge(x) ) count++;
    }
  printf("%d\n",count);
 
}
int judge (int a)
{
  int i;
  if(a<2) return 0;
  if(a==2) return 1;
  if(a%2 ==0) return 0;
  for(i=3; i*i <= a; i+=2)
    {
      if(a%i==0) return 0;
    }
  return 1;
}



Measured memory_bytes: 2124
S=input()
N=len(S)
MOD=10**9+7

dp=[[0]*13 for _ in range(N+1)]
dp[0][0]=1
for i in range(1,N+1):
    c=S[i-1]
    if c=='?':
        for k in range(10):
            for n in range(13):
                nn=(n*10+k)%13
                dp[i][nn]+=dp[i-1][n]
                dp[i][nn]%=MOD
    else:
        for n in range(13):
            nn=(n*10+int(c))%13
            dp[i][nn]+=dp[i-1][n]
            dp[i][nn]%=MOD
print(dp[N][5])

Measured memory_bytes: 64020
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
vector<pair<ll,ll> > adj[100005];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll n,m,i,j,x,y,ans=0,flag;
    cin>>n>>m;
    ll arr[n];
    map<ll,vector<ll> >m1;
    for(i=0;i<n;i++)
        cin>>arr[i];
    map<ll,ll> m2;
    for(i=0;i<m;i++){
        cin>>x>>y;
        x-=1;y-=1;
        m1[x].push_back(arr[y]);
        m1[y].push_back(arr[x]);
    }
    for(i=0;i<n;i++){
        vector<ll> temp=m1[i];
        if(temp.size()==0)
            ans+=1;
        else{
            flag=*max_element(temp.begin(),temp.end());
            if(arr[i]>flag)
                ans+=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 18084
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;

//ここから

void solve(){
  int w,a,b;
  cin>>w>>a>>b;
  if(a+w<b)cout<<abs(b-a-w);
  else if(b+w<a)cout<<abs(a-b-w);
  else cout<<0;
}

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


Measured memory_bytes: 256
//Coloring Dominoes

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using P = pair<ll,ll>;
using graph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

signed main (){
    int mod=1000000007;
    int n;string s,t;cin>>n>>s>>t;
    vector<int>a;
    rep(i,0,n){
        if(s[i]==t[i])a.pb(1);
        else {
            a.pb(2);
            i++;
        }
    }
    int ans=(a[0]==1?3:6),l=a[0];
    rep(i,1,a.size()){
        if(l==1)ans*=2;
        else if(l==2&&a[i]==2)ans*=3;
        ans%=mod;
        l=a[i];
    }
    cout<<ans<<nnn;
    return 0;
}

Measured memory_bytes: 3624
#include <cstdlib>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

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

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

template<typename T> pair<T, T> operator-(const pair<T, T>& a, const pair<T, T>& b) {
	return make_pair(a.first - b.first, a.second - b.second);
}

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

	for(int m; cin >> m, m;) {
		pair<int, int> origin;
		cin >> origin;

		vector<pair<int, int> > pos;
		for(int i = 1; i < m; ++i) {
			pair<int, int> in;
			cin >> in;
			pos.push_back(in - origin);
		}

		int n;
		cin >> n;

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

		for(int i = 0; i < n; ++i) {
			for(int j = 0; j < m - 1; ++j) {
				for(int k = 0; k < n; ++k) {
					if(i == k)
						continue;

					if(pos[j] == stars[k] - stars[i])
						goto next;
				}

				break;

			next:;
				if(j == m - 2) {
					cout << stars[i] - origin << endl;
					goto success;
				}
			}
		}

	success:;
	}


	return EXIT_SUCCESS;
}

Measured memory_bytes: 1220
import math
 
N = 1000001
 
spf = [*range(N)]
i = 2
while i * i < N:
  if spf[i] == i:
    for j in range(i * i, N, i):
      if spf[j] == j:
        spf[j] = i
  i += 1
  
r = 'pairwise'
 
input()
d = None
u = set()
for x in map(int, input().split()):
  d = math.gcd(d or x, x)
  s = set()
  while x > 1:
    p = spf[x]
    if p in u:
      r = 'setwise'
    s.add(p)
    x //= p
  u |= s
print((r, 'not')[d > 1], 'coprime')


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

ll query(ll n) {
  cout << n << endl;
  string res; cin >> res;
  if(res == "Vacant") exit(0);
  return res == "Female";
}

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

  ll x = query(0);
  ll l = 0, h = N;
  REP(i, 1, 20) {
    ll m = (l + h) / 2;
    ll y = query(m);
    if((m - l) % 2 == 0 && x == y) {
      l = m;
      x = y;
    } else if((m - l) % 2 == 1 && x == y) {
      h = m;
    } else if((m - l) % 2 == 0 && x != y) {
      h = m;
    } else if((m - l) % 2 == 1 && x != y) {
      l = m;
      x = y;
    }
  }
  assert(false); // not reached
}


Measured memory_bytes: 852
// -- 霊長類の競プロ
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <numeric>

using namespace std;

int main(int argc, const char * argv[]) {
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;
    double ans = 0;
    
    cin >> N;
    
    double A;
    
    for(int i=0;i<N;i++){
        cin >> A;
        ans+=1/A;
    }
    
    cout << 1/ans << endl;

    return 0;
}



Measured memory_bytes: 256
def resolve():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip())
    ans = {"AC":0, "WA":0, "TLE":0, "RE":0 }

    for _ in range(n):
        s = input().rstrip()
        ans[s] += 1

    for key, val in ans.items():
        print(key + " x " + str(val))



if __name__ == "__main__":
    resolve()


# を理解する。そうすると、明らかに制限時間内に実行が終わらないソースコードを出さなくなる。ちなみに、競プロでは 108108 ～ 109109 回程度のループが回せるといわれている。

Measured memory_bytes: 67912
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define RREP(i, a, n) for(int i=n-1; i>=a; i--)
#define INF 100000000
#define ll long long

queue<string> str;
int main()
{
	string S;
	vector<string> gene;
	cin >> S;
	
	gene.push_back("A");
	gene.push_back("B");
	gene.push_back("C");

	str.push(S);
	while (!str.empty()) {
		string s = str.front();
		str.pop();

		if (s.size() == 3 && s == "ABC") {
			cout << "Yes" << endl;
			return 0;
		}

		REP(i, 0, 3) {
			int cnt = 0;
			string ns = s;
			vector<int> idx;
			bool flag = false;

			RREP(j, 0, (int)s.size() - 2) {
				if (ns[j] == 'A' && ns[j + 1] == 'B' && ns[j + 2] == 'C') {
					flag = true;
					idx.push_back(j);
					cnt++;
				}
			}
			
			if (cnt != count(ns.begin(), ns.end(), 'A' + i)) continue;

			REP(k, 0, (int)idx.size()) {
				ns.replace(idx[k], 3, gene[i]);
			}

			if (flag) str.push(ns);
		}
	}

	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3196
x = input()
ls_x = x.split()

for i in range(len(ls_x)):
    ls_x[i] = int(ls_x[i])


ct7=0
for i in range(len(ls_x)):
    if ls_x[i]==7:
        ct7 = ct7 + 1


ct5=0    
for i in range(len(ls_x)):
    if ls_x[i]==5:
        ct5 = ct5 + 1
    
if (ct7==1) and (ct5==2):
    print("YES")

else:
    print("NO")


Measured memory_bytes: 3064
#include <stdio.h>

int main() {
    bool some = false;
    int x;
    double w, h;
    while (scanf("%d,%lf,%lf", &x, &w, &h) != EOF) {
        if (w >= 25*h*h) {
            printf("%d\n", x);
            some = true;
        }
    }
    if (!some) puts("ツ該ツ督鳴づ按つオ");
    return 0;
}

Measured memory_bytes: 0
#include <iostream>

int arr[100005];

int main()
{
	int n, k;
	std::cin >> n >> k;
	for (int i = 0; i < n; ++i)
		std::cin >> arr[i];
	int count = 0;
	int i = 1;
	while (true)
	{
		if (i + k - 1 > n)
		{
			if (i < n && n < i + k - 1)
				++count;
			break;
		}
		i = i + k - 1;
		++count;
	}
	std::cout << count << '\n';
	return 0;
}

Measured memory_bytes: 640
n,x = gets.split.map(&:to_i)
a = gets.split.map(&:to_i).sort
(n-1).times{|i| a[i+1] += a[i]}
puts a[n-1] > x ? a.index{|e| e > x} : (a[n-1] == x ? n : n - 1)

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

constexpr int INF = 1'000'000'000;
int N, M;
int d[1100][1100], pr[1100][1100];
std::vector<int> G[1100];
std::vector<int> cycle;

void bfs(int s){
    std::queue<int> que;
    d[s][s] = 0;
    que.emplace(s);
    
    until(que.empty()){
        int v = que.front();
        que.pop();

        for(int w : G[v]){
            if(d[s][w] > d[s][v] + 1){
                d[s][w] = d[s][v] + 1;
                pr[s][w] = v;
                que.emplace(w);
            }
        }
    }
}

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

    std::cin >> N >> M;

    for(int i=0;i<M;++i){
        int A, B;
        std::cin >> A >> B;

        G[A].emplace_back(B);
    }

    std::fill(&d[0][0], &d[0][0] + 1100 * 1100, INF);

    for(int i=1;i<=N;++i){
        bfs(i);
    }

    int a = -1, b = -1, c = -1;

    for(int i=1;i<=N;++i){
        for(int j=i+1;j<=N;++j){
            int c2 = d[i][j] + d[j][i];

            if(c2 >= INF){
                continue;
            }

            if(a == -1 || c2 < c){
                a = i;
                b = j;
                c = c2;
            }
        }
    }

    if(a == -1){
        std::cout << -1 << std::endl;
        return 0;
    }

    int cur = a;
    while(cur != b){
        cycle.emplace_back(cur);
        cur = pr[b][cur];
    }

    while(cur != a){
        cycle.emplace_back(cur);
        cur = pr[a][cur];
    }

    std::cout << cycle.size() << std::endl;

    for(int v : cycle){
        std::cout << v << std::endl;
    }
}


Measured memory_bytes: 9728
#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <iomanip>
#include <math.h>
#include <list>
#include <numeric>
using namespace std;

long long combi(long long n, long long k) {
  if (n == k || k == 0)
    return 1;
  else {
    return combi(n - 1, k - 1) + combi(n - 1, k);
  }
}

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

int main(){
  double A,B,H,M;
  cin >> A >> B >> H >>M;

  double angle = abs(H*30+0.5*M-M*6);
  angle = min(angle,(360 - angle));
  
  double ans =A*A + B*B - 2*A*B*cos(M_PI / 180 * angle) ;
  cout << fixed << setprecision(20) << sqrt(ans) << endl;
 
}
 


Measured memory_bytes: 4092
#include <cstdio>

int N, M;
long long res;

void solve()
{
	if(N==1 && M==1)
		res = 1;
	else if(N==1 && M>1){
		res = M-2;
	}
	else if(N>1 && M==1)
		res = N-2;
	else{
		res = 1ll*(M-2)*(N-2);
	}
	printf("%lld\n", res);
}

int main()
{
	scanf("%d%d", &N, &M);
	solve();
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <cmath>
#include <ios>
#include <ctype.h>
#include <stack>
#include <istream>
#include <stdio.h>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>
#include <functional>
#include <bitset>
#include <list>
#include <deque>
#include <time.h>
#include <random>
#include <iomanip>
#include <fstream>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define pint pair<int,int>
const int INF = 1000000007;
const long double EPS = 1e-15;
const long double PI = acos(-1);
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;
using Graph_weighted = vector<vector<pair<int,int>>>;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll ceil(const ll a, const ll b) { return (a + b - 1) / b; }
int main(){
  ll n,k;
  cin >> n >> k;
  ll ans = 0;
  for(ll i = k; i <= n + 1; i++){
    ll a = i * (i - 1) / 2,b = n * i - a;
    ans += b - a + 1;
    ans %= INF;
  }
  cout << ans % INF << endl;
  return 0;
}

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

int main() {
  int a, b, c, d, L, R;
  cin >> a >> b >> c >> d;
  L = a + b;
  R = c + d;
  
  if (L > R) {
    cout << "Left" << endl;
  }
  
  else if (L == R) {
    cout << "Balanced" << endl;
  }
  
  else
    cout << "Right" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
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; }
//#define int long long

int n, m;
vector<int> g[100100];
vector<vector<int>> color;

void dfs(int v, int d, int c) {
    if(color[v][d] != 0) return;
    color[v][d] = c;
    if(d == 0) return;
    dfs(v, d - 1, c);
    for(auto& nv: g[v]) {
        dfs(nv, d - 1, c);
    }
}

void solve() {
	cin >> n >> m;
    color.assign(n, vector<int>(11, 0));
    rep(i, m) {
        int a, b; cin >> a >> b; --a; --b;
        g[a].pb(b);
        g[b].pb(a);
    }
    int q; cin >> q;
    vector<int> v(q), d(q), c(q);
    rep(i, q) {
        cin >> v[i] >> d[i] >> c[i];
        --v[i];
    }
    per(i, q) {
        dfs(v[i], d[i], c[i]);
    }
    rep(i, n) {
        cout << color[i][0] << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}


Measured memory_bytes: 16248
#c
import numpy as np
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
if N>2:
    A[0]=B[0]
    for i in range(1,N-1):
        A[i]=min(B[i],B[i-1])
    A[N-1]=B[N-2]
    print(np.sum(A))
else:
    print(B[0]*2)

Measured memory_bytes: 12392
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int h,n,a,sum=0;
  cin>>h>>n;
  for(int i=0;i<n;++i)
  {
      cin>>a;
      sum+=a;
  }
  if(sum>=h)
    cout<<"Yes";
else
    cout<<"No";
}
  

Measured memory_bytes: 384
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#include <bitset>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < (n); i++)

using namespace std;

void solve() {
  long A, B;
  cin >> A >> B;
  long current = 1;
  long result = 0;
  while (current < B) {
    result ++;
    current += (A-1);
  }
  cout << result << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


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

int main() {
    while (1) {
        int H, W;
        cin >> H >> W;
        if (!(H)) break;
        
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                cout << '#';
            }
            cout << endl;
        }
        
        cout << endl;
    }
}


Measured memory_bytes: 3072