akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int MOD = 1000000007;
long long int gcd(long long int x, long long int y) { return (x % y)? gcd(y, x % y): y; }
long long int lcm(long long int x, long long int y) { return x / gcd(x, y) * y; }
long beki(int a,int b){
	if(b==0)return 1;
	else return a*beki(a,b-1)%MOD;
}
int main(){
	int N,A[10000];
	long long sum=0,pre;
	vector<int> in;
	int so[1000000]={0},sop;
	long long int LCM=1;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>A[i];
		pre=A[i];
		for(int j=2;j*j<=A[i];j++){
			sop=0;
			while(pre%j==0){
				sop++;
				pre/=j;
			}
			so[j]=max(so[j],sop);
			if(pre==1)break;
		}
		if(pre>1)so[pre]=max(so[pre],1);
	}
	for(int i=2;i<1000000;i++){
		for(int j=0;j<so[i];j++){
			in.push_back(i);
		}
	}
	for(int i=0;i<N;i++){
		pre=1;
		for(int j=0;j<in.size();j++){
			if(A[i]%in[j]==0)A[i]/=in[j];
			else pre*=in[j];
			pre%=MOD;
		}
		sum+=pre;
		sum%=MOD;
	}
	cout<<sum;
	return 0;
}

Measured memory_bytes: 4352
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    int count=0;
    for(int i=0;i<n-1;i++){
      if(s.charAt(i)!=s.charAt(i+1)){
        count++;
      }
    }
    System.out.println(count+1);
  }
}


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

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef array<int, 3> tri;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}




void _main() {
        int n; cin >> n;
        vector<string> v(n); cin >> v;

        string s;
        for (char c = 'a'; c <= 'z'; c++) {
                int freq = 1e9;
                for (int i = 0; i < n; i++) {
                        int cur = 0;
                        for (auto x: v[i]) cur += c == x;
                        freq = min(freq, cur);
                }
                s += string(freq, c);
        }


        cout << s;
}




signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


Measured memory_bytes: 3644
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var NM = ReadSplitInt();
            YesOrNo(NM[0] == NM[1]);
        }

        static List<long> ReadLines(long n)
        {
            var l = new List<long>();
            for (long i = 0; i < n; i++)
            {
                l.Add(ReadLong());
            }
            return l;
        }

        static void YESOrNO(bool e) => Println(e ? "YES" : "NO");

        static void YesOrNo(bool e) => Println(e ? "Yes" : "No");

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());
        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}



Measured memory_bytes: 13396
//By Vlgd
#include<bits/stdc++.h>
using namespace std;
struct P{double x,y;};
void koch(int n,P a,P b){
	if (n==0) return;
	P s,t,u;
	double th=M_PI/3;
	s.x=(2*a.x+1*b.x)/3;
	s.y=(2*a.y+1*b.y)/3;
	t.x=(1*a.x+2*b.x)/3;
	t.y=(1*a.y+2*b.y)/3;
	u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
	u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
	koch(n-1,a,s);
	printf("%.8f %.8f\n",s.x,s.y);
	koch(n-1,s,u);
	printf("%.8f %.8f\n",u.x,u.y);
	koch(n-1,u,t);
	printf("%.8f %.8f\n",t.x,t.y);
	koch(n-1,t,b);
}
int main(){
	int n;
	scanf("%d",&n);
	P a,b;
	a.x=a.y=b.y=0;
	b.x=100;
	printf("%.8f %.8f\n",a.x,a.y);
	koch(n,a,b);
	printf("%.8f %.8f\n",b.x,b.y);
	return 0;
}


Measured memory_bytes: 3200
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int q=sc.nextInt();
        int[] year=new int[n+1];
        String[] name=new String[n+1];
        for(int i=0; i<n; i++) {
        	year[i]=sc.nextInt();
        	name[i]=sc.nextLine();
        }
        for(int i=0; i<n; i++) {
        	if(0<=q && year[0]>q) {
        		System.out.println("kogakubu10gokan");
        		break;
        	}else if(year[i]<=q && year[i+1]>q) {
        		System.out.println(name[i].trim());
        		break;
        	}else if(year[n-1]<=q) {
        		System.out.println(name[n-1].trim());
        		break;
        	}
        }
     }
}


Measured memory_bytes: 26608
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	double dp[n+1][n+1]={};
	vector<double> p(n);
	for(int i = 0;i<n;i++)
		cin>>p[i];
	dp[0][0] = 1;
	for(int i = 0;i<n;i++)
	{
		for(int j = 0;j<=i;j++)
		{
			dp[j+1][i+1] += p[i]*dp[j][i];
			dp[j][i+1] += (1-p[i])*dp[j][i];
		}
	}
	double ans;
	for(int i = n/2+1;i<=n;i++)
		ans+=dp[i][n];
	cout<<setprecision(12)<<fixed<<ans<<'\n';
}


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

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

    vector<int> v(100);
    v.at(a - 1)++;
    v.at(b - 1)++;
    v.at(c - 1)++;

    int n = count(v.begin(), v.end(), 0);
    cout << 100 - n << endl;
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s = input()
    ans = 0
    for i in range(len(s)>>1):
        ans += (s[i] != s[-1-i])
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 39152
#include <bits/stdc++.h>
typedef long long ll;
const int maxn = 4e5 + 5;
//（重复区间最大层数 - 1） * m +　重复区间最大层数区间的端点到数轴端点距离

