akhauriyash/Code-Regression huggingface dataset:
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vec;
typedef vector<P> pvec;
typedef vector<vector<int>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<int> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<int,vector<int>,greater<int>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> DX = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> DY = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const ll INF = (1LL << 60); // 1152921504606846976
const double PI = (3.141592653589794);
const double EPS = (0.0000000001); // 10^(-10)

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1) / b);}
template<class T> inline T round(T a, T b) {return T(a / b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template <class T> inline void out(T &a) { bool flag=true; for(auto&x:a){if(flag) {flag=false;} else{ cout << ' '; } cout<<x; } cout << endl; }



//----------------------------------------------------------------
int nmax=200000; // 2*(10^5)
vvec G(nmax);





void solve4ts()
{
  
  
  
  int n;
  double d;
  cin>>n>>d;
  int ans=0;
  rep(i,n){
    int x,y;
    cin>>x>>y;
    double z=sqrt(x*x+y*y);
    if(z<=d){
      ans++;
    }
  }
  cout<<ans<<endl;
}
//-----------------------------------------------------------------

signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15);
    int repeat = 1;
    // cin >> repeat;
    while(repeat--) solve4ts();
}

/*

g++ -std=c++1z code.cpp
./a.out

*/

Measured memory_bytes: 7792
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define dbg(x) cerr << #x"=" << x << endl;
const int MAX_N = 2*1e3+100;
const int MOD = 1e9+7;
int n,m;
char s[MAX_N][MAX_N];
int dir[4][2] = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
int r[MAX_N][MAX_N], c[MAX_N][MAX_N];


int main(){
    //freopen("in.txt", "r", stdin);
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i){
        scanf("%s", s[i]);
    }
    for(int i = 0; i < n; ++i){
        int f = 0, now = 0;
        int j;
        for(j = 0; j < m; ++j){
            if(s[i][j] == '.'){
                ++now;
            } else { // 当前是'#'
                for(int k = f; k < j; ++k) r[i][k] = now;
                now = 0;
                f = j+1;
            }
        }
        for(int k = f; k < j; ++k){
            r[i][k] = now;
        }
    }

    for(int i = 0; i < m; ++i){
        int f = 0, now = 0;
        int j;
        for(j = 0; j < n; ++j){
            if(s[j][i] == '.'){
                ++now;
            } else { // 当前是'#'
                for(int k = f; k < j; ++k) c[k][i] = now;
                now = 0;
                f = j+1;
            }
        }
        for(int k = f; k < j; ++k){
            c[k][i] = now;
        }
    }

    int ans = 0;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            ans = max(ans, r[i][j] + c[i][j] - 1);
        }
    }
    cout << ans << endl;
    return 0;
}


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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++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 irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, 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; }

const ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  ll ans=0;
  rep(i,n){
    while(a[i]%2==0){
      ans++;
      a[i]/=2;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
template<class T> bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

int main() {
    int a, b;
    cin >> a >> b;
    if (a <= b) cout << "unsafe" << '\n';
    else cout << "safe" << '\n';
    return 0;
}

Measured memory_bytes: 3644
from collections import Counter

n, m = map(int, input().split())
cards = Counter(map(int, input().split()))
for i in range(m):
  cards.update({y: x for x, y in (map(int, input().split()),)})

c_num = 0
_sum = 0
for k in sorted(list(cards.keys()), reverse=True):
  if c_num == n:
    break
  if c_num + cards[k] > n:
    _sum += (n - c_num) * k
    break
  else:
    _sum += cards[k] * k
    c_num += cards[k]
print(_sum)

Measured memory_bytes: 32448
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string a,b,c;
    while(cin>>a, a!="0"){
        cin>>b>>c;
        ll n = a.size();
        vvl dp(n+1, vl(2,0));
        dp[n][0]=1;
        rrep(i,n){
            ll up=0,keep=0;
            rep(p,10)if(a[i]=='?' or a[i]-'0' == p)if(i or p)
            rep(q,10)if(b[i]=='?' or b[i]-'0' == q)if(i or q){
                rep(r,2){
                    if(c[i]=='?' or c[i]-'0' == (p+q+r)%10)if(i or (p+q+r<10 and p+q+r)){
                        // puta(p,q,r,dp[i+1][r]);
                        if(p+q+r>=10)dp[i][1]=(dp[i][1]+dp[i+1][r])%MOD;
                        else dp[i][0]=(dp[i][0]+dp[i+1][r])%MOD;
                    }
                }
            }
            // puta(dp[i]);
        }
        puta(dp[0][0]);
    }
    return 0;
}


Measured memory_bytes: 3172
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int H,W,i,j,l;
    
    for (i=0; ; i++) {
        scanf("%d %d",&H,&W);
        if (H==0&&W==0) {
            break;
        }
        for (j=0; j<H; j++) {
            for (l=0; l<W; l++) {
                printf("#");
            }
            printf("\n");
        }
    printf("\n");
    }
    return 0;
}

