akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

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

int ans[100010];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<pii> E[100010];
    rep(i, n) ans[i] = -1;

    rep(i, n - 1) {
        int u, v, w;
        cin >> u >> v >> w;
        u--, v--;
        E[u].push_back(MP(v, w % 2));
        E[v].push_back(MP(u, w % 2));
    }

    queue<int> que;
    que.push(0);
    ans[0] = 0;

    while (!que.empty()) {
        int now = que.front();
        que.pop();
        for (auto e : E[now]) {
            if (ans[e.first] == -1) {
                que.push(e.first);
                ans[e.first] = (ans[now] ^ e.second);
            }
        }
    }
    rep(i, n) cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 6784
/*
  Contest 078
  B - ISU
  Rakesh Kumar --> 13/09/2020
 */

#include <bits/stdc++.h>

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0); std::cout.tie(0);

    int x = 0, y = 0, z = 0;
    std::cin >> x >> y >> z;
    int seats = x / (y + z);
    if (((seats * y) + ((seats + 1) * z)) > x)
        --seats;
    std::cout << seats << std::endl;

    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
typedef struct{
  string str;
  int start,end;
}P;
int main(){
  int n,m,a;
  while(1){
    cin >> n >> m;
    if(n==0&&m==0)break;
    P data[n];
    for(int i=0;i<n;i++){
      cin >> data[i].str >> a >> data[i].end;
      data[i].start = data[i].end - a + 1;
    }
    for(int i=0;i<m;i++){
      cin >> a;
      bool ok=false;
      for(int j=0;j<n;j++){
	if(data[j].start<=a&&data[j].end>=a){
	  ok = true;
	  cout << data[j].str << " " << a-data[j].start+1 << endl;
	}
      }
      if(!ok)cout << "Unknown" << endl;
    }
  }
}

Measured memory_bytes: 1276
#include<bits/stdc++.h>
using namespace std;
int main(){
    //long long c;
    //map<string,int>mp;
    //map<string,int>::iterator itr;
    long long n,c1,c2,c3,c4;
    cin>>n;
    string s;
    string arr1[n];
    c1=0,c2=0,c3=0,c4=0;
    for(int i=0;i<n;i++){
            cin>>arr1[i];
            if(arr1[i]=="AC"){
                c1++;
            }

            else if(arr1[i]=="WA"){
                c2++;
            }

            else if(arr1[i]=="TLE"){
                c3++;
            }

            else if(arr1[i]=="RE"){
                c4++;
            }
    }
    cout<<"AC x "<<c1<<endl;
    cout<<"WA x "<<c2<<endl;
    cout<<"TLE x "<<c3<<endl;
    cout<<"RE x "<<c4<<endl;

    //string arr[4]={"AC","WA","TLE","RE"};

    //cout<<arr[3]<<endl;
   /* for(int i=0;i<4;i++){
        cout<<arr[i]<<endl;
    }*/

            /*for(itr=mp.begin();itr!=mp.end();itr++){

                    cout<<itr->first<<"x"<<itr->second<<endl;

            }*/

    /*for(int i=0;i<4;i++){
        c==0;
        for(itr=mp.begin();itr!=mp.end();itr++){

                if(itr->first==arr[i]){
                    c++;
                    cout<<arr[i]<<" x "<<itr->second<<endl;
                    break;
                }
        }
        if(c==0){
             cout<<arr[i]<<" x "<<"0"<<endl;
        }

    }

*/
}


Measured memory_bytes: 6748
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
    int ans = 0;
    string S;

    cin >> S;

    for (int i = 0; i < 4; i++) {
        if(S[i] == '+') {
            ans++;
        }
        else {
            ans--;
        }
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }


signed main()
{
	int X;
	cin >> X;
	YESNO(X == 7 || X == 5 || X == 3);
}



Measured memory_bytes: 3032
#include <iostream>
#include <vector>
#include <sstream>
#include <string>

using namespace std;

int main()
{
    string S;
    cin >> S;

    stringstream ss{S};
    string buf;
    vector<int> split;

    while (getline(ss, buf, '/')) {
        split.push_back(stoi(buf));
    }

    if (split[0] < 2019) {
        cout << "Heisei";
        return 0;
    } else if (split[0] == 2019 &&
               split[1] <= 4 &&
               split[2] <= 30) {
        cout << "Heisei";
        return 0;
    }
    cout << "TBD";

    return 0;
}   


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

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

    int a, b;
    cin >> a >> b;
    if((a + b) % 3 == 0 || a % 3 == 0 || b % 3 == 0)
        cout << "Possible";
    else
        cout << "Impossible";

    return 0;
}

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

typedef long long ll;
typedef pair<int, int> P;

int MOD = 1e9 + 7;
ll INF = 1e18;

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

int main(){
    int n; cin>>n;
    vector<int> a(n+10, 0);
    for(int i=1; i<=n; i++) cin>>a[i];

    int sum=0;
    for(int i=0; i<=n; i++){
        sum += abs(a[i+1] - a[i]);
    }
    
    for(int i=1; i<=n; i++){
        int i_sum = sum + abs(a[i+1] - a[i-1]) - (abs(a[i] - a[i-1]) + abs(a[i+1] - a[i]));
        cout << i_sum << endl;
    }
}

