akhauriyash/Code-Regression huggingface dataset:
N,M = map(int,input().split())
A = [list(map(int,input().split())) for n in range(N)]
C = [list(map(int,input().split())) for m in range(M)]


for n in range(N):
  ans = []
  for m in range(M):
    ans.append(abs(A[n][0]-C[m][0])+abs(A[n][1]-C[m][1]))
  print(ans.index(min(ans))+1)

Measured memory_bytes: 9152
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll a = 0;
    for (int i = 0; i < (1 << (s.length() - 1)); i++) {
        //1 2 5
        //125   00
        //1 25  01
        //12 5  10
        //1 2 5 11
        
        //123 45 67
        //b=1
        //b=12
        //b=123
        //a+=123, b=4
        //b=45
        //a+=45, b=6
        //b=67
        //a+=67
        ll b = s[0] - '0';
        for (int j = 1; j < s.length(); j++) {
            if (i & (1 << (j - 1))) {
                a += b;
                b = s[j] - '0';
            } else {
                b = b * 10 + s[j] - '0';
            }
        }
        a += b;
    }
    cout << a << '\n';
}


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

using namespace std;
using ll = long long;


int prim(int start, vector<vector<pair<int,int>>> hen) {

    priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> que;
    que.emplace(0, start);
    vector<int> seen(hen.size());
    int sum = 0;

    while(que.size()) {
        int cost = que.top().first, vert = que.top().second;
        que.pop();
        if(seen[vert])continue;
        seen[vert] = true;
        //処理をする
        sum += cost;

        for(auto i : hen[vert]) {
            if(seen[i.first])continue;
            que.emplace(i.second, i.first);

        }
    }
    return sum;
}


int main()
{
    int n, m;
    cin >> n >> m;
    vector<vector<pair<int,int>>> hen(n);
    for(int i = 0; i < m; i++) {
        int a, b, c; cin >> a >> b >> c;
        hen[a].emplace_back(b, c);
        hen[b].emplace_back(a, c);
    }
    cout << prim(0, hen) << endl;
}


Measured memory_bytes: 8424
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

typedef long long ll;
typedef pair<ll, int> P;
const ll INFTY = ll(1) << 60;

int main()
{
    int N;
    cin >> N;
    vector<ll> A(3*N), latter(N+1), former(N+1);
    priority_queue< ll, vector<ll>, greater<ll> > min_f;
    priority_queue<ll> max_l;

    for(int i=0;i<3*N;++i){
        cin >> A[i];
    }

    for(int i=0;i<N;++i){
        former[0] += A[i];
        latter[N] += A[3*N-1-i];
        min_f.push(A[i]);
        max_l.push(A[3*N-1-i]);
    }

    for(int i=1;i<N+1;++i){
        former[i] = former[i-1];
        if(min_f.top() < A[N+i-1]){
            former[i] -= min_f.top();
            former[i] += A[N+i-1];
            min_f.pop();
            min_f.push(A[N+i-1]);
        }
        latter[N-i] = latter[N-i+1];
        if(max_l.top() > A[2*N-i]){
            latter[N-i] -= max_l.top();
            latter[N-i] += A[2*N-i];
            max_l.pop();
            max_l.push(A[2*N-i]);
        }
    }

    ll ans = -INFTY;
    for(int i=0;i<N+1;++i){
        //cout << former[i] << " " << latter[i] << endl;
        ans = max(ans, former[i] - latter[i]);
    }

    cout << ans << endl;
}


Measured memory_bytes: 5996
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed
#define endl '\n'

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

void solve(istream& cin, ostream& cout) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> w(n + 1), e(n + 1);
  REP(i, n) {
    if (s[i] == 'W') {
      w[i] = 1;
    }
    if (s[n - 1 - i] == 'E') {
      e[n - 1 - i] = 1;
    }
  }

  REP(i, n - 1) {
    w[i + 1] += w[i];
    e[n - 2 - i] += e[n - 1 - i];
  }

  int ans = INF;
  REP(i, n) {
    int tmp = 0;
    if (i >= 1) tmp += w[i - 1];
    if (i <= n - 2) tmp += e[i + 1];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif


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

#define ll          long long
#define pb          push_back
#define endl        '\n'
#define mii         map<ll,ll>
#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 INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    vi arr={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    ll n;
    cin>>n;
    cout<<arr[n-1]<<endl;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    time
    return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int l = (int)s.size();
    cout << s[0] << l-2 << s[l-1] << endl;

    return 0;
}

Measured memory_bytes: 3568
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < (int) (n); i++)
#define MOD 1000000007
typedef long long ll;

int main(){
  	char str[100010];
  	scanf("%s", str);
  		for(int i = 0; i <= 100010; i++){
           if (str[i] == '\0') break;
          	
      		if(i % 2 == 0){
             	printf("%c", str[i]);
            }
    }
	return 0;
}



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

