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

// isDebug?
#ifndef ONLINE_JUDGE
#define _DEBUG
#endif

// Function Macros:
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)

// -* https://xn--kst.jp/blog/2019/08/29/cpp-comp/ *- Thx :)
// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                        \
    cout << __FILE__ << ": " << __LINE__ << ": " << __func__ << " -> ";   \
    CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
    (__VA_ARGS__)
#else
#define debug(...)
#endif

// namespace / type / class / struct - alias, def:
using namespace std;

using ll = long long;
using ull = unsigned long long;

// Constants:
const int INF = (1ll << 30) - 1;  // approx 1.07e9
const ll INFLL = 1ll << 60;       // approx 1.15e18
const int MOD = 1e9 + 7;          // 998244353
const long double EPS = 1.0e-14;
const int FACN = 510000;

// Global Variables:
// ll fac[FACN], finv[FACN], inv[FACN];

// Prototype Declarations:
int gcd(int, int);
int lcm(int, int);
template <class T>
inline bool chmin(T&, T);
template <class T>
inline bool chmax(T&, T);

// ================ Main Loop ================
int main() {
    int n, ans = 0;
    cin >> n;
    int a;
    rep(i, n) {
        cin >> a;
        if(i % 2 == 0) {
            if(a % 2 == 1) {
                ans++;
            }
        }
    }
    cout << ans << endl;

    return 0;
}
// ===========================================

// Functions:
// 最大公約数 O(log(min(a, b)))
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
// 最小公倍数 O(log(min(a, b)))
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

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


Measured memory_bytes: 3620
#include <iostream>

using ll = long long;
bool cond1(char * p, int len)
{
  // std::printf("%d\n", len);
  //if (len < 3) return false;
  char * wp = p;
  char * rwp = p + len - 1;
  for (int i = 0; i < (len / 2); ++i) {
    // std::printf("%c, %c\n", *(wp + i), *(rwp - i));
    if (*(wp + i) != *(rwp - i)) {
      return false;
    }
  }
  return true;
}

int main(int argc, char ** argv)
{
  //
  std::string s;

  char * wp;
  int len;
  std::cin >> s;
  wp = const_cast<char *>(s.c_str());
  len = s.length();
  // std::puts("cond1");
  if (!cond1(wp, len)) {
    std::puts("No");
    return 0;
  }

  wp = const_cast<char *>(s.c_str() + 0);
  len = (s.length() - 1) / 2;
  // std::puts("cond2");
  if (!cond1(wp, len)) {
    std::puts("No");
    return 0;
  }

  wp = const_cast<char *>(s.c_str() + (s.length() + 3) / 2 - 1);
  len = s.length() - ((s.length() + 3) / 2 - 1);
  // std::puts("cond3");
  if (!cond1(wp, len)) {
    std::puts("No");
    return 0;
  }
  std::puts("Yes");
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
#define pii pair<ll,ll>
#define ve(x) vector<x>
#define f(a,b,c) for(ll a=b;a<c;a++)
#define foto(x,v) for(auto x:v)
#define read(t) ll t; cin>>t;
#define reads(t) string t; cin>>t;
#define readarr(arr,n) ll arr[n]; f(i,0,n) cin>>arr[i];
#define dbg(x) cout<<#x<<" = "<<x<<endl;
#define dbg2(x,y) cout<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;
#define all(v) v.begin(),v.end()
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL);	cout.tie(NULL);
const ll M = 1e9+7 , INF = 1e16;


// 														MAIN
int32_t main()
{ 
    FASTIO
    read(n) read(d)
    ll ans = n;
    f(i,0,n)
    {
      read(x) read(y)
      x*=x; y*=y;
      x+=y;
      if(x>d*d) ans--;
    }
    cout<<ans;
}



Measured memory_bytes: 3652
#include<iostream>
using namespace std;
int main()
{
	long long a, b, c, d, N, Ans1, Ans2, Ans3, Ans4, Ans5, Ans6, Ans7, Ans8;

	cin >> N;

	a = N / 1000;
	b = (N - 1000 * a) / 100;
	c = (N - 1000 * a - 100 * b) / 10;
	d = N - 1000 * a - 100 * b - 10 * c;

	Ans1 = a + b + c + d;
	Ans2 = a + b + c - d;
	Ans3 = a + b - c + d;
	Ans4 = a + b - c - d;
	Ans5 = a - b + c + d;
	Ans6 = a - b + c - d;
	Ans7 = a - b - c + d;
	Ans8 = a - b - c - d;

	if (Ans1 == 7)
		cout << a << "+" << b << "+" << c << "+" << d << "=7";

	else if(Ans2 == 7)
		cout << a << "+" << b << "+" << c << "-" << d << "=7";

	else if (Ans3 == 7)
		cout << a << "+" << b << "-" << c << "+" << d << "=7";

	else if (Ans4 == 7)
		cout << a << "+" << b << "-" << c << "-" << d << "=7";

	else if (Ans5 == 7)
		cout << a << "-" << b << "+" << c << "+" << d << "=7";

	else if (Ans6 == 7)
		cout << a << "-" << b << "+" << c << "-" << d << "=7";

	else if (Ans7 == 7)
		cout << a << "-" << b << "-" << c << "+" << d << "=7";

	else if (Ans8 == 7)
		cout << a << "-" << b << "-" << c << "-" << d << "=7";

	cin >> a;

	return 0;
}

Measured memory_bytes: 256
S = input()