ll n, m, L, R;
struct Interval
{
    ll l, r, cnt;
    bool operator<(const Interval cmp) const
    {
        return (this->l < cmp.l) || (this->l == cmp.l && this->cnt < cmp.cnt);
    }
} I[maxn];

ll res, max;
inline int bin_s(int p)
{
    int l = p, r = n;
    int res = p;
    while (l <= r)
    {
        int mid = (l + r) >> 1;
        if (I[mid].l <= I[p].r)
            l = mid + 1, res = mid;
        else
            r = mid - 1;
    }
    return res;
}

inline void solve()
{
    for (int i = 1; i <= n; i++)
    {
        int tmp = bin_s(i), tmp2 = tmp - i + 1; //tmp -> pos tmp2 -> 层数
        if (tmp2 > max)
        {
            L = I[tmp].l, R = I[i].r;
            max = tmp2;
        }
        if (tmp2 == max)
        {
            L = std::min(L, I[tmp].l), R = std::max(R, I[i].r);
        }
        // printf("$%d %d %d %d %d\n", i, tmp,tmp2, L, R);
    }
}

inline void work()
{
    ll count = 0;
    for (int i = 1; i <= 2 * n; i++)
    {
        // printf("$%d ", i);
        ll p = i, a = 0, d = 0;
        while (I[p].l == I[p + 1].l)
            p++;
        for (int j = i; j <= p; j++)
            if (I[j].cnt == 1)
                a++;
            else
                d++;
        i = p;
        count += a;
        // printf("%d \n", count);
        if (count % 2)
            res = std::max(res, 1ll * (count - 1) * m + I[i].l);
        else
            res = std::max(res, 1ll * count * m - I[i].l);
        count -= d;
    }
}

int main()
{
    scanf("%lld%lld", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%lld%lld", &I[i].l, &I[i + n].l), I[i].cnt = 1, I[i + n].cnt = -1;
    std::sort(I + 1, I + 2 * n + 1);
    //solve();
    work();
    // res = 1ll * (max - 1) * m;
    // if (max % 2 == 0) res += 1ll * m - L;
    // else res += R;
    std::cout << res << std::endl;
}


Measured memory_bytes: 12612
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MOD 1000000007
int main(){
	fast;
	string s1,s2,s3;
	cin>>s1>>s2>>s3;
	cout<<'A'<<s2[0]<<'C';
	return 0;
}



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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    int n, m, x;
    cin >> n >> m >> x;
    int a[n];
    rep(i, m) cin >> a[i];
    int cnt = 0;
    rep(i, m)
    {
        if (a[i] < x)
            cnt++;
    }

    OP(min(cnt, m - cnt));
    return 0;
}

Measured memory_bytes: 256
while True:
    n, x = map(int, input().split())
    if n==0 and x==0:
        break
    else:
        c = 0
        for i in range(1, n+1):
            for j in range(i+1, n+1):
                    for k in range(j+1, n+1):
                        if i+j+k == x:
                            c+=1
        print(c)



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

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

typedef long long ll;

const ll MOD = 1e9 + 7;

using namespace std;

ll powmod(ll a, ll b) {
    ll val = 1;
    REP(_, b) {
        val *= a;
        val %= MOD;
    }
    return val;
}

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

    ll N;
    cin >> N;

    ll cnt = powmod(10, N) - powmod(9, N) - powmod(9, N) + powmod(8, N);
    cnt %= MOD;
    cnt = (cnt + MOD) % MOD;

    cout << cnt << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define int long long int
#define mod(x) ((x % MOD) + MOD) % MOD
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define LB(c,x) (int)(lower_bound(ALL(c),x)-(c).begin())
#define UB(c,x) (int)(upper_bound(ALL(c),x)-(c).begin())
#define COUNT(c,x) (UB(c,x)-LB(c,x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DEL(v) decltype(v)().swap(v)
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define NL cerr << endl;
#define chmax(a, b) a=(((a)<(b))?(b):(a))
#define chmin(a, b) a=(((a)>(b))?(b):(a))
#define F first
#define S second
using namespace std;
template<typename T1, typename T2> using P = pair<T1,T2>;
template<typename T> using V = vector<T>;
struct edge { int from, to; int cost; };
bool operator< (const edge &edge1, const edge &edge2) { return edge1.cost < edge2.cost; };
const int INF = 1e18;
const int MOD = 1e9+7;