Measured memory_bytes: 572
S = list(map(int, input().split()))
K, N= S[0], S[1]
A = list(map(int, input().split()))

# それぞれの家の間隔リストを作る
kankaku = [0] * N

for i, v in enumerate(A):
	if i == 0:
		# 最後の家との距離
		kankaku[i] = A[i] + (K - A[N - 1])
	else:
		kankaku[i] = v - A[i - 1]

kankaku.remove(max(kankaku))
print(sum(kankaku))

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string s;
    cin >> s;
    int n=s.size()-1;
    if(s[n]=='s'){
        cout << s << "es" << "\n";
    }else{
        cout << s << "s" << "\n";
    }
    return 0;
    
}   

Measured memory_bytes: 3620
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <ctime>
#include <map>
#include <stack>
#include <sstream>
#include <set>
#include <cmath>
#include <functional>
#include <memory.h>

// pi = atan(1)*4;

using namespace std;

int main(void)
{
	int a, b;

	cin >> a >> b;

	cout << (a + b) % 24 << '\n';

	return 0;
}

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

using namespace std;

int main() {
    int n;
    int vec[3][3];
    bool seen[3][3];
    int nums[10];

    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> vec[i][j];
        }
    }
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> nums[i];
    }
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            seen[i][j] = false;
            for (int k = 0; k < 10; k++) {
                if (nums[k] == vec[i][j]) {
                    seen[i][j] = true;
                }
            }
        }
    }
    string ans = "No";

    // Rows
    for (int i = 0; i < 3; i++) {
        if (seen[i][0] && seen[i][1] && seen[i][2]) {
            ans = "Yes";
        }
    }

    // Cols
    for (int i = 0; i < 3; i++) {
        if (seen[0][i] && seen[1][i] && seen[2][i]) {
            ans = "Yes";
        }
    }
    if (seen[0][0] && seen[1][1] && seen[2][2]) ans = "Yes";
    if (seen[0][2] && seen[1][1] && seen[2][0]) ans = "Yes";
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
H, W, K = map(int, input().split())
X = [input() for _ in range(H)]

ans = 0
for bit_h in range(2 ** H):
    for bit_w in range(2 ** W):
        cnt = 0
        for i in range(H):
            for j in range(W):
                if (bit_h >> i & 1) and (bit_w >> j & 1) and X[i][j] == "#":
                    cnt += 1
                    
        ans += int(cnt == K)
        
print(ans)


Measured memory_bytes: 68360
#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>;

ll A, B;

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

  std::cin >> A >> B;

  A %= B;

  ll C = std::abs(A - B);
  ll res = std::min(A, C);
  std::cout << res << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli a[3];