Measured memory_bytes: 1664
N,M=list(map(int,input().split()))
l=[0]*N
for i in range(M):
   a,b=map(int,input().split())
   a-=1;b-=1
   l[a]+=1
   l[b]+=1
l=[i for i in l if i%2!=0]
print("YES") if len(l)==0 else print("NO")

Measured memory_bytes: 10144
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define EPS 1e-12
using namespace std;

int i;
double pr[111][55], tim[111][55];
double t[111], p[111], v[111];
int n, m;
long long comb[55][55];
double l;

double compute_t(int x, double v, double t) {
  return 1. * l / v + t * x;
}

double compute_p(int x, double p) {
  return (1.0 * comb[m][x]) * pow(p, x) * pow(1.0 - p, m - x);
}

void Pascal()
{
  for(int i = 0; i <= 50; i++) {
    comb[i][0] = 1;
    for(int j = 1; j <= i; j++) {
      comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1];
    }
  }
}

int main() {
  Pascal();         
  cin >> n >> m >> l;
  for(int i = 1; i <= n; i++) {
    cin >> p[i] >> t[i] >> v[i];
    p[i] /= 100.0;
  }

  for(int i = 1; i <= n; i++)
    for(int j = 0; j <= m; j++) {
      tim[i][j] = compute_t(j, v[i], t[i]);
      pr[i][j] = compute_p(j, p[i]);
    }
                              
  cout << fixed << setprecision(6);
  
  
  for(int i = 1; i <= n; i++) {
    double ans = 0.;
    for(int x = 0; x <= m; x++) {
      double prob = 1.;
      for(int j = 1; j <= n; j++) {
        if(j == i) continue;
        int ind = m;
        double pp = 0.;
        while(ind >= 0 && tim[j][ind] > tim[i][x]) pp += pr[j][ind--];
        prob *= pp;                                  
      }
     // cout << i << ' ' << x << ' ' << prob << '\n';
      ans += prob * pr[i][x];
    }
    cout << ans << '\n';
  }

  return 0;
}


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

#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define vin(v,n) copy_n(istream_iterator<int>(cin),n,back_inserter(v));
#define all(v) v.begin(),v.end()
#define INF 2000000000
#define MOD 1000000007
#define ll long long 
#define vi vector<int>
#define ii pair<int,int>
#define si set<int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define f1(i,a,b) for(int i = a;i<b;i++)
#define f2(i,a,b) for(int i = a;i<=b;i++)

using namespace std;

int32_t main() 
{
	IOS;
	string s, t;
	cin >> s >> t;
	
	vector<vi> dp(s.length() +1, vi(t.length() +1, 0));

	f2(i,0,s.length())
	{
		f2(j,0,t.length())
		{
			if(i==0||j==0)
				dp[i][j] = 0;
			else if(s[i-1]==t[j-1])
				dp[i][j] = dp[i-1][j-1] + 1;
			else
				dp[i][j] = max(dp[i][j-1], dp[i-1][j]);
		}
	}

	string res = "";
	int i = s.length();
	int j = t.length();
	while(i>0 && j>0)
	{
		if(s[i-1]==t[j-1])
		{
			res+=s[i-1];
			i--, j--;	
		}
		else if(dp[i-1][j]>dp[i][j-1])
			i--;
		else
			j--;
	}

	reverse(all(res));
	cout << res;
	return 0;
}


Measured memory_bytes: 70784
#include <iostream> 
#include <vector>
#include <cmath>
#include <string>
#include <sstream>
#include <algorithm>
#include <queue>
#include <stack>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <map>
#include <iomanip>
#include <cctype>
#include <climits>

using namespace std;

using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vvi = vector<vi>;

using ll = long long int;

#define mp(a,b) make_pair(a,b)

const int MOD = 1000 * 1000 * 1000 + 7;

bool res() {
	string s;
	cin >> s;
	if (!cin) return false;

	bool pos = true;
	if (s.size() % 2 == 1) pos = false;
	for (int i = 0; i < s.size(); ++++i) {
		if (s[i] != 'h') pos = false;
	}
	for (int i = 1; i < s.size(); ++++i) {
		if (s[i] != 'i') pos = false;
	}

	if (pos) cout << "Yes\n";
	else cout << "No\n";

	return true;
}

int main() {
	while (res()) {}
	return 0;
}

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

int main() {
  int n, sum = 0;
  cin >> n;
  int d[n];
  for (int i = 0;i < n;i++)
    cin >> d[i];
    
   for (int i = 0;i < n;i++) {
     for (int j = i + 1;j < n;j++) {
       sum += d[i] * d[j];
     }
   }
  cout << sum <<  endl;
}

Measured memory_bytes: 256
a=[]
a=input().split(" ")
N=int(a[0])
A=int(a[1])
B=int(a[2])
b=[]
for c in range(0,N):
    c=input().split(" ")
    b.extend(c)
#bの偶数がAi,bの奇数がBi
d=0
for i in range(0,N):
    b1=int(b[2*i])
    b2=int(b[2*i+1])

    if b1 >= A and b2 >= B :
        d=d+1
    else:
        continue