template<typename T> ostream& operator << (ostream& s, const V<T>& v) {
   s << "[";
   for (int i = 0; i < v.size(); i++) { s << v[i]; if (i < v.size() - 1) s << " "; }
   s << "]";
   return s;
}
template<typename T1, typename T2> ostream& operator << (ostream& s, const P<T1,T2>& p) {
   s << "(" << p.first << "," << p.second << ")";
   return s;
}
template<typename T> ostream& operator << (ostream& s, const set<T>& st) {
   s << "{";
   for (auto i = st.begin(); i != st.end(); ++i) {
      s << *i;
      if (next(i) != st.end()) s << ", ";
   }
   s << "}";
   return s;
}
template<typename T1, typename T2> ostream& operator << (ostream& s, const map<T1,T2>& m) {
   s << "{";
   for (auto i = m.begin(); i != m.end(); ++i) {
      s << i->first << ":" << i->second;
      if (next(i) != m.end()) s << ", ";
   }
   s << "}";
   return s;
}

int f(int n) {
   int sum = 0;
   while (n > 0) {
      sum += n % 10;
      n /= 10;
   }
   return sum;
}
int power(int x, int n) {
   int res = 1;
   while (n > 0) {
      if ((n & 1) == 1) res *= x;
      x *= x;
      n >>= 1;
   }
   return res;
}

signed main()
{
   int K; cin >> K;

   V<int> s;
   REP(i, 10) {
      REP(j, 10) {
         REP(k, 10) {
            REP(l, 16) {
               int n = i*power(10,l+2) + j*power(10,l+1) + k*power(10,l) + power(10,l)-1; // n: ijk9...9
               s.PB(n);
            }
         }
      }
   }
   UNIQUE(s);
   double MIN = INF;
   stack<int> st;
   RFOR(i, 0, s.size()) {
      double x = (double)s[i]/f(s[i]);
      if (x <= MIN) {
         MIN = x;
         st.push(s[i]);
      }
   }
   
   REP(i, K) {
      cout << st.top() << endl;
      st.pop();
   }

   return 0;
}


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

#define mp make_pair
#define pb push_back

#define int int64_t
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

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

    string s,t;
    cin>>s>>t;
    int n = s.length();
    int m = t.length();
    vector<vector<int>> dp(n+1, vector<int>(m+1));  
    vector<int> par(n+1);
    for(int i=1;i<=n;i++) {
        for(int j=1;j<=m;j++) {
            if(s[i-1]==t[j-1]) {
                dp[i][j]=dp[i-1][j-1]+1;
            }
            else {
                dp[i][j]=max(dp[i][j-1], dp[i-1][j]);
            }
        }
    }
    // cout<<dp[n][m];

    string ans = "";
    int i=n,j=m; 

    while(i>0&&j>0) {
        if(s[i-1]==t[j-1]) {
            ans+=s[i-1];
            i--;j--;
        }
        else if(dp[i-1][j]>dp[i][j-1]) {
            i--;
        }
        else {
            j--;
        }
    }

    reverse(ans.begin(), ans.end());

    cout<<ans;

    return 0;
}

Measured memory_bytes: 70784
package main

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

var in = NewScanner(os.Stdin, 0)

/* this is port of top c++ answer to test go performance */
func main() {
	n, d := in.Int(), in.Int()
	a := in.Array1Int(n)
	ans := 0
	for i := 1; i <= n; i++ {
		ans += a[i]
	}
	ans += d * (n - 1)
	f := make([]int, n+1)
	f[1] = a[1]
	for i := 2; i <= n; i++ {
		Eln(i, n)
		f[i] = Min2(a[i], f[i-1]+d)
	}
	g := make([]int, n+1)
	g[n] = a[n]
	for i := n - 1; i >= 1; i-- {
		g[i] = Min2(a[i], g[i+1]+d)
	}
	for i := 2; i <= n-1; i++ {
		ans += Min2(f[i], g[i])
	}
	Pln(ans)
}

const M7 = 1000000007

type Scanner struct {
	*bufio.Scanner
}

func NewScanner(r io.Reader, max int) *Scanner {
	s := bufio.NewScanner(r)
	s.Split(scanWords)
	if max <= 0 {
		max = 1048576
	}
	s.Buffer([]byte{}, max)
	return &Scanner{s}
}
func (s *Scanner) Int() int {
	s.Scan()
	i, e := strconv.ParseInt(s.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return int(i)
}
func (s *Scanner) Array1Int(n int) []int {
	r := make([]int, n+1)
	for i := 1; i <= n; i++ {
		r[i] = s.Int()
	}
	return r
}
func isSpace(b byte) bool {
	return b == ' ' || b == '\n' || b == '\r' || b == '\t'
}
func scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	start := 0
	for start < len(data) && isSpace(data[start]) {
		start++
	}
	for i := start; i < len(data); i++ {
		if isSpace(data[i]) {
			return i + 1, data[start:i], nil
		}
	}
	if atEOF && len(data) > start {
		return len(data), data[start:], nil
	}
	return start, nil, nil
}
func Min2(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func Eln(s ...interface{}) {
	fmt.Fprintln(os.Stderr, s...)
}
func Pln(s ...interface{}) {
	fmt.Println(s...)
}

type ByteSlice []byte
type IntSlice []byte


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

typedef long long ll;

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

ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a / g * b;
}

