akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#define double long double
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005ll
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,a[200005],b[200005];
int32_t main(){
CODE_START;
cin>>n;
for(ll i=1;i<=n;i++)
{
    ll x,y;
    cin>>x>>y;
    a[i]=x+y;
    b[i]=x-y;
}
sort(b+1,b+n+1);
sort(a+1,a+n+1);
ll ans=a[n]-a[1];
ans=max(ans,b[n]-b[1]);
cout<<ans<<endl;
}

Measured memory_bytes: 6784
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string ch="...";
    int limit;
    while(cin>>limit)
    {
       string str;
       cin>>str;
       int size=str.size();
       if(size==limit || size<limit)
        {
          cout<<str<<'\n';
        }
        else
        {
            string temp;
            for(int i=0;i<limit;i++)
             {
                temp+=str[i];
             }
            temp+=ch;
            cout<<temp<<'\n';
        }
    }
}

Measured memory_bytes: 3624
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    d <- replicateM n $ do
            [d1,d2] <- getIntList
            return $ d1 == d2
    let f (m,s) p | p = (max m (s+1), s+1)
                  | otherwise = (m,0)
    let ans = fst $ foldl' f  (0,0) d
    putStrLn $ if ans >= 3 then "Yes" else "No"

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

int main()
{
    long x,k,d;
    cin >> x >> k >> d;

    if(x<0)
    {
        x = -x;
    }

    if(x/d >= k)
    {
        cout << x-d*k << endl;
        return 0;
    }

    long a = x/d * d;
    long b = a + d;
    long na = x/d;
    if((k%2 + na%2) % 2 == 0)
    {
        cout << x-a << endl;
    }
    else
    {
        cout << abs(x-b) << endl;
    }
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX=2e5;

int n,m;
ll k,a[MAX+1],b[MAX+1];

int main(void){
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        a[i]+=a[i-1];
    }
    for(int i=1;i<=m;i++)
    {
        cin>>b[i];
        b[i]+=b[i-1];
    }
    int ans=0;
    for(int i=0,j=m;i<=n;i++)
    {
        if(a[i]>k)
        break;
        while(a[i]+b[j]>k)
        j--;
        ans=max(ans,i+j);
    }
    cout<<ans;
}


Measured memory_bytes: 6764
#include <stdio.h>
 
int main(void)
{
	int a,b;
	scanf("%d%d",&a,&b);
	int c=a+b,d=a*b;
	if(c==15){
		printf("+");
	}else if(d==15){
		printf("*");
	}else{
		printf("x");
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 128
ans = []
while True:
    data = input().split()
    g = data[0]
    if g == '#':
        break
    y, m, d = map(int, data[1:])
    if y > 30 and m > 4:
        ans.append(("? %d %d %d") % (y-30, m, d))
    elif y > 31:
        ans.append(("? %d %d %d") % (y-30, m, d))
    else:
        ans.append(("%s %d %d %d") % (g, y, m, d))
print(*ans, sep="\n")



Measured memory_bytes: 5616
#include <iostream>
using namespace std;
int main() {
    int k = 1,e,o;
    cin >> k;
    if (k%2 == 0) {
        e = o = k/2;
    } else {
        e = k/2;
        o = k/2+1;
    }
    cout << e * o;
}

Measured memory_bytes: 888
#line 1 "d.cpp"
// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 08/29/20 20:54:54
// -----------------------------------

#include <bits/stdc++.h>
#line 4 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/unionfind.hpp"

class UnionFind {
 private:
  std::vector<int> par_,sz_;

 public:
  explicit UnionFind(size_t size) : par_(size), sz_(size, 1) {
    std::iota(par_.begin(), par_.end(), 0);
  }

  int root(int u) {
    if (u == par_[u])
      return u;
    return par_[u] = root(par_[u]);
  }

  bool are_union(int u, int v) {
    return root(u) == root(v);
  }

  int size_of(int u) {
    return sz_[root(u)];
  }

  bool unite(int u, int v) {
    if (are_union(u,v))
      return false;
    if (size_of(u) < size_of(v))
      std::swap(u,v);
    sz_[root(u)] += size_of(v);
    par_[root(v)] = root(u);
    return true;
  }

};

#line 9 "d.cpp"

using namespace std;
using ll = long long;

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

  int n,m; cin>>n>>m;
  UnionFind uf(n);
  for (int i = 0; i < m; i++) {
    int a,b; cin>>a>>b; a--; b--;
    uf.unite(a,b);
  }
  int ans = 1;
  for (int i = 0; i < n; i++) {
    if (i != uf.root(i)) continue;
    ans = max(ans, uf.size_of(i));
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4780
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if (a>c || a+b<c) {
      System.out.println("NO");
    } else {
      System.out.println("YES");
    }
  }
}

Measured memory_bytes: 21844
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
using lint = long long;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int M;
	cin >> M;

	cout << 48 - M << "\n";

	return 0;
}