print(d)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
const long long llINF = 9223372036854775807;
const int INF = 2147483647;
const int maxn = 2e5 + 7;
const int maxm = 1e6 + 7;
const int ALP = 26;
const long long mod = 1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-8;

int n;
string s[200],x;
int t[200];
int ans;

int main()
{
	//freopen("1.in","r",stdin);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		cin>>s[i]>>t[i];	
	cin>>x;
	bool flag=0;
	for(int i=1;i<=n;i++)
	{
		ans+=flag*t[i];
		if(s[i]==x)
			flag=1;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
from collections import deque

def main():
    n = int(input())
    _next = [[] for _ in range(n)]
    for _ in range(n):
        u, k, *v = map(lambda s: int(s) - 1, input().split())
        _next[u] = v
    queue = deque()
    queue.append(0)
    d = [-1] * n
    d[0] = 0
    while queue:
        u = queue.popleft()
        for v in _next[u]:
            if d[v] == -1:
                d[v] = d[u] + 1
                queue.append(v)
    for i, v in enumerate(d, start=1):
        print(i, v)


if __name__ == '__main__':
    main()



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

int main() {
  int X;
  cin >> X;
  string ans = X >= 30 ? "Yes" : "No";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3604
object Main {

  val amari = 1000000007

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt()
    val V = Array.fill(N, 2)(sc.next())
    println(V.map { x =>
      if (x(1) == "JPY")
        x.head.toDouble
      else
        x.head.toDouble * 380000
    }.sum)
  }
}


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

int main(){
    int m, f, r;
    string grade;
    for (int i=0; i<50; i++){
        cin >> m >> f >> r;
        if ( m == -1 && f == -1 && r == -1 ) break;
        else if ( m == -1 || f == -1 ) grade = "F";
        else if ( m + f >= 80 ) grade = "A";
        else if ( m + f >= 65 && m + f < 80 ) grade = "B";
        else if ( m + f >= 50 && m + f < 65 ) grade = "C";
        else if ( m + f >= 30 && m + f < 50 && r >= 50) grade = "C";
        else if ( m + f >= 30 && m + f < 50 && r < 50) grade = "D";
        else if ( m + f < 30 ) grade = "F";
        cout << grade << endl;
    }
    return 0;
}


Measured memory_bytes: 3120
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>

constexpr long long int MOD = 1000000007;
long long int power(long long int base, long long int exp) {
	switch (exp) {
	case 0: return 1L;
	case 1: return base % MOD;
	default: return power(base, exp % 2) * power(base * base % MOD, exp / 2) % MOD;
	}
}
int gcd(int a, int b) {
	return b == 0 ? a : gcd(b, a % b);
}
int main() {
	long long int w, h; std::cin >> w >> h;
	const long long int point = (w + 1) * (h + 1);
	const long long int sum = point * (point - 1) % MOD * (point - 2) % MOD * power(6, MOD - 2) % MOD;
	long long int minus = 0;
	for (auto i = 0; i <= w; ++i) for (auto j = 0; j <= h; ++j) if (i != 0 || j != 0) {
		const auto count = (w - i + 1) * (h - j + 1);
		minus += (gcd(i, j) - 1) * count % MOD * ((i == 0 || j == 0) ? 1 : 2);
		minus %= MOD;
	}
	std::cout << ((sum - minus) % MOD + MOD) * power(2, point - 3) % MOD << '\n';
}


Measured memory_bytes: 3124
n=list(map(int,input().split()))
#高橋くん=n[0]、青木くん=n[1]、K=n[2]
for i in range(n[2]):
    #x=クッキーを渡す人 y=クッキーを受け取る人
    x=i%2
    y=(i+1)%2
    #xはクッキーが奇数個だったら1個食べる
    if n[x]%2==1:
        n[x]=n[x]-1
    #xのクッキーを半分yに渡す
    n[x]=n[x]/2
    n[y]=n[y]+n[x]
print(int(n[0]),int(n[1]))

Measured memory_bytes: 3060
#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define dup(x) x.erase(unique(x.begin(), x.end()),x.end())
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;
// https://atcoder.jp/contests/abc171/tasks/abc171_b
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    ll ans = 0;
    ll n, k;
    cin >> n >> k;
    vector<ll> v(n);
    for(int i = 0;i<n;i++){
        cin >> v[i];
    }
    sort(all(v));
    for(int i = 0;i<k;i++){
        ans += v[i];
    }
    cout << ans;
    
	return 0;
}


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

int main(){
  string s;
  cin >> s;
  int start, end;
  int N = s.size();
  for(int i = 0; i < N; i++){
    if(s[i] == 'A'){
      start = i;
      break;
    }
  }
  for(int i = 0; i < N; i++){
    if(s[i] == 'Z'){
      end = i;
    }
  }
  int ans;
  ans = end - start + 1;
  cout << ans << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <queue>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <set>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repl(i, n) for(LL i = 0; i < (LL)(n); i++)

LL lcm (LL num1, LL num2) {
  LL tmp;
  LL prod = num1 * num2;

  while((tmp = num1%num2) != 0) {
    num1 = num2;
    num2 = tmp;
  }

  return (prod / num2);
}

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

  LL cd = lcm(c, d);
  LL num_c = (b / c) - ((a-1) / c);
  LL num_d = (b /d) - ((a-1)/ d);
  LL num_cd = (b / cd) - ((a-1) / cd);

  cout << (b - a + 1) - (num_c + num_d - num_cd) << endl;

  return 0;
}

Measured memory_bytes: 256
/* ****revpro**** */
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl	   '\n'
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)    
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mii	    map<ll,ll>
using namespace std;