int main() {
    int N;
    cin >> N;
    vector<ll> T(N);
    for (int i = 0; i < N; i++)
        cin >> T[i];

    ll ans = 1;
    for (int i = 0; i < N; i++)
        ans = lcm(ans, T[i]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(int argc,char* argv[]){
  char str[21];
  int len;
  int count;

  scanf("%s",str);
  len = strlen(str);

  for(count = len - 1; count >= 0; --count){
    printf("%c",str[count]);
  }
  printf("\n");

  return 0;
  
}

Measured memory_bytes: 0
#include<stdio.h>
#define MAX 100
#define INF (1<<21)
#define B 2
#define G 1
#define W 0

int n,M[MAX][MAX];

void dijkstra(){
  int i,u,v,min,d[MAX],color[MAX];
  for(i=0;i<n;i++){
    d[i]=INF;
    color[i]=W;
  }
  d[0]=0;
  color[0]=G;
  while(1){
    min=INF;
    u=-1;
    for(i=0;i<n;i++){
      if(min>d[i]&&color[i]!=B){
        u=i;
        min=d[i];
      }
    }
    if(u==-1) break;
    color[u]=B;
    for(v=0;v<n;v++){
      if(color[v]!=B&&M[u][v]!=INF){
        if(d[v]>d[u]+M[u][v]){
          d[v]=d[u]+M[u][v];
          color[v]=G;
        }
      }
    }
  }
  for(i=0;i<n;i++){
    printf("%d %d\n",i,(d[i]==INF ? -1 : d[i]));
  }
}

int main(){
  int i,j,k,c,u,v;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      M[i][j]=INF;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d%d",&v,&c);
      M[u][v]=c;
    }
  }
  dijkstra();
  return 0;
}

Measured memory_bytes: 636
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int kaisuu = Integer.parseInt(br.readLine());
        String line = br.readLine();
        String []N = line.split(" ");
        int count = 0;
        int num;
        
        for(int j = 0; j < N.length; j++){
            num = Integer.parseInt(N[j]);
            if(num % 2 != 0){
                System.out.println(count);
                System.exit(0);
            }
            
        }
        while(true){
            for(int i = 0; i < N.length; i++){
                num = Integer.parseInt(N[i]);
                if(num % 2 != 0){
                    System.out.println(count);
                    System.exit(0);
                }else{
                    N[i] = String.valueOf(num / 2);
                    
                }    
            }
            count++;
        }
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); i++)
#define rep(i, n) rep2(i, 0, n)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
const ll INF = ll(1e15)+10;
const ld EPS = 1e-10;
const int MOD = int(1e9)+7;

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

    ll ans = (N + 1) / 2;
    cout << ans << endl;
    return 0;
}


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

#define froop1(a,n) for(int i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)

#define ll long long

#define pq(name,type) priority_queue<type> name
#define vec(name,type,length,value) vector<type> name(length,value)
#define vec2(name,type,length,width,value) vector<vector<type>> name(length,vector<type>(width,value));

int main(){
	ll N,K;
  cin >> N >> K;
  vector<ll> point(N);
  vector<ll> sum;
  ll t = 1;
    froop1(0,N){
	cin >> point.at(i);
      t += point.at(i);
      if(i >= K - 1){
       sum.push_back(t); 
        t -= point.at(i - K + 1);
      }
  }
  froop1(1,N - K + 1){
    if(sum.at(i - 1) < sum.at(i)){
      cout << "Yes" << endl;
    }else{
	cout << "No" << endl;
    }
  }
return 0;
}

Measured memory_bytes: 6824
q = int(input())
num = [int(input()) for _ in range(q)]
for n in num:
    cnt = 0
    mulnum = [n]
    while True:
        strn = str(n)
        if len(strn) == 1:
            break
        m = 0
        for i in range(len(strn) - 1):
            m = max(m, int(strn[:i+1]) * int(strn[i+1:]))
        if m in mulnum:
            cnt = -1
            break
        else:
            cnt += 1
            mulnum.append(m)
            n = m
    print(cnt)

Measured memory_bytes: 6728
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

#define Sq(x) ((x)*(x))

#define Foreach(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)

const double PI = M_PI;
const double EPS = 0.0001;

struct Point{
  double x,y;