Measured memory_bytes: 256
X, Y = map(int, input().split())
syoukin = [3*10**5, 2*10**5, 1*10**5]
if X == 1 and Y == 1:
    print(10*10**5)
else:
    money = 0
    if X <= 3:
        money += syoukin[X-1]
    if Y <= 3:
        money += syoukin[Y-1]
    print(money)

Measured memory_bytes: 3060
N,M=map(int,input().split())
A=list(map(int,input().split()))
weight=[0,2,5,5,4,5,6,3,7,6] # それぞれの数字で使う本数
dp=[-1]*(N+1) # i本使ったときに作成できる最大の数字をいれる
dp[0]=0
for i in range(N+1):
    for a in A:
        if i+weight[a]<N+1: # N本まで
            dp[i+weight[a]]=max(dp[i+weight[a]],dp[i]*10+a) # aを末尾につけたほうがおおきいかどうか
print(dp[N]) # ちょうどN本使ったときの数字

Measured memory_bytes: 50908
#include<cstdio>
using namespace std;
typedef long long LL;
const int maxn=200005,TT=998244353;
int n,m,K,fac[maxn],inv[maxn],ans;
inline int QP(int a,int b)
{
	int ret=1,w=a;
	while(b)
	{
		if(b&1) ret=(LL)ret*w%TT;
		w=(LL)w*w%TT;b>>=1;
	}
	return ret;
}
inline int C(int n,int m){return (LL)fac[n]*inv[m]%TT*inv[n-m]%TT;}
int main()
{
	scanf("%d%d%d",&n,&m,&K);
	fac[0]=1;
	for(int i=1;i<=n;i++)
		fac[i]=(LL)fac[i-1]*i%TT;
	inv[n]=QP(fac[n],TT-2);
	for(int i=n-1;i>=0;i--) inv[i]=(LL)inv[i+1]*(i+1)%TT;
	for(int i=0;i<=K;i++)
		ans=(ans+(LL)C(n-1,i)*m%TT*QP(m-1,n-i-1)%TT)%TT;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3296
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def main():
    N, X, *xn = map(int, open(0).read().split())
    ans = None
    for x in xn:
        if ans is None:
            ans = abs(X - x)
        else:
            div = abs(X - x)
            if div % ans:
                ans = gcd(ans, div)
    print(ans)
    return


main()


Measured memory_bytes: 14052
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//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(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	int a, b, k; cin >> a >> b >> k;

	set<int> s;

	for (int i = a; i <= a+k-1; i++) {
		s.insert(i);
	}

	for (int i = b-k+1; i < b+1; i++) {
		s.insert(i);
	}

	for (auto i : s) {
		if (i < a || i > b)continue;
		cout << i << endl;
	}
	return 0;
}

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

ll nC2(ll x) {
    if(x <= 1) return 0;
    return x * (x-1) / 2;
}

int main() {
    ll n; cin >> n;
    int a[n];
    map <ll, ll> b;
    for(ll i = 0; i < n; i++) {
        cin >> a[i]; 
        b[a[i]]++;
    }

    ll sum = 0;
    for(auto x : b) {
        sum += nC2(x.second);
    }

    for(int i = 0; i < n; i++) {
        cout << sum - (b[a[i]]) + 1<< "\n";
    }
}

Measured memory_bytes: 10240
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
    int maxi = 0;
    char x[102];
    char dna[4]={'A', 'C', 'G', 'T'};
    scanf("%s",x);
    int len = strlen(x);
    int coun = 0;
    for (int i=0;i<len;i++){
    	int found = 0;
    	for (int j=0;j<4 && !found;j++){
    		if (x[i] == dna[j]){
    			coun++;
    			found = 1;
    		}
    	}
    	if (!found) coun = 0;
    	maxi = max(maxi, coun);
    }
    printf("%d\n", maxi);
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main(){
	int n,a,b,x,c;
	for(c=0;;){
		cin>>n>>x;
		if(n+x==0)break;
		for(a=1;a<x/3;a++){
			for(b=a+1;b<x*2/3;b++){
				if(x-a-b>b&&x-a-b<=n)c++;
			}
		}
		cout<<c<<endl;c=0;
	}
	return 0;
}

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

typedef long long int ll;

ll gcd(ll m,ll n){
    if(n==0) return m;
    return gcd(n,m%n);
}

ll lcm(ll m,ll n){
    ll g = gcd(m,n);
    return (m/g)*n;
}

int main(){
    ll ans=1,tmp;
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lld",&tmp);
        ans = lcm(ans,tmp);
    }
    printf("%lld\n",ans);
};

Measured memory_bytes: 256
k,a,b = ([int(i) for i in input().split()])
ans = 1
if 2 >= (b-a):
    ans = ans + k
else:
    n = k - (a-1)
    ans = ans + (a-1)
    if n %2 == 0:
        ans = ans + n//2 * (b-a)
    else:
        ans = ans + n//2 * (b-a) + 1
print(ans)

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

// GNU C Compiler
//template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