#define N  100005
ll add(ll x,ll y,ll mod) { x += y; if(x >= mod) x -= mod; return x;}
ll sub(ll x,ll y,ll mod) { x -= y; if(x < 0) x += mod; return x;}
ll mul(ll x,ll y,ll mod=hell) { return (x * 1ll * y) % mod;}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		ll n;
		cin>>n;
		ll ans=1;
		ll cnt[3]={0};
		ll arr[n];
		rep(i,0,n) cin>>arr[i];
		rep(i,0,n){
			ll idx=0;
			ll cur=0;
			rep(j,0,3) if(cnt[j]==arr[i]) cur++,idx=j;
			ans=mul(ans,cur);
			cnt[idx]++;
		}
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <cstring>

using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i < (n); ++i)

int n;
ll a[212345];
ll ans = 0;

int main() {
    cin >> n;
    rep(i,n) cin >> a[i];
    
    sort(a,a+n);

    reverse(a,a+n);

    ans += a[0];

    if (n%2==0){
        int idx = n/2;
        for (int i = 1; i < idx; i++) ans += 2*a[i];
    }
    else{
        int idx = (n-1)/2;
        for (int i = 1; i < idx; i++) ans += 2*a[i];
        ans += a[idx];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 5204
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vi=vector<int>;

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

//pow(llpow,modpow)
template<class T> ll llpow(T x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep2(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)

long long INF = 1LL<<60;
int main( ){
    vi v(3);
    rep(i,3)cin>>v[i];
    int eo[2]={0,0};
    rep(i,3)eo[v[i]%2]++;
    if(!eo[0]||!eo[1]){
        sort(v.begin(),v.end(),greater<int>());
        int cnt=0;
        rep2(i,1,3){
            while(v[0]>v[i]){
                cnt++;
                v[i]+=2;
            }
        }
        cout<<cnt<<endl;
    }
    else{
        int cnt=0;
        if(!(eo[0]%2)){
            rep(i,3)if(v[i]%2==0){
                v[i]++;
            }
        }
        else{
            rep(i,3)if(v[i]%2==1){
                v[i]++;
            }
        }
            cnt++;
            sort(v.begin(),v.end(),greater<int>());
            rep2(i,1,3){
                while(v[0]>v[i]){
                    cnt++;
                    v[i]+=2;
                }
            }
        cout<<cnt<<endl;
    }
    return 0;
}




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

using namespace std;

int main()
{
    int N; cin >> N;
    vector<vector<int> > to(N), cost(N);

    for (int i=0; i < N - 1; i++) 
    {
      int a, b, w; cin >> a >> b >> w;
      a--;
      b--;
      to[a].push_back(b); cost[a].push_back(w);
      to[b].push_back(a); cost[b].push_back(w);
    }
  
  	vector<int> ans(N, -1);
    queue<int> q;

    ans[0] = 0;
    q.push(0);

    while (! q.empty()) {
      int v = q.front();
      q.pop();
      for (int i=0; i < to[v].size(); i++) {
        int u = to[v][i];
        int w = cost[v][i];
        if (ans[u] != -1) continue;
        
        ans[u] = (ans[v] + w) % 2;
        q.push(u);
      } 
    }

    for (const auto& val : ans) {
      cout << val << endl;
    }

    
}

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

int main()
{
    string s;
    cin>>s;
    int l=s.size();
    ll sum=0;
    for(int i=0;i<l;i++)
    {
        sum+=(s[i]-'0');
    }
    if(sum%9)
        cout<<"No";
    else
        cout<<"Yes";
}


Measured memory_bytes: 3724
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll a,v,b,w,t;
	cin>>a>>v>>b>>w>>t;
	if(w>=v)
	{
		cout<<"NO";
		return 0;
	}
	if(b>a)
	{
		int time=ceil((b-a)/double(v-w));
		if(t>=time)
			cout<<"YES";
		else
			cout<<"NO";
	}
	else
	{
		int time=ceil((b-a)/double(w-v));
		if(t>=time)
			cout<<"YES";
		else
			cout<<"NO";
	}
}


Measured memory_bytes: 3724
X, K, D = map(int, input().split())
#  何回で0をまたぐか、その時いる場所
if X < 0:
    X = X * (-1)
times = X // D + 1
place = X - D * (times)
if times <= K:
    #  残った移動回数
    K = K - times
    if K % 2 == 0:
        place = place
    else:
        place = place + D
else:
    place = X - D * K

if place < 0:
    place = place * (-1)

print(place)

Measured memory_bytes: 9068
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
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; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int n,m;
  cin >> n >> m;
  vector<int>x(m);
  rep(i,m)cin >> x[i];
  sort(x.begin(),x.end());
  vector<int> v;
  rep(i,m-1)v.push_back(x[i+1]-x[i]);
  sort(v.begin(),v.end());
  ll ans = 0;
  rep(i,m-n)ans+=v[i];
  cout << ans << endl;
}

Measured memory_bytes: 1276
object Main extends App {
  import scala.io.StdIn.readLine

  val d = readLine().toInt
  var res = ""
  if (d == 25) {
    res = "Christmas"
  } else if (d == 24) {
    res = "Christmas Eve"
  } else if (d == 23) {
    res = "Christmas Eve Eve"
  } else if (d == 22) {
    res = "Christmas Eve Eve Eve"
  }

  println(res)
}

Measured memory_bytes: 25544
main = mapM_ process . takeWhile (/= "-1 -1 -1") . lines =<< getContents
  where process line = do
                          putStrLn $ grade m f r
                          where [m,f,r] = map (read::String->Int) $ words line
                                grade m f r
                                  | m==(-1) || f==(-1) ="F"
                                  | m+f>=80 = "A"
                                  | m+f>=65 && m+f<80 ="B"
                                  | m+f>=50 && m+f<65 ="C"
                                  | m+f>=30 && m+f<50 && r>=50 ="C"
                                  | m+f>=30 && m+f<50 && r<50 ="D"
                                  | m+f<30 ="F"

Measured memory_bytes: 4032
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define sz(s) (int)s.size()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

ll power(ll x,ll y){
	ll t=1;
	while(y>0){
		if(y%2) y-=1,t=t*x%mod;
		else y/=2,x=x*x%mod;
	}
return t;
}

int main(){
	ll m,n;
	scanf("%lld%lld",&n,&m);
	if (m<2*n) printf("%lld\n",m/2);
	else printf("%lld\n",n+(m-2*n)/4);
	return 0;
}

Measured memory_bytes: 256
S=input()
N=len(S)+1
S='>'+S+'<'
a=[0] * (N+2)

i=1
while i<=N:
    if S[i-1]==">" and S[i]=="<":
        a[i]=0

        j=i
        while j>=1:
            if S[j-1]==">":
                if a[j-1]<=a[j]:
                    a[j-1]=a[j]+1
                j=j-1
            else:
                break
        k=i
        while k<=N:
            if S[k]=="<":
                if a[k+1]<=a[k]:
                    a[k+1]=a[k]+1
                k=k+1
            else:
                break
    i=i+1

a[0]=0
a[N+1]=0
print(sum(a))

Measured memory_bytes: 23228
use std::io::*;
use std::str::FromStr;

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main(){
    match read::<usize>() {
        7 | 5 | 3 => println!("YES"),
        _ => println!("NO"),
    }
}

Measured memory_bytes: 4352
//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*
    I LOVE CLARICE STARLING

     ♥LOVE♥        ♥LOVE♥
  ♥LOVE♥♥LOVE♥  ♥LOVE♥♥LOVE♥
♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥
   ♥LOVE♥♥LOVE♥♥LOVE♥♥LOVE♥
      ♥LOVE♥♥LOVE♥♥LOVE♥
         ♥LOVE♥♥LOVE♥
            ♥LOVE♥
               ♥


    EXPLAINATION BELOW->
    Brute force Complete Search + Backtracking
    Read Editorial
    https://cp-algorithms.com/combinatorics/stars_and_bars.html
    https://www.youtube.com/watch?v=qvqPZkPURCo
    https://codeforces.com/blog/entry/76792?#comment-614251
    

*/
//C-Many Requirements
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
void solve()
{
    ld A,B,N;cin>>A>>B>>N;
    if(N>=B)
    cout<<floor(A*(B-1)/B)<<"\n";
    else
    cout<<floor(A*(N)/B)<<"\n";
}
int main()
{
   fastio
   solve();
  return 0;
}
//map<ll,ll,greater<int>> to sort in descending order ,in iterator declaration no greater<int>
//if you want to apply lowerbound on set use s.lower_bound(key),not the one used for vector
/* TIPS FOR DEBUGGING
 * Check if values are not overflowing (use long long where required)
 * Check if ranges are inclusive or not.
 * Check properly if greedy will work or not before using it.
 * Check EDGE CASES!! Seriously, even in 2B, saving 8 points by being
 * 2 minutes faster will bite you in the ass if you don't make sure
 * it works on edge cases.
 * Keep adding to this list.
*/
/*   EXPLAINATION BELOW->
     The bank pays an annual interest rate of 1 % compounded annually. 
     P+=(P*1)/100;
*/
/*void solve()
{
   ll X,P=100;cin>>X;
   int cnt=0;
   while(P<X)
   {
       P+=(P/100);
       cnt++;
   }
   cout<<cnt<<"\n";
}*/
/*
 *  EXPLAINATION BELOW->
    Brute force Complete Search + Backtracking
    Read Editorial
    https://cp-algorithms.com/combinatorics/stars_and_bars.html
    https://www.youtube.com/watch?v=qvqPZkPURCo
    https://codeforces.com/blog/entry/76792?#comment-614251

 ll ans;
vector<int>a,b,c,d;
int n,m,q;
void recursion(vector<int> A)
{
    int i;
   if(sz(A)==n+1)
   {
       ll score=0;
       fo(i,0,q)
       {
           if(A[b[i]]-A[a[i]]==c[i])score+=d[i];
       }
       ans=max(ans,score);
   }
   else
   {
       int last_entered=A.back();
       fo(i,last_entered,m+1)
       {
           A.pb(i);
           recursion(A);
           A.pop_back();
       }
   }
 
}
void solve()
{
   cin>>n>>m>>q;
   int i;
   a=b=c=d=vector<int>(q,0);
   fo(i,0,q)
   cin>>a[i]>>b[i]>>c[i]>>d[i];
   
   recursion(vector<int>(1,1));
   cout<<ans<<"\n";
   
}*/

Measured memory_bytes: 3728
def match(s_, t_):
    for s__, t__ in zip(s_, t_):
        if s__ == '?':
            continue

        if s__ != t__:
            return False

    return True


s = input()
t = input()

lens = len(s)
lent = len(t)

cnds = []

for i in range(lens-lent+1):
    if match(s[i:i+len(t)], t):
        # print(s[i:i+len(t)])
        # print(t)
        matched = s[:i] + t + s[i+len(t):]
        matched = matched.replace('?', 'a')
        cnds.append(matched)

if len(cnds) == 0:
    print('UNRESTORABLE')

else:
    print(list(sorted(cnds))[0])


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, q;
    cin >> n >> m >> q;
    vector<string> s(n);
    vector<vector<int>> v(n + 1, vector<int>(m + 1));
    vector<vector<int>> ea = v, eb = v;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        for (int j = 0; j < m; j++) {
            v[i + 1][j + 1] = s[i][j] - '0' + v[i + 1][j] + v[i][j + 1] - v[i][j];
            if (i) {
                ea[i + 1][j + 1] = (s[i][j] == '1' && s[i - 1][j] == '1') + ea[i][j + 1] - ea[i][j] + ea[i + 1][j];
            }
            if (j) {
                eb[i + 1][j + 1] = (s[i][j] == '1' && s[i][j - 1] == '1') + eb[i + 1][j] - eb[i][j] + eb[i][j + 1];
            }
        }
    }
    while (q--) {
        int x1, x2, y1, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        int vc = v[x2][y2] - v[x2][y1 - 1] - v[x1 - 1][y2] + v[x1 - 1][y1 - 1];
        int ec = ea[x2][y2] - ea[x2][y1 - 1] - ea[x1][y2] + ea[x1][y1 - 1];
        ec += eb[x2][y2] - eb[x2][y1] - eb[x1 - 1][y2] + eb[x1 - 1][y1];
        cout << vc - ec << endl;
    }
    return 0;
}