using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[200002];
    int x;
    for(int i=1;i<=n;++i)   cin>>a[i];
    for(int i=n;i>0;i-=2)
    {
        cout<<a[i]<<' ';
        x = i;
    }
    if(x==2)
        for(int j=x-1;j<n;j+=2) cout<<a[j]<<' ';
    else
        for(int j=x+1;j<n;j+=2) cout<<a[j]<<' ';


    return 0;
}

Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n; long long sum=0; cin>>n;
vector<int>a(n+1),b(n);
for(int i=0; i<n+1; i++) { cin>>a[i];}  
for(int i=0; i<n; i++) { cin>>b[i];}  
for(int i=n-1; i>=0; i--) { 
	if(a[i+1]<b[i]){
		 b[i]-=a[i+1]; sum+=a[i+1];
		 if (a[i]<b[i]) {
		 	sum+=a[i]; a[i]=0;	
		 }
		 else { sum+=b[i]; a[i]-=b[i];} 
	}
	else{
		sum+=b[i]; 
	}
}
cout<<sum<<endl;  
return 0;
}


Measured memory_bytes: 1152
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
ld EPS = 1e-12;
int INF = numeric_limits<int>::max() / 2;
int MOD = 1e9 + 7;
#define rep(i,n) for(int i=0;i<n;i++)
 
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int a, b, c;
	cin >> a >> b >> c;
    string result = "Yes";
    if(a + b < c){
        result = "No";
    }
	
	cout << result << endl;
	return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

int main() {
    ll S;
    cin >> S;
    ll x1, y1, x2, y2, x3, y3;
    x1 = y1 = 0;

    ll t = sqrt(S);
    if (t * t == S) {
        x2 = t;
        y2 = 0;
        x3 = 0;
        y3 = t;
    } else {
        x2 = t + 1;
        y2 = x2 * x2 - S;
        x3 = 1;
        y3 = t + 1;
    }

//    cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;

    if (t * t == S) {
        cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
//        cout << "0 0 " << t << " " << "0 0 " << t << "\n";
        return 0;
    }
    t += 1;
    ll e = t * t - S;
    cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
    return 0;
}

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

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

  if (N % 500 <= A) {
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  // ここにプログラムを追記
}

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

const int S = 1e4 + 10, MAX = 0x3f3f3f3f, MX = 1e4;
int dp[S], c[S], w[S], n, m;

int main() {
	memset(dp, MAX, sizeof(dp));
	scanf("%d%d", &m, &n);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", c + i, w + i);
	dp[0] = 0;
	for (int i = 1; i <= n; i++)
		for (int j = c[i]; j <= MX; j++)
			dp[j] = min(dp[j], dp[j - c[i]] + w[i]);
	int ans = INT_MAX;
	for (int i = m; i <= MX; i++) ans = min(ans, dp[i]);
	printf("%d\n", ans);
	return 0;
}


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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  
  if (A+B>=C) {
    cout << B+C;
  }
  
  else if (A+B<C) {
    cout << A+2*B+1;
  }
}

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


template<typename F = long long>
struct Linear { // y = a * x + b;
  F a, b;
  Linear(F a = 0, F b = 0) : a(a), b(b) {}
  bool operator<(Linear oth) const {
    return a == oth.a ? b < oth.b : a < oth.a;
  }
  template<typename T> T operator()(T x) const { return a * x + b; }
};


template<typename F = long long>
class ConvexHull { // lower envelop
  vector<Linear<F>> f;
  bool cross(Linear<F> P, Linear<F> Q, Linear<F> T) const {
    if (Q.a == T.a) return Q.b <= T.b;
    auto ceil2 = [=](F a, F b) {
      return a >= 0 ? (a + b - 1) / b : a / b;
    };
    const F x = ceil2(P.b - Q.b, Q.a - P.a);
    const F y = ceil2(Q.b - T.b, T.a - Q.a);
    return y <= x;
  }
  void getHull() {
    int m = 0;
    for (int i = 0; i < f.size(); ++i) {
      while (m >= 2 and cross(f[m - 2], f[m - 1], f[i]))  --m;
      if (m == 1 and f[0].a == f[i].a) --m;
      f[m++] = f[i];
    }
    f.resize(m);
  }
public:
  int size() const { return f.size(); }
  ConvexHull(vector<Linear<F>> A) : f(A) {
    sort(f.begin(), f.end());
    getHull();
  }
  F operator()(F x) const {
    int n = f.size();
    auto df = [&](int i) { return f[i + 1](x) - f[i](x); };
    if (n == 0) return numeric_limits<F>::min();
    if (n == 1 or df(0) <= 0) return f[0](x);
    int l = 0, r = n - 1;
    while (r - l > 1) {
      int m = l + r >> 1;
      (df(m) < 0 ? r : l) = m;
    }
    return f[r](x);
  }
  void merge(const ConvexHull &oth) {
    auto mid = f.size();
    f.insert(f.end(), oth.f.begin(), oth.f.end());
    inplace_merge(f.begin(), f.begin() + mid, f.end());
    getHull();
  }
};