  Point(){}
  Point(double x, double y) : x(x), y(y) {}
};

Point operator+(const Point &a, const Point &b){
  return Point(a.x + b.x, a.y + b.y);
}

Point operator-(const Point &a, const Point &b){
  return Point(a.x - b.x, a.y - b.y);
}

Point operator*(const Point &a, const double k){
  return Point(a.x * k, a.y * k);
}

Point operator*(const Point &a,const Point &b){
  return Point(a.x*b.x-a.y*b.y, a.x*b.y+a.y*b.x);
}

Point operator/(const Point &p, const double k){
  return Point(p.x / k, p.y / k);
}

double dot(const Point &a, const Point &b){
  return a.x * b.x + a.y * b.y;
}

double cross(const Point &a, const Point &b){
  return a.x * b.y - a.y * b.x;
}

double norm(const Point &p){
  return dot(p, p);
}

double abs(const Point &p){
  return sqrt(norm(p));
}

typedef Point Vector;

struct Circle : Point{
  double r;
  Circle(Point p = Point(0,0), double r = 0) : Point(p), r(r) {}
};

double distPP(const Point &a, const Point &b) {
  return sqrt(Sq(a.x-b.x) + Sq(a.y-b.y));
}

bool isPointInCircle(const Point &p, const Circle &c) {
  return abs(p - c) <= c.r + EPS;
}

Point rotate90(const Point &p) {
  return Point(-p.y, p.x);
}

/* テ・ツソツ?ィツヲツ?」ツ?ェテ」ツ?凝」ツ?」テ」ツ??*/
vector<Point> getCrossPointCC_R1(const Circle &c1, const Circle &c2) {
  vector<Point> ret;

  double dist = abs( c1 - c2 );
  if( abs( c1 - c2 ) < EPS || abs( c1 + c2 ) > dist ) return vector<Point>();
  
  Point cent = ( c1 + c2 ) / 2;
  
  Vector v1 = c1 - cent;
  Vector v2 = rotate90(v1);
  ret.push_back(cent + v1);

  v1 = c2 - cent;
  v2 = rotate90(v2);
  ret.push_back(cent + v2);

  return ret;
}

/*
テ」ツ??」ツ?セテ」ツ?湘・ツ仰陛」ツ?凝」ツ?ェテ」ツ??
Point rotateVector(const Vector &p, double th) {
  return Point(p.x * cos(th) - p.y*sin(th), p.x * sin(th) + p.y * cos(th));
}
*/

int main() {
  int n;
  Point p[300];
  
  while(cin >> n && n) {
    for(int i=0; i<n; i++) {
      cin >> p[i].x >> p[i].y;
    }
    
    int ans = 1;
    for(int i=0; i<n-1; i++) {
      for(int j=i+1; j<n; j++) {
	if(distPP(p[i], p[j]) + EPS > 2.0) continue;
	
	Point cent((p[i]+p[j])/2);
	double a = distPP(p[i], cent);
	double b = sqrt(1.0 - a*a);
	
	Vector v1 = p[i] - cent;
	Vector v2 = rotate90(v1);
	Point center = cent + ((v2/abs(v2)) * b);
	Circle c1(center, 1.0);
	int cnt = 0;
	for(int k=0; k<n; k++) {
	  cnt += isPointInCircle(p[k], c1);
	}
	ans = max(ans, cnt);
	
	center = cent + ((v2/abs(v2)) * -b);
	Circle c2(center, 1.0);
	cnt = 0;
	for(int k=0; k<n; k++) {
	  cnt += isPointInCircle(p[k], c2);
	}
	ans = max(ans, cnt);
      }
    }
    cout << ans << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
template <typename T>
using V = std::vector<T>;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  i64 t1, t2;
  cin >> t1 >> t2;
  i64 a1, a2, b1, b2;
  cin >> a1 >> a2 >> b1 >> b2;
  i64 d = a1 * t1 + a2 * t2 - (b1 * t1 + b2 * t2);
  if (d == 0) {
    cout << "infinity" << endl;
    return 0;
  }

  // Ensure a1*t1 + a2*t2 is bigger.
  if (d < 0) {
    swap(a1, b1);
    swap(a2, b2);
    d *= -1;
  }

  i64 e = b1 * t1 - a1 * t1;
  if (e < 0) {
    cout << 0 << endl;
    return 0;
  }

  i64 k = e / d;
  if (e % d == 0) {
    cout << 2 * k << endl;
  } else {
    cout << 2 * k + 1 << endl;
    //   i64 k = e / d;

    //   cout << 2LL * k + 1 << endl;
  }
}


Measured memory_bytes: 3648
n = int(input())
a = [int(input()) for _ in range(n)]

ans, tmp = 0, 0
for i in range(n - 1, 0, -1):
    if a[i] - a[i - 1] > 1:
        print(-1)
        break
    if tmp != a[i]:
        ans += a[i]
    tmp = a[i] - 1
else:
    print(ans if a[0] == 0 else - 1)


Measured memory_bytes: 88016
#include<bits/stdc++.h>
using namespace std;
int c[1<<17],n,m,ac,wa,i,p;
string s;
main(){
	scanf("%d%d",&n,&m);
	while(m--){
		cin>>p>>s;
		if(c[p]==-1)continue;
		if(s=="AC")ac++,wa+=c[p],c[p]=-1;
		else c[p]++;
	}
	printf("%d %d",ac,wa);
}


Measured memory_bytes: 640
N,x=map(int,input().split())
a=list(map(int,input().split()))
a.append(0)
ans=0
for i in range(N):
  if i==0:
    if a[i]+a[i+1]>x:
      if a[i]>x:
        ans+=a[i+1]+a[i]-x
        a[i+1]=0
      else:
        ans+=(a[i]+a[i+1]-x)
        a[i+1]=x-a[i]
  else:
    if a[i]+a[i+1]>x:
      if a[i]>x:
        ans+=a[i+1]+a[i]-x
        a[i+1]=0
      else:
        ans+=(a[i]+a[i+1]-x)
        a[i+1]=x-a[i]
print(ans)

Measured memory_bytes: 20088
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            String dream = "dream";
            String dreamer = "dreamer";
            String erase = "erase";
            String eraser = "eraser";

            str = str.replaceAll(eraser, "");
            str = str.replaceAll(erase, "");
            str = str.replaceAll(dreamer, "");
            str = str.replaceAll(dream, "");

            String ret = str.length() == 0 ? "YES" : "NO";
            out.println(ret);
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.buflen = 0;
        }

        private boolean hasNextByte() {
            if (ptr < buflen) return true;
            else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) return false;
            }
            return true;
        }

        private byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

        private void skipUnprintable() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
                ptr++;
            }
        }

        public boolean hasNext() {
            skipUnprintable();
            return hasNextByte();
        }

        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            byte b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

    }
}



