akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
typedef unsigned int uint;
typedef unsigned long long ull;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template <class T> using VVV = V<VV<T>>;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;
void yesno(bool ok, string yes = "Yes", string no = "No") {
    if (ok) {
        cout << yes << endl;
    } else {
        cout << no << endl;
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    ll A[M];
    ll sum = 0;
    REP(i, 0, M) {
        cin >> A[i];
        sum += A[i];
    }
    if (N >= sum) {
        cout << N - sum << endl;
    } else {
        cout << "-1" << endl;
    }
}


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

static const int MAX = 50;
static const int LEFT = 3;
static const int RIGHT = 2;
static const int UP = 1;
static const int DOWN = 0;
static const int INF = 1<<30;

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

int main(){
    int H,W;

    while(1){
        cin>>W>>H;
        if(H == 0 && W == 0) break;
        vector<vector<vector<bool> > > dir(MAX,vector<vector<bool> >(MAX,vector<bool>(4)));

        for(int i=0; i<H; i++){
            for(int j=0; j<W;  j++){
                for(int k=0; k<4; k++){
                    dir[i][j][k] = true;
                }
            }
        }

        for(int i=0; i<W; i++){
            dir[0][i][UP] = false;
        }

        for(int i=0; i<W; i++){
            dir[H-1][i][DOWN] = false;
        }

        for(int i=0; i<H; i++){
            dir[i][0][LEFT] = false;
        }

        for(int i=0; i<H; i++){
            dir[i][W-1][RIGHT] = false;
        }

        for(int i=0; i<2*H-1; i++){
            int len;
            if(i % 2 == 0){
                len = W-1;
            }
            else len = W;

            for(int j=0; j<len; j++){
                int flag;
                cin>>flag;
                if(flag == 1){
                    if(i % 2 != 0){
                        dir[i/2+1][j][UP] = false;
                        dir[i/2][j][DOWN] = false;
                    }

                    else {
                        dir[i/2][j][RIGHT] = false;
                        dir[i/2][j+1][LEFT] = false;
                    }
                }
            }
        }

        vector<vector<int> > dis(MAX,vector<int>(MAX,INF));
        for(int i=0; i<H; i++){
            for(int j=0; j<W; j++){
                dis[i][j] = INF;
            }
        }
        dis[0][0] = 1;

        queue<pair<int,int> > dic;
        dic.push({0,0});

        while(! dic.empty()){
            pair<int,int> v = dic.front();
            dic.pop();
            int x = v.first;
            int y = v.second;

            for(int i=0; i<4; i++){
                if(!dir[x][y][i]) continue;
                int nx,ny;
                nx = x+dx[i];
                ny = y+dy[i];
                if(dis[nx][ny] <= dis[x][y]+1) continue;
                dis[nx][ny] = dis[x][y]+1;
                dic.push({nx,ny}); 
            }
        }

        if(dis[H-1][W-1] == INF) cout<<0<<endl;
        else cout<<dis[H-1][W-1]<<endl;
    }

    return 0;
}


Measured memory_bytes: 3316
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

typedef long long ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define present(i, c) ((c).find(i) != (c).end())
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i <= n; i++)
#define foreach(i, c) for(auto i : c)

#define TRACE(x...) x
#define watch(x) TRACE(cerr << #x" = " << x << endl)
#define watchc(x) TRACE(cerr << #x" = "); for(auto __i : x) cerr << __i << " "; cerr << endl

#define INF 0x3f3f3f3f

int main() {
	
	ifstream infile("input.in");
	if(infile.good()) cin.rdbuf(infile.rdbuf());

    int n, m, x;
    cin >> n >> m >> x;

    vector<int> c(n);
    vector<vi> a(n);
    rep(i, n) {
        cin >> c[i];
        rep(j, m) {
            int a1; cin >> a1;
            a[i].pb(a1);
        }
    }

    int v[m];
    int res = INF;
    rep(k, (1 << n)) {
        int s = 0;
        memset(v, 0, sizeof v);
        rep(i, n) if(k & (1 << i)) {
            rep(j, m) 
                v[j] += a[i][j];
            s += c[i];
        }
        int cnt = count_if(v, v+m, [=](int i) { return i >= x; });
        if(cnt == m) res = min(res, s);
    }

    if(res < INF) cout << res << endl;
    else cout << -1 << endl;
	
	if(infile.good()) infile.close();
	return 0;
	
}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int dp[4][2005][2005];