amount = 0
for n in range(2 ** (len(S) - 1)):
    s = ""
    nn = n
    for i in range(len(S) - 1):
        s += S[i]
        if nn % 2 == 1:
            s += "+"
        nn >>= 1
    s += S[-1]
    amount += eval(s)
print(amount)

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

int main() {
    int N, M;
    cin >> N >> M;
    int res=0;
    int tmp=0;
    vector<int> c(N,-1);
    for (int i=0;i<M;i++){
        int si,ci;
        cin >> si >> ci;
        if (c[si-1]==-1){
            c[si-1]=ci;
        }else{
            if(c[si-1]!=ci){
                res=-1;
            }
        }
    }

    if (N>1){
        if (c[0]==-1) c[0]=1;
    }else{
        if (c[0]==-1) c[0]=0;
    }

    for (int i=0; i<N-1; i++){
        if(tmp==0 && c[i]==0){
            res=-1;
            break;
        }
        tmp=c[i];
    }

    if(res==-1){
        cout << res;
    }else{
        bool flag=false;
        for (int i=0;i<N;i++){
            if (c[i]==-1){
                c[i]=0;
            }
            if (i==N-1){
                flag=true;
            }
            if (c[i]==0){
                if(flag==true){
                    cout << c[i];
                }
            }else{
                flag=true;
                cout << c[i];
            }
        }
    }
    cout << endl;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int> > a;
    vector<vector<int> > b;
    FOR(i, n) {
        string temp;
        cin >> temp;
        vector<int> hoge;
        FOR(j, n) {
            if(temp[j] == '.') hoge.push_back(0);
            else hoge.push_back(1);
        }
        a.push_back(hoge);
    }
    FOR(i, m) {
        string temp;
        cin >> temp;
        vector<int> hoge;
        FOR(j, n) {
            if(temp[j] == '.') hoge.push_back(0);
            else hoge.push_back(1);
        }
        b.push_back(hoge);
    }

    bool exist = false;
    for(int i = 0; i < n - m + 1; i++) {
        for(int j = 0; j < n - m + 1; j++) {
            bool match = true;
            for(int k = 0; k < m; k++) {
                for(int l = 0; l < m; l++) {
                    if(b[k][l] != a[k + i][l + j]) {
                        match = false;
                    }
                }
            }
            if(match) exist = true;
        }
    }

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

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

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

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

#define MOD 1000000007
#define INF 2000000000

int GLL(LL& x) {
    return scanf("%lld", &x);
}

int GI(int& x) {
    return scanf("%d", &x);
}

const int MAXN = 100005;
int dp[MAXN];

string t;

vector<string> suffix = {"dream", "dreamer", "erase", "eraser"};

int main() {
    cin >> t; int m = t.size();

    memset(dp, 0, sizeof dp); dp[0] = 1;

    for (int i = 1; i <= m; i++) {
        for (auto& s : suffix) {
            int sz = s.size();
            if (i - sz >= 0 && t.substr(i - sz, sz) == s && dp[i - sz]) dp[i] = 1;
        }
    }

    cout << (dp[m] == 1 ? "YES" : "NO") << "\n";
    
    return 0;
}

Measured memory_bytes: 896
#include    <iostream>
#include    <string>
#include    <queue>
#include    <utility>

using namespace std;

int main() {
    int n, q;

    cin >> n >> q;

    queue< pair<string, int> > pq, comp;

    // 入力
    for(int i = 0; i < n; i++) {
        string name;
        int time;

        cin >> name >> time;
        pq.push(make_pair(name, time));
    }

    // 処理
    unsigned int stime = 0;
    while(!pq.empty()) {
        const auto x = pq.front();
        pq.pop();
        if(x.second <= q) {
            stime += x.second;
            comp.push(make_pair(x.first, stime));
        } else {
            stime += q;
            pq.push(make_pair(x.first, x.second - q));
        }
    }

    // 出力
    while(!comp.empty()) {
        auto x = comp.front();
        cout << x.first << ' ' << x.second << endl;
        comp.pop();
    }

    return 0;
}


Measured memory_bytes: 6088
# coding: utf-8
H,W,D=map(int,input().split())
num=[[] for i in range(H*W+1)]

for i in range(H):
    A=list(map(int,input().split()))
    for j in range(W):
        num[A[j]]=[i+1,j+1]

cost=[0 for i in range(D)]

for i in range(H*W-D):
    cost.append(cost[i] + abs(num[H*W-i][0]-num[H*W-i-D][0]) + abs(num[H*W-i][1]-num[H*W-i-D][1]))

cost.append(None)

cost.reverse()

Q=int(input())

for i in range(Q):
    L,R=map(int,input().split())
    print(cost[L]-cost[R])


Measured memory_bytes: 17716
import java.util.Scanner;
class Main{
  public static void main(String args[]){
    Scanner scan=new Scanner(System.in);
    int h=scan.nextInt();
    int w=scan.nextInt();
    h=h-scan.nextInt();
    w=w-scan.nextInt();
    System.out.println(h*w);
  }
}

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

#define int ll

#define pb push_back
#define all(v) (v).begin(), (v).end() 
#define sz(v) (int)((v).size())
#define fs first
#define sd second

typedef long long ll;

typedef pair < int, int > pi;
typedef pair < pi, int > ppi;

typedef vector < int > vi;
typedef vector < vector < int > > vvi;
typedef vector < pi > vpi;
typedef vector < vpi > vvpi;
typedef vector < ppi > vppi;

void fast() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}