Measured memory_bytes: 26836
//void _(){
//    int n,t;
//    cin >> n >> t;
//    vi arr(n);
//    cin >> arr;
//    int min_seen = MOD;
//    int max_diff = 0;
//    vpii pairs;
//    rep(i,0,n-1){
//        min_seen = min(min_seen,arr[i]);
//        if(arr[i]-min_seen > max_diff){
//            max_diff = arr[i]-min_seen;
//            pairs.clear();
//        }
//        if(max_diff == arr[i]-min_seen)
//            pairs.pb({min_seen,arr[i]});
//    }
//    print(sz(pairs));
//}
#include <iomanip>
#include <algorithm>
#include <cassert>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define pb push_back
#define REP_INT(i,l,r) for(int i = l; i <= r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
const ll MOD = 1e9 + 7;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 istream& operator>>(istream& stream, vector<T>& t){
    return read(all(t), stream);
}
T1 istream& read(T b, T e, istream& stream){
    for(T it = b; it != e; ++it)
        stream >> *it;
    return stream;
}
T1 void print(T x, string end = "\n"){
    cout << x << end;
}
void _(){
    int n,t;
    cin >> n >> t;
    vi arr(n);
    cin >> arr;
    int min_seen = MOD;
    int max_diff = 0;
    vpii pairs;
    rep(i,0,n-1){
        min_seen = min(min_seen,arr[i]);
        if(arr[i]-min_seen > max_diff){
            max_diff = arr[i]-min_seen;
            pairs.clear();
        }
        if(max_diff == arr[i]-min_seen)
            pairs.pb({min_seen,arr[i]});
    }
    print(sz(pairs));
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        _();
}


Measured memory_bytes: 1276
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
//#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

const int dm = 1 << 20;
char dn[dm], * di = dn;
inline void putint(int X) {
	if (X == 0) {
		*di++ = '0';
		*di++ = '\n';
		return;
	}
	int keta = 0;
	char C[10];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}

int N, M;
int K[100001];
int to[200001], ne[200001], he[100001], num[200001];
int dame[100001];
int S1[200001], S2[200001];