int main(){
  int H, W;
  cin >> H >> W;
  vector<string> S;
  rep(i,H){
    string s;
    cin >> s;
    S.push_back(s);
  }

  rep(i,H){
    rep(j,W){
      int prevL = 0;
      if(0<=j-1 && j-1<W && S[i][j-1]=='.') prevL = dp[0][i][j-1];
      dp[0][i][j] = prevL+1;
      int prevR = 0;
      if(0<=W-1-(j-1) && W-1-(j-1)<W && S[i][W-1-(j-1)]=='.') prevR = dp[1][i][W-1-(j-1)];
      dp[1][i][W-1-j] = prevR+1;
    }
  }

  rep(j,W){
    rep(i,H){
      int prevU = 0;
      if(0<=i-1 && i-1<H && S[i-1][j]=='.') prevU = dp[2][i-1][j];
      dp[2][i][j] = prevU+1;
      int prevD = 0;
      if(0<=H-1-(i-1) && H-1-(i-1)<H && S[H-1-(i-1)][j]=='.') prevD = dp[3][H-1-(i-1)][j];
      dp[3][H-1-i][j] = prevD+1;
    }
  }

  int ret = 0;
  rep(i,H){
    rep(j,W){
      if(S[i][j] != '.') continue;
      
      int sum = 1;
      rep(k,4){
        sum += dp[k][i][j] - 1;
      }
      ret = max(ret, sum);
    }
  }

  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 67200
#include "bits/stdc++.h"
using namespace std;

int main(){
    int N,X,Y;
    cin >> N >> X >> Y;

    int A[N-1]={0};
    A[0]=N;

        for(int i=1;i<=N-1;i++){
            for(int j=i+2;j<=N;j++){
              int a,b,c;
                a=j-i;
              b=abs(X-i)+abs(Y-j)+1;
              c = min(a,b); 
               //cout << c ;
              for(int k=1;k<=N-2;k++){
                 if(c==k+1) {
                   A[k]++;
                   break;
                 }
              }
            }
        }

   for(int i=0;i<N-1;i++) cout << A[i] <<endl;;


}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 1e6 + 4;

int isprime[MAX];
   //to store smallest prime factor of number
void sieve()
    {
       for(int i = 1;i < MAX;++i)
           isprime[i] = i;

        for(int i = 2;i < MAX;++i)
        {
            if(i == isprime[i])
            {
                for(int j = 2 * i;j <= MAX;j += i)
                {
                    if(isprime[j] == j)
                    isprime[j] = i;
                }
            }
        }

    }
// A O(log n) function returning primefactorization 
 
vector<int>factorize(int x) 
{ 
    vector<int>res; 
    while (x != 1) 
    { 
        res.push_back(isprime[x]); 
        x = x / isprime[x]; 
    } 
    return res; 
} 




signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    sieve();
    
    int testCases = 1;
  //  cin >> testCases;
    
    while(testCases--)
    {
        int n,i;
        cin >> n;
        
        int a[n];
        
        for(i = 0;i < n;++i)
            cin >> a[i];
        
        
        int GCD = a[0];
        for(i = 1;i < n;++i)
        {
           GCD = __gcd(GCD,a[i]);
            
        }
        map<int,int>mp;
        for(i = 0;i < n;++i)
        {
            vector<int>y = factorize(a[i]);
            set<int>X;
            
            for(int e : y)
                X.insert(e);
            
            for(auto e : X)
                mp[e]++;
            
        }
        bool flg = false;
        for(auto it : mp)
        {
            if(it.second > 1)
            {
                flg = true;
                break;
            }
        }
        
        if(!flg and GCD == 1)
        {
            cout << "pairwise coprime";
        }
        else{
            if(GCD == 1)
                cout << "setwise coprime";
            else
                cout << "not coprime";
        }
       
        cout << '\n';
    }
    
}


Measured memory_bytes: 24176
S = list(input())
s = S[0]
res = 0
for i in range(1,len(S)-1):
    s += S[i]
    n = len(s)
    middle = n//2
    if n%2 == 1:
        continue
    elif s[:middle] == s[middle:n]:
        res = n
print(res)

Measured memory_bytes: 38384
N,K = map(int, input().split())
S = list(input())
numL = S.count("L")
numR = S.count("R")

score = 0
turning = 0
for i in range(1, N):
	if S[i-1] == S[i]:
		score += 1
	else:
		turning += 1

if K >= (turning + 2) // 2:
	print(N-1)
else:
	print(score + 2*K)

Measured memory_bytes: 4024
#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
	ll n; 
	cin >> n;
	ll a[n];
	for(ll i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n);
	ll po = a[0];
	ll yo = 0;
	for(ll i = 1; i < n; i++){
		if(po * 2 < a[i]) yo = i;
		po += a[i];
	}
	cout << n - yo << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <math.h>

using namespace std;

const double eps = 1e-10;

class Point {
public:
    double x, y;
    Point(double _x = 0., double _y = 0.) : x(_x), y(_y) {}
};

istream& operator >> (istream& in, Point& P)
{
    in >> P.x >> P.y;
    return in;
}

double Dist(const Point& P, const Point& Q)
{
    double dx = P.x - Q.x;
    double dy = P.y - Q.y;
    return sqrt(dx * dx + dy * dy);
}

class Circle {
public:
    Point c;
    double r;
    Circle(const Point& _c = Point(), double _r = 0.) : c(_c), r(_r) {}
};