template<typename F>
class ExpandableHull {
  vector<ConvexHull<F>> stk;
public:
  void addLine(Linear<F> l) {
    stk.emplace_back(vector<Linear<F>>{l});
    int m = stk.size();
    while (m > 1 and stk[m - 2].size() <= stk[m - 1].size()) {
      stk[m - 2].merge(stk[m - 1]);
      stk.pop_back();
      --m;
    }
  }
  F operator()(F x) {
    return accumulate(stk.begin(), stk.end(), numeric_limits<F>::min(),
      [&](F y, ConvexHull<F>& C) { return max(y, C(x));
    });
  }
};

long long dp[1<<18] = {0};


int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  ExpandableHull<long long> U;
  int n; long long C; cin >> n >> C;
  for (int i = 0; i < n; ++i) {
    long long h; cin >> h;
    if (i == 0) {
      dp[i] = 0;
    } else {
      dp[i] = h * h + C - U(h);
    }
    U.addLine(Linear<long long>(2 * h, -h * h - dp[i]));
  }
  cout << dp[n - 1] << '\n';
}


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

int main() {
  string s, t;
  cin >> s >> t;

  int ans = 100000;
  for (int i = 0; i <= s.size()-t.size(); i++) {
    int ta = 0;
    for (int j = 0; j < t.size(); j++) {
      if (s[i+j] != t[j]) ta++;
    }
    ans = min(ans, ta);
  }

  cout << ans << endl;

  return 0;
}



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

int is[1000001];
bool isprime[1000001];

int main() {

    isprime[0] = isprime[1] = true;
    for(int i=4; i<=1000000; i+=2) isprime[i] = true;
    for(int i=3; i*i<=1000000; i+=2)
        for(int j=2; i*j<=1000000; ++j)
            isprime[i*j] = true;

    int n,x,s;
    while(cin>>n>>x, n|x) {
        memset(is, -1, sizeof(is));
        is[0] = 0;
        for(int i=1; i<=n; ++i) {
            cin>>s;
            for(int j=0; j<=x; ++j) {
                if(is[j] >= i) continue;
                if(is[j] >= 0) {
                    for(int k=1; j+s*k <= x; ++k)
                        is[j+s*k] = i;
                }
            }
        }

        for(int j=x; j>=0; --j) {
            if(is[j] >= 0 && !isprime[j]) {
                cout<<j<<endl;
                goto NEXT;
            }
        }
        cout<<"NA"<<endl;
    NEXT:;
    }
}

Measured memory_bytes: 5744
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define sorta(V) sort(V.begin(), V.end())
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 
#define CERR if(false) cerr

using namespace std;


int main(){

    int a,b;
    cin >> a >> b;

    int X = 100;
    int Y = 100;

    vector<string> ans;

    rep(i,Y){
        string tmp;

        if(i < Y / 2){
            rep(j,X){
                tmp.pback('#');
            }
        }else{
            rep(j,X){
                tmp.pback('.');
            }
        }

        ans.pback(tmp);
    }

    a--;
    b--;

    int x = 1;
    int y = 1;

    while(a > 0){
        ans[y][x] = '.';

        x = x + 2;

        if(x == X - 3){
            x = 1;
            y = y + 2;
        }
        a--;
    }

    x = 1;
    y = Y / 2 + 1;

    while(b > 0){
        ans[y][x] = '#';

        x = x + 2;

        if(x == X - 3){
            x = 1;
            y = y + 2;
        }
        b--;
    }

    cout << Y << " " << X << endl;

    rep(i,Y){
        cout << ans[i] << endl;
    }


    return 0;
}

Measured memory_bytes: 256
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N = read_int()
    s = []
    for i in range(N):
      S = read_str()
      s.append(S)
    s.sort()
    s.append('')

    res = []
    M = -1
    m = 1
    for i in range(1, N+1):
      if s[i-1] == s[i]:
        m += 1
      else:
        if m == M:
          res.append(s[i-1])
        if m > M:
          M = m
          res = [s[i-1]]
        m = 1
    print(*res, sep='\n')