int dfs(int v, int prev) {
	auto s1 = S1 + K[v - 1];
	auto s2 = S2 + K[v - 1];
	int sm = K[v] - K[v - 1];
	if (dame[v]) {
		if (dame[v] >= 2) {
			ll tmp = dfs(to[dame[v]], dame[v] ^ 1);
			int k = sm - num[dame[v]];
			for (int i = k - 1; i < sm; i++) {
				s1[i] = s1[i] * tmp % M;
			}
			s2[k - 1] = tmp;
			tmp = s2[sm - 1];
			for (int i = sm - 2; i >= 0; i--) {
				tmp = tmp * s2[i] % M;
				s2[i] = tmp;
			}
			dame[v] = -1;
		}

		ll ret = 1;
		if (prev >= 2) {
			int k = sm - num[prev];
			if (k >= 2) ret *= s1[k - 2];
			if (k < sm) ret *= s2[k];
			ret %= M;
		}
		else ret = s1[sm - 1];

		return ret + 1;
	}
	dame[v] = prev;
	ll ret = 1;
	int k = 0;
	for (int i = he[v]; i; i = ne[i]) {
		int tmp = 1;
		if (i != prev) {
			tmp = dfs(to[i], i ^ 1);
			ret = ret * tmp % M;
		}
		s1[k] = ret;
		s2[k++] = tmp;
	}
	if (prev == -1) {
		ll tmp2 = s2[sm - 1];
		for (int i = k - 2; i >= 0; i--) {
			tmp2 = tmp2 * s2[i] % M;
			s2[i] = tmp2;
		}
	}
	return ret + 1;
}

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


	N = getint();
	M = getint();

	int k = 2;
	rep1(i, N - 1) {
		int x = getint(), y = getint();

		num[k] = K[x]++;
		to[k] = y;
		ne[k] = he[x];
		he[x] = k++;
		num[k] = K[y]++;
		to[k] = x;
		ne[k] = he[y];
		he[y] = k++;
	}
	rep1(i, N) K[i] += K[i - 1];

	rep1(j, N) putint(dfs(j, -1) - 1);

	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

Measured memory_bytes: 13056
n, x, m = map(int, input().split())
mn = min(n, m)
P = [] # value of pre & cycle
sum_p = 0 # sum of pre + cycle
X = [False] * m # for cycle check
for _ in range(mn):
    if X[x]:
        pre_len = P.index(x)
        cyc_len = len(P) - pre_len
        nxt_len = (n - pre_len) % cyc_len
        pre = sum(P[:pre_len])
        cyc = (sum_p - pre) * ((n - pre_len) // cyc_len)
        nxt = sum(P[pre_len: pre_len + nxt_len])
        print(pre + cyc + nxt)
        exit()
    X[x] = True
    P.append(x)
    sum_p += x
    x = x*x % m
print(sum_p)


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main()
{
    char C;
    cin >> C;
    C++;
    cout << C << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import numpy as np

n = int(input())
s = str(input())

state = 0
ans = 0

for i in range(n - 2):
    letters = s[i] + s[i + 1] + s[i + 2]
    if letters == 'ABC':
        ans += 1

print(ans)
    

Measured memory_bytes: 21364
N,K=map(int,input().split())
H=list(map(int,input().split()))

dp=[float('inf')]*N
dp[0]=0
dp[1]=abs(H[1]-H[0])

for n in range(2,N):
    if n-K>0:
        dp[n]=min([(dp[i]+abs(H[n]-H[i]))for i in range(n-K,n)])
    else:
        dp[n]=min([dp[i]+abs(H[n]-H[i])for i in range(0,n)])

print(dp[N-1])

Measured memory_bytes: 20496
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, greater<>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 300'000;
const int LOGN = 19;

int n, m, k;

void solve(int test)
{
  int x;
  cin >> n >> x;
  int ans = 1;
  int cur = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    cur += a;
    ans += cur <= x;
  }
  cout << ans << '\n';
}

void precalc()
{
}

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i)
    solve(i);
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}


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

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

  int m = n.size();
  int sum = 0;
  for(int i=0; i<m; i++) {
    sum += (int)(n[i]) -48;
  }

  if(sum%9==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define PI 3.14159265359
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define tr(con, it) \
    for (auto it = con.begin(); it != con.end(); it++)
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define present(con, ele) (con.find(ele) != con.end())
#define cpresent(con, ele) (find(all(con), ele) != con.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef long long ll;
typedef long double lf;
typedef unsigned long long lu;
const ll mod = 1e9 + 7;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    s[1] == 'R' ? s[1] = 'B' : s[1] = 'R';
    cout << s << "\n";
    return 0;
}

Measured memory_bytes: 3596
a,b,c = map(int,input().split())
if a == b == c:
    if a % 2 == 0:
        print(-1)
        exit(0)
    else:
        print(0)
        exit(0)
ans = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    al = b // 2 + c // 2
    bl = a // 2 + c // 2
    cl = a // 2 + b // 2
    a = al
    b = bl
    c = cl
    ans += 1
print(ans)

Measured memory_bytes: 9120
/*氏名：保坂優介, 学籍番号：200441141
  概要：*/

#include<stdio.h>

int main(void)
{
    int i, j, k, n, x, ans;

    scanf("%d %d", &n, &x);

    while (n != 0 || x != 0)
    {
        ans = 0;

        for (i = 1; i <= n ; i++)
        {
            for (j = i+1; j <= n; j++)
            {
                for (k = j+1; k <= n; k++)
                {
                    if (i + j + k == x)
                    {
                        ans++;
                    }
                }
            }
            
        }
        printf("%d\n", ans);
        
        scanf("%d %d", &n, &x);
    }

    return 0;
}