Measured memory_bytes: 53248
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    long long int a,b;
    cin>>a>>b;
    long long int r=1;
    long long int ea=max(a,b);
    ll eb=min(a,b);
    while(r!=(ll)0){
        r=ea%eb;
        ea=eb;
        eb=r;
    }
    cout<<((a*b)/ea)<<endl;
    return(0);
}

Measured memory_bytes: 256
n = gets.to_i

i = 1

loop do
  x = i

  flag1 = false
  
  if x % 3 == 0
    print " #{i}"
    flag1 = true
  end

  if flag1 == false
    loop do
      if x % 10 == 3
        print " #{i}"
        break
      end
      x /= 10
      break if x.zero?
    end 
  end

  break if (i += 1) > n
end

puts

Measured memory_bytes: 8688
import java.util.*;
import java.math.BigInteger;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		BigInteger A = sc.nextBigInteger();
		BigInteger B = sc.nextBigInteger();
      
		if(A.compareTo(B) > 0){
		    System.out.println("GREATER");
		}else if(A.compareTo(B) < 0){
		    System.out.println("LESS");
		}else{
		    System.out.println("EQUAL");
		}
    }
}

Measured memory_bytes: 35592
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <list>
using namespace std;

#define rep(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define SZ(x) ((int) (x).size())
typedef long long ll;