def main2():
    N = read_int()
    s = []
    for i in range(N):
      S = read_str()
      s.append(S)

    d = dict()
    for i in range(N):
      if s[i] not in d:
        d[s[i]] = 0
      d[s[i]] += 1
    # print(d)

    M = -1
    for key, value in d.items():
      if value > M:
        M = value
    # print(M)

    res = []
    for key, value in d.items():
      if value == M:
        res.append(key)
    res.sort()
    print(*res, sep='\n')

main2()


Measured memory_bytes: 36172
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll A, B, C;
  cin >> A >> B >> C;
  if (A == B && A == C) {
    cout << "No" << endl;
  } else if (A == B || B == C || A == C)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	double w,h,x,y;
	cin >> w >> h >> x >> y;
	int judge;
	if(2 * x == w && 2 * y == h) judge = 1;
	else judge = 0;
	cout << w * h / 2 << " " << judge << endl;
}

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


int main(){
    string s;
    cin >> s;
    int ans = s.size() / 2;
    rep(i, s.size()) ans -= (s[i] == 'p');
    cout << ans << endl;
}

Measured memory_bytes: 512
program main
implicit None
	integer::n,m,a,i
	
	read *,n,m
	
	a = m/n
	
	do while (a > 0)
		if (mod(m,a) == 0)then
			exit
		endif
		a = a-1
	enddo
	
	print 102,a
	
	
101 format(a)
102 format(i0)
end program main

Measured memory_bytes: 640
#include<cstring>
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int a,b,c,t;
	cin>>a>>b>>c;
	if(a<b)swap(a,b);
	if(a<c)swap(a,c);
	cout<<a*10+b+c;
	return 0;
}

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

int main()
{
  int n;
  cin >> n;
  int kind = 0;
  int i;
  vector<bool> color(4,false);
  char temp;
  for(i = 0;i <= n;++i){
    cin >> temp;
    if(temp == 'P'){
      color.at(0) = true;
    }else if(temp == 'W'){
      color.at(1) = true;
    }else if(temp == 'G'){
      color.at(2) = true;
    }else{
      color.at(3) = true;
    }
  }
  int ans = 0;
  for(i = 0;i < 4;++i){
    if(color.at(i)){
      ++ans;
    }
  }
  if(ans == 3){
    cout << "Three" << endl;
  }else{
    cout << "Four" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define lf long double
#define vi vector<int>
#define vl vector<long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define in insert
#define all(x) x.begin(),x.end()
#define zapp ios::sync_with_stdio(false);cin.tie(0)
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res - MOD : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= MOD ? res % MOD : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + MOD : res);}
ll power(ll x, ll y) {if (y < 0) return 1; ll res = 1; x %= MOD; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll inv(ll x){return power(x, MOD - 2);}
const int MAXN = 1e5 + 5;
//const bool is_in = container.find(element) != container.end();
int main()
{
	zapp;
	ll a;
	lf b;
	cin>>a>>b;
	lf mul = (lf)a * b;
	ll gh = floor(mul);
	cout<<gh;
}




Measured memory_bytes: 3748
//include
//------------------------------------------
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
//-------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int n;
int m=10;
int** data;

void print_matrix(){

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            cout << data[i][j] << " ";
        }
        cout<<endl;
    }
}

bool dfs(int* row, int c, int head1, int head2){

    if(c+1 == m && (row[c] > head1 || row[c] > head2)){
        return true;
    }

    if(row[c] > head1){
        if(dfs(row, c+1, row[c], head2)){
            return true;
        }
    }

    if(row[c] > head2){
        if(dfs(row, c+1, head1, row[c])){
            return true;
        }
    }

    return false;
}

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

  cin >> n;

  data = (int**)malloc(sizeof(int*)*n);

  for(int i=0; i<n; i++){
      int* b = (int*)malloc(sizeof(int)*10);
      cin >> b[0] >> b[1] >> b[2] >> b[3] >> b[4] >> b[5] >> b[6] >> b[7] >> b[8] >> b[9];
      data[i] = b;

      bool res = dfs(data[i],0,0,0);
      if(res){
          cout << "YES" << endl;
      }else{
          cout << "NO" <<endl;
      }
  }

  for(int i=0; i<n; i++){
      free(data[i]);
  }
  free(data);

  return 0;
}

Measured memory_bytes: 1188
fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val switches = (0 until m).map {
        val s = readLine()!!.split(' ').map { it.toInt() }
        s.slice(1 .. s[0]).toSet()
    }
    val ps = readLine()!!.split(' ').map { it.toInt() }

    fun dfs(i: Int, set: Set<Int>): Int {
        if (i == n) {
            val r = (0 until m).all {
                switches[it].intersect(set).size % 2 == ps[it]
            }
            return if (r) {
                1
            } else {
                0
            }
        }
        return dfs(i + 1, set.plus(i + 1)) + dfs(i + 1, set)
    }

    println(dfs(0, emptySet()))
}