// type
using ll = int_fast64_t;
using ull = uint_fast64_t;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
//using pair<T1, T2> = p12;

//container
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())
#define ALL(v) v.begin(),v.end()

//repetition
#define REP(n) for(ll i=0; i<(n); i++)
#define REPj(n) for(ll j=0; j<(n); j++)
#define REPinit(i,a,n) for(int i=(a); i<(n); i++)
#define REPinitj(j,a,n) for(int j=(a); j<(n); j++)

//algorithm
#define SORT(c) sort((c).begin(),(c).end())
#define CONTAINER_ALL(a) a.begin(),a.end()

//constant

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//Optimizer
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


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

    string S;
    cin >> S;

    REPinit(i, 1, S.size()) {
        if (S[i] == S[i - 1]) {
            cout << "Bad" << endl;
            return 0;
        }
    }
    
    cout << "Good" << endl;

    return 0;
}


Measured memory_bytes: 3584
def compare_cards(a, b):
    return a[1] < b[1]

def bubble_sort(A):
    for i in range(len(A)):
        for j in range(len(A)-1, i, -1):
            if compare_cards(A[j], A[j-1]):
                A[j], A[j-1] = A[j-1], A[j]

def selection_sort(A):
    for i in range(len(A)):
        mini = i
        for j in range(i, len(A)):
            if compare_cards(A[j], A[mini]):
                mini = j
        A[i], A[mini] = A[mini], A[i]

def check_stable(originA, sortedA):
    for i in range(len(originA)-1):
        if not compare_cards(sortedA[i], sortedA[i+1]):
            if originA.index(sortedA[i]) > originA.index(sortedA[i+1]):
                return "Not stable"
    return "Stable"

N = int(input())
A = input().split()

bubbleA = list(A)
selectionA = list(A)

bubble_sort(bubbleA)
selection_sort(selectionA)

print(*bubbleA)
print(check_stable(A, bubbleA))

print(*selectionA)
print(check_stable(A, selectionA))

Measured memory_bytes: 7792
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str

def solve(A: int, B: int, X: int):
    print(YES if A <= X <= A+B else NO)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(A, B, X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string>
#include <tuple>
#include <random>
#include <map>
#include <queue>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <cmath>
#include <stdio.h>
#include <functional>

using namespace std;
using ll = long long;
using ld = double;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>; //(x, y, dx, dy)
const ll INF = 1e17;
const ld eps = 1e-10;
const ll MOD = 1e9 + 7;

const double pi = acos(-1.0);

ll gcd(ll a, ll b) {
	if (a%b == 0)
		return b;
	else
		return gcd(b, a%b);
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll A, B, T;
	cin >> A >> B >> T;
	cout << (T / A) * B << endl;
	return 0;
}


Measured memory_bytes: 256
(* Vicfred
 * https://atcoder.jp/contests/abc135/tasks/abc135_b
 * greedy
 * *)
let n = Scanf.scanf "%d\n" ( + ) 0
let ps = Array.init n @@ fun _ -> Scanf.scanf " %d" ( + ) 0
let swaps = Array.fold_left ( + ) 0 @@ Array.init n @@ fun i -> if (i + 1) != ps.(i) then 1 else 0
let _ = Printf.printf "%s\n" (if swaps <= 2 then "YES" else "NO")


Measured memory_bytes: 3708
def input_n
  gets.to_i               # 単一整数
end

def input_s
  gets.chomp              # 文字列。chompを付けないと改行文字がついてくる
end

def input_a
  gets.split.map(&:to_i)  # スペースで区切られた複数の整数
end

def input_o(num)
  num.times.map { gets.to_i }  # 縦に並んだ複数の整数。たまにある
end

def output_f(num)
  puts sprintf("%.12f", num)
end

a, b, h, m = input_a
p = Math::PI * 2
#long_omega = 6
#short_omega = 0.5
short_omega = (360 / 12) * h + (0.5) * m
long_omega = (360 / 60) * m
naikaku = short_omega - long_omega
#long_rad = long_omega * h
#short_rad = short_omega * m
#long_v = long_omega * a
#short_v = short_omega * b
# long = (p / 12) * h
# short = (p / 60) * m
# puts short_omega
# puts long_omega
# puts naikaku
# puts Math.cos(naikaku * Math::PI / 180)
puts anser = (a ** 2 + b ** 2 - 2 * a * b * Math.cos(naikaku * Math::PI / 180)) ** 0.5


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

int main(){//1からはじめてnを超えるまでの繰り返し処理
  int n, x;
  cin >> n;
  for (int i=1; i<=n;i++){
      x=i;
      if (x%3 == 0){
          cout << " " << i;
          continue;
      }
      while (x){
          if((x%10) == 3){
              cout << " " << i;
              break;
          }
          x /= 10;
      }
  }
  cout << endl;
}


Measured memory_bytes: 3096
N = int(input())

flag_ok = True

As = [int(a) for a in input().split(' ')] 
for Ai in As:
	if Ai%2 == 0:
		if (Ai%3==0) or (Ai%5==0):
			pass
		else:
			flag_ok=False
	else:
		pass
      
if flag_ok:
	print('APPROVED')
else:
	print('DENIED')

Measured memory_bytes: 3060
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <algorithm>

using namespace std;
const int N = 200005;
int a[N], b[N];
int n, m, k;
long long psa[N], psb[N];

int main()
{
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i]);
	for (int i = 0; i < m; i++)
		scanf("%d", &b[i]);
	for (int i = 1; i <= n; i++)
		psa[i] = psa[i - 1] + a[i - 1];
	for (int i = 1; i <= m; i++)
		psb[i] = psb[i - 1] + b[i - 1];
	int ans = 0;
	for (int i = 0, j = m; i <= n; i++) {
		if (psa[i] > k) break;
		while (psa[i] + psb[j] > k) {
			j--;
		}
		ans = max(ans, i + j);
	}
	printf("%d\n", ans);
	return 0;
}