istream& operator >> (istream& in, Circle& C)
{
    in >> C.c >> C.r;
    return in;
}

int CircStatus(const Circle& C1, const Circle& C2)
{
    double d = Dist(C1.c, C2.c);
    if (d > C1.r + C2.r + eps) {
        return 4;
    } else if (d > C1.r + C2.r -eps) {
        return 3;
    } else if (d > fabs(C1.r - C2.r) + eps) {
        return 2;
    } else if (d > fabs(C1.r - C2.r) - eps) {
        return 1;
    } else {
        return 0;
    }
}

int main()
{
    Circle C1, C2;
    cin >> C1 >> C2;

    cout << CircStatus(C1, C2) << endl;
    
    return 0;
}



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

int main() {
  string str1, str2;
  cin >> str1;
  cin >> str2;
  
  int judge = 1;
  int size = str1.size();
  
  for (int i = 0; i < size; i++) {
    if (str1.at(i) != str2.at(i)) {
      judge = 0;
    }
  }
  
  if (judge == 1) {
    cout << "Yes" << endl;
  }
  
  if (judge == 0) {
    cout << "No" << endl;
  }
}


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

int main()
{
    int a, b;
    cin >> a >> b;
    
    for (int i = 1; i <= 1000; ++i)
    {
        if (floor(i * 0.08) == a and floor(i * 0.1) == b)
        {
            cout << i << endl;
            return 0;
        }
    }
    
    cout << -1 << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){

  int n, x;
  int l;
  int ans = 1;
  int sum = 0;

  cin >> n >> x;

  for(int i = 0; i < n; i++){
    cin >> l;
    sum += l;
    if(sum <= x){
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
D, G = MAP()
pc = [LIST() for _ in range(D)]

count_min = 1001

for i in range(1<<D):
	count = 0
	sum = 0
	i = list("{:b}".format(i).zfill(D))
	#print(i)
	for j in range(D):
		if i[j] == "1":
			count += pc[j][0]
			sum += pc[j][0]*100*(j+1) + pc[j][1]

	if sum >= G:
		if count < count_min:
			#print("更新", count_min, ">", count)
			count_min = count

	else:
		for j in range(D-1, -1, -1):
			if i[j] == "0":
				remain_count = -(-(G-sum)//(100*(j+1)))
				#print(remain_count)
				if remain_count >= pc[j][0]:
					count = 1001
					break
				else:
					count += remain_count

				if count < count_min:
					#print("更新", count_min, ">", count)
					count_min = count

print(count_min)



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

// @author: pashka

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

    int n, s;
    cin >> n >> s;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<long> d(s + 1);
    static const int MOD = 998244353;
    int res = 0;
    for (int i = 0; i < n; i++) {
        int x = a[i];
        for (int j = s - x; j >= 0; j--) {
            d[j + x] += d[j];
            d[j + x] %= MOD;
        }        
        if (x <= s) {
            d[x] += i + 1;
            d[x] %= MOD;
        }
        res += d[s];
        res %= MOD;
    }
    cout << res;

    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main(){
  int n;
  cin >> n;
  set<int> s;
  REP(i,n){
    int tmp;
    cin >> tmp;
    s.insert(tmp);
  }
  int m;
  cin >> m;
  set<int> t;
  REP(i,m){
    int tmp;
    cin >> tmp;
    t.insert(tmp);
  }
  set<int> ans;
  set_difference(ALL(s),ALL(t),inserter(ans,ans.end()));
  for(auto i:ans){
    cout << i << endl;
  }
}



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

int main(){
    int n,l;
    cin>>n>>l;
    vector<string> letter(n);
    for (int i = 0; i < n; i++){
        cin>>letter.at(i);
    }
    sort(letter.begin(),letter.end());
    string ans;
    for (int i = 0; i < n; i++){
        ans+=letter.at(i);
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e09;

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

  ll a, b, c, x;
  cin >> a >> b >> c >> x;
  ll ans = 0;
  REP(i, a + 1){
    REP(j, b + 1){
      REP(k, c + 1){
        if(i * 500 + j * 100 + k * 50 == x) ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i = m;i < n;i++)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) REP(i,1,n+1)
typedef pair<int,int> P;
typedef pair<int, P> PP;
#define fi first
#define se second
const int inf = 1e9;

int main(){
	int a, b, c, d;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	printf("%d\n", min(a, b)+min(c, d));
	return 0;
}

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

using namespace std;

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

    vector<string> vt = {
            "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"
    };

    auto idx = find(vt.begin(), vt.end(), s) - vt.begin();
    cout << 7 - idx << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
from collections import Counter
d = Counter(a)
s = sum(a)
q = int(readline())
for i in range(q):
  b,c = map(int,readline().split())
  m = d[b]
  s = s-m*(b-c)
  print(s)
  d.update({b:-m})
  d.update({c:m})

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


int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  ll s = 0;
  rep(i, n)
  {
    cin >> a[i];
    s += a[i];
  }
  vector<ll> c;
  for (ll i = 1; i * i <= s; i++)
    if (s % i == 0)
    {
      c.push_back(i);
      c.push_back(s / i);
    }
  sort(c.begin(), c.end(), greater<ll>());
  for (auto i : c)
  {
    vector<ll> m(n);
    ll msum = 0;
    rep(j, n)
    {
      m[j] = a[j] % i;
      msum += m[j];
    }
    sort(m.begin(), m.end());
    ll msum2 = 0;
    for (int j = m.size() - 1; j >= 0; j--)
    {
      msum -= m[j];
      msum2 += i - m[j];
      if (max(msum, msum2) <= k)
      {
        cout << i << endl;
        return 0;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdlib.h>
 
using namespace std;
 
const int N=123456;
int a[N];
int b[N];
 
int main() {
    int n;
    int h=0;
    scanf("%d",&n);
    int s=0;
    for(int i=1;i<=n;i++) {
        scanf("%d",&a[i]);
        if(a[i]!=a[i-1] ) {
            b[s++]=a[i];
        }
    }
    for(int i=0;i<s;i++) {
        if(i==n-1){
            h++;
            break;
        }
        int flag1=0;
        int flag2=0;
        while(b[i]>=b[i+1] && i+1<s) {
            i++;
            flag1=1;
        }
        if(flag1) {
            h++;
            i++;
        }
        while(b[i]<=b[i+1] && i+1<s) {
            i++;
            flag2=1;
        }
        if(flag2) {
            h++;
        } else if(flag1) {
            i--;
        }
    }
    printf("%d\n",h);
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <cmath>
using namespace std;

int main(void)
{
	string str;
	while(getline(cin, str) && str != "."){
		bool flag = true;
		stack<char> st;
		for(int i = 0; i < str.size(); i++){
			if(str[i] == '(' || str[i] == '[') st.push(str[i]);
		
			if(str[i] == ']'){
				if(st.size() != 0 && st.top() == '[') st.pop();
				else { flag = false; break; }
			}
			if(str[i] == ')'){
				if(st.size() != 0 && st.top() == '(') st.pop();
				else { flag = false; break; }
			}
		}
		if(flag && st.size() == 0) cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}

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

vector<int> graph[110000];
vector<int> memo(110000,-1);

int dp(int n){
    if(memo[n]!=-1)return memo[n];
    int ans = 0;
    for(int i=0;i<graph[n].size();i++){
        ans = max(ans,dp(graph[n][i])+1);
    }
    memo[n]=ans;
    return ans;
}

int main() {
    int n,m;
    cin >> n >> m;
    for(int i=0;i<m;i++){
        //cout << i << " " << m << endl;
        int x,y;
        cin >> x >> y;
        graph[x-1].push_back(y-1);
    }

    for(int i=0;i<n;i++)dp(i);

    int ans = -1;
    for(int i=0;i<n;i++){
        ans = max(ans,memo[i]);
    }
    cout << ans << endl;

}


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

int main(){
    ll x;
    cin >> x;
    for(ll i = 1 ; i <= 1000 ; ++i){
        for(ll j = -1000 ; j <= 1000 ; ++j){
            if(i*i*i*i*i - j*j*j*j*j == x){
                cout << i << " " << j << endl;
                return 0;
            }
        }
    }
    return 0;
}

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


double prod(int i, vector<int> A){
	
	double ans = 1.0;
	
	// i = -1なら全ての積、それ以外ならi番目を除く全ての積
	if(i == -1){
		for(int j = 0; j < A.size(); j++){
			ans *= A[j];
		}
	}
	else{
		for(int j = 0; j < A.size(); j++){
			if(j == i) continue;
			ans *= A[j];
		}
	}
	
	return ans;

}

int main() {
	int N;
	cin >> N;
	vector<int> A(N);

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

	double bb = 0; // 分母
	for(int i = 0; i < N; i++){
		bb += prod(i,A);
	}
	
	double ans = prod(-1,A) / bb;
	cout << ans << endl;
	
	
}

Measured memory_bytes: 256
n = gets.to_i
s = gets.chomp
if n % 2 == 1
  puts 'No'
else
  a = s.slice(0, s.size/2)
  b = s.slice(s.size/2, s.size)
  if a.nil? || b.nil?
    puts 'No'
  else
    puts a == b ? 'Yes' : 'No'
  end
end



Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
int a[100];
int main()
{
	int n;
	long long ans=1e9;
	long long sum=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	
	for(int i=1;i<=100;i++)
	{
		sum=0;
		for(int j=0;j<n;j++)
		{
			sum+=(a[j]-i)*(a[j]-i);
		}
		ans=min(ans,sum);
	}
	cout<<ans<<endl;
 } 

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

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    if (A < B){
        if(N<A+B) cout << A << " " << A-(N-B) <<  endl;
        else cout << A << " " << 0 <<  endl;
    }else if(B<A){
        if(N<A+B) cout << B << " " << B-(N-A) <<  endl;
        else cout << B << " " << 0 <<  endl;
    }else{
        if(N<A+B) cout << B << " " << B-(N-A) <<  endl;
        else cout << A << " " << A <<  endl;
    }
}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

#define Ms(s, n) memset(s, n, sizeof(s))
#define Rp(i,l,m) for(int i=l; i<m; ++i)
#define Rpd(i,l,m) for(int i=l; i>=m; --i)
#define Rpp(i,l,m) for(int i=l; i<=m; i++)
#define RpAll(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define All(a) (a).begin(), (a).end()
#define Fi first
#define Se second
#define Pb push_back
#define Pf push_front
#define Is insert
#define Sz(a) int((a).size())
#define ooi INT_MAX
#define ool LLONG_MAX
typedef long long ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
const int MOD = (int) 1e9 + 7;
const ld PI = acos((ld) -1);
inline ll gcd(ll a,ll b) {ll r;while(b){r=a%b;a=b;b=r;}return a;}
inline ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}
inline ll fpow(ll n,ll k){ll r=1; for(;k;k>>=1){if(k&1)r=r*n%MOD;n=n*n%MOD;}return r;}
const int base = 311;
const int N = 2e5 + 5;

ll n, m, k, test, a[N], F[N][3];

void Solve(){
    cin >> n;
    int ans = 0;
    for(int i = 1; i<=n; i++){
        if(int(log10(i) + 1) & 1) ans ++;
    }
    cout << ans;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    Solve();
    return 0;
}



















Measured memory_bytes: 256
n = int(input())
s = input() + "@"
t = input() + "@"
mod = 10 ** 9 + 7

# 情報を1次元にして処理しやすくするぜ
# 縦で一致 True 横で一致 False
b = []
for i in range(n):
    if s[i] == s[i + 1]:
        continue
    b.append(s[i] == t[i])

# 処理するぜ
if b[0]:
    ans = 3
else:
    ans = 6

for i in range(1, len(b)):
    if b[i]:
        if b[i - 1]:
            ans *= 2
    else:
        if b[i - 1]:
            ans *= 2
        else:
            ans *= 3

print(ans % mod)



Measured memory_bytes: 9140
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[100010];
int N, S, W, Q;

int main(){
    while(cin >> N >> S >> W >> Q && N){
        int g = S;
        for(int i=0; i<N; i++) {
            a[i] = (g/7) % 10;
            if( g%2 == 0 ) { g = (g/2); }
            else           { g = (g/2) ^ W; }
        }
        int ans = 0;
        if(Q != 2 && Q != 5){
            unordered_map<int,int> m = {{0,1}};
            ll dig = 1, cur = 0;
            for(int i = N-1; i >= 0; --i) {
                cur = i == N-1 ? a[i] % Q : cur + a[i]*dig;
                cur %= Q;
                if(a[i] != 0) ans += m[cur];
                m[cur]++;
                dig *= 10;
                dig %= Q;
            }
        } else if(Q == 2 || Q == 5){
            int pos = 0;
            for(int i = 0; i < N; ++i){
                if(a[i] != 0) ++pos;
                if(a[i] % Q == 0) ans += pos;
            }
        } 
        cout << ans << endl;
    }
}

Measured memory_bytes: 6868
#include<iostream>
using namespace std;
int main()
{
    int a,b;
    char c;
    cin>>a>>c>>b;
    int sub,sum;
    
    cin>>c;
    sum=a+b;
    sub=a-b;
    if (c=='+') 
        cout<<sum<<endl;
    else
        cout<<sub<<endl;
        
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
float PHI = 1.6180339;
//const float  PI_F=3.14159265358979f;
#define MAX 100000 
#define endl "\n"    
//typedef long long float;
#define int long long
//#define float unsigned long long

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int a,b;
    cin>>a>>b;
    int x=2*b;
    if(x>=a)
    {
        cout<<"0"<<endl;
    }
    else
    {
        int diff=a-x;
        cout<<diff<<endl;
    }


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
template<int mod>
struct Combination {
    std::vector<long long> fact, finv, inv;
    Combination(int sz) {
        fact.resize(sz);
        finv.resize(sz);
        inv.resize(sz);
        fact[0] = 1;
        for(int i=1;i<sz;++i) {
            fact[i] = fact[i-1] * i % mod;
        }
        inv[0] = 0;
        inv[1] = 1;
        for(int i=2;i<sz;++i) {
            inv[i] = mod - inv[mod%i] * (mod/i) % mod;
        }
        finv[0] = 1;
        for(int i=1;i<sz;++i) {
            finv[i] = finv[i-1] * inv[i] % mod;
        }
    }
    long long C(int n, int k) {
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return (fact[n] * finv[k] % mod) * finv[n-k] % mod;
    }
    long long P(int n, int k) {
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return fact[n] * finv[n-k] % mod;
    }
    long long H(int n, int k) {
        return this->C(n + k - 1, k);
    }
};
template<typename T>
struct Edge {
    int from, to;
    T cost;
    Edge(int from, int to, T cost) {
        this->from = from;
        this->to = to;
        this->cost = cost;
    }
};
template<typename T>
using Edges = std::vector<Edge<T>>;
template<typename T>
using Graph = std::vector<Edges<T>>;
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double eps = 1e-10;
const int MOD = 1000000007;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
    cin.tie(0);
    cout << fixed << setprecision(10);
    int n, k; cin >> n >> k;
    Graph<int> g(n);
    for(int i=0;i<n-1;++i) {
      int u, v; cin >> u >> v;
      u--; v--;
      g[u].push_back(Edge<int>(u, v, 1));
      g[v].push_back(Edge<int>(v, u, 1));
    }
    Graph<int> tr(n);
    queue<int> que;
    vector<int> sel(n, false);
    que.push(0);
    sel[0] = true;
    while(!que.empty()) {
      int now = que.front(); que.pop();
      for(int i=0;i<(int)(g[now].size());++i) {
        int next = g[now][i].to;
        if(!sel[next]) {
          sel[next] = true;
          tr[now].push_back(Edge<int>(now, next, 1));
          que.push(next);
        }
      }
    }
    ll ans = k;
    Combination<MOD> comb(100000);
    ans *= comb.P(k-1, (int)(tr[0].size())) % MOD;
    ans %= MOD;
    for(int i=0;i<(int)(tr[0].size());++i) {
      que.push(tr[0][i].to);
    }
    while(!que.empty()) {
      int now = que.front(); que.pop();
      ans *= comb.P(k-2, (int)(tr[now].size())) % MOD;
      ans %= MOD;
      for(int i=0;i<(int)(tr[now].size());++i) {
        que.push(tr[now][i].to);
      }
    }
    cout << ans << endl;
}


Measured memory_bytes: 13952
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
using namespace __gnu_pbds;
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

const int mod = 1e9 + 7;
int x, y;
long long fac[2000001][2];

long long modpow(int a, int b){
	if(b == 0) return 1;
	long long val = modpow(a, b / 2);
	val = (val * val) % mod;
	if(b % 2 == 1) val = (val * a) % mod;
	return val;
}

int main(){
	//IO("input.txt", "output.txt");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> x >> y;
	fac[0][0] = fac[0][1] = 1;
	for(int i = 1; i <= 2000000; i++){
		fac[i][0] = (fac[i - 1][0] * i) % mod;
		fac[i][1] = modpow(fac[i][0], mod - 2);
	}
	long long ways = 0;
	for(int i = 0; i <= min(x, y); i++){
		int a = x - i, b = y - i * 2;
		if(a >= 0 && b >= 0 && b * 2 == a){
			int j = b;
			ways = (ways + ((fac[j + i][0] * fac[i][1]) % mod * fac[j][1]) % mod) % mod; 
		}
	}
	cout << ways << "\n";
	return 0;
}

Measured memory_bytes: 31488
get_number(Number) :-
    get_string(String),
    number_string(Number, String).

get_number(A, B) :-
    get_number(A),
    get_number(B).

get_number(A, B, C) :-
    get_number(A, B),
    get_number(C).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).

/* memo
    code(int)
    string_code(1, S, C), (C: code)
    char_code(X, Y) (X: char, Y: code)
    string_chars(S, S2) (S: string, S2: [char])
    to_lower(C, C2) (C: char? C2: code?)
    sub_string

    f(0, [], []).
    f(Z, [X|Xs], [Y|Ys]) :- X = Y, f(Z1, Xs, Ys), Z is Z1 + 1.
    f(Z, [_|Xs], [_|Ys]) :- f(Z, Xs, Ys).

    match: =, \=

    numeric: <,=<, >, >= (eval)
    lexicographically: @<. @=<, @>, @>=
    value?: =:=, =\= (eval)
    identical: ==, \==
*/

f([A,B,C],[C,B,A]).

main :-
    get_string(S),
    get_string(T),
    string_chars(S, S2),
    string_chars(T, T2),
    f(S2, T2) -> writeln("YES") ; writeln("NO").


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

int main(void){
  string s;cin>>s;
  map<char, int> mp;
  for(int i=0;i<int('z'-'a')+1;i++){
    mp[char('a'+i)]=0;
  }
  for(int i=0;i<s.size();i++){
    char c=s.at(i);
    mp[c]++;
  }
  bool ans=true;
  for(int i=0;i<int('z'-'a')+1;i++){
    if(mp[char('a'+i)]%2){
      ans=false;break;
    }
  }
  if(ans)cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+5;
int n;
int a[maxn];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int x;
        scanf("%d",&x);
        a[x]=i;
    }
    for(int i=1;i<=n;i++){
        printf("%d%c",a[i],i==n?'\n':' ');
    }


	return 0;
}




Measured memory_bytes: 4076
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	char buf[7];
	scanf("%s",buf);

	if(buf[2] == buf[3] && buf[4] == buf[5]){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define max0(a,b,c) max(max(a,b),c)
#define min0(a,b,c) min(min(a,b),c)
#define ft first
#define sc second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
using namespace std;
using Graph = vector<vector<int>>;
typedef long long lint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldouble;
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<ull> ulvec;
typedef vector<double> dvec;
typedef vector<pair<int,int>> pvec;
typedef vector<pair<ll,ll>> plvec;
typedef vector<tuple<ll,ll,ll>> tvec;
typedef vector<string> svec;

int main(){
    ll n;cin>>n;
    lvec a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    ll cnt=0;
    rep(i,n) cnt+=a[i]-b[i];
    if(cnt<0) cout<<-1<<endl;
    else{
        plvec p(n);
        rep(i,n){
            p[i]=make_pair(a[i]-b[i],i);
        }
        sort(all(p));
        set<ll> st;
        rep(i,n){
            if(p[i].ft>=0) break;
            st.insert(p[i].sc);
        }
        cnt=0;
        ll cnt1=0;

        rep(i,n){
            if(p[i].ft<0) cnt+=p[i].ft;
        }
        ll r=n-1;
        while(cnt1<abs(cnt)){
            cnt1+=p[r].ft;
            st.insert(p[r].sc);
            r--;
        }
        cout<<st.size()<<endl;
    }
}

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

int main(){
    int K;
    string S;
    cin >> K >> S;
    int Ssize = S.size();
    if(Ssize <= K) cout << S << endl;
    else{
        for(int i=0; i<K; i++) cout << S.at(i);
        cout << "..." << endl;
    }
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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

	string s;
	cin >> s;

	int n = s.size();
	if(n == 2) cout << s << endl;
	else{
		rep(i, n){
			cout << s[n-i-1];
		}
		cout << endl;
	}
}


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

struct Node
{
	int id;
	int children;
};

int main()
{
	vector<Node> members;
	int n;

	cin >> n;

	members.emplace_back();
	members.back().id = 1;
	members.back().children = 0;

	for (int i = 1; i < n; ++i)
	{
		members.emplace_back();
		members.back().id = i;
		members.back().children = 0;
		int up;
		cin >> up;
		members[up - 1].children++;
	}

	for (auto& m : members)
	{
		cout << m.children << "\n";
	}


	return 0;
}

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

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

int main(void){
  int a,b;
  cin >> a >> b;
  if(a == 1) a = 14;
  if(b== 1) b = 14;
  if(a < b) cout << "Bob" << endl;
  else if(a==b) cout <<"Draw" << endl;
  else cout << "Alice" << endl;
}

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


int main()
{
  int n, x;
  int data[101];
  int ans;

  cin >> n >>x;

  for ( int i = 0; i < n; i++) {
    cin >> data[i];
    x -= data[i];
  }

  sort(data, data + n);

  ans = n;
  while ( x - data[0] >= 0 ) {
    x -= data[0];
    ans++;
  }

  cout << ans << endl;

  return (0);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define rep(i, init, n) for(int i = init; i <(int)(n); i++)

int main() {
    string s;
    cin >> s;
    int l = s.size();
    set<char> ss;
    REP(i, l){
        if(ss.find(s[i]) == ss.end()) ss.insert(s[i]);
        else{
            cout << "no" << endl;
            return 0;
        }
    }
    cout << "yes" << endl;

    return 0;
}

Measured memory_bytes: 256
X,N = map(int,input().split())
P = list(map(int,input().split()))
m = {}
for i in range(102):
    if i in P:
        continue
    ab = abs(i - X)
    m[i] = ab
# min_kv_list = [kv for kv in m.items() if kv[1] == min(m.values())]
min_k_list = [kv[0] for kv in m.items() if kv[1] == min(m.values())]
print(min(min_k_list))

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

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

int main() {
  long double X,Y,x,y;
  cin>>X>>Y>>x>>y;
  cout<<X*Y/2<<" ";
  int ans;
  if(X/2==x&&Y/2==y){
    ans=1;
  }
  else{
    ans=0;
  }
  cout<<ans;
  
 
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n,m,i,j;
        n=scan.nextInt();
        m=scan.nextInt();
        int arraya[][]=new int[n][m],arrayb[]=new int[m],arrayc[]=new int[n];
        for(i=0;i<n;i++) {
        	for(j=0;j<m;j++) {
        		arraya[i][j]=scan.nextInt();
        	}
        }
        for(i=0;i<m;i++) {
        	arrayb[i]=scan.nextInt();
        }
        for(i=0;i<n;i++) {
        	arrayc[i]=0;
        }
        for(i=0;i<n;i++) {
        	for(j=0;j<m;j++) {
        		arrayc[i]+=arraya[i][j]*arrayb[j];
        	}
        }
        for(i=0;i<n;i++) {
        	System.out.println(arrayc[i]);
        }
    }
}



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

Measured memory_bytes: 384
// #include <stdio.h>
// #include <string.h>
//#include <iostream>
#include <utility>
#include <cstdio>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <string>
#include <set>

using namespace std;
typedef pair<int, int> XY;// Pair型変数の宣言
    
int main()
{
  	int Nmax = 100000;
    char S[4];
    char T[4];
    int N;
    int i,j,k;
    int len;   // 文字列の長さ
    int flag=0;
    int t[Nmax];
    int x[Nmax];
    int y[Nmax];
/*  
    // int型スタック
    stack<int> stack;   
    stack.push(777);
    stack.push(778);
    stack.push(779);
  
	int tmpsl = stack.top();  // LAST要素の参照
 // 	int tpmsf = stack.back(); // FIRST要素の参照
 //	printf("%d %d \n",tmpsl,tmpsf);
    stack.pop();// LAST要素の削除（取出しではない）
 // 	if( stack.empty() == true) printf("empty stack\n");
     
    // int型キュー
    queue<int> que;
  	que.push(999);
  	que.push(998);   
  	que.push(997);    
  	int tmpqs = que.front(); // FIRST要素の参照
  	int tmpqe = que.back();  // LAST要素の参照
 //	printf("%d %d \n",tmpqs,tmpqe);
  	que.pop();  // FIRST要素の削除（取出しではない）
  //	if( que.empty() == true) printf("empty que\n");
    
    // ２次元座標を扱うキュー
    queue<XY> xyque; // ２次元座標型変数のキュー
  	XY p; 
  	xyque.pop();	// FIRST要素の削除。キューが空のときは削除が予約されて次のPOPが即削除される
  	xyque.push( XY(5,5) );
    xyque.push( XY(5,5) );
   	p = xyque.front();  // FIRST要素からのコピー
 // 	printf("%d %d\n", p.first, p.second);
  	
    
  que.back();
  //  sort(&(que.front()), &(que.back()));
  */  
      
    // 入力読込
    // 文字列
    scanf("%s", S);   
    scanf("%s", T);   
    
    
    
    // 数列
//    scanf("%d", &N);
//    for(i=1;i<=N;i++){
//        scanf("%d %d %d",&t[i],&x[i],&y[i]);
//    }
    
    // 文字列の長さをチェック
    // 文字列は配列の0からlen-1に格納されてる
//    len = strlen( String );
//  	printf("%d\n",len);
    int count =0;
    for(int i =0;i<3;i++){
        if(S[i] == T[i])
            count++;
    }
    
    
   printf("%d",count);
    
  
  return 0;
   
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	char b;
	 scanf("%s",&b);
	 if(b=='A'){
		 printf("T\n");
	 }
	 if(b=='T'){
		 printf("A\n");
	 }
	 if(b=='C'){
		 printf("G\n");
	 }
	 if(b=='G'){
		 printf("C\n");
	 }
	 return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double r=sc.nextDouble();
        System.out.println(String.format("%.6f",r*r*Math.PI) + " " + String.format("%.6f",r*2*Math.PI));
    }
}


Measured memory_bytes: 28340
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

ll binomialCoeff(ll n, ll k) 
{ 
    ll C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (ll j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    int test=0;
    map<int,int> m;
    for(int i=0;i<n;i++)
    {
        int x=nxt();
        m[x]+=1;
    }
    for(int i=0;i<1e5;i++)
    {
        int val=m[i]+m[i-1]+m[i+1];
        if(val>test)
            test=val;
    }
    cout<<test<<endl;
    
    
    
    return 0;   
}




 
 


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

#define pb            push_back
#define mp            make_pair
#define ins           insert
#define endl          '\n'
#define all(x)        x.begin(),x.end()
#define debug(X)      { cerr<<endl<<(#X)<<" = "<<(X)<<endl; }
//#define cerr if(0)cerr

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;


int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n,r;

    cin>>n>>r;
    if (n>=10) cout<<r;
    else {
        r+=100*(10-n);
        cout<<r;
    }
    cout<<endl;
}


Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 10005
#define PI 	3.14159265358979323846


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int s;
    cin >> s;
    cout << (s/100)+(s%100/10)+(s%10) << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<map>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
using namespace std;

#define pa pair<int,int>
#define sc(n) scanf("%d",&n)
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define mem(a,b) memset(a,b,sizeof a)
#define uint unsigned int

const  int N = 1e6 + 10;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;

typedef long long ll;
typedef long double ld;




int main()
{
	int n,d;
	cin>>n>>d;
	cout<<ceil(n*1.0/(d*2+1))<<endl;
	return 0;
}

Measured memory_bytes: 256
N= int(input())
n = N % 10
if n == 2 or n==4 or n ==5 or n == 7 or n == 9:
  print('hon')
elif n == 0 or n ==1 or n == 6 or n == 8:
  print('pon')
elif n == 3:
  print('bon')

Measured memory_bytes: 9172