Measured memory_bytes: 40844
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mod 1000000007
#define test ll t; cin>>t; while(t--)
typedef long long int ll;
int main() {
    FIO;
    //test
    {
        ll d,s,t;
        cin>>d>>s>>t;
        if(d>s*t){
            cout<<"No\n";
        }
        else{
            cout<<"Yes\n";
        }
    }
	return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
//cout << setprecision(20) << 

int main() {
    ll A, B; cin >> A >> B;
    ll ans = -1;
    if (A > 0 && B > 0 && A < 10 && B < 10) ans = A * B;
    cout << ans << endl;
}

Measured memory_bytes: 256
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;

typedef long long lint;
typedef long double louble;
template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return b<a?a:b;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

namespace ae86
{
	const int bufl = 1<<15;
	char buf[bufl],*s=buf,*t=buf;
	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}

	inline int ty()
	{
		int a=0,b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 200007 , mo = 1000000007;

struct sgt
{
#define lc (x<<1)
#define rc (x<<1|1)
#define mid ((l+r)>>1)

	static const int _t = _<<2;

	lint t[_t];

	inline void up(int x){t[x]=(t[lc]+t[rc])%mo;}
	
	void plant(int x,int l,int r)
	{
		t[x]=0;
		if(l==r)return;
		plant(lc,l,mid),plant(rc,mid+1,r),up(x);
	}

	void change(int x,int l,int r,int tar,lint dlt)
	{
		if(l==r){t[x]=(t[x]+dlt)%mo;return;}
		if(tar<=mid)change(lc,l,mid,tar,dlt);
		else change(rc,mid+1,r,tar,dlt);
		up(x);
	}

	lint finder(int x,int l,int r,int tl,int tr)
	{
		if(tl<=l && r<=tr)return t[x];
		if(tr<=mid)return finder(lc,l,mid,tl,tr);
		if(tl>mid)return finder(rc,mid+1,r,tl,tr);
		return (finder(lc,l,mid,tl,tr)+finder(rc,mid+1,r,tl,tr))%mo;
	}
	
#undef lc
#undef rc
#undef mid
}t;

struct cxk
{
	int loc,spd;
	cxk(int _loc=0,int _spd=0){loc=_loc,spd=_spd;}
	inline friend int operator < (cxk a,cxk b){return a.spd<b.spd;}
}p[_];

int n,stk[_],top,ll[_],rr[_];
vector<int> got[_];

int main()
{
	n=ty();
	for(int i=1,a,b;i<=n;i++)a=ty(),b=ty(),p[i]=cxk(a,b);
	sort(p+1,p+n+1);

	top=0;
	for(int i=1;i<=n;i++)
	{
		int l=1,r=top,ans=i;
		while(r>=l)
		{
			int mid=(l+r)>>1;
			if(p[stk[mid]].loc>p[i].loc)ans=stk[mid],r=mid-1;
			else l=mid+1;
		}
		ll[i]=ans;
		if(top<=0 || p[i].loc>p[stk[top]].loc)stk[++top]=i;
	}

	top=0;
	for(int i=n;i>=1;i--)
	{
		int l=1,r=top,ans=i;
		while(r>=l)
		{
			int mid=(l+r)>>1;
			if(p[stk[mid]].loc<p[i].loc)ans=stk[mid],r=mid-1;
			else l=mid+1;
		}
		rr[i]=ans;
		if(top<=0 || p[i].loc<p[stk[top]].loc)stk[++top]=i;
	}

	for(int i=1;i<=n;i++)got[ll[i]].push_back(rr[i]);
	for(int i=1;i<=n;i++)sort(got[i].begin(),got[i].end());

	t.plant(1,0,n),t.change(1,0,n,0,1);
	for(int i=1;i<=n;i++)
		for(auto j:got[i])
			t.change(1,0,n,j,t.finder(1,0,n,i-1,n));

	printf("%lld\n",t.finder(1,0,n,n,n));

	return 0;
}


Measured memory_bytes: 20864
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use feature qw/say/;

my $S = <STDIN>;
say join(' ', detect($S));

sub detect {
    my ($s) = @_;
    if ($s =~ /(.)(\1|.\1)/ ) {
        return ($-[0] + 1, $+[0]);
    }
    return (-1, -1);
}

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

int main(){
	
	int N;
	cin>>N;
	
	vector<int> V(N),W(N);
	for(int i=0;i<N;i++)scanf("%d %d",&V[i],&W[i]);
	
	vector<vector<int>> dp(512,vector<int>(100001,-Inf));
	for(int i=0;i<=100000;i++)dp[0][i] = 0;
	for(int i=1;i<min(512,N+1);i++){
		for(int j=0;j<=100000;j++){
			dp[i][j] = max(dp[i][j],dp[i/2][j]);
			if(j!=0)dp[i][j] = max(dp[i][j],dp[i][j-1]);
			int t = j-W[i-1];
			if(t<0)continue;
			dp[i][j] = max(dp[i][j],dp[i/2][t] + V[i-1]);
		}
	}
	
	int Q;
	cin>>Q;
	for(int i=0;i<Q;i++){
		int v,L;
		scanf("%d %d",&v,&L);
		if(v<512){
			printf("%d\n",dp[v][L]);
			continue;
		}
		vector<int> vv,ww;
		while(v>=512){
			vv.push_back(V[v-1]);
			ww.push_back(W[v-1]);
			v/=2;
		}
		int ans = 0;
		for(int j=0;j<(1<<vv.size());j++){
			int VV = 0,WW = 0;
			for(int k=0;k<vv.size();k++){
				if((j>>k)&1){
					VV += vv[k];
					WW += ww[k];
				}
			}
			
			if(WW>L)continue;
			ans = max(ans,VV + dp[v][L-WW]);
		}
		printf("%d\n",ans);
	}
		
	
	return 0;
}

Measured memory_bytes: 206608
#include<iostream>
#include<algorithm>
#include<functional>

using namespace std;

#define SIZE 10

int main(){
	int array[SIZE];

	for(int i = 0; i < SIZE; i++) {
		cin >> array[i];
	}

	sort(array, array + SIZE, greater<int>());

	for(int i = 0; i < 3; i++) {
		cout << array[i] << endl;
	}
	return 0;
}

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

int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a <= 0 && b >= 0)
        printf("Zero");
    else
        if(a > 0 && b > 0)
            printf("Positive");
        else
            if ((b - a + 1) % 2 == 0)
                printf("Positive");
            else
                printf("Negative");
    return 0; }


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