Measured memory_bytes: 6416
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define sz(x) x.size()
#define printarray(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout<<*it<<" "; cout<<endl;
#define rep(n) for (ll i = 0; i < n; i++)
#define repc(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define DEC(i, x, y) for (int i = x; i >= y; i--)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a + n
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b)/gcd(a, b)
#define int long long int
#define ull unsigned long long

using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;

int fastexpo(int b, int exp){
    if(exp == 0) return 1;
    if(exp == 1) return b;
    int ans = (fastexpo(b,exp/2) % MOD);
    ans *= ans;
    ans %= MOD;
    if(exp % 2 == 1){
        ans *= b;
    }
    ans %= MOD;
    return ans;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //#endif
    int a, b;
    cin>>a>>b;
    cout<<max((int)0, a - (b + b))<<endl;    
    return 0;
}


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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
	string S;
	map<char, int> K;
	cin >> S;
	fx(S.size()) {
		K[S[x]]++;
	}

	if (S.size() == 1) {
		ceY;
	}else if(S.size() == 2){
		if (K['a'] == 2 || K['b'] == 2 || K['c'] == 2) {
			ceN;
		}
		else {
			ceY;
		}
	}
	else {

		if (K['a'] == 0 || K['b'] == 0 || K['c'] == 0) {
			ceN;
		}
		else {
			if (abs(K['a'] - K['b'])<=1&& abs(K['c'] - K['b']) <= 1&& abs(K['a'] - K['c']) <= 1) {
				ceY;
			}
			else {
				ceN;
			}
		}
	}

    return 0;
}



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

using namespace std;
typedef long long int ll;
typedef long long unsigned int ull;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define REPD(i, n) for (int i = 0, i##_len = (n); i < i##_len; i--)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
const int MOD = 1000000007;

void Main()
{
    string s;
    std::cin >> s;
    int cnt = 0;
    for (auto &c : s)
    {
        if(c == '1')
            cnt++;
    }
    cout << cnt << endl;
}

int main()
{
    std::ios::sync_with_stdio(false); // printf/scanf を使わない
    std::cin.tie(0);
    std::cout << std::fixed << std::setprecision(15); // 浮動小数点数を小数点表記

    Main();

    return 0;
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  if (a <= 0 && b >= 0) {
    cout << "Zero" << '\n';
  } else if (b < 0 && (b - a + 1) % 2 == 1) {
    cout << "Negative" << '\n';
  } else {
    cout << "Positive" << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int path[110][110];
int dist[110][110];
int a[1010],b[1010],c[1010];
int n,m;
const int inf = 1000000000;
int main(){
    cin >> n >> m;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < n;j++){
            if(i == j)dist[i][j] = 0;
            else dist[i][j] = inf;
        }
    }
    for(int i = 0;i < m;i++){
        cin >> a[i] >> b[i] >> c[i];
        --a[i];
        --b[i];
        dist[a[i]][b[i]] = min(dist[a[i]][b[i]],c[i]);
        dist[b[i]][a[i]] = min(dist[a[i]][b[i]],c[i]);
        path[a[i]][b[i]] = c[i];
        path[b[i]][a[i]] = c[i];
    }
    for(int k = 0;k < n;k++){
        for(int j = 0;j < n;j++){
            for(int i = 0;i < n;i++){
                dist[i][j] = min(dist[i][j],dist[i][k]+dist[k][j]);
            }
        }
    }
    int ans = 0;
    for(int i = 0;i < m;i++){
        if(dist[a[i]][b[i]] < path[a[i]][b[i]])++ans;
    }
    cout << ans << endl;
    cin >> n;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223372036854775807
#define INF 2147483647
#define MOD 1000000007
using namespace std;

int main(int argc, char* argv[])
{
    char str[30]={0};
    scanf("%s", str);

    long i;
    for(i=0; i<30; i++) {
        if(str[i]==',') str[i]=' ';
    }
    printf("%s\n", str);

    return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            var line = new List<int>();

            for (int i = 0; i < 5; i++)
            {
                line.Add(int.Parse(Console.ReadLine()));
            }

            int time = 0;

            var minlist = line.Select(i => i % 10).ToList();
            if (minlist.All(i => i == 0)) {
                keisan(line, time);
                return;
            } 

            minlist.RemoveAll(i => i == 0);
            int min = minlist.Min();

            var target = line.Where(i => i % 10 == min).ToList();
            line.Remove(target[0]);
            line.Add(target[0]);
            
            keisan(line, time);
           
        }

        static void keisan(List<int> line,int time) {
            for (int i = 0; i < 5; i++)
            {
                time += line[i];

                if (i == 4) break;
                else if (line[i] % 10 != 0)
                {
                    time += (10 - (line[i] % 10));
                }
            }

            Console.WriteLine(time);

        }
    }
}