int main() {
  read_n(a, 3);
  if (a[1] == a[2] && a[1] == a[0]) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using std::cin;
typedef long long ll;
const int INF=1e+9;
const ll INFLL=1e+17;
int N;
int A[100010];
int cuml[100010],cumr[100010];
int gcd(int a,int b){
  if(b==0) return a;
  else return gcd(b,a%b);
}
void cumgcd(){
  cuml[0]=0;cumr[0]=0;
  rep1(i,N){
    cuml[i]=gcd(cuml[i-1],A[i-1]);
  }
  rep1(i,N){
    cumr[i]=gcd(cumr[i-1],A[N-i]);
  }
}
void solve(){
  int res=0;
  rep(i,N){
    int temp=gcd(cuml[i],cumr[N-i-1]);
    res=std::max(res,temp);
  }
  prin(res);
}
int main(){
  cin>>N;
  rep(i,N) cin>>A[i];
  cumgcd();
  solve();
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(17) << res << endl;
 
int main() {
    ll x;
    cin >> x;
    map<ll,ll> v;
    ll i = 0;
    v[0] = 0;
    ++i;
    ll j = 0;
    bool positive = true;
    while (true) {
        //./a   cerr << i << endl;
        auto p = i * i;
        p = p * p * i;
        if (p == x) {
            j = 0;
            break;
        }
        if (v[abs(p-x)] != 0) {
            j = v[abs(p-x)];
            if (p < x) {
                j = -j;
            }
            break;
        }
        v[p] = i;
        ++i;
    }
    cout << i << " " << j << endl;
}


Measured memory_bytes: 3644
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
const int inf = 10e9 + 7;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,m,n) for(int i=m;i<n;i++)
#define endre getchar(); getchar();return 0;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int a[100010];int n;
signed main() {
	cin >> n;
	rep(i, n) {
		cin >> a[i];
	}
	int ans = a[0];
	loop(i, 1, n) {
		ans = gcd(ans, a[i]);
	}
	cout << ans << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e9;
const ll MOD = 1e9 + 7;


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

    vector<int> v(4);
    rep(i, n){
        string s;
        cin >> s;
        if(s == "AC") v[0]++;
        if(s == "WA") v[1]++;
        if(s == "TLE") v[2]++;
        if(s == "RE") v[3]++;
    }

    cout << "AC x " << v[0] << endl;
    cout << "WA x " << v[1] << endl;
    cout << "TLE x " << v[2] << endl;
    cout << "RE x " << v[3] << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <sstream>
#include <vector>
//#include <numeric>
//#include <algorithm>
#include <cmath>
#include <string>
//#include <map>
//#include <iomanip>
using namespace std;

//関数getinputdata宣言
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();

void abc108_b(vector<vector<int>> v) {

    int x1 = v[0][0];
    int y1 = v[0][1];
    int x2 = v[0][2];
    int y2 = v[0][3];

    int x = x2 - x1;
    int y = y2 - y1;

    int x3 = x2 - y;
    int y3 = y2 + x;

    int x4 = x3 - x;
    int y4 = y3 - y;

    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;



}

int main() {

    //    vector<vector < string>> vec_arr_result;
    vector<vector<int>> vec_arr_result;
    vec_arr_result = getinputdata2();

    abc108_b(vec_arr_result);

    return 0;
}

//関数getinputdata実装

vector<vector<double>> getinputdata3() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<double>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<double> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atof(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;
}

//関数getinputdata実装

vector<vector<int>> getinputdata2() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<int>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<int> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atoi(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;


}

//関数getinputdata実装

vector<vector < string >> getinputdata() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector < string>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<string> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(ret);
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;

}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int n, d[1000], i, j, m, a=1;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&d[i]);
    
    for(i=0;i<n;i++){
        m=d[i];
        for(j=i;j<n;j++){
            if(d[j]>m){
                m=d[j];
                d[j]=d[i];
                d[i]=m;
            }
        }
    }
    for(i=1;i<n;i++){
        if(d[i]<d[i-1]){
            a++;
        }
    }
    printf("%d\n",a);
    return 0;
}

Measured memory_bytes: 1736
module Main (main) where

import qualified Data.ByteString.Char8     as C8
import           Data.Maybe
import           Data.Bool

main :: IO ()
main = do
  [a,b] <- readInts
  print . showAnswer $ solve (a,b)

type Input  = (Int, Int)
type Output = Bool

solve :: Input -> Output
solve (a,b) = even (a*b)

showAnswer :: Output -> Answer
showAnswer = String . bool "Odd" "Even"

-- utils
readInts :: IO [Int]
readInts = map (fst . fromJust . C8.readInt) . C8.words <$> C8.getLine

data Answer
  = YesNo Bool
  | YESNO Bool
  | AB Bool
  | Number Int
  | String String
  | Compare Ordering
  | Compare2 Ordering

instance Show Answer where
  show (YesNo b)   = if b then "Yes" else "No"
  show (YESNO b)   = if b then "YES" else "NO"
  show (AB b)      = if b then "A"   else "B"
  show (Number i)  = show i
  show (String s)  = s
  show (Compare o)
    | o == EQ = "="
    | o == LT = "<"
    | o == GT = ">"
  show (Compare2 o)
    | o == EQ = "Balanced"
    | o == LT = "Right"
    | o == GT = "Left"

Measured memory_bytes: 380
#include<iostream>
#include<algorithm>

using namespace std;

const long int INF=1000000000;//十分大きな値にする

//入力
int n,A,k;
long int h[100010];