void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

double get_time() {
	return 1.0 * clock() / CLOCKS_PER_SEC;
}

const int MAX = 1E5 + 100;
int n, m;
vvi adj(MAX);
vi up(MAX), dp(MAX), dp2(MAX);

void DFS(int u, int p) {
	dp[u] = 1;
	for(int v : adj[u]) {
		if(v == p)
			continue;
		DFS(v, u);
		dp[u] = ((dp[v] + 1) * dp[u]) % m;
	}
}

void calc_up(int u, int p) {
	vi children;
	for(int v : adj[u]) {
		if(v == p)
			continue;
		children.pb(v);
	}
	int siz = sz(children);
	vi pref(siz + 1), suff(siz + 1);
	pref[0] = 1;
	suff[siz] = 1;
	for(int i = 0; i < siz; i++) {
		int v = children[i];
		pref[i + 1] = (pref[i] * (dp[v] + 1)) % m;
		//debug(u, i, pref[i + 1]);
	}
	for(int i = siz - 1; i >= 0; i--) {
		int v = children[i];
		suff[i] = (suff[i + 1] * (dp[v] + 1)) % m;
		//debug(u, i, suff[i + 1]);
	}
	for(int i = 0; i < siz; i++) {
		int v = children[i];
		up[v] = (pref[i] * suff[i + 1]) % m;
		up[v] = ((up[u] + 1) * up[v]) % m;
	}
	for(int v : children)
		calc_up(v, u);
}

int32_t main() {
	cin >> n >> m;
	for(int i = 0; i < n - 1; i++) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	DFS(0, -1);
	calc_up(0, -1);
	for(int i = 0; i < n; i++) {
		//debug(dp[i], up[i]);
		cout << (dp[i] * (up[i] + 1)) % m << '\n';
	}
}


Measured memory_bytes: 23936
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k==x:
                ans+=1
print(ans)

Measured memory_bytes: 77760
#include<iostream>

using namespace std;

long long abs(long long x,long long y){ long long  c;
  if( x >= y){ c = x - y;}
  else{c = y - x;}
                    return c;}

long long Fac( long long n){
     long long rep = 1;
  for(long long i = 1; i <= n; i++){ 
     rep = rep * i;  rep = rep % 1000000007;} 
   
  
  return rep;}
    


int main()
{long long N, M ; cin >> N >> M;
 
 if(abs(N,M) == 1){cout << Fac( M ) * Fac( N ) % 1000000007 << endl;}
 else if(abs(N,M) == 0){cout << 2*Fac( M ) * Fac( N ) % 1000000007 << endl;}
 else{cout << 0 << endl;}
 
 return 0;}


Measured memory_bytes: 256
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18

# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;

template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const pair <ll,ll> &a,const pair <ll,ll> &b){
    return a.second<b.second;
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};


struct c_h {
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        x ^= FIXED_RANDOM;
        return x ^ (x >> 16);
    }
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}
ll n,m;
bool ok(ll a,ll b){
    return a>=0&&b>=0&&a<n&&b<m;
}
ll dx[8]={1,0,-1,0,1,-1,1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};