Measured memory_bytes: 13396
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
    int k, n, ans = 0, pin = 0;
    cin >> n >> k;
    priority_queue<int, vector<int>, greater<int>> p;
    for(int i = 0; i < n; ++i){
        cin >> pin;
        p.push(pin);
    }
    for(int i = 0; i < k; ++i){
        pin = p.top(); p.pop();
        ans += pin;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3600
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		int h, w;

		Scanner stdIn = new Scanner(System.in);

		while (true) {
			h = stdIn.nextInt();
			w = stdIn.nextInt();

			if((h+w) == 0) {
				System.exit(0);
			}

			for(int i = 0; i < w; i++) {
				System.out.print("#");
			}
			System.out.println();
			for (int i = 1; i < h-1; i++) {

				System.out.print('#');
				for (int j = 1; j < w-1; j++) {
					System.out.print('.');
				}
				System.out.println('#');
			}
			for(int i = 0; i < w; i++) {
				System.out.print("#");
			}
			System.out.println();
			System.out.println();
		}

	}

}

Measured memory_bytes: 38452
M, D = map(int, input().split())

cnt = 0
for m in range(1, M + 1):
    for d in range(1, D + 1):
        if d % 10 >= 2 and d // 10 >= 2 and (d % 10) * (d // 10) == m:
            cnt += 1
print(cnt)

Measured memory_bytes: 2940
import re

NQ = [int(i) for i in input().split()]
N = NQ[0]
Q = NQ[1]
S = input()
LR = [[int(i) for i in input().split()] for j in range(Q)]
check = [0] * N
for i in range(N - 1):
    check[i + 1] = check[i] + (1 if S[i:i + 2] == "AC" else 0)


for j in range(Q):
    print((check[LR[j][1] - 1]) - (check[LR[j][0] - 1]))

Measured memory_bytes: 26264
_=gets()
a=gets.split.map(&:to_i)

def rec(x)
    if x.size ==0
        return true
    end
    (0...x.size).to_a.reverse.each{|i|
        if x[i] >(i+1)
            return false
        end
        if x[i]==(i+1)
            r=rec(x.values_at(0...i,(i+1)...x.size))
            if r
                p (i+1)
                return true
            end
        end
    }
    return false
end

r=rec(a)
p -1 if !r



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

int main()
{
  string s;
  cin>>s;
  int n =  s.length();
  int pre[n];
  int suff[n];
  int answer[n];
  memset(answer,0,sizeof(answer));
  pre[0]=0;
  suff[n-1]=0;
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R')
      pre[i]=pre[i-1]+1;
    else
      pre[i]=0;
  }
  for(int i=n-2;i>=0;i--)
  {
    if(s[i+1]=='L')
      suff[i]=suff[i+1]+1;
    else
      suff[i]=0;
  }
  for(int i=1;i<n;i++)
  {
    if(s[i-1]=='R'&&s[i]=='L')
    {
      answer[i-1]=suff[i]-suff[i]/2+pre[i]-pre[i]/2;
      answer[i]=suff[i-1]-suff[i-1]/2+pre[i-1]-pre[i-1]/2;
    }
  }
  for(int i=0;i<n;i++)
    cout<<answer[i]<<" ";
}

Measured memory_bytes: 1792
import sys
input = sys.stdin.readline
from heapq import heappush, heappop
inf = float('inf')
mod = 10**9 + 7

# ダイクストラ法 計算量O(ElogV)
# [引数]: 隣接リスト, 始点
class Dijkstra:
    def __init__(self, to:list, start:int):
        self.N = len(to)
        self.to = [s[:] for s in to]
        self.start = start
        self.dist = [inf] * self.N
        self.dist[start] = 0
        # cnt : 最短経路の数
        # self.cnt = [0] * self.N
        # self.cnt[start] = 1
        self.pq = [(self.dist[start], start)]

    # distを更新
    def update(self) -> None:
        while self.pq:
            _, v = heappop(self.pq)
            for nv, w in self.to[v]:
                if self.dist[nv] > self.dist[v] + w:
                    self.dist[nv] = self.dist[v] + w
                    heappush(self.pq, (self.dist[nv], nv))
                # if self.dist[nv] == self.dist[v] + w:
                #     self.cnt[nv] += self.cnt[v]
                #     self.cnt[nv] %= mod