//DPテーブル
long int dp[100010];
//dp[i+1][j]:=i番目までの整数のなかから総和がjとする方法そ全て考えたときのコストの最小値
int main(){
cin >>n>>k;

for(int i=1;i<=n;++i)cin >>h[i];

for(int i=0;i<100010;++i)dp[i]=INF;
dp[1]=0;//dp[1]だけ0に=1番目の足場にたどり着くコスト=0
dp[2]=abs(h[1]-h[2]);
long int minD=INF;//
for(int i=3;i<=n;i++){
    minD=INF;
    if(i>k){
    for(int l=1;l<=k;l++){
        minD=min(minD,dp[i-l]+abs(h[i]-h[i-l]));
    }
    }
    else
    {
       for(int l=1;i-l>=1;l++){
        minD=min(minD,dp[i-l]+abs(h[i]-h[i-l]));
    } 
    }
    
    dp[i]=minD;

}

cout <<dp[n]<<endl;

}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string s,r;
   cin>>s;
   r=s;
  int i,j;
   reverse(s.begin(),s.end());
   if(r!=s)
     cout<<"No";
   else
   {
      i=0;
      j=(s.size()-1)/2-1;
     while(i<j)
     {
       if(s[i]!=s[j])
       {
          cout<<"No";
          return 0;
       }
       i+=1;
       j-=1;
     }
     cout<<"Yes";
   }
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <cassert>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <list>
#include <forward_list>
#include <array>
#include <cstring>
#include <cmath>
#include <tuple>
#include <complex>
#include <bitset>
#include <climits>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using LD = long double;
using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pld = pair<LD, LD>;
int len_S, len_T;


int get_nr_diff_chrs(const deque<char> &cur_str, const string searched_str)
{
    int res = 0;
    for (int i = 0; i < len_T; ++i)
    {
        res += cur_str[i] != searched_str[i];
    }

    return res;
}


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

    string S, T;
    cin >> S >> T;
    len_S = S.size(), len_T = T.size();
    
    deque<char> cur_str;
    for (const char &chr : S.substr(0, len_T))
    {
        cur_str.emplace_back(chr);
    }
    int ans = get_nr_diff_chrs(cur_str, T);
    for (int i = 1; i + len_T < len_S; ++i)
    {
        cur_str.pop_front();
        cur_str.emplace_back(S[i + len_T - 1]);

        ans = min(ans, get_nr_diff_chrs(cur_str, T));
    }

    cout << ans;
}


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