int main(){
	int n;
	while(cin >> n) {
		list<int> li;
		int a;
		rep(i,0,n) {
			cin >> a;
			if(i % 2 == 1) li.push_back(a);
			else li.push_front(a);
		}
		if(n % 2 == 0) {
			for(auto iter = li.rbegin(); iter != li.rend(); iter++) cout << *iter << " "; cout << endl;
		
		} else {
			for(auto iter = li.begin(); iter != li.end(); iter++) cout << *iter << " "; cout << endl;
		}
	}
    return 0;
}


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

int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<char>> c(h, vector<char> (w));
  rep(i,h) {
    rep(j,w) cin >> c[i][j];
  }
  
  rep(i,h) {
    rep(j,w) cout << c[i][j];
    cout << endl;
    rep(j,w) cout << c[i][j];
    cout << endl;
  }
}

Measured memory_bytes: 256
N = gets.chomp.to_i

note = []

N.times{|n|
  s, p = gets.chomp.split(" ")
  p = p.to_i
  note[n] = [s, p, n + 1]
}

def sort_by_of_mine!(book)

  for i in 0..(book.length - 1)
    for j in (book.length - 1).downto(i + 1)
      c = ""
      if (book[j-1][0] <=> book[j][0]) == 1 then
        c = book[j-1]
        book[j-1] = book[j]
        book[j] = c
      end
    end
  end

  for i in 0..(book.length - 1)
    for j in (book.length - 1).downto(i + 1)
      c = ""
      if (book[j-1][1] < book[j][1]) && (book[j-1][0] == book[j][0]) then
        c = book[j-1]
        book[j-1] = book[j]
        book[j] = c
      end
    end
  end
  book