int main(){
  int x;
  cin>>x;
  if(x%10==7){
  cout<<"Yes"<<endl;
  return 0;
  }
  if((x%100)-(x%10)==70){
  cout<<"Yes"<<endl;
  return 0;
  }
  if(x-(x%100)==700){
  cout<<"Yes"<<endl;
  return 0;
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
    long long a[5];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    if(a[0]%2==0 || a[1]%2==0 || a[2]%2==0){
        cout<<"0"<<endl;
    }
    else{
        cout<<a[0]*a[1]<<endl;
    }
    return(0);
}

Measured memory_bytes: 3572
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#define INF 1000000000
#define rep(i,n) for(int i =0;i<n;i++)
using namespace std;
typedef long long int ll;


int main(){
    for(;;){
        int n,w,h;
        cin >> n >> w >> h;
        if(!n)break;
        int g[101][101];
        rep(i, h+1){
            rep(j,w+1){
                g[i][j]=0;
            }
        }
        rep(i, n){
            int x,y;
            cin >> y >> x;
            g[x][y]=1;
        }
        rep(i, h+1){
            for (int j=1; j<w+1; j++) {
                if (g[i][j]==0) {
                    g[i][j]=g[i][j-1];
                }else{
                    g[i][j]=g[i][j-1]+1;
                }
            }
        }/*
        for (int i=0; i<=h; i++) {
            for (int j=0; j<=w; j++) {
                cout << g[i][j]<<" ";
            }
            cout << endl;
        }*/
        int s,t;
        cin >> s >> t;
        int ans = 0;
        for (int i=1; i<=h; i++) {
            for (int j=1; j<=w; j++) {
                int ch=0;
                for (int k=0; k<t; k++) {
                    if(j+s-1>w or i+k>h) break;
                    ch += g[i+k][j+s-1]-g[i+k][j-1];
                }
                ans = max(ans,ch);
            }
        }
        cout <<ans << endl;
    }
}

Measured memory_bytes: 1196
require 'pp'
s = gets.chomp
K = gets.chomp.to_i

ans = []

a = 0
b = 0
len = s.size

while a < len
  b = a
  while b < a + 5 && b < len
    str = s[a..b]
    if ans.include?(str)
    elsif ans.size < K
      ans << str
      ans.sort!
    else
      if ans[-1] < str
        break
      else
        ans << str
        ans.sort!
        ans.pop
      end
    end
    b += 1
  end
  a += 1
end

# puts ans

puts ans[K-1]


Measured memory_bytes: 2300
#include <iostream>

using namespace std;

int N;

int main(){
    cin >> N;

    int A[N+1], B[N];
    for(int i=0; i<N+1; i++){
        cin >> A[i];
    }

    long sum = 0;
    for(int i=0; i<N; i++){
        cin >> B[i];
        sum += B[i];
    }

    for(int i=0; i<N; i++){
        int t = A[i];
        A[i] = max(t - B[i], 0);
        B[i] -= t - A[i];

        if(B[i] != 0){
            int p = A[i+1];
            A[i+1] = max(p - B[i], 0);
            B[i] -= p - A[i+1];
        }
    }

    long sum2 = 0;
    for(int i=0; i<N; i++){
        sum2 += B[i];
    }

    cout << sum - sum2;

    return 0;

}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n,m; cin >> n >> m;
  vector<P<int,int>> v;
  int l = n/2;
  int r = l + 1;
  for(int i = 0; i < m; ++i){
    v.emplace_back(l,r);
    cout << l << ' ' << r << endl;
    if(n - (r - l) == (r + 1 - (l - 1)))r++;
    l--;
    r++;
    if(n - (r - l) == (r - l))r++;
  }
  return 0;
}


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