int main() {
  int N;
  string S, T;
  string newString = "";
  cin >> N;
  cin >> S >> T;

  for (int i = 0; i < N; i++) {
    newString += S[i];
    newString += T[i];
  }

  cout << newString << endl;
  return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() int {
	sc.Scan()
	data, _ := strconv.Atoi(sc.Text())
	return data
}

func main() {
	data := []int{}
	for sc.Scan() {
		i, _ := strconv.Atoi(sc.Text())
		data = append(data, i)
	}
	k := data[5]

	for i := 0; i < len(data)-2; i++ {
		for j := 1; j < len(data)-1; j++ {
			v1 := data[i]
			v2 := data[j]
			if (v2 - v1) > k {
				fmt.Println(":(")
				return
			}
		}
	}
	fmt.Println("Yay!")
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n;
	cin>>n;
	vector<pair<ll,ll>>ch;
	for(ll i=0;i<n;i++){
		ll x,y;
		cin>>x>>y;
		ll s=x-y;
		ll e=x+y;
		ch.push_back(make_pair(e,s));
	}
	sort(ch.begin(),ch.end());
	ll r=ch[0].first;
	ll cnt=0;
	for(ll i=1;i<n;i++){
		if(r<=ch[i].second){
			r=ch[i].first;
		}
		else{
			cnt++;
		}
	}
	cout <<n-cnt;
	// your code goes here
	return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long int;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1e10;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;

int main() {
    int n,d[100005];
    cin >> n;
    rep(i,n) cin >> d[i];
    sort(d,d+n);
    int ans;
    if (n%2) ans = 0;
    else{
        ans = d[n/2]-d[n/2-1];
    }
    PRINT(ans);
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<int, pair<int, int>> PP;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const ll mod = 1e+9 + 7;
const int INF = 1001001001;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

int n;
ll k;
vector<ll> a;
vector<ll> negative, positive, zero;
int sz_p, sz_n, sz_z, sz_h;
ll negative_cnt;
ll zero_cnt;
vector<ll> hoge;

bool C2(ll x){
    ll res = 0;
    for(int i = 0; i < sz_n - 1; ++i){
        res += upper_bound(negative.begin() + i + 1, negative.end(), x / negative[i]) - (negative.begin() + i + 1);
    }
    for(int i = 0; i < sz_p - 1; ++i){
        res += upper_bound(positive.begin() + i + 1, positive.end(), x / positive[i]) - (positive.begin() + i + 1);
    }
    return res >= k - negative_cnt - zero_cnt;
}

bool C1(ll x){
    ll res = 0;
    for(int i = 0; i < sz_n; ++i){
        res += upper_bound(positive.begin(), positive.end(), x / negative[i]) - positive.begin();
    }
    return res <= negative_cnt - k;
}

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

    cin >> n >> k;
    a.resize(n);
    for(int i = 0; i < n; ++i){
        cin >> a[i];
        if(a[i] == 0)   zero.push_back(a[i]);
        else if(a[i] > 0)   positive.push_back(a[i]);
        else    negative.push_back(-a[i]);
    }
    sz_p = positive.size();
    sz_n = negative.size();
    sz_z = zero.size();

    negative_cnt = (ll)sz_p * sz_n;
    zero_cnt = (ll)sz_z * (n - sz_z) + (ll)sz_z * (sz_z - 1) / 2;
    if(k > negative_cnt && k <= negative_cnt + zero_cnt){
        cout << 0 << endl;
        return 0;
    }
    sort(negative.begin(), negative.end());
    sort(positive.begin(), positive.end());
    if(k <= negative_cnt){
        ll lb = 0, ub = 1e+18;
        while(ub - lb > 1){
            ll mid = (lb + ub) / 2;
            if(C1(mid)) lb = mid;
            else    ub = mid;
        }
        cout << -ub << endl;
        return 0;
    }
    // for(int i = 0; i < sz_n; ++i)   hoge.push_back(negative[i]);
    // for(int i = 0; i < sz_p; ++i)   hoge.push_back(positive[i]);
    // sort(hoge.begin(), hoge.end());
    // sz_h = hoge.size();
    ll lb = 0, ub = 1e+18;
    while(ub - lb > 1){
        ll mid = (lb + ub) / 2;
        if(C2(mid))  ub = mid;
        else    lb = mid;
    }
    cout << ub << endl;
}

Measured memory_bytes: 4084
#include<stdio.h>
int main(){
  int s,a=1,i;
  scanf("%d",&s);
  for(i=0;i<=100;i++){
  if(s==1)
    break;
  if(a*2>s){
   break;
  }
    a=a*2;
  }
  printf("%d",a);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int i, g = 0,s;
	for (i = 0; i < 4; i++)
	{
		cin >> s;
		g += s;
	}
	cout << g / 60 << endl << g % 60 << endl;
	return 0;
}

Measured memory_bytes: 3008
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

	static Scanner scan = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int n = si();
		int[] h = new int[6];
		for (int i = 0; i < n; i++) {
			double k = Double.parseDouble(scan.next());
			if(k<165) h[0]++;
			else if(k<170) h[1]++;
			else if(k<175) h[2]++;
			else if(k<180) h[3]++;
			else if(k<185) h[4]++;
			else h[5]++;
		}
		for (int i = 0; i < 6; i++) {
			String ass = "";
			for (int j = 0; j < h[i]; j++) ass+="*";
			out.println((i+1)+":"+ass);
		}
		out.flush();
	}

	static int si() {
		return Integer.parseInt(scan.next());
	}
}

Measured memory_bytes: 17156
import sys
input = sys.stdin.readline

def main():
    n, m, c = map(int, input().split())
    b = list(map(int, input().split()))
    a = [list(map(int, input().split())) for i in range(n)]

    ans = 0
    for i in a:
        cnt = c
        for j in range(m):
            cnt += i[j] * b[j]
        
        if cnt > 0:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

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

    vector<int> V(N);
    for (int i = 0; i < N; i++)
    {
        cin >> V[i];
    }

    vector<int> C(N);
    for (int i = 0; i < N; i++)
    {
        cin >> C[i];
    }

    int ans = 0;
    for (int i = 0; i < (1 << N); i++)
    {
        int v = 0;
        int c = 0;
        bitset<32> b(i);
        for (int j = 0; j < N; j++)
        {
            if (b[j])
            {
                v += V[j];
                c += C[j];
            }
        }
        ans = max(ans, v - c);
    }
    cout << ans << endl;
}


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

int main()
{
    int a , b , c ;
    cin >> a >> b >> c ;
    cout << a <<" "<< b <<" "<< 3*c-a-b <<" "<< endl ;
    cout << 4*c-2*a-b <<" "<< c <<" "<< 2*a+b-2*c <<" "<< endl ;
    cout << a+b-c <<" "<< 2*c-b <<" "<< 2*c-a <<" "<< endl ;
    return 0 ;
}

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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i) // ROF(i,n,0)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで降順
#define pb push_back
#define eb emplace_back
#define fst first
#define snd second
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>T add(const T &a, const T &b){return (a+b)%mod;}

vector<vector<int>> g;
vector<int> par,d;
int ans = 1;
int n, k;
vi data;