int main(){
    IOS;
    make(ll,n);
    make(string,s);
    ll ans=0;
    for(ll i=1;i<n;i++){
        set <char> s1,s2;
        fr(j,i) s1.insert(s[j]);
        for(ll j=i;j<n;j++) s2.insert(s[j]);
        unordered_map <char,ll> um;
        for(auto x : s1) um[x]++;
        for(auto x : s2) um[x]++;
        ll c=0;
        for(auto x : um) if(x.second==2) c++;
        ans=max(ans,c);
    }
    cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 3664
N = int(input())
s = str(input())
s = list(s)

master = [["S","S"],["W","S"],["S","W"],["W","W"]]
for case in range(4):
  ans = master[case]
  for i in range(len(s)):
    if ans[-2] == "S" and ans[-1] == "S":
      if s[i] == "o":
        temp = "S"
      else:
        temp = "W"
    elif ans[-2] == "W" and ans[-1] == "S":
      if s[i] == "o":
        temp = "W"
      else:
        temp = "S"
    elif ans[-2] == "S" and ans[-1] == "W":
      if s[i] == "o":
        temp = "W"
      else:
        temp = "S" 
    else:
      if s[i] == "o":
        temp = "S"
      else:
        temp = "W"
    ans.append(temp)
#print(ans)
  if ans[0] != ans[-2] or ans[1] != ans[-1]:
    continue
  else:
    answer = ans[1:-1]
    t = "".join(answer)
    print(t)
    exit()
print(-1)

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

int main() {
  int n;
  cin >> n;
  vector<int>count (n);
  for (int x=1;x<100;x++){
    for (int y=1;y<100;y++){
      for (int z=1;z<100;z++){
        int a = x*(x+y)+y*(y+z)+z*(z+x);
        if (a<=n)
          count.at(a-1)++;
      }
    }
  }
  
  for (int i=0;i<n;i++)
    cout << count.at(i) << endl;
  
  
  return 0;
}

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

typedef long long ll;

const int kN = 1e5 + 5;

int a[kN], ans[kN], lptr, rptr; ll tot = 0;

int main() {
	int n; ll L;
	scanf("%d%lld", &n, &L);
	for(int i = 1; i <= n; ++i) scanf("%d", a + i);
	for(int i = 1; i < n; ++i)
		if(a[i] + a[i + 1] >= L) {
			printf("Possible\n");
			for(int j = 1; j < i; ++j)
				printf("%d\n", j);
			for(int j = n - 1; j > i; --j)
				printf("%d\n", j);
			printf("%d\n", i);
			return 0;
		}
	printf("Impossible");
	return 0;
}

Measured memory_bytes: 1152
n = int(input())
a = list(map(int,input().split()))
b = list(a)
b.sort()
c = int(n/2)
ML=b[c-1]
MR=b[c]
for i in range(0,n):
    if a[i] >= MR:
        print(ML)
    else:
        print(MR)

Measured memory_bytes: 93780
n = int(input())
a=[int(input()) for i in range(n)]

ans=0
last=0
for i in range(n):
    if (i < a[i]) or (last + 1 < a[i]):
        print(-1)
        exit()
    elif last+1==a[i]:
        last=a[i]
    else: # last >= a[i]
        ans+=last
        last=a[i]

ans+=last
print(ans)

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

int main() {

	int n; cin >> n;
	vector<int> p(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}
	sort(p.rbegin(), p.rend());
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (i == 0) ans += p[i] / 2;
		else ans += p[i];
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
	ios_base::sync_with_stdio( false );

	int N;
	cin >> N;

	if( N == 1 ) {
		cout << "Hello World\n";
	}
	else {
		int A, B;
		cin >> A >> B;
		cout << A+B << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

template <class T>
class operators
{
public:
    T operator+(const T& right) const {
        T ans = static_cast<const T&>( *this );
        ans += right;
        return ans;
    }
    T operator-(const T& right) const {
        T ans = static_cast<const T&>( *this );
        ans -= right;
        return ans;
    }
    T operator*(const T& right) const {
        T ans = static_cast<const T&>( *this );
        ans *= right;
        return ans;
    }
    T operator/(const T& right) const {
        T ans = static_cast<const T&>( *this );
        ans /= right;
        return ans;
    }
};

class Mod : public operators<Mod>
{
private:
    static const int MOD = 1000000007;
    long long a;
public:
    Mod(){
        a = 0;
    }
    Mod(long long x){
        a = (x % MOD + MOD) % MOD;
    }
    Mod& operator+=(const Mod& x){
        a = (a + x.a) % MOD;
        return *this;
    }
    Mod& operator-=(const Mod& x){
        a = (a - x.a + MOD) % MOD;
        return *this;
    }
    Mod& operator*=(const Mod& x){
        a = (a * x.a) % MOD;
        return *this;
    }
    Mod& operator/=(const Mod& x){ // フェルマーの小定理、MODが素数である場合のみ有効
        int b = MOD - 2;
        long long c = x.a;
        long long ans = 1;
        while(b > 0){
            if(b & 1){
                ans *= c;
                ans %= MOD;
            }
            c *= c;
            c %= MOD;
            b >>= 1;
        }
        a *= ans;
        return *this;
    }
    long long getValue(){
        return a;
    }
};

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

    vector<Mod> dp(2*n+2, 0);
    dp[0] = 1;
    dp[1] = -1;
    Mod ans = 0;
    for(int i=0; i<n; ++i){
        Mod x = dp[i];
        if(i < n - 1){
            Mod tmp = (n - 1LL) * (n - 1LL);
            ans += x * tmp;
        }
        dp[i+1] += x;
        dp[i+2] -= x;
        dp[i+3] += x;
        dp[i+n+2] -= x;

        dp[i+1] += dp[i];
    }

    for(int i=n; i<=2*n; ++i){
        ans += dp[i];
        dp[i+1] += dp[i];
    }
    cout << ans.getValue() << endl;

    return 0;
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  cin >> N;
  VL acc(N+1);
  REP(i,N){
	LL x;
	cin >> x;
	acc[i+1] = acc[i] + x;
  }

  LL ans = 1e18;
  FOR(i,1,N)
	mini(ans, abs(acc[N] - acc[i] - acc[i]));
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
using namespace std;
int M,D,ans;
int main()
{
	cin>>M>>D;
	if(D<10)
	{
		cout<<0<<endl;
		return 0;
	}
	for(int i=1;i<=M;i++)
	{
		for(int j=10;j<=D;j++)
		{
			if((j%10)*(j/10)==i && (j%10)>=2 && (j/10)>=2)
			{
//				cout<<i<<' '<<j<<endl;
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
// AtCoder template
// sabaより胡蝶しのぶさんの方が可愛いのではないか？
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)

class CumulativeSum2D{
private:
    vector<vector<ll>> CumSum;
public:
    // コンストラクタ
    CumulativeSum2D(int H, int W): CumSum(H+1, vector<ll>(W+1, 0)){}
    // 配列に値を加える
    // 引数y, x：加えたい座標. CumSum[y][x]なので注意
    void add(int y, int x, ll value){
        ++x; ++y;
        if(y >= CumSum.size() || x >= CumSum[0].size()) return;
        CumSum[y][x] += value;
    }
    // 二次元累積和を構築する
    // 引数、戻り値なし
    void build(){
        int h = CumSum.size()-1, w = CumSum[0].size()-1;
        for(int i = 0; i < h; ++i){
            for(int j = 0; j < w; ++j){
                CumSum[i+1][j+1] += CumSum[i][j+1]+CumSum[i+1][j]-CumSum[i][j];
            }
        }
    }
    // (sx,sy)から(gx,gy)までの長方形の区間にある数の総和を求める（半開区間）
    ll query(int sy, int sx, int gy, int gx){
        return CumSum[gy][gx]-CumSum[sy][gx]-CumSum[gy][sx]+CumSum[sy][sx];
    }
};

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

    int h,w,k; cin >> h >> w >> k;
    vector<string> s(h); rep(i,h) cin >> s[i];

    CumulativeSum2D s_sum(h,w);
    rep(i,h) rep(j,w) if(s[i][j] == '1') s_sum.add(i, j, 1);
    s_sum.build();
    
    int ans = 100010;
    for(int bit = 0; bit < (1 << (h-1)); bit++){
        int devide_cnt = 0;
        bool notAccepted = false;

        for(int right = 0, left = 0; right < w; ++right){
            bool need_devide = false;
            for(int down = 0, up = 0; down < h; ++down){
                up = down;
                while(down < h && (bit & (1 << down)) == 0) down++;
                if(down == h) down--;
                if(s_sum.query(up, left, down+1, right+1) > k && left == right){
                    notAccepted = true;
                    break;
                }else if(s_sum.query(up, left, down+1, right+1) > k){ // 更新
                    left = right;
                    need_devide = true;
                }
            }
            if(notAccepted) break;
            if(need_devide) devide_cnt++;
        }

        if(notAccepted) continue;
        int tmp = __builtin_popcount(bit);
        tmp += devide_cnt;
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include<stdio.h>
int main(void) {
	int a, b, c;

	scanf("%d %d %d", &a, &b, &c);
	if (a > b) {
		if (b <= c && c <= a) {
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	}
	else {
		if(a <= c && c <= b) {
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	}
	return 0;
}

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

int main() {
    int N, M, ans = 0, arr[10], a, b;
    vector<int> v[10];
    cin >> N >> M;
    for (int i = 0; i < M; ++i) {
        cin >> a >> b;
        v[a - 1].push_back(b - 1);
        v[b - 1].push_back(a - 1);
    }
    for (int i = 0; i < N; ++i) arr[i] = i;

    do {
        if (arr[0]) break;
        bool can = true;
        for (int i = 0; i < N - 1; ++i) {
            bool can2 = false;
            for (int j = 0; j < v[arr[i]].size(); ++j) {
                if (v[arr[i]][j] == arr[i + 1]) {
                    can2 = true;
                    break;
                }
            }
            if (!can2) {
                can = false;
                break;
            }
        }
        if (can) ++ans;
    } while (next_permutation(arr, arr + N));

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    static Scanner scanner = new Scanner(System.in);
 
    public static void main(String[]$) {
        long n = scanner.nextInt() - 2, a = scanner.nextInt(), b = scanner.nextInt();
        System.out.println(a == b ? 1 : n == -1 || a > b ? 0 : n * (b - a) + 1);
    }
}

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

int main() {
  string S; cin >> S;
  string ans;
  if (S == "Sunny") ans = "Cloudy";
  else if (S == "Cloudy") ans = "Rainy";
  else ans = "Sunny";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const ll MAX = 1e9+7;
template<typename T> T factorial(T n){
    if(n==1) return 1;
    else return n*factorial(n-1)%MOD;
}
template<typename T> T Pow(T x, T n, T m){
    if(n == 0) return 1;
    if(n % 2 == 0) return Pow(x * x % m, n / 2, m);
    else return x * Pow(x, n - 1, m) % m;
}
template<typename T> T combination(T n, T k, T m){
    return factorial<T>(n) * Pow<T>(factorial(k), m-2, m) % m * Pow<T>(factorial(n-k), m-2, m) % m;
}
struct edge{
    int to; // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using graph = vector<vector<edge>>;
using Graph = vector<vector<int>>;

int main(){
    ll x, y, a, b, c; cin >> x >> y >> a >> b >> c;
    vector<ll> p;
    ll tmp;
    rep(i, a){
        cin >> tmp;
        p.push_back(tmp);
    }
    vector<ll> q;
    rep(i, b){
        cin >> tmp;
        q.push_back(tmp);
    }
    vector<ll> r;
    sort(all(p), greater<ll>());
    sort(all(q), greater<ll>());
    vector<ll> apples;
    rep(i, x) apples.push_back(p[i]);
    rep(i, y) apples.push_back(q[i]);
    rep(i, c){
        cin >> tmp;
        apples.push_back(tmp);
    }
    sort(all(apples), greater<ll>());
    ll ans = 0;
    rep(i, x+y) ans += apples[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 7536
#include <bits/stdc++.h>
/*
#include<algorithm>
#include<array>
#include<cassert>
#include<cmath>
#include<cstdlib>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<typeinfo>
#include<utility>
#include<vector>
*/
#define int long long int
#define double long double
using namespace std;
#define MOD 1000000007
#define INF 1000000000000000007
const int MAX_N = 1 << 17;
#define REP(i, n) for (int(i) = 0, i##_len = (n); (i) < i##_len; (i)++)
#define REPS(i, x) for (int(i) = 1; (i) <= (int)(x); (i)++)
#define RREP(i, x) for (int(i) = ((int)(x)-1); (i) >= 0; (i)--)
#define RREPS(i, x) for (int(i) = ((int)(x)); (i) > 0; (i)--)
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define pb push_back
#define mp make_pair
#define BIT(n) ((int)(1) << (n))
#define ALL(x) (x).begin(), (x).end()
#define debug(x) std::cout << #x << ": " << (x) << std::endl
#define nint int
using namespace std;

int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
typedef pair<int, int> pii;
typedef pair<double, double> dop;
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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
struct aaa {
    aaa()
    {
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout << fixed << setprecision(20);
    };
} aaaaaaa;


signed main()
{
    std::string s;
    cin >> s;
    int f = 0;
    for (int i = 0; i < 3; i++) {
        if (s[i] == '7') {
            f = 1;
            break;
        }
    }
    if (f) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3652
n,q=map(int,input().split())
s=input()
l=[[] for i in range(q)]
for i in range(q):
    l[i]=list(map(int,input().split()))
ans=[0 for i in range(n)]
con=0
j=0
k=0
for i in s:
    if i=="C" and j==1:
        con+=1
    if i=="A":
        j=1
    else:
        j=0
    ans[k]=con
    k+=1
    
for i in l:
    print(ans[i[1]-1]-ans[i[0]-1])

Measured memory_bytes: 31056
#include <bits/stdc++.h>
#define cina(a, n) for (int i = 0; i < n; ++i){ cin >> a[i]; }

using namespace std;

int main () {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	string s;
	cin >> s;
	if (s == "ABC") {
		cout << "ARC";
	} else {
		cout << "ABC";
	}

	return 0;
}

Measured memory_bytes: 3644
k, x = map(int, input("").split(" "))
ans_array = []
for i in range(k-1):
    ans_array.append(x-(i+1))
for i in range(k-1):
    ans_array.append(x+(i+1))
ans_array.append(x)
ans_array.sort()
for i in range(len(ans_array)):
    if i == 0:
        ans = str(ans_array[i])
    else:
        ans += " "
        ans += str(ans_array[i])
print(ans)

Measured memory_bytes: 3064
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String first = scan.next();
        String second = scan.next();
        String result = "";
        
        if (Integer.parseInt(first) >= 3200) {
            result = second;
        } else {
            result = "red";
        }
        System.out.println(result);
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+50;
char s[N];int n,now,mn[N],mx[N],m,smx[N],smn[N],ans=1e9,mm;
void solve(int x){
    int dat=mn[1],sum=0;
    for(int i=2;i<=m;i++){
        if(smx[i]+sum+2<=x)sum+=2;
        dat=min(dat,mn[i]+sum);
    }
    ans=min(ans,x-dat);
}
int main(){
    scanf("%s",s+1);n=strlen(s+1);
    for(int i=1,j;i<=n;i++){
        if(s[i]=='?'){m++;mn[m]=mx[m]=now;continue;}
        j=i;
        while(j<n&&s[j+1]!='?')j++;
        m++;mn[m]=now;mx[m]=now;
        for(int k=i;k<=j;k++){
            if(s[k]=='0')now--;
            else now++;
            mn[m]=min(mn[m],now);
            mx[m]=max(mx[m],now);
        }
        i=j+1;
    }
    if(s[n]=='?')m++,mn[m]=mx[m]=now;mm=mx[1];
    for(int i=2;i<=m;i++)mn[i]-=(i-1),mx[i]-=(i-1),mm=max(mm,mx[i]);
    for(int i=1;i<=m;i++)ans=max(ans,mx[i]-mn[i]);
    smx[m]=mx[m];
    for(int i=m-1;i;i--)smx[i]=max(smx[i+1],mx[i]);
    solve(mm);solve(mm+1);cout<<ans;
    return 0;
}

Measured memory_bytes: 16424
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define alpha_size 26

const int N = 1e5 + 5;

string s;
string a = "CODEFESTIVAL2016";

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);    

    cin >> s;
    int ret = 0;
    for (int i = 0; i < s.size(); i++){
      ret += s[i] != a[i];
    }
    cout << ret << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cctype>

using namespace std;

string shuffle (string card, int m)
{   
    string card1, card2;
    card1 = card.substr(0, m);
    card2 = card.substr(m, card.size() - m);
    card = card2 + card1;

    return card;
}

int main()
{
    string card;
    int n;
    
    while(1){
        cin >> card;
        if (card == "-") break;
        int time;
        cin >> time;
        for (int i = 0; i < time; i++){
            cin >> n;
            card = shuffle(card, n);
        }
        cout << card << endl;
    }
    

    return 0;    
}



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

bool K(string a,string b){
	if(a.length()!=b.length())return a.length()>b.length();
	return a>b;
	}
signed main(){
	string a,b;cin>>a>>b;
	if(a==b)puts("EQUAL");
	else if(K(a,b))puts("GREATER");
	else puts("LESS");
	}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=4e5+10;

namespace Calc_with_MOD{
	const int mod=998244353;
	int add(ll a,ll b){
		ll ret=a+b;
		if(ret<=0)ret+=mod;
		ret%=mod;
		return ret;
	}
	int dec(ll a,ll b){
		ll ret=a-b;
		ret%=mod;
		if(ret<=0)ret+=mod;
		ret%=mod;
		return ret;
	}
	int mul(ll a,ll b){
		a%=mod;b%=mod;
		ll ret=a*b%mod;
		if(ret<=0)ret+=mod;
		return ret;
	}
}
int n,ans,a[maxn];
char s[maxn];
using namespace Calc_with_MOD;
int calc(int x){
	int k=n/x,res=0;
	for(int i=1;i<=k;++i){
		res=add(res,res);
		if(s[i]=='1')res=add(res,1);
	}
	int flag=1;
	for(int i=k+1;i<=n;++i){
		int r=(i-1)%(2*k)+1,c;
		if(r<=k)c=s[r]-'0';
		else c=s[r-k]-'0',c^=1;
		
		if(c<s[i]-'0')break;//if T is lexicographically less than T'
		else if(c==s[i]-'0')continue;//continue for compare
		else {flag=0;break;} //not satisfy
	}

	res+=flag;
	return res;
}
void solve(){
	scanf("%d%s",&n,s+1);
	for(int i=1;i<=n;++i){
		if(n%i||~i&1)continue;
		a[i]=calc(i);
	}
	for(int i=n;i;--i)
		for(int j=i+i;j<=n;j+=i)
			a[i]=dec(a[i],a[j]);
	int res=0;
	for(int i=1;i<=n;++i)
		res=add(res,mul(n/i*2,a[i]));
	printf("%d\n",res);
}
int main(){
	solve();

	return 0;
}
//powered by poorwill

Measured memory_bytes: 896
#include<stdio.h>
int main(){
	int a;
	scanf("%d", &a);
	char b[10001];
	scanf("%s", b);
	for(int i=0; b[i]!='\0'; i++){
		b[i]+=a;
		if(b[i]>'Z'){
			b[i]-=26;
		}
		printf("%c", b[i]);
	}
	return 0;
}

Measured memory_bytes: 1620
#include <stdio.h>

#define N 500000

int a;

int parent(int);
int left(int);
int right(int);
void maxHeapify(int*,int);
void buildMaxHeap(int*);

main(){

  int i,A[N];

  scanf("%d",&a);
  for(i = 1; i <= a; i++){
    scanf("%d",&A[i]);
  }
  buildMaxHeap(A);

  for(i = 1; i <= a; i++){
    printf(" %d",A[i]);
  }
    printf("\n");
  
  return 0;
}

int parent(int i){
  return i / 2;
}



int left(int i){
  return 2 * i;
}


int right(int i){
  return 2 * i +1;
}
void maxHeapify(int* A,int i){
  int x,l,r,largest;

  l = left(i);
  r = right(i);

  if(l <= a && A[l] > A[i]) largest = l;
  else largest = i;

  if(r <= a && A[r] > A[largest]) largest = r;

  if(largest != i){
    x = A[i];
    A[i] = A[largest];
    A[largest] = x;
    maxHeapify(A,largest);
  }
}

void buildMaxHeap(int* A){
  int i;
  for(i = a / 2;i >= 1; i--){
    maxHeapify(A,i);
  }
}

Measured memory_bytes: 2552
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
	mod            = 998244353
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func max(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	n, k := nextInt(), nextInt()
	l, r := make([]int, k), make([]int, k)
	for i := 0; i < k; i++ {
		l[i], r[i] = nextInt(), nextInt()
	}

	// 0-indexed
	dp := make([]int, n)
	// 1-indexed
	a := make([]int, n+1)
	dp[0] = 1
	a[1] = 1
	for i := 1; i < n; i++ {
		for j := 0; j < k; j++ {
			L, R := max(0, i-r[j]), max(0, i-l[j]+1)
			dp[i] += (a[R] - a[L] + mod) % mod
			dp[i] %= mod
		}
		a[i+1] = (a[i] + dp[i]) % mod
	}

	puts(dp[n-1])
}


Measured memory_bytes: 5036
n = int(input())
a_list = list(map(int, input().split()))
mod = 10 ** 9 + 7
ans = 0
for i in range(60):
    k = sum(a >> i & 1 for a in a_list)
    ans += (k * (n - k) % mod) * ((1 << i) % mod) % mod
print (ans % mod)


Measured memory_bytes: 124636
#include <stdio.h>

int main(void){
    char cstr[200001];

    long long int sum;
    int i;
    (void)scanf("%s", &cstr);

    sum = 0;
    for (i =0;i<200001;++i){
        if (cstr[i] == '\0') {
            break;
        }
        sum += (int)cstr[i] - 48;
        // printf("%d\n", (int)cstr[i] - 48);
    }
    if (sum % 9 == 0) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

}

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

using namespace std;

int main()
{
    int n,x,t;
    cin >> n >> x >> t;
    int quant = 0,count = 0;
    for(int i = 1;i <=1000;i++)
    {
        quant = x*i;
        count++;
        if(quant >= n)
        break;
    }
    cout << count*t;
}

Measured memory_bytes: 3544
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 510000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int main(){
  lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> N;
  Vec(P,lli,N,0);
  rep(i,0,N)cin >> P[i];
  Sort(P);
  Vec(Q,lli,N,0);
  Q[0]=P[0];
  rep(i,1,N)Q[i]=Q[i-1]+P[i];
  Rev(P);
  Rev(Q);
  rep(i,1,N){
    if(2*P[i]>=P[i-1]||2*Q[i]>=P[i-1])sum++;
    else break;
  }
  Out(sum+1);
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <bitset>
#include <complex>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;


int main(){
    int N;
    cin >> N;
    int L[2000];
    for(int i=0; i<N; i++){
        cin >> L[i];
    }
    sort(L,L+N);
    int ans=0;
    for(int i=2; i<N; i++){
        for(int j=0; j<i; j++){
            for(int k=0; k<j; k++){
                if(L[i]<L[j]+L[k]){
                    ans++;
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
    
}


Measured memory_bytes: 384
import java.util.Scanner;

class Main
{
    public static void main(String[] args)
    {     
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        
        if (a < b && b < c) {
            System.out.println("Yes"); 
        } else {
             System.out.println("No");
        }
        return;
}
}


Measured memory_bytes: 26356
#include<bits/stdc++.h>
#define boost std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

using namespace std;
using LL = long long;

constexpr int MAXN = 505;
constexpr LL M = 998244353;

template <typename T> inline void read(T &x) {
    int f = 1; x = 0;
    char ch = getchar();
    while (!isdigit(ch)) f = (ch == '-') ? -1 : 1, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}


int main() {
    boost;
    int n, m, k, t, a[101], sum = 0;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i];
    int lowBound = (ceil)(1.0 * sum / (4.0 * m));
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (a[i] >= lowBound) cnt++;
    }
    cnt >= m ? cout << "Yes" : cout << "No";
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	int D, T, S; cin >> D >> T >> S;
	if(S * T >= D) cout << "Yes" << endl;
	else cout << "No" << endl; 
	return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define maxn 200100
using namespace std;
typedef long long ll;
typedef pair<ll,ll> par;
par s[maxn<<2];
int n,a[maxn],b[maxn],q;
void upd(int o){
	s[o].first=max(s[o<<1].first+s[o<<1|1].first,s[o<<1].second+s[o<<1|1].second);
	s[o].second=max(s[o<<1].second+s[o<<1|1].first,s[o<<1].first+s[o<<1|1].second); 
}
void build(int o,int l,int r){
	if(l==r){
		s[o]=par(b[l],a[l]);
		return ;
	}
	int mid=l+r>>1;
	build(o<<1,l,mid);
	build(o<<1|1,mid+1,r);
	upd(o);
}
void mdy(int o,int l,int r,int k,par p){
	if(l==r){
		s[o]=p;
		return ;
	}
	int mid=l+r>>1;
	if(k<=mid)mdy(o<<1,l,mid,k,p);
	else mdy(o<<1|1,mid+1,r,k,p);
	upd(o);
}
int main(){
	scanf("%d%d",&n,&q);
	for(int i=1;i<=2*n;++i)scanf("%d",&a[i]);
	for(int i=1;i<=2*n;++i)scanf("%d",&b[i]);
	if(n>1)build(1,2,2*n-1);
	for(int i=1,p,x,y;i<=q;++i){
		scanf("%d%d%d",&p,&x,&y);
		if(2<=p&&p<=2*n-1)mdy(1,2,2*n-1,p,par(y,x));
		else a[p]=x,b[p]=y;
		printf("%lld\n",a[1]+a[2*n]+s[1].first); 
	}
}

Measured memory_bytes: 11904
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include <queue>
using namespace std;
using ll = long long;

int N,Q;
string S;
ll L[110000];
ll R[110000];
char ch[110000];

int main(void){

    ll ans = 0;

    cin >> N >> Q;
    cin >> S;
    for (int i = 1; i <= Q;i++) cin >> L[i] >> R[i];

    for (int i = 1; i <= N; i++){
        ch[i] = S[i-1]; //chは[0]から始まるので注意！
    }

    ll times = 0;
    ll T[N+1];
    T[0] = 0;

    bool AL = false;

    for (int i = 1; i <= N; i++){
        if(ch[i] == 'A') {
            AL = true;
        } else if(AL){
            if (ch[i] == 'C'){
                times++;
            } 
            AL = false;
        }
        T[i] = times;
    }

    for (int i = 1; i <= Q; i++){
        ans = T[R[i]] - T[L[i]-1];
        if (T[L[i]] - T[L[i]-1] == 1){
            ans--;
        }
        cout << ans << endl;
        ans = 0;
    }



    return 0;
}

Measured memory_bytes: 6108
import java.util.Scanner;
class Main {

    
    public static void main(String[] args) {
        Scanner x = new Scanner(System.in);
        int a, y, z, w, q;
        a = x.nextInt();
        if(a>=0 && a<= 86400){
            y = a / 3600;
            z = a % 3600;
            w = z / 60;
            q = z % 60;
            System.out.println(y + ":" + w + ":" + q);
        }
    }
}

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

#define MAX_N 100000

using namespace std;

int main(void)
{
    int N;
    int a[MAX_N];

    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    sort(a, a + N);
    int answer = 0;
    for (int i = 0; i < N;) {
        int x = a[i];
        int numX = 0;
        while (i < N && a[i] == x) {
            numX++;
            i++;
        }
        if (numX < x) {
            answer += numX;
        } else {
            answer += min(numX, numX - x);
        }
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

		if (b - a == c - b) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 35652
n,m = map(int,input().split())
x = [int(_) for _ in input().split()]
if n >= m:
    print(0)
else:
    x.sort()
    diff = [x[i+1]-x[i] for i in range(m-1)]
    diff.sort(key = lambda y:-y)
    ans = x[m-1] - x[0]
    for i in range(n-1):
        ans -= diff[i]
    print(ans)

Measured memory_bytes: 13832
#include <bits/stdc++.h>
using namespace std;
#define faster ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define ll long long
#define FO(n) for (ll i = 0; i < n; i++)
#define endl "\n"
const long long int M = 10e9 + 7;
void solve()
{
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(a*c,max(b*d,max(b*c,a*d)));

}

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



Measured memory_bytes: 3608