Measured memory_bytes: 2024
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define ll long long
using namespace std;
const ll maxn = 1e6 + 5;
ll a,b,c,t,n,m;
ll num[maxn];
string str;
int main()
{
    cin >> str;
    if(str[0] == str[1] && str[2] == str[1])
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
    int n;
    cin>>n>>s;
    for(int i=0;i<s.length();i++)
    {
        int d=int(s[i]);
        if(d>=97)d-=32;
        d+=n;
        if(d>90)d-=26;
        cout<<char(d);
    }
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(int, a, b, k);
    while(true){
        a /= 2;
        b += a;
        if(--k == 0) break;
        b /= 2;
        a += b;
        if(--k == 0) break;
    }
    Cout(a, " ", b);
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll n,k;cin>>n>>k;
    string s;cin>>s;
    s[k-1]+=32;
    cout<<s;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fin freopen("input", "r", stdin);
#define fout freopen("output", "w", stdout);
#define wt(x) cerr << #x << ": " << x << " ";
#define whatis(x) {cerr << #x << ": " << x << endl;}
#define whatis2(x, y) {wt(x); wt(y); cerr << endl;}
#define whatis3(x, y, z) {wt(x); wt(y); wt(z); cerr << endl;}
#define whatis4(x, y, z, a) {wt(x); wt(y); wt(z); wt(a); cerr << endl;}
using namespace std;

typedef long long ll; typedef unsigned long long ull; typedef long double ld;
const ll MOD = 1000000007; const ld PI = acos(-1.0);

const int N = 1000000;
int power[N];

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

    ll n;
    cin >> n;
    ll cnt = 0;
    for (ll i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            n /= i;
            power[i] += 1;
        }
    }
    int ans = 0;
    if (n > 2) {
        /* power[n] += 1; */
        ans += 1;
    }
    for (int i = 0; i < N; ++i) {
        int val = 1;
        int cnt = 0;
        while (power[i]) {
            cnt += val;
            val += 1;
            /* if (i == 2) whatis(cnt); */
            if (cnt <= power[i]) {
                ans += 1;
            } else {
                break;
            }
        }
    }

    /* whatis(power[3]); */
    /* whatis(power[2]); */
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
   int  a,b;
   cin>>a>>b;
   int c[a];
   for(int i=0;i<a;i++)
   {
       cin>>c[i];
   }
   
   for(int i=b;i<a;i++)
   {
     
      if(c[i-b]<c[i])
       cout<<"Yes\n";
       else
       cout<<"No\n";
      
   }
   
   
   return 0;
}

Measured memory_bytes: 4372
n = int(input())
a = list(map(int,input().split()))
if n % 2 == 0:
    start = n - 1
    while start >= 0:
        print(a[start],end=' ')
        start -= 2
    start = 0
    while start < n:
        print(a[start],end=' ')
        start += 2
elif n % 2 == 1:
    start = n - 1
    while start >= 0:
        print(a[start],end=' ')
        start -= 2
    start = 1
    while start < n:
        print(a[start],end=' ')
        start += 2

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

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

	string cond[6];
	cond[0] = "abc";
	cond[1] = "acb";
	cond[2] = "bac";
	cond[3] = "bca";
	cond[4] = "cab";
	cond[5] = "cba";

	int flag = 0;
	for (int i=0; i<6; i++){
		if (str == cond[i]){
			flag++;
			break;
		}
	}

	if (flag) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
N, M = map(int, input().split())

A = []
for i in range(N):
    tmp = str(input())
    A.append(tmp)
    
B = []
for i in range(M):
    tmp = str(input())
    B.append(tmp)
    
ans = "No"
for i in range(N-M+1):
    for j in range(N-M+1):
        if [a[j:j+M] for a in A[i:i+M]] == B:
            ans = "Yes"

print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<math.h>
#include <iomanip>
using namespace std;


int main() {
  const double PI=3.1415926535897932;
  double a, b, h, m;
  cin >> a >> b >> h >> m;
  double t1, t2, t3;
  t1 = (PI / 6) * h + (PI * m / 360);
  t2 = (PI / 30) * m;
  if(t1 > t2) {
    t3 = t1 - t2;
  } else {
    t3 = t2 - t1;
  }

  if(t3 >= PI) {
    t3 = (2 * PI) - t3;
  }

  cout << fixed;
  cout << setprecision(10) << sqrt((a * a) + (b * b) - (2 * a * b * cos(t3))) << endl;

  return 0;
}


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

int main(void){
    int N; cin >> N;
    vector<int> A(100000,0);

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

    int ans=0;
    for(int i=0; i<100000; i++){
        ans=max(ans,A[i]);
    }

    cout << ans << endl;
}

Measured memory_bytes: 640