// @@ !! LIM(sieve)
// --> sieve
// ---- inserted library file sieve.cc

// sieve(upto) returns the list of prime numbers up to upto.
//   Size: upto(1e8).size() ... 5.7e6,  upto(1e9).size() ... 5.1e7
//   Performance: upto(1e8) ... 0.7sec,   upto(1e9) ... 9.2sec
vector<int> sieve(int upto) {
  vector<int> res;
  vector<bool> tbl(upto+1);
  ll lim = (int)(sqrt((double)upto)) + 1;
  for (int x = 2; x <= upto; x++) {
    if (tbl.at(x))  continue;
    res.push_back(x);
    if (x > lim)  continue;
    for (int y = x * 2; y <= upto; y += x) tbl.at(y) = true;
  }
  return res;
}

/*
  Prime Factorization
    Two versions:
      - prfac(n)
      - prfac(n, primes)
 */

vector<pair<ll, int>> prfac(ll n, const vector<int>& primes) {
  //      primes should contain prime numbers at least up to sqrt(n)
  vector<pair<ll, int>> res;
  ll x = n;
  for (ll p : primes) {
    if (x == 1)  break;
    if (p * p > x)  break;
    if (x % p != 0)  continue;
    int c = 1;
    x /= p;
    while (x % p == 0) {
      c += 1;
      x /= p;
    }
    res.push_back(make_pair(p, c));
  }
  if (x != 1)  res.push_back(make_pair(x, 1));
  return res;
}

vector<pair<ll, int>> prfac(ll n) {
  return prfac(n, sieve((int)(sqrt((double)n)) + 1));
}

/*
    List of divisors
      - getDivisors(n)
    Note: the results are NOT sorted
 */

// gdsub ... aux function used in getDivisors()
vector<ll> gdsub(int i, int n, auto fs) {
  if (i == n) { return vector<ll>({1}); }
  auto part = gdsub(i+1, n, fs);
  ll p  = fs.at(i).first;
  int r = fs.at(i).second;
  ll pp = p;    // pp = p^m, for m \in [1, r]
  int partOrigLen = part.size();
  for (int m = 1; m <= r; m++) {
    for (int j = 0; j < partOrigLen; j++) {
      part.push_back(pp * part.at(j));
    }
    pp *= p;
  }
  return part;
}

vector<ll> getDivisors(ll n) {
  auto fs = prfac(n);
  return gdsub(0, fs.size(), fs);
}

// ---- end sieve.cc
// @@ !! LIM  -- end mark --

vector<ll> pre({
    0,
      7235066807370,
      30326437365305,
      70058845460324,
      126850677017896,
      200992731246868,
      292711756082245,
      402189540344467,
      529582304274542,
      675022487920202
      });

int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N; cin >> N;
  ll step = 1e6 + 1;
  ll nq = N / step;

  auto primes = sieve(1e4);
  auto f = [&](ll k) -> ll {
    ll ret = 1;
    for (auto [p, r] : prfac(k, primes)) {
      ret *= (r + 1);
    }
    return ret;
  };
  
  ll s = pre.at(nq);
  for (ll k = nq * step + 1; k <= N; k++) {
    s += k * f(k);
  }
  cout << s << endl;

  return 0;
}



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

int main()
{
	string s;
	cin>>s;
	
	bool flag = true;
	
	for(int i=0; i<s.size(); i++)
	{
		if(s[i]=='R' && (i+1)%2==0 || s[i]== 'L' && (i+1)%2!=0) 
		{
		    flag = false;
		 break;	
		}
	}
	
	
	if(flag) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
} 

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x=ii()

for i in range(-200,200):
    for j in range(-200,200):
        if i**5 - j**5 ==x:
            print(i,j)
            exit()



Measured memory_bytes: 77536
from math import sqrt


def prime_factorize(n):
    result = []
    for i in range(2, int(sqrt(n)) + 1):
        if n % i != 0:
            continue
        t = 0
        while n % i == 0:
            n //= i
            t += 1
        result.append((i, t))
        if n == 1:
            break
    if n != 1:
        result.append((n, 1))
    return result