end

book = note.dup

book = sort_by_of_mine!(book)

# p book

# N.times{|n|
#   note[n][2] = book.find_index(note[n]) + 1
# }

# p note

for i in 0...note.length
  puts book[i][2]
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9+7;
ll const INF = 1e18;
using namespace std;

int main(){
    ios();
    int N;
    ll W;
    cin >> N >> W;

    vector<pair<ll,ll>> vec(N);
    for(auto& i : vec){
        cin >> i.first >> i.second;
    }

    vector<ll> dp(100100, INF);
    dp[0] = 0;

    for(auto i : vec){
        ll w = i.first, v = i.second;
        RREP(j, dp.size()-v){
            dp[j+v] = min(dp[j+v], dp[j] + w);
        }
    }

    ll ans = 0;
    RREP(i, dp.size()){
        if(dp[i] <= W){
            ans = i;
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

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

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, N);
    IN(ll, D);
    A2IN(ll, X, ll, Y, N);
    ll ans = 0;
    REP(i, N)
    {
        ans += (X[i] * X[i] + Y[i] * Y[i]) <= D * D;
    }
    OUT(ans);
}

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

using namespace std;
typedef long long int ll;
int main() 
{



string s;
cin>>s;

if(s[0]==s[1] && s[1]==s[2])
{
    cout<<"No";
}
else
{
    cout<<"Yes";
}

    
    
    


return 0;    
}

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

#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

using namespace std;

/**
 * calculate GCD(greatest common divisor)
 * @param a
 * @param b
 * @return
 */
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

/**
 * change minimum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T> inline bool changeMinimum(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * change maximum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T> inline bool changeMaximum(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * output answer
 * @tparam T
 * @param answer
 * @return
 */
template<typename T>
T output(T answer) {
    cout << answer << endl;
    return 0;
}

/** ----from here ---------------------------------------------------------- */

int main() {

    int N, M ;
    cin >> N >> M;
    vector<int>  a(N,0);

    int sum=0;

    for (int i = 0; i < N; ++i) {
        cin >> a.at(i);
    }
    for (int i = 0; i < N; ++i) {
        sum += a.at(i);
    }
    int count = 0;

    double n, m;
    n = N;
    m = M;
//    cout << n << m ;
    double p,q;
    q = sum / (4.0 * m);
    string ans = "No";
    for (int i = 0; i < N; ++i) {
        if (a.at(i) >= q){
            count ++;
        }
        if(count >= M){ans = "Yes";}
    }
    cout << ans << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[200001];
int main(){
int n,k;
cin>>n>>k;
for(int i=0;i<n;i++){
  cin>>a[i+1];
   a[i+1]+=a[i];
}
int ans=0;
for(int i=k;i<=n;i++){
  ans = max(ans,a[i]-a[i-k]);
 }
cout<<fixed<<setprecision(9)<<(double)(ans+k)/2.0<<endl;                 
}

Measured memory_bytes: 1024
import java.util.*;
public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}//standard output
        static void myerr(Object t){System.err.println(t);}//standard error
        static String getStr(){return sc.next();}
        static int getInt(){return Integer.parseInt(getStr());}
        static long getLong(){return Long.parseLong(getStr());}
        static boolean isNext(){return sc.hasNext();}
        static String[] mySplit(String str){return str.split("");}
        public static void main(String[] args){
          int N = getInt();
          int M = getInt();
          PriorityQueue<Integer>[] qlist = new PriorityQueue[N];
          HashMap<Integer,Integer> noMap = new HashMap<Integer,Integer>(M);
          ArrayList<String> outlist = new ArrayList<String>(M);
          for(int i = 0; i < N;i++){
            qlist[i] = new PriorityQueue<Integer>();
          }
          for(int i = 0; i < M;i++){
            int p = getInt()-1;
            int y = getInt();
            qlist[p].add(y);
            noMap.put(y,i);
            outlist.add("");
          }
          
          for(int i = 0; i < N;i++){
            int count = 1;
            while(qlist[i].size() > 0){
              int getY = qlist[i].poll();
              int addNo = noMap.get(getY);
              String addString = String.format("%06d",i+1) + String.format("%06d",count);
              outlist.set(addNo,addString);
              count++;
            }
          }
          for(int i = 0; i < M;i++){
            myout(outlist.get(i));
          }
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
}


Measured memory_bytes: 176888
#include<bits/stdc++.h>
using namespace std;
string s;
int a;
int main(){
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]=='C') a=1;
        if(s[i]=='F'&&a==1){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const unsigned int M = 1000000007;
int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int a,b,c;
    set<int>s;
    while(cin>>a>>b>>c){
        s.insert(a);
        s.insert(b);
        s.insert(c);
        cout<<s.size()<<endl;
        s.clear();
    }
}