void dfs(int s){ // sを根としてdfs
  stack<int> st;
  d[s] = 0;
  st.push(s);
  
  while(!st.empty()){
    int next = st.top();
    st.pop();
    if(next != s){
      ans *= k - data[par[next]];
      ans %= mod;
      data[next] = 2;
      data[par[next]]++;
    }else{
      ans *= k;
      data[s] = 1;
    }
    
    rep(i, g[next].size()){
      int c = g[next][i];
      
      if(d[c] == -1){
	par[c] = next;
	d[c] = d[next] + 1;
	st.push(c);
      }
    }
  }
}

signed main(){
  cin >> n >> k;
  g.resize(n);
  rep(i,n-1){
    int a, b; cin >> a >> b; a--; b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  d.resize(n,-1);
  par.resize(n,-1);
  data.resize(n,-1);
  dfs(0);
  cout << ans << endl;
}


Measured memory_bytes: 9716
# coding: utf-8

n = int(input())
a = [int(x) for x in input().split()]

count = 0
xor_result = 0
sum_result = 0
r = 0

for l in range(0, n):
    while r < n:
        x = a[r]
        if sum_result & x != 0:
            break
        xor_result ^= x
        sum_result += x
        r += 1
    count += r - l
    xor_result ^= a[l]
    sum_result -= a[l]

print(count)


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

int main() {
    int64_t a, b, c, d, ans = INT64_MIN;
    cin >> a >> b >> c >> d;
    ans = max(a * c, ans);
    ans = max(b * c, ans);
    ans = max(a * d, ans);
    ans = max(b * d, ans);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N;
int A[200003];

int main() {
  INCANT;
  cin >> N;
  rep(i, N) cin >> A[i];
  int total_xor=A[0];
  rep(i, N) {
    if (i==0) continue;
    total_xor = total_xor ^A[i];
  }
  rep(i, N) {
    int a = total_xor ^ A[i];
    cout << a << ' ';
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 4404
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
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; }

const ll INF=1e18;
//abc168

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    double a,b,h,m;
    cin>>a>>b>>h>>m;
    double s=(double)360*h/12+30*m/60;
    double t=360*m/60;
    double u=fabs(s-t);
    if(u>180) u=360-u;
    cout<<FS<<(double)sqrt(a*a+b*b-2*a*b*cos(u*M_PI/180))<<endl;
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
//どうしてもわからないときはサンプルで実験　何か見えてくるかも
//頭で考えてダメなら紙におこせ！！
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ！
(適切にmodをとれ　にぶたんで途中で切り上げろ)
制約をよく読め！
{
    ・全探索できるなら全探索しろ
    ・異常な制約ならそこに注目
}
stringの計算量(扱い)注意
コーナー注意！(特に数値が小さいものについては要検証)
N行出力のときは'¥n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え('='でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ！
*/

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_BIT = (int)(5e3 + 5);

int n, m;

vector<ll> as;
vector<int> cs;

ll memo[MAX_BIT];

int main(void) {
  // Here your code !
  scanf("%d %d", &n, &m);

  for (int i = 0; i < m; ++i) {
    ll a;
    int b;
    scanf("%lld %d", &a, &b);
    as.push_back(a);

    int empty_bit = 0;
    cs.push_back(empty_bit);

    for (int j = 0; j < b; ++j) {
      int c;
      scanf("%d", &c);

      cs.back() |= (1 << (c - 1));
    }
  }

  for (int i = 0; i < MAX_BIT; ++i) {
    memo[i] = INF;
  }

  // printf("size: %d\n", cs.size());

  // for (int i = 0; i < cs.size(); ++i) {
  //   auto key_set = cs[i];
  //   if (mp.find(key_set) == mp.end()) {
  //     mp[key_set] = as[i];
  //   } else {
  //     mp[key_set] = min(mp[key_set], as[i]);
  //   }
  // }

  priority_queue<pair<ll, int>> pq;

  int empty_bit = 0;
  pq.push(make_pair(0L, empty_bit));
  memo[empty_bit] = 0L;

  while (!pq.empty()) {
    auto cur = pq.top();
    pq.pop();

    // for (auto &e : cur.second) {
    //   printf("%d ", e);
    // }
    // printf(": ");

    // printf("%lld\n", cur.first);

    for (int i = 0; i < cs.size(); ++i) {
      int new_bit = cur.second;

      new_bit |= cs[i];

      // for (auto &e : new_set) {
      //   printf("%d ", e);
      // }

      // printf("\n");

      if (memo[new_bit] > cur.first + as[i]) {
        memo[new_bit] = cur.first + as[i];
        pq.push(make_pair(memo[new_bit], new_bit));
      }
    }
  }

  // printf("---------------------\n");

  int key = 0;
  for (int i = 0; i < n; ++i) {
    key |= (1 << i);
  }

  // printf("key: ");
  // for (auto &e : key) {
  //   printf("%d ", e);
  // }
  // printf("\n");

  // for (auto &e : mp) {
  //   for (auto &d : e.first) {
  //     printf("%d ", d);
  //   }
  //   printf(": ");

  //   printf("%lld\n", e.second);
  // }

  if (memo[key] == INF) {
    printf("%lld\n", -1L);
  } else {
    printf("%lld\n", memo[key]);
  }

  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;;
#define ll long long
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
const int MOD = 1000000007;
 
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int main(){
    ll n, t;
    cin >> n >> t;
    ll m = LINF, dif = 0;
    vector<ll> a(n);
    REP(i,n){
        cin >>  a[i];
        m = min(m,a[i]);
        if(i!=0 && a[i] - m > dif){
                dif = a[i] - m;
        }
    }
    m = LINF;
    ll smtmp = 0;
    ll bgtmp = 0;
    ll ans = 0;
    REP(i,n){
        if(a[i] < m){
            m = a[i];
            if(smtmp & bgtmp) ans += max(smtmp, bgtmp);
            smtmp = 1;
            bgtmp = 0;
        }else if(a[i] == m){
            smtmp++;
        }
        if(i!=0 && a[i] - m == dif){
            bgtmp++;
        }
    }
    if(smtmp & bgtmp) ans += max(smtmp, bgtmp);
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
#define dump(a) cout << (a) << endl;
typedef long long ll;

int main() {
    int prime[100001] = {};
    for( int i = 2; i <= 100000; i++ ) prime[i] = 1;
    for( int i = 2; i*i <= 100000; i++ ) {
        if( prime[i] == 0 ) continue;
        for( int j = i*2; j <= 100000; j+=i ) {
            prime[j] = 0;
        }
    }
    for( int i = 99999; 3 <= i; i-=2 ) if( prime[i] == 0 || prime[(i+1)/2] == 0 ) prime[i] = 0;
    prime[2] = 0;
    for( int i = 2; i < 100000; i++ ) prime[i+1] += prime[i];
    int n;
    cin >> n;
    while ( n-- > 0 ) {
        int l, r;
        cin >> l >> r;
        dump( prime[r]-prime[l-1] );
        // for( int i = l; i <= r; i++ ) if( prime[i] == 1 ) dump( i );
    }
    return 0;  
}

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

int main(){
  long int N,a[5];
  cin >> N >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
  long int min = a[0];
  
  for(int i=1; i<5; i++){
    if(a[i] < min) {
      min = a[i];
    }
  }

  long int time;
  if(N%min>0) time =4+N/min + 1;
  else time = 4+N/min;
  
  cout << time << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<vector>
#define REP(i, n) for(int i=0;i<(n);++i)
#define PII pair<int, int>
using namespace std;
int main(){
    int H, W;
    cin>>H>>W;
    vector<vector<char> > map(H, vector<char>(W));
    queue<PII > que;
    REP(y, H){
        REP(x, W){
            cin >> map[y][x];
            if(map[y][x] == '#'){
                que.push(PII(y, x));
            }
        }
    }
    int ans = -1;
    bool flag = true;
    int mx[]={1, 0, -1, 0},my[]={0, 1, 0, -1};
    while(flag){
        flag = false;
        ++ans;
        queue<PII > nq;
        while(!que.empty()){
            PII d = que.front();
            que.pop();
            int ny = d.first;
            int nx = d.second;
            REP(i, 4){
                int nnx = nx + mx[i];
                int nny = ny + my[i];
                if(nnx == -1 || nnx == W || nny == -1 || nny == H)continue;
                if(map[nny][nnx]=='#')continue;
                map[nny][nnx]='#';
                nq.push(PII(nny, nnx));
                flag = true;
            }
        }
        que = nq;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<pair<ll,ll>> T(N);
  rep(i,N){
    cin >> T[i].first;
    cin >> T[i].second;
  }
  vector<pair<ll,ll>> pq;//異なる二点のx,y座標の差のペア列
  for(int i = 0;i<N;i++){
    for(int j = i+1;j<N;j++){
      pq.push_back(make_pair(T[i].first-T[j].first,T[i].second-T[j].second));
    }
  }
  /*for(int i = 0;i<pq.size();i++){
    cout << pq[i].first << " " << pq[i].second << endl;
  }*/

  
  ll cm = 0;
  for(int i = 0;i<pq.size();i++){
    ll count = 1;
    for(int j = 0;j<pq.size();j++){
      if(i == j) continue;
      if((pq[i].first == pq[j].first && pq[i].second == pq[j].second)
       || (pq[i].first == -pq[j].first && pq[i].second == -pq[j].second)) count++;
    }
    cm = max(cm,count);
  }
  cout << N-cm << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
int main(void){
  char s[201];
  scanf("%s",s);
  int i,n=strlen(s);
  for(i=n-2;i>0;i-=2){
    if(strncmp(s,s+i/2,i/2)==0){
      printf("%d",i);
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 128
div = 1000000007

n, m, *b = map(int, open(0).read().split())
a = set(b)
 
f = [0] * (n + 1)
f[0] = 1

if 1 not in a:
    f[1] = 1
 
for i in range(2, n + 1):
    if i in a:
        continue
    f[i] = (f[i - 1] + f[i - 2]) % div
 
print(f[-1])


Measured memory_bytes: 14180
import sys

n, k, *ab = map(int, sys.stdin.read().split())
ab = zip(*[iter(ab)] * 2)

def main():
    s = 0
    for a, b in sorted(ab):
        s += b
        if s >= k:
            return a

if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 25116
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static Input in = new Input(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int N = in.nextInt();
        int X = in.nextInt();
        int T = in.nextInt();

        out.println(((N + X - 1) / X) * T);

        out.flush();
    }

    static class Input {
        private BufferedReader br;
        private String[] buff;
        private int index = 0;

        Input(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        String next() {
            while (buff == null || index >= buff.length) {
                buff = nextLine().split(" ");
                index = 0;
            }
            return buff[index++];
        }
        byte nextByte() {
            return Byte.parseByte(next());
        }
        short nextShort() {
            return Short.parseShort(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        float nextFloat() {
            return Float.parseFloat(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }
    }
}


Measured memory_bytes: 32848
h, w = map(int, input().split())
grid = [[0]*(w) for _ in range(h)]

black = []
for i in range(h):
    for j, k in enumerate(input()):
        if k == "#":
            black.append((i, j))
            grid[i][j] = 1

ans = 0
d = ((0, 1),
     (1, 0),
     (0, -1),
     (-1, 0),)
while True:
    paint = []
    while black:
        x, y = black.pop()
        for nx, ny in d:
            if x+nx == -1 or x+nx == h or y+ny == -1 or y+ny == w:
                continue
            if not grid[nx + x][ny + y]:
                grid[nx + x][ny + y] = 1
                paint.append((nx + x, ny + y))

    if len(paint) == 0:
        break
    black = paint[:]
    ans += 1

print(ans)

Measured memory_bytes: 123600
/* ex_4-1. nknm */

#include <stdio.h>
#include <math.h>

//関数を宣言
int judge(int number, int capa);

int main(void){

    int number, capa, ans;

    scanf("%d%d", &number, &capa);

    //関数の計算結果を出力
    ans = judge(number, capa);
    printf("%d\n", ans);
    
    return 0;
}

int judge(int number, int capa){

    int result;
    
    //切り上げの有無で分岐
    if(number % (2 * capa + 1) == 0){
        result = number / (2 * capa + 1);
    }else{
        result = number / (2 * capa + 1) + 1;
    }
    return result;
}

Measured memory_bytes: 128
import Control.Monad
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S

solve :: M.Map Int Int -> S.Set Int -> [[Int]] -> Int
solve hMap hSet routeList
 | null routeList = S.size hSet
 | otherwise = solve hMap deletedHSet (tail routeList)
   where leftObservatory = (head routeList) !! 0
         rightObservatory = (head routeList) !! 1
         leftHeight  = hMap M.! leftObservatory
         rightHeight = hMap M.! rightObservatory
         deletedHSet = if leftHeight > rightHeight      then S.delete rightObservatory hSet
                       else if leftHeight < rightHeight then S.delete leftObservatory hSet
                       else S.delete rightObservatory$ S.delete leftObservatory hSet    
main = do
 [n,m] <- map read . words <$> getLine :: IO[Int]
 hList <- map read . words <$> getLine :: IO[Int]
 let hMap = M.fromList $ zip [1..] $ hList
 let hSet = S.fromList $ [1..n]
 routeList <- replicateM m (map read . words <$> getLine) :: IO[[Int]]
 print $ solve hMap hSet routeList


Measured memory_bytes: 211624