N, u, v = map(int, input().split())
u -= 1; v -= 1
to = [[] for _ in range(N)]
for _ in range(N - 1):
    A, B = map(int, input().split())
    A -= 1; B -= 1
    to[A].append((B, 1))
    to[B].append((A, 1))

T = Dijkstra(to, u)
T.update()
A = Dijkstra(to, v)
A.update()

adopt = 0
for d1, d2 in zip(T.dist, A.dist):
    if d1 > d2:
        continue
    adopt = max(adopt, d2)

ans = adopt - 1
print(ans)

Measured memory_bytes: 62376
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	ll a,b,k;
	cin>>a>>b>>k;
	if(k>=a)
	{
		k=k-a;
		a=0;
		b=b-k;
		if(b<0)
		b=0;
	}
	else
	{
		a=a-k;
	}
	cout<<a<<" "<<b;
	return 0;
}

Measured memory_bytes: 256
import collections

MOD = 10**9+7


def solve(n, k, a):
    total = 0

    cnt = [0] * 2001
    for v in a:
        cnt[v] += 1
    for i in range(n - 1):
        for j in range(i + 1, n):
            if a[i] > a[j]:
                total += 1
    total *= k
    l_sum = [0] * 2001
    r_sum = [0] * 2001
    for i in range(1, 2001):
        l_sum[i] = l_sum[i-1] + cnt[i-1]
    for i in range(1999, 0, -1):
        r_sum[i] = r_sum[i + 1] + cnt[i + 1]
    z = k*(k-1)//2
    for i in range(1, 2001):
        total += z*(l_sum[i]) * cnt[i]

    return total % MOD


def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    print(solve(n, k, a))


if __name__ == "__main__":
    main()


Measured memory_bytes: 41436
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ITP1_5
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string[] strArray = Console.ReadLine().Split(' ');
                int height = int.Parse(strArray[0]);
                int width = int.Parse(strArray[1]);

                if (height == 0 && width == 0)
                {
                    break;
                }

                string border = "";
                string body = "";

                for (int i = 1; i < (width - 1); ++i)
                {
                    border += '#';
                    body += '.';
                }

                for (int i = 0; i < height; ++i)
                {
                    Console.Write('#');
                    if (i == 0 || i == (height - 1))
                    {
                        Console.Write(border);
                    }
                    else
                    {
                        Console.Write(body);
                    }
                    Console.Write('#');
                    Console.WriteLine();
                }
                Console.WriteLine();
            }
        }
    }
}

Measured memory_bytes: 5396
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

int main(){
 int n,s;
 int score[1000]={0};
 while(1){
   cin >> n;
   if( n==0 ){
     break;
   }
   int sum=0;
   for(int i=0; i<n; i++){
     cin >> s;
     score[i] = s;
     sum += s;
   }

   double m=sum/(double)n;

   double a_sum=0;
   for( int j=0; j<n; j++ ){
     a_sum += pow((score[j]-m),2.0);
   }
   double a = a_sum/(double)n;

   cout << fixed << setprecision(8) << sqrt(a) << endl;
 }

 return 0;
}


Measured memory_bytes: 3224
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp15
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string t = Console.ReadLine();
          

            int a = 0;


            for (int i = 0; i < 3; i++)
            {
                if (s[i] == t[i])
                {
                    a++;
                }

            }
            Console.WriteLine(a);
            Console.Read();
        }
    }
}


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

using namespace std;

int main()
{
    int n, m, N, X, Y, X1, Y1, A;
    long double a, b, nn, mm, al;
    cin >> n >> m >> N;
    nn = n;
    nn /= 2;
    mm = m;
    mm /= 2;
    vector <pair<long double, int>> V;
    deque <int> D;
    for (int i = 0; i < N; i++)
    {
        cin >> X >> Y >> X1 >> Y1;
        if ((X == 0 || Y == 0 || X == n || Y == m) && (X1 == 0 || Y1 == 0 || X1 == n || Y1 == m))
        {
            a = X;
            b = Y;
            al = atan2(a-nn, b-mm);
            V.push_back({al, i});
            a = X1;
            b = Y1;
            al = atan2(a-nn, b-mm);
            V.push_back({al, i});
        }
    }
    sort(V.begin(), V.end());
    for (int i = 0; i < V.size(); i++)
    {
        A = V[i].second;
        if (D.size() != 0 && D.front() == A)
        {
            D.pop_front();
        }
        else
        {
            D.push_front(A);
        }
    }
    if (D.size() == 0)
    {
        cout << "YES";
    }
    else
    {
        cout << "NO";
    }
    return 0;
}


Measured memory_bytes: 9964
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }
 
using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;
 
//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};
 
const int mod = 1000000007;
//const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod

#include <bits/stdc++.h>
using namespace std;