Measured memory_bytes: 256
#include<iostream>
#define DIM 1000005
#define mod 998244353
using namespace std;
int n, i, j, x, sol, m;
char c[DIM], ok[DIM];
int nr[DIM], sum[DIM];
int modul(int x){
    if(x >= mod){
        return x - mod;
    }
    return x;
}
int mult(int x, int e){
    if(e == 0){
        return 1;
    }
    else{
        int a = mult(x, e / 2);
        if(e % 2 == 0){
            return a * 1LL * a % mod;
        }
        else{
            return a * 1LL * a % mod * x % mod;
        }
    }
}
int main(){
    cin>> n;
    for(i = 1; i <= n; i++){
        cin>> x;
        m = max(m, x);
        sum[x] = modul(sum[x] + x);
        sol = modul(sol - x + mod);
    }
    c[1] = 1;
    for(i = 1; i <= m; i++){
        if(c[i] == 0){
            nr[i] = 1;
            for(j = i + i; j <= m; j += i){
                c[j] = 1;
                nr[j]++;
                if( (j / i) % i == 0){
                    ok[j] = -1;
                }
            }
        }
        for(j = i + i; j <= m; j += i){
            sum[i] = modul(sum[i] + sum[j]);
        }
        sum[i] = sum[i] * 1LL * sum[i] % mod;
    }
    for(i = 1; i <= m; i++){
        for(j = i + i; j <= m; j += i){
            if(ok[j / i] == 0){
                if(nr[j / i] % 2 == 1){
                    sum[i] = modul(sum[i] - sum[j] + mod);
                }
                else{
                    sum[i] = modul(sum[i] + sum[j]);
                }
            }
        }
        sol = (sol + sum[i] * 1LL * mult(i, mod - 2) ) % mod;
    }
    sol = sol * 1LL * mult(2, mod - 2) % mod;
    cout<< sol;
}


Measured memory_bytes: 9984
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
#define rreps(i, n) for(int i=((int)(n)); i>0; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pl(s) cout << (s) << "\n";
#define pls(...) {bool space = false; for(auto i : __VA_ARGS__) (cout << (space?" ":"") << i), space = true; cout << "\n";}
#define plexit(s) {cout << (s) << "\n"; exit(0);}
#define yes(s) cout << ((s)?"Yes":"No") << "\n";
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using ll = long long; using ull = unsigned long long; using ld = long double;
template<typename T = int> using V = vector<T>; template<typename T = int> using P = pair<T, T>;
using Vi = V<int>; using Vl = V<ll>; using Vd = V<ld>; using VVi = V<Vi>; using VVl = V<Vl>; using Pi = P<int>; using Pl = P<ll>; using Pd = P<ld>;
constexpr ll MOD = 1000000007; constexpr int INF = (1 << 30) - 1; constexpr ll INFL = 1LL << 60; constexpr ld EPS = 1e-12; constexpr ld PI = 3.141592653589793238462643383279;

int main(void) {
  int n; cin >> n;
  int count = 0;
  rep(i,n) {
    int a, b; cin >> a >> b;
    if (a == b) count++;
    else count = 0;
    if (count == 3) plexit("Yes")
  }
  pl("No")
  return 0;
}


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

int main() {
  int a,b;
  cin>>a>>b;
  int ap,bp;
  for(int i=1;i<1001;i++){
    ap=i*8/100;
    bp=i/10;
    if(ap==a&&bp==b){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
}

Measured memory_bytes: 256
#ifdef _DEBUG
#define _CRT_SECURE_NO_WARNINGS
#include "MyLib.h"
#else
#define main_B main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define MGN 8
#define LINF (LONG_MAX/2)
using namespace std;
typedef long long ll; typedef unsigned long long ull;
typedef vector<int> vi; typedef vector<vi> vvi; 
typedef vector<ll> vl; typedef vector<vl> vvl;
typedef vector<double> vd; typedef vector<string> vs;
typedef pair<int, int> pii; typedef pair<ll, ll> pll;
typedef vector<bool> vb; typedef vector<vb> vvb;
template <typename T>
using keyVal = pair<string, T>;
template<typename T>
bool val_greater(const keyVal<T>& left, const keyVal<T>& right) {
    return left.second > right.second;}
vs split(string str, char sep) {
    vs v; stringstream ss(str); string t;
    while (getline(ss, t, sep)) v.push_back(t);
    return v;}
vs re_search_g(string s, regex re) {
    vs ret; smatch mc; auto it = s.cbegin();
    while (regex_search(it, s.cend(), mc, re)) {
        ret.push_back(mc[0]);
        it += mc.position(0) + mc.length();}
    return ret;}
#endif

void init_global_B() {}


int main_B() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N; cin >> N;
    vi l(N), r(N); REP(i, N) cin >> l[i] >> r[i];

    int ans = 0;
    REP(i,N){
        ans += r[i] - l[i] + 1;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256