N = int(input())

result = 0
for p, e in prime_factorize(N):
    i = 1
    while e >= i:
        result += 1
        e -= i
        i += 1
print(result)


Measured memory_bytes: 9224
/*ex3_4
series2*/
 
# include <stdio.h>
int main(void){
      //各文字の箱を作って読み取り
    int N;
    scanf("%d", &N);
    int i=1;//調べている九九のうちの片方の数字(1から9)
    while(i<10){//割り切れるまで確かめる
        if (N%i==0 && N/i<10){//Nが1から9の中で割り切れるものがあり、かつその商が9以下の時、Yesである。
            printf("Yes\n");
            return 0;//Yesの時処理を終了させる
        }
        i++;
    }
    //いずれにも該当しない時はNoを出力する。
    printf("No\n");
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  int ans=31;
  for(int i=0; i<N; i++){
    cin >> A.at(i);
    int j=i;
    int num=0;
    while(A.at(j)%2==0){
      A.at(j)=A.at(j)/2;
      num++;
    }
    ans=min(ans, num);
  }
  cout << ans << endl;
}

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

int main() {
  int n;
  cin >> n;
  int count, countmax = 0, x, max = 1;
  for (int i = 1; i <= n; i++) {
    x = i;
    count = 0;
    while (x % 2 == 0 && x != 0) {
      x /= 2;
      count++;
    }
    if (countmax < count) {
      max = i;
      countmax = count;
    }
  }
  cout << max << endl;
}

Measured memory_bytes: 256
program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,i,ans,l_a, r_a
    integer(int64), allocatable:: a(:)

    read*, n
    allocate(a(n))
    read*, a(:)
    l_a=a(1)
    r_a=sum(a(2:))
    ans=abs(l_a-r_a)

    do i=2,n-1
        l_a=l_a+a(i)
        r_a=r_a-a(i)
        ans=min(ans,abs(l_a-r_a))
    end do

    print'(i0)', ans
end program name

Measured memory_bytes: 2304
#include<cstdio>

using namespace std;

int main()
{
	for(int i=0;i<3;i++){
		int h,m,s,sec[2]={};
		for(int j=0;j<2;j++)	scanf("%d%d%d",&h,&m,&s),sec[j]=s+(m+h*60)*60;
		int ans=sec[1]-sec[0];
		printf("%d %d %d\n",ans/3600,(ans%3600)/60,ans%60);
	}
	return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for (int i = a; i <= (b); i++)
#define ROF(i, a, b) for (int i = a; i >= (b); i--)

using pii = pair<int, int>; using vpii = vector<pii>;
using vi = vector<int>; using vvi = vector<vi>;
using ll = long long;
using pll = pair<ll, ll>; using vpll = vector<pll>;
using vll = vector<ll>; using vvll = vector<vll>;

int main() {
    int n; cin >> n;
    vll l(n);
    FOR(i, 0, n - 1) cin >> l[i];
    int ans = 0;
    FOR(i, 0, n - 1) FOR(j, i + 1, n - 1) FOR(k, j + 1, n - 1) {
        if (l[i] == l[j] || l[j] == l[k] || l[k] == l[i]) continue;
        if (l[i] + l[j] > l[k] &&
            l[j] + l[k] > l[i] &&
            l[k] + l[i] > l[j])
            ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3640
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1ll, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

int main(void) {
	int n, m, k;
	cin >> n >> m >> k;
	vector<ll> a(n + 1), b(m + 1);
	rep(i, 1, n + 1)cin >> a[i], a[i] += a[i - 1];
	rep(i, 1, m + 1)cin >> b[i], b[i] += b[i - 1];
	int j = m, ans = 0;
	rep(i, 0, n + 1) {
		if (a[i] > k)break;
		while (b[j] + a[i] > k)j--;
		ans = max(ans, i + j);
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 6344
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define IREP(i, v) for(auto i = (v).begin(); i != (v).end(); ++i)
#define IRREP(i, v) for(auto i = (v).rbegin(); i != (v).rend(); ++i)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

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


int main(){
    string X; cin >> X;
    deque<char> stk;
    int ans(X.length());
    REP(i, X.length()){
        if(X[i] == 'S') stk.EB('S');
        if(X[i] == 'T'){
            if(stk.empty() || stk.back() == 'T') stk.EB('T');
            else{
                stk.pop_back(); ans -= 2;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 644
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int W = arr[0];
        int H = arr[1];
        int x = arr[2];
        int y = arr[3];
        int r = arr[4];
        if (x - r >= 0 && y - r >= 0 && x + r <= W && y + r <= H)
        {
            Console.WriteLine("Yes");
        }
        else
        {
            Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 20320