signed main(){
    int N,M; cin>>N>>M;
    int X = (1900*M+100*(N-M))*pow(2,M);
    Out(X);
}
  


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main() {

	long long int n;
	cin >> n;

	long long int a = -1;

	for (long long int i = 1; i*(i + 1) / 2 <= n; i++) {
		if (i*(i + 1) / 2 == n) {
			a = i;
		}
	}

	if (a == -1) {
		cout << "No" << endl;
	}
	else {
		vector< vector<long long int> > ans(a + 1, vector<long long int>(a));
		long long int aa, bb;
		aa = bb = 1;
		for (long long int i = 0; i < a; i++) {
			for (long long int j = i; j < a; j++) {
				ans[i][j] = aa;
				aa++;
			}
			for (long long int j = i + 1; j <= a; j++) {
				ans[j][i] = bb;
				bb++;
			}
		}

		cout << "Yes" << endl;
		cout << a + 1 << endl;
		for (long long int i = 0; i <= a; i++) {
			cout << a;
			for (long long int j = 0; j < a; j++) {
				cout << ' ' << ans[i][j];
			}
			cout << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 2944
def main():
    N = int(input())
    s = []
    for i in range(N):
        s.append(input())
    M = int(input())
    t = []
    for i in range(M):
        t.append(input())

    ans = []
    
    for i in s:
        ans.append( s.count(i) - t.count(i))
    
    ans = max(ans)
    if ans < 0:
        ans = 0
    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout<<#x<<"="<<x<<endl;
#define endl '\n'
#define M 998244353
#define int long long
#define INF 1e18
#define max_n 1000000

using namespace std;

ll p(ll n,ll k)
{
    if(k==0)return 1;
    ll x=p(n,k/2)%M;
    if(k%2==0) return ((x%M)*(x%M))%M;
    else return ((((x%M)*(x%M))%M)*n)%M;
}

ll ncr(ll n,ll r,ll fact[])
{
	ll ans=((fact[n]%M) * (p(fact[r],M-2))%M)%M;
	ans=(ans*p(fact[n-r],M-2))%M;
	return ans;
}

void solve()
{
	ll n,m,k;
	cin>>n>>m>>k;
	ll fact[n+1];
	fact[0]=1;
	for (int i = 1; i < n+1; ++i)
	{
		fact[i]=(fact[i-1]*i)%M;
	}
	ll ans=0;
	for (int i = 0; i <= k; ++i)
	{
		ans=(ans+(((ncr(n-1,i,fact)*m)%M)*p(m-1,n-1-i))%M)%M;
	}
	cout<<ans<<endl;
}

int32_t main() 
{
	IOS	
	ll T=1;
	// cin>>T;
	for(ll i=1;i<=T;++i)
	{		
		// cout<<"Case #"<<i<<": ";
    	solve();
	}
	return 0;
}

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

int main(void)
{
	int i, j;
	int w;
	int N = 0, T = 0;
	int X = 0;
	
	int t[220000];

	cin >> N >> T;

	for (i = 0; i < N; i++) {
		cin >> t[i];

	}

	for (j = 0; j < N - 1; j++) {

		w = min(t[j + 1] - t[j], T);
		X = X + w;
	}



	cout << X + T << endl;
	
	return (0);

	
}

Measured memory_bytes: 1024
def main():
    x,n = map(int,input().split())
    p = set(map(int,input().split()))
    x1,x2 = x,x
    if n == 0:
        print(x)
        return 0
    if x not in p:
        print(x)
        return 0
    while True:
        x1 -= 1
        x2 += 1
        if x1 not in p:
            print(x1)
            return 0
        if x2 not in p:
            print(x2)
            return 0

if __name__ == '__main__':
    main()


Measured memory_bytes: 61980
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

int main() {
  string S;
  cin >> S;
  map<char, int> m;
  rep(i, S.size()) {
    m[S[i]]++;
    if (m[S[i]] == 2) {
      cout << "no" << endl;
      return 0;
    }
  }
  cout << "yes" << endl;
}

Measured memory_bytes: 256
def is_palindrome(S, i, j):
    if i >= j:
        return True
    return S[i] == S[j] and is_palindrome(S, i + 1, j - 1)

s = input()
n = len(s)
print('Yes' if is_palindrome(s, 0, n - 1) and is_palindrome(s, 0, (n-1)//2 - 1) and is_palindrome(s, (n+1)//2, n - 1) else 'No')


Measured memory_bytes: 3060
#include <stdio.h> 


int N;

int main(void){
	scanf("%d",&N);

	if(N/10==9){
		printf("Yes\r\n");
		return 0;
	}

	if(N%10==9){
		printf("Yes\r\n");
		return 0;
	}

	printf("No\r\n");

	return 0;
}

Measured memory_bytes: 128
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn alphabet(i: i128) -> String {
    if i < 0 {
        String::new()
    } else {
        let mut a = alphabet((i / 26) - 1);
        let c = ((97 + i % 26) as u8) as char;
        a.push(c);
        a
    }
}

fn main() {
    let mut sc = Scanner::new();
    let n: i128 = sc.cin();
    put!(alphabet(n - 1));
}

use std::collections::VecDeque;
use std::io::{self, Write};
use std::str::FromStr;

struct Scanner {
    stdin: io::Stdin,
    buffer: VecDeque<String>,
}
impl Scanner {
    fn new() -> Self {
        Scanner {
            stdin: io::stdin(),
            buffer: VecDeque::new(),
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.is_empty() {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.cin::<String>().chars().collect()
    }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.cin()).collect()
    }
}


Measured memory_bytes: 2148
main(b,r,g,c,s,t){for(;scanf("%d%d%d%d%d%d",&b,&r,&g,&c,&s,&t),b+r+g+c+s+t;)printf("%d\n",100+g*7+c*2+(s-t)*3+b*95+r*63);exit(0);}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
using namespace std;

int main(void) {
	int a=0,b=0,n=1;
	vector<int> r;
	while (scanf("%d %d",&a,&b) != EOF)
	{
		n=1;
		while ((a+b)>=pow(10,n))
		{
			n++;
		}
		r.push_back(n);
	}
	for (int i=0;i<r.size();i++)
	{
		cout << r[i] << endl;
	}
	return 0;
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(b > a and b < c) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 3092
n = int(input())
s = input()
ans = 0
max_ans = 0

for i in range(len(s)):
    if s[i] == 'I':
        ans += 1
    if s[i] == 'D':
        ans -= 1
    
    max_ans = max(max_ans,ans)

print(max_ans)

Measured memory_bytes: 3060
// If you want something you've never had, you must be willing to do s
// something you've never done

//  When the going gets tough,  the tough get going
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace __gnu_pbds;

typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<pair<int,int>, null_type,less<pair<int, int> >,rb_tree_tag,tree_order_statistics_node_update > pbds;

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)
#define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define pb push_back
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll power(ll a, ll b, ll mod) {
    ll res = 1;
    a %= mod;
    while(b) {
        if(b % 2) {
            res *= a;
            res %= mod;
        }
        a = a * a % mod;
        b >>= 1;
    }
    return res % mod;
}

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

const int N = 1e5 + 5;
const ll mod = 1e9 + 7;
const int INF = 2e9;

signed main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    for(char &c: s) {
        if(c == 'R') c = '0';
        else if(c == 'G') c = '1';
        else c = '2';
    }
    int p[n+4][3], q[n+4][3];
    memset(p, 0, sizeof p);
    memset(q, 0, sizeof q);
    for(int i=1; i<=n; i++) {
        for(int j=0; j<3; j++) p[i][j] = p[i-1][j];
        p[i][s[i-1]-'0']++;
    }
    for(int i=n; i>=1; i--) {
        for(int j=0; j<3; j++) q[i][j] = q[i+1][j];
        q[i][s[i-1]-'0']++;
    }
    ll tot = 0;
    for(int i=1; i<=n; i++) {
        for(int j=i+1; j<=n; j++) {
            if(s[i-1] == s[j-1]) continue;
            char a = s[i-1], b = s[j-1];
            if(a == '0' && b == '1' || a == '1' && b == '0') tot += q[j+1][2];
            else if(a == '1' && b == '2' || a == '2' && b == '1') tot += q[j+1][0];
            else if(a == '0' && b == '2' || a == '2' && b == '0') tot += q[j+1][1];
        }
    }
    for(int i=2; i<n; i++) {
        int j=i-1, k=i+1;
        while(j>0 && k<n+1) {
            char a = s[j-1], b = s[k-1], c = s[i-1];
            if(a == b || a == c || b == c) {
                j--, k++;
                continue;
            }
            tot--;
            j--, k++;
        }
    }
    cout << tot << '\n';
    return 0;
}

// A telephone line whose bandwidth is 1638 Hz is connected from point A to point B. What will be the channel capacity if signal-to-noise ratio is 22 db?


Measured memory_bytes: 3656
h,w = gets.split.map(&:to_i)
arr = []
h.times do
  arr << gets.chomp
end


(h+2).times  do |i|
  if i == 0 || i == (h+1)
    puts "#"*(w+2)
  else
    puts "#"+ arr[i-1] + "#"
  end
end

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

using namespace std;
int main() {
    int N, M;
    vector<string> s, t;
    int ans = 0;

    cin >> N;
    for (int i = 0; i < N; i++) {
        string str;
        cin >> str;
        s.push_back(str);
    }

    cin >> M;
    for (int i = 0; i < M; i++) {
        string str;
        cin >> str;
        t.push_back(str);
    }

    for (int i = 0; i < N; i++) {
        int point = 0;
        string str = s[i];
        for (int j = 0; j < N; j++) {
            if (str == s[j]) point++;
        }
        for (int j = 0; j < M; j++) {
            if (str == t[j]) point--;
        }
        ans = max(ans, point);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256