akhauriyash/Code-Regression huggingface dataset:
n = 1000000
a = [True for i in range(n)]
i = 3
while i * i < n:
    for j in range(3 * i, n, 2 * i): a[j] = False
    i += 2
 
while True:
    try:
        b = int(input())
    except:
        break
 
    count = int(b >= 2) + sum(a[i] for i in range(3, b + 1, 2))
    print(count)


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

#define ten(n) ((int)1e##n)
#define uni(x) x.erase(unique(all(x)),x.end())
// 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 );
}

// dump macro{{{
// http://www.creativ.xyz/dump-cpp-652
#define DUMPOUT cerr // 変数ダンプ先。coutかcerr

#ifdef PCM
// 引数はいくつでもどんな型でも可（ストリーム出力演算子があればOK）
#define dump(...) DUMPOUT<<"  "; \
  DUMPOUT<<#__VA_ARGS__; \
  DUMPOUT<<":=> "; \
  dump_func(__VA_ARGS__); DUMPOUT<<"in ["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl;
#define dump_1d(x,n) DUMPOUT <<"  " \
  <<#x<<"["<<#n<<"]"<<":=> {"; \
  rep(i,n){ DUMPOUT << x[i] << (((i)==(n-1))?"}":", "); } DUMPOUT <<" in [" << __LINE__ << "]" << endl;

#define dump_2d(x,n,m) DUMPOUT <<"  " \
    <<#x<<"["<<#n<<"]"<<"["<<#m<<"]"<<":=> \n"; \
    rep(i,n)rep(j,m){ DUMPOUT << ((j==0)?"     |":" ") << x[i][j] << (((j)==(m-1))?"|\n":" "); } \
    DUMPOUT <<"  in [" << __LINE__ << "]" << endl;
#else
#define dump(...) 42
#define dump_1d(...) 42
#define dump_2d(...) 42
#endif

// デバッグ用変数ダンプ関数
void dump_func() {
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail)
{
    DUMPOUT << head;
    if (sizeof...(Tail) == 0) {
        DUMPOUT << " ";
    }
    else {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec) {
    os << "{";
    for (int i = 0; i<vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}/*}}}*/

#define rep(i, x) for(int i = 0; i < (int)(x); i++)/*{{{*/
#define reps(i,x) for(int i = 1; i <= (int)(x); i++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define RFOR(i, m, n) for(int i = m;i >= n;i--)
#define foreach(x,a) for(auto& (x) : (a) )
#define all(x) (x).begin(),(x).end()
#define sum(v) accumulate(all(v), 0)
#define sz(x) ((int)(x).size())
#define fill(x,y) memset(x,y,sizeof(x))
#define pb(a) push_back(a)
#define INF 2147483647
#define INFLL 1000000000000000000LL
#define MOD 1000000007/*}}}*/

struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;/*{{{*/
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef vector<vii> vvii;
typedef tuple<int,int,int> iii;
typedef set<int> si;
typedef complex<double> pnt;
typedef vector<pnt> vpnt;
typedef priority_queue<pii,vii,greater<pii> > spq;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

/*}}}*/

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

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

ll lcd(ll a, ll b){
  return (a/gcd(a,b))*b;
}

int main() {
  ll n;cin>>n;
  ll t;
  ll res=1;
  rep(i, n){
    cin>>t;
    res = lcd(res, t);
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
dic = {}
j = True

for i in range(0, len(A)):
  if str(A[i]) in dic:
    print("NO")
    j = False
    break
  else:
    dic.setdefault(str(A[i]), A[i])

if j:
  print("YES")



Measured memory_bytes: 43428
#include <algorithm>
// #include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <bitset>
using namespace std;
typedef long long LL;
typedef double db;
const int oo=2139063143;
const int N=1010000;
const int P=1000000007;
const db eps=1e-7;
#define pritnf printf
//char buf[1<<22],*p1=buf,*p2=buf,obuf[1<<22],*O=obuf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <typename T>
inline void sc (T &x)
{
    x=0; static int p; p=1; static char c; c=getchar();
    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }
    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }
    x*=p;
}
template <typename T>
inline void print (T x)
{
    if (x< 0) putchar('-'),x=-x;
    if (x>=10) print(x/10);
    putchar(x%10+'0');
}
template <typename T>
inline void pr (T x) { print(x),putchar('\n'); }
template <typename T1,typename T2>
void chkmax (T1 &A,T2 B) { A=A>=B?A:B; }
template <typename T1,typename T2>
void chkmin (T1 &A,T2 B) { A=A<=B?A:B; }

int n,len,x[N],t[N],l[N],r[N]; bool vis[N];
int main ()
{
    // freopen (".in","r",stdin);
    // freopen (".out","w",stdout);
	sc(n),sc(len);
	for (int i=1; i<=n; i++)
		sc(x[i]);
	LL ans=n;
	for (int i=1; i<=n; i++)
	{
		sc(t[i]),ans+=t[i]/(len<<1),t[i]%=len<<1;
		if (!t[i]) vis[i]=1,--ans;
		else
		{
			l[i]=2*(len-x[i])>=t[i],r[i]=2*x[i]>=t[i];
			if (!l[i]&&!r[i]) vis[i]=1;
		}
	}
	if (!l[n]) ++ans;
	int pos=n,las=0;
	for (int i=1; i< n; i++) if (!vis[i])
	{
		if (!l[i]) { pos=i; break; }
		r[i]?(++las):(las?--las,--ans:0);
	}
	int sum=las; las=0;
	for (int i=n-1; i>=pos; i--) if (!vis[i])
	{
		if (!r[i]) break;
		l[i]?(++las):(las?--las,--ans:0);
	}
	sum+=las;
	ans-=sum>>1;
	pr(ans*len<<1);


    return 0;
}


Measured memory_bytes: 9728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    bool bs = false;
    ll ans = 0;
    rep(i, n) {
        if (bs) {
            if (a[i] == (i + 1)) ans++;
            bs = false;
        }
        else {
            if ((i > 0) && (a[i - 1] == i) && (a[i] == (i + 1))) {
                bs = true;
            }
            else if (a[i] == (i + 1)) {
                ans++;
                bs = false;
            }
            else {
                bs = false;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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


int main(){
 
  int n ;
  cin >> n ;
  
  int count = 0 ; 
  
  vector<int> vec(n);
  
  for (int i = 0; i < n ; i++) {
    cin >> vec.at(i);
  }
  
  for ( int i = 0; i<n-2 ; i++ ) {
    
    int maximum = max( { vec.at(i),vec.at(i+1),vec.at(i+2) });
    int minimum = min( { vec.at(i),vec.at(i+1),vec.at(i+2) });
      if (vec.at(i+1) > minimum && vec.at(i+1) < maximum ) count++;
  }
  cout << count  << endl ; 
  
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int l[] = new int[m];
		int r[] = new int[m];
		for (int i = 0; i < m; i++) {
			l[i] = sc.nextInt();
			r[i] = sc.nextInt();
		}
		Arrays.sort(l);
		Arrays.sort(r);
		if (r[0] - l[m-1] < 0) {
			System.out.println(0);
			return;
		}
		System.out.println(r[0] - l[m-1] + 1);
	}
}

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

//wierd debugging stuff
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << "\n" ; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
//end of weird debugging stuff
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
 
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define fo(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define foe(i,x) for(auto& i: x)
#define ar array
#define pb push_back
#define vt vector
#define F first
#define S second

template<class T> bool umin(T& a,const T& b){return b<a?a=b,1:0;}
template<class T> bool umax(T& a,const T& b){return b>a?a=b,1:0;}

template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(ar<A, S>& a);
template<class T> void read(T& x) {cin>>x;}
void read(double& d) {string t;read(t);	d=stod(t);}
void read(long double& d) {	string t;read(t);d=stold(t);}
template<class H, class... T> void read(H& h, T&... t) {read(h);read(t...);}
template<class A> void read(vt<A>& x) {	foe(a, x)read(a);}

// no change 
const ll MOD = 1e9+7;  
int n;
void Titan(){
	read(n);
	string s;
	read(s);
	int i = 0,j = n-1;
	int ans = 0;
	while(i<j){

		if(s[i] == 'W' && s[j] == 'R'){
			swap(s[i],s[j]);
			ans++;
			i++,j--;
			continue;
		}
		if(s[i] == 'W' && s[j] != 'R')j--;
		else if(s[i] != 'W' && s[j] == 'R')i++;
		else i++,j--;
	}
	cout << ans;

}

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int T = 1;
	//cin >> T;		//cmt if one test case
    fo(T){
		//cout << "Case #" << i+1 << ": " ;
		Titan();
	}
}
/*///////////////////////////////////////////////////////////
Important Notes : 
* check long long 
* check base cases
* do not loose Hope
* if case fails on 2nd test case maybe some cases are missing check them
* do not sit idle
* try to do it using pen/paper.
*/


Measured memory_bytes: 3772
using System;
using System.Collections.Generic;

namespace cswork
{

    class Program
    {
        public Program() { }

        Scanner cin;

        void Omame()
        {
            cin = new Scanner();

            int n = cin.nextInt();
            string s = cin.next();

            int ans = 0;
            for (int i = 0; i <= 9; i++)
            {
                for (int j = 0; j <= 9; j++)
                {
                    for (int k = 0; k <= 9; k++)
                    {
                        string x = i.ToString() + j.ToString() + k.ToString();
                        int jj = 0;
                        for (int l = 0; l < n; l++)
                        {
                            if (s[l] == x[jj])
                            {
                                jj++;
                            }

                            if (jj == 3)
                            {
                                ans++;
                                break;
                            }
                        }
                    }
                }
            }
            Console.Write(ans);
        }

        static void Main(string[] args)
        {
            new Program().Omame();
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();

            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next();
        }

        public int nextInt()
        {
            return int.Parse(next());
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }
    }
}

Measured memory_bytes: 13152
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    B = [0] * n
    for i in range(n):
        B[0] += A[i] if i % 2 == 0 else -A[i]

    for j in range(1, n):
        B[j] = 2 * A[j - 1] - B[j - 1]

    print(*B)


if __name__ == '__main__':
    resolve()


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int x;
    cin >> x;
    if (x == 7 or x == 5 or x == 3) {
        cout << "YES" << endl;
    }
    else cout << "NO" << endl;
}


Measured memory_bytes: 256
//#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct Comb {
  vector<mint> fact, ifact;
  Comb(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint nCk(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint nHk(int n, int k) {
    if (n == 0 && k == 0) return 1; 
    if (n <= 0 || k < 0) return 0;
    return nCk(n + k - 1, k); 
  }
  mint nPk(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[n-k];
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int s; cin >> s;
  if(s<3){
    cout << 0 << endl;
    return 0;
  }

  mint ans = 0;
  Comb comb(s*2);
  for(int k=1; k*3<=s; k++){
    int rest = s-k*3;
    ans += comb.nHk(k, rest);

  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3684
n = int(input())
H = list(map(int, input().split()))
#1~N番目の高さを取り出すにはH[N-1]

seeable = 1 #1番めは必ずseeable
for i in range(2, n+1, 1): #2番目~N番目につき
  iseeable = 1
  for j in range(1, i, 1): #1番め~i-1番目につき
    if H[j-1] > H[i-1]: #i番目より高いなら見えない
      iseeable = 0
      break
  seeable += iseeable

print(seeable)

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


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 100010;
const int mod = 1e9+7,base = 31;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

const int m = 2200;

int n,ans;

int pri[maxn],cnt;

int has[maxn];

pair<ll,pair<ull,ull> > A[maxn];

map<pair<ll,pair<ull,ull> >,int > mp;

bool check(ll x){
	ll y=(ll)sqrt(x);
	for(ll i=y;i<=y+3;i++)if(i*i==x)return true;
	return false;
}

ull make(){
	ull ans=0;
	REP(i,1,cnt)ans=ans*base+has[i];
	return ans;
}

void Work(){
	REP(i,1,n)if(A[i].fi==1){
		if(A[i].se==MP((ull)0,(ull)0))ans++;
		else ans+=max(mp[A[i]],mp[MP(1,MP(A[i].se.se,A[i].se.fi))]),mp[A[i]]=0,mp[MP(1,MP(A[i].se.se,A[i].se.fi))]=0;
	}
	REP(i,1,n)if(A[i].fi!=1){
		if(check(A[i].fi)){
			ll x=sqrt(A[i].fi);
			ans+=max(mp[A[i]],mp[MP(x,MP(A[i].se.se,A[i].se.fi))]);
			mp[MP(x,MP(A[i].se.se,A[i].se.fi))]=0;
		}
	}
	REP(i,1,n)if(!check(A[i].fi))ans+=mp[A[i]];
	iout(ans);
}

void Init(){
	REP(i,2,m){
		bool ok=1;
		REP(j,2,i-1)if(__gcd(i,j)!=1)ok=0;
		if(ok)pri[++cnt]=i;
	}
	read(n);
	REP(i,1,n){
		ll x;read(x);
		REP(j,1,cnt)has[j]=0;
		REP(j,1,cnt){
			while(x%pri[j]==0)has[j]++,x/=pri[j];
		}
		REP(j,1,cnt)has[j]%=3;
		ull x1=make();
		REP(j,1,cnt)has[j]=(3-has[j])%3;
		ull x2=make();
		mp[MP(x,MP(x1,x2))]++;
//		cout<<x<<' '<<x1<<' '<<x2<<endl;
		A[i]=MP(x,MP(x1,x2));
	}
	sort(A+1,A+n+1);
	n=unique(A+1,A+n+1)-A-1;
}

int main(){
	Init();
	Work();
	return 0;
}


Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
int x, y, z;
int main(){
	scanf("%d %d %d", &x, &y, &z);
	int temp;
	temp = x;
	x = y;
	y = temp;
	temp = x;
	x = z;
	z = temp;
	printf("%d %d %d", x, y, z);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int OO = 0x3f3f3f3f3f3f3f3f;

int n, w, maxi;
int value[120], weight[120];
int dp[100040];

int32_t main()
{
	cin >> n >> w;
	for(int i = 0; i < n; i++)
		cin >> weight[i] >> value[i];
	memset(dp, 63, sizeof(dp));
	dp[0] = 0;
	for(int item = 0; item < n; item++)
		for(int cur_val = 100000 - value[item]; cur_val >= 0; cur_val--)
			dp[cur_val + value[item]] = min(dp[cur_val + value[item]], dp[cur_val] + weight[item]);
	int ans = 0;
	for(int i = 0; i <= 100000; i++)
		if(dp[i] <= w)
			ans = i;
	cout << ans << '\n';
	
	return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#define MAXN 55
int n, m;
char a[MAXN][MAXN], b[MAXN][MAXN];
bool judge(int x, int y) {
    if(x + m > n || y + m > n)   return false;
    for(int i = x; i < x + m; i++)
        for(int j = y; j < y + m; j++)
            if(a[i][j] != b[i-x][j-y])
                return false;
    return true;
}
int main() {

    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; i++)
        scanf("%s", a[i]);
    for(int i = 0; i < m; i++)
        scanf("%s", b[i]);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            if(judge(i, j)) {
                printf("Yes\n");
                return 0;
            }
    printf("No\n");
    return 0;
}


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

int main(){
  int count=0;
  string str1,str2;
  cin >> str1 >> str2;
  for(int i=0;i<str1.length();i++){
    if(str1[i]!=str2[i]){
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 3860
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,int> T;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define emplace_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
template<class t,class u>
ostream& operator << (ostream& os,pair<t,u> p){
	return os << p.fi << ',' << p.sec;
}
template<class T>
void dump(vector<T> &vec){
	for(int i=0;i<vec.size();i++){
		cout << vec[i];
		if(i+1<vec.size())cout << ' ';
		else cout << endl;
	}
	return;
}
int N;
ll A[200100];
bool check(ll K){
	vector<P> vec;
	vec.pb(P(0,A[0]));
	for(int i=1;i<N;i++){
		//dump(vec);
		if(A[i-1]<A[i]){
			vec.pb(P(0,A[i]-A[i-1]));
		}else{
			ll tmp = A[i-1]-A[i];
			while(tmp>0){
				P a = vec.back();
				vec.pop_back();
				if(tmp<a.sec){
					vec.pb(P(a.fi,a.sec-tmp));	
					tmp = 0;
				}else{
					tmp -= a.sec;
				}
			}
			P a = vec.back();
			vec.pop_back();
			if(a.fi==K-1){
				while(!vec.empty()){
					if(vec.back().fi!=K-1)break;
					a.sec += vec.back().sec;
					vec.pop_back();
				}
				if(vec.empty())return false;
				P b = vec.back();
				vec.pop_back();
				assert(b.fi<K-1);
				if(b.sec>1)vec.pb(P(b.fi,b.sec-1));
				vec.pb(P(b.fi+1,1));
				vec.pb(P(0,a.sec));
			}else{
				if(a.sec>1)vec.pb(P(a.fi,a.sec-1));
				vec.pb(P(a.fi+1,1));
			}
			/*ll sum = 0ll;
			for(int j=0;j<vec.size();j++){
				sum += vec[j].sec;
			}
			if(sum!=A[i]){
				cout << sum << ' ' << A[i] << endl;
			}*/
		}
	}
	return true;
}
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> A[i];
	}
	ll l = 0ll,r = 1000000000000000ll;
	while(r-l>1ll){
		ll mid = (l+r)/2ll;
		if(check(mid))r = mid;
		else l = mid;
	}
	cout << r << endl;
	return 0;
}


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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;
typedef pair<int, int>             pii;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

int main(){
    fIO
//    freopen("", "r", stdin);
//    freopen("", "w", stdout);

    ll n;
    cin >> n;

    ll sum = (n * (n + 1)) / 2;

    for(int i = 1; i <= n; i++) {
        if(i % 15 == 0) sum -= i;
        else if(i % 3 == 0) sum -= i;
        else if(i % 5 == 0) sum -= i;
    }
    cout << sum;

}








Measured memory_bytes: 3640
N = int(input())
a_line = []
a_con = []
flag = True

for _ in range(N):
  a_line.append(int(input()))
  a_con.append(0)
  
ans = 1
place = 0

for i in range(N):
  if a_con[place] == 1:
    flag = False
    break
  if a_line[place] == 2:
    break
  a_con[place] += 1
  place = a_line[place] - 1
  ans += 1

if flag:
  print(ans)
else:
  print(-1)

Measured memory_bytes: 13468
n = int(input())
given_array = [int(x) for x in input().split()]

for i in range(1,n):
    print(" ".join([str(x) for x in given_array]))
    key = given_array[i]
    j = i - 1
    while j >= 0 and given_array[j] >= key:
        temp = given_array[j]
        given_array[j] = given_array[j+1]
        given_array[j+1] = temp
        j -= 1

    given_array[j+1] = key

print(" ".join([str(x) for x in given_array]))



Measured memory_bytes: 5608
a,b=map(int,input().split())
v,w=map(int,input().split())
t=int(input())
if a<=v:
    d1 = a + t*b
    d2 = v + t*w
    if d1>=d2:
        print('YES')
    else:
        print('NO')
else:
    d1 = a - t*b
    d2 = v - t*w
    if d1<=d2:
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 9192
n,m = map(int,input().split())
sub = []
for i in range(m):
    tmp= [x for x in input().split()]
    sub.append(tmp)
ac = [0]*n
wa = [0]*n
for i in range(m):
    res = sub[i][1]
    que = int(sub[i][0]) - 1
    if res == "AC" and ac[que] == 0:
        ac[que] += 1
    elif res == "WA" and ac[que] == 0:
        wa[que] += 1
for i in range(n):
    if ac[i] != 1:
        wa[i] = 0
print(sum(ac),sum(wa))



    


Measured memory_bytes: 33576
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <string>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <set>
#include <climits>
#include <sstream>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;
const dd PI = 3.1415926535;

class UnionFind {
	std::vector<int> p;

public:
	UnionFind(int n) : p(n, -1) {}

	int root(int x) { return p[x] < 0 ? x : p[x] = root(p[x]); }

	bool same(int x, int y) { return root(x) == root(y); }

	bool unite(int x, int y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (p[y] < p[x]) std::swap(x, y);
		if (p[x] == p[y]) --p[x];
		p[y] = x;
		return true;
	}
};

ll fast(ll n, ll k) {
	if (k == 0) {
		return 1;
	}
	if (k == 1) {
		return n;
	}
	if (k % 2 == 0) {
		ll tmp = fast(n, k / 2);
		return tmp * tmp % MOD;
	}
	else {
		ll tmp = fast(n, k / 2);
		tmp = tmp * tmp % MOD;
		return n * tmp % MOD;
	}
}

ll count(ll n, ll k) {
	ll cnt = 0;
	while (true)
	{
		if (n >= k) {
			break;
		}
		cnt++;
		n *= 2;
	}
	return cnt;
}

int main() {
	ll N, K;
	cin >> N >> K;
	vector<ll> cnt(N + 1, 0);

	for (ll i = 1; i <= N; i++)
	{
		cnt[i] = count(i, K);
	}

	dd ans = 0;
	for (ll i = 1; i <= N; i++)
	{
		ans += 1 - pow(0.5, cnt[i]);
	}
	cout << fixed << setprecision(12) <<  (1 - ans / (dd)N)<< endl;
}

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

signed main() 
{
	int n;
    cin >> n;
    int a[n];
    for(int i = 0 ; i < n  ; i++)
        cin >> a[i];
    sort(a,a+n);
    int cnt = n , res = a[n-1] , i = 2;
    cnt -= 2;
    while(cnt>0)
    {
        res += min(cnt,2ll)*a[n-i];
        cnt-=2;
        i++;
    }
    cout << res;
}

Measured memory_bytes: 5200
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n) ; i++)
constexpr auto INF = 2147483647;
typedef long long ll;
const int MAX = 200001;

int n;
int A[MAX];
int L[MAX / 2 + 2], R[MAX / 2 + 2];

ll Merge(int left,int mid,int right){
	int n1 = mid - left;
	int n2 = right - mid;
	ll cnt = 0;
	rep(i, n1) L[i] = A[left + i];
	rep(i, n2) R[i] = A[mid + i];
	L[n1] = R[n2] = INF;
	int i, j;
	i = j = 0;
	for (int k = left; k < right; k++) {
		if (L[i] <= R[j]) A[k] = L[i++];
		else {
			A[k] = R[j++];
			cnt += n1 - i;
		}
	}
	return cnt;
}


ll MergeSort(int left, int right){
	ll v1, v2, v3;
	int mid;
	if (left + 1 < right) {
		mid = (left + right) / 2;
		v1 = MergeSort(left, mid);
		v2 = MergeSort(mid, right);
		v3 = Merge(left, mid, right);
		return v1 + v2 + v3;
	}
	else return 0;
}

int main() {
	cin >> n;
	rep(i, n) cin >> A[i];

	ll ans = MergeSort(0, n);
	cout << ans << endl;


	return 0;
}


Measured memory_bytes: 4660
//INCLUDE
//------------------------------------------
#include <iostream>
#include <functional>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <string>
#include <cstring>
#include <vector>
//DEFINE
//------------------------------------------
#define ll long long
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
  string str;cin>>str;
  char buf=' ';bool isi=false,ish=false;
  int j;
  REP(i,str.size()){
    if(i==0||isi){;
      if(str[i]!='h'){
	cout<<"No";
	exit(0);
      }else{
	ish=true;
	isi=false;
      }
    }else if(ish){
      if(str[i]!='i'){
	cout<<"No";
	exit(0);
      }else{
	isi=true;
	ish=false;
      }
    }j=i;
  }
  if(str[j]=='i')cout<<"Yes";
  else cout<<"No";
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
typedef long long int LL;
void solve(){
	LL a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<max(a*c,max(a*d,max(b*c,b*d)))<<"\n";
}
int main(){
	int t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 3636
def main():
  N = int(input())
  a_list = list(map(int, input().split()))
  cost = 0
  if not (len(a_list) == N):
    print('ERROR')
  a_ave = sum(a_list)/N # 平均値取得
  a_ave = round(a_ave) # 平均値を整数で四捨五入
  for i in range(len(a_list)):
    cost = cost + (a_list[i]-a_ave)**2
  print(cost)
main()


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

using namespace std;

#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define PB push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second

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

const int MAX = 10000007;

int dive[10000007];

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

	FOR(i, MAX) dive[i] = 1;

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

	ll ans = 0;
	int n; cin >> n;
	for(int i = 1; i <= n; i++){
		ans += 1LL*dive[i]*i;
	}

	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 42708
#include <iostream>
#include <cstdio>
#include <string>

using namespace std;


int main(void) {

	string oder;

	int sum = 700;

	cin >> oder;

	for (int i = 0; i < 3; i++) {
		if (oder[i] == 'o')
			sum += 100;
	}

	cout << sum;

}



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

using namespace std;

int main() {
int N,K;
cin>>N>>K;
vector<int>h(N);
for(int i=0;i<N;i++){
   cin>>h[i];
}
sort(h.begin(),h.end());
int minn=1000000000;
int a;
for(int i=0;i<=N-K;i++){
   a=h[i+K-1]-h[i];
   minn=min(minn,a);
}
cout<<minn<<endl;

   return 0;
}






Measured memory_bytes: 3764
char*p,S[9999];
i,j;c[99],t;
main()
{
	for(gets(S),gets(p=S);*p;c[*p++]++)for(j=2e3;j--;)t-=(*p^p[j]^p[j+j])==87;
	printf("%ld",1L*c[66]*c[71]*c[82]+t);
}

Measured memory_bytes: 1636
#include<stdio.h>

int main(void){

int a,b,c,d,r;

double f;


scanf("%d",&a); 

scanf("%d",&b);

d=a/b;


r=a%b;


f=(double)a/b;

printf("%d %d %lf\n",d,r,f);

return 0; 

}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
const int MOD=1000000007;
#define VAR(type,...) type __VA_ARGS__;in(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);each(i, name)in(i)
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(a-1);i>=(b);--i)
#define each(i,v) for(auto &i:(v))
#define all(v) (v).begin(),(v).end()
#define print(...) out(__VA_ARGS__);cout<<endl
void in(){} template<class T,class... U> void in(T &t,U &...u){cin>>t;in(u...);}
void out(){} template<class T,class... U> void out(T t,U ...u){cout<<t<<" ";out(u...);}
void solve();
int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}

ll gcd(ll a,ll b){while(a^=b^=a^=b%=a);return b;}

void solve() {
  VAR(int, K);
  ll ans = 0;
  rep(i, 1, K+1) {
    rep(j, 1, K+1) {
      rep(k, 1, K+1) {
        ans += gcd(gcd(i, j), k);
      }
    }
  }
  print(ans);
}

Measured memory_bytes: 3600
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>

using namespace std;

// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;

typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;

const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const double PI = 3.14159265358979323846264338327950288;
//========================================================================


int main() {

	//==================================
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(30);
	//==================================


	ll N;
	cin >> N;

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

	int ans = 0;
	for (int i = 0; i < N-1; i++) {

		if (A[i] == A[i + 1]) {
			ans++;
			i++;
		}

	}
	cout << ans;





}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
	long long q,w,e,i;
	cin>>q>>w;
	i=(q+w)/2;
	if(q-i==i-w)
	cout<<i;
	else
	cout<<"IMPOSSIBLE";
	
	
	return 0;
}

Measured memory_bytes: 256
N, A, B, C, D = map(int, input().split())
S = input()

if C < D:
    if "##" in S[A - 1:C] or "##" in S[B - 1:D]:
        print("No")
    else:
        print("Yes")
else:
    if "..." in S[B - 2:D + 1] and "##" not in S[A - 1:C] and "##" not in S[B - 1:D]:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <cmath>


using namespace std;
using ll = long long;
using ull = unsigned long long;


#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a-1;i>=b;i--)

class employee {
public:
	int id;
	vector<int> children;
	int salary;
	
	employee(int _id) {
		id = _id;
		children = {};
		salary = -1;
	}



};


double length(pair<double, double> coord) {
	return sqrt(coord.first * coord.first + coord.second * coord.second);
}


int main() {
	ll N, M;
	cin >> N >> M;
	vector<pair<unsigned int, unsigned int>> step(N + 1, make_pair(0,0));
	static unsigned int modd = 1'000'000'007;

	//initial step
	step[0].first = 1;
	unsigned int temp;
	rep(i, 1, M+1) {
		cin >> temp;
		step[temp].second = 1;
	}

	//first step
	if (step[1].second != 1)step[1].first = 1;

	rep(i, 2, N+1) {
		if (step[i].second != 1)step[i].first = step[i - 1].first%modd + step[i - 2].first%modd;
	}

	cout << step[N].first % modd << endl;

	return 0;

}

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

int main(){
	int k, s;
	int count = 0;
	cin >> k >> s;
	for(int i=0; i<=k; i++){
		for(int j=0; j<=k; j++){
			int z = s - i - j;
			if(z >= 0 && z <= k) count++;
		}
	}
	cout << count;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void){

  int  a, b;

  cin >> a >> b;

  if(a == 1) a += 13;
  if(b == 1) b += 13;

  if(a == b){
    cout << "Draw" << endl;
  }else if(a > b) cout << "Alice" << endl;
  else cout << "Bob" << endl;

  return 0;

}


Measured memory_bytes: 256
f=s=t=0
for i in range(10):
    n=int(input())
    if(n > f):
        t = s
        s = f
        f = n
    elif(n > s):
        t = s
        s = n
    elif(n > t):
        t = n
print('%d\n%d\n%d'%(f,s,t))

Measured memory_bytes: 7656
N=int(input())
# L=[]
# for i in range(N):
#     L.append(int(read_input()))

A=[int(x) for x in input().split()]
B=[int(x) for x in input().split()]

ans=0
for n in range(N):
    if A[n]>B[n]:
        ans+=B[n]
        B[n]=0
    else:
        ans+=A[n]
        B[n]=B[n]-A[n]
        
    if A[n+1]>B[n]:
        ans+=B[n]
        A[n+1]=A[n+1]-B[n]
        B[n]=0
    else:
        ans+=A[n+1]
        B[n]=B[n]-A[n+1]
        A[n+1]=0
        
print(ans)

Measured memory_bytes: 19004
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int r,d,x,m=0,i;
  cin >> r >> d >> x;
  for(i=0;i<10;i++)
  {
    m=r*x-d;
    cout << m << endl;
    x=m;
  }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

const string YES = "YES";
const string NO = "NO";

void solve(ll r, ll g, ll b) {
  bool pred = (100*r+10*g+b) % 4 == 0;
  cout << (pred ? YES : NO) << endl;
}

int main() {
  ll r;
  cin >> r;
  ll g;
  cin >> g;
  ll b;
  cin >> b;
  solve(r, g, b);
  return 0;
}


Measured memory_bytes: 256
def solve():
    n, q = map(int, input().split())
    s = input()
    lrs = list(list(map(int, input().split())) for _ in range(q))
    # ans = [s[l - 1:r].count("AC") for l, r in lrs]
    c = [0] * n
    for i in range(1, n):
        c[i] = c[i - 1]
        if s[i - 1] == "A" and s[i] == "C":
            c[i] += 1
    ans = [c[r - 1] - c[l - 1] for l, r in lrs]
    print(*ans, sep="\n")


if __name__ == "__main__":
    solve()


Measured memory_bytes: 73048
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>
#include <cstdint>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define REP(i, n)				for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)			for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF						2e9
#define MOD						(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)				(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)				(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)			((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)				(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)				(!IsOdd((x)))						
#define ArrayLength(x)			(sizeof( x ) / sizeof( x[ 0 ]))
#define	MAX_QWORD				((QWORD)0xFFFFFFFFFFFFFFFF)
#define M_PI					3.14159265358979323846
typedef long long				ll;
typedef unsigned long long int	QWORD;
typedef unsigned long long		SQWORD;
typedef pair<ll, ll>			P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
int main()
{
	int a;
	cin >> a;
	if (a == 1) {
		cout << "Hello World" << endl;
	} else {
		int b, c;
		cin >> b >> c;
		cout << c + b << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(void){
  int n,m;
  string s;
  cin >> n >> m;
  cin >> s;
  int dice[100010];
  int next[100010];
  fill(next, next+100010, -1);
  int target = 0;
  int last = 0;
  for(int i = 1;i <= n;++i){
    if(s[i] == '1'){
      dice[i] = -1;
      continue;
    }
    while(i - target > m){
      if(next[target] == -1){
        puts("-1");
        return 0;
      }
      target = next[target];
    }
    dice[i] = i - target;
    next[last] = i;
    last = i;
  }
  vector<int> res;
  int now = n;
  while(now > 0){
    res.push_back(dice[now]);
    now -= dice[now];
  }
  reverse(res.begin(), res.end());
  for(int i = 0;i < (int)res.size();++i){
    if(i != 0)printf(" ");
    printf("%d", res[i]);
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 1912
#include <iostream>
#include <vector>
#include <cstdio>
// #include <cstdint>

using namespace std;

static vector<int> M(44, 0);

static inline int fibonacci(int n) {
  if (n == 0 || n == 1) {
    return 1;
  } 

  if (M[n] != 0) {
    return M[n];
  } 
  M[n] = fibonacci(n - 2) + fibonacci(n - 1);
  return M[n];
}

int main() {
  int n;
  cin >> n;
  
  cout << fibonacci(n) << endl;
 
  return 0;
}



Measured memory_bytes: 3084
from collections import defaultdict

def dfs(i,j,dx,dy,kum):
    visited[i][j] = 1
    if grid[i][j]!="#" and visited[i][j]!=1:
        num[i][j]=max(num[i][j],dfs(i+dx,j+dy,dx,dy,kum+1))
    num[i][j] = max(num[i][j],kum)
    return kum
def main():
    h,w = map(int, input().split())
    grid = []
    for i in range(h):
        s = list(input().rstrip())
        grid.append(s)
    l = [[0]*w for _ in range(h)]
    r = [[0]*w for _ in range(h)]
    d = [[0]*w for _ in range(h)]
    u = [[0]*w for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if grid[i][j]!="#":
                if j==0:
                    l[i][j]=1
                else:
                    l[i][j]=l[i][j-1]+1
            if grid[i][j]=="#":
                l[i][j]=0
            if grid[i][j]!="#":
                if i==0:
                    d[i][j]=1
                else:
                    d[i][j]=d[i-1][j]+1
            if grid[i][j]=="#":
                d[i][j]=0
    for i in range(h):
        for j in range(w-1,-1,-1):
            if grid[i][j]!="#":
                if j==w-1:
                    r[i][j]=1
                else:
                    r[i][j]=r[i][j+1]+1
            if grid[i][j]=="#":
                r[i][j]=0

    for i in range(h-1,-1,-1):
        for j in range(w):
            if grid[i][j]!="#":
                if i==h-1:
                    u[i][j]=1
                else:
                    u[i][j]=u[i+1][j]+1
            if grid[i][j]=="#":
                u[i][j]=0
    tmp = 0

    for i in range(h):
        for j in range(w):
            tmp = max(tmp, l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)



    print(tmp)

if __name__ == '__main__':
    main()


Measured memory_bytes: 308744
import java.util.Scanner;
import java.util.ArrayList;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		int[][] map = new int[h][w];
		ArrayList<String> list=new ArrayList<>();
		int sum=0;
		for(int i = 0; i<h; i++){
			for(int j = 0; j<w; j++){
				map[i][j]=sc.nextInt();
			}
		}
		boolean jud=false;
		for(int i = 0; i<h; i++){
			if(i%2==0){
				for(int j = 0; j<w; j++){
					if(jud){
						if(j==0){
							list.add(i+" "+(j+1)+" "+(i+1)+" "+(j+1));
							sum++;
						}else{
							list.add((i+1)+" "+j+" "+(i+1)+" "+(j+1));
							sum++;
						}
					}
					if(map[i][j]%2==1){
						jud=!jud;
					}
				}
			}else{
				for(int j = w-1; j>=0; j--){
					if(jud){
						if(j==w-1){
							list.add(i+" "+(j+1)+" "+(i+1)+" "+(j+1));
							sum++;
						}else{
							list.add((i+1)+" "+(j+2)+" "+(i+1)+" "+(j+1));
							sum++;
						}
					}
					if(map[i][j]%2==1){
						jud=!jud;
					}
				}
			}
		}
		System.out.println(sum);
		for(String i:list){
			System.out.println(i);
		}
	}
}

Measured memory_bytes: 102416
n,m = map(int,input().split())
high = list(map(int,input().split()))
num = []
for i in range(m):
  mountain = list(map(int,input().split()))
  if high[mountain[0] - 1] < high[mountain[1] - 1]:
    num.append(mountain[0])
  elif high[mountain[0] - 1] == high[mountain[1] - 1]:
    num.append(mountain[0])
    num.append(mountain[1])
  else:
    num.append(mountain[1])
ans = [0]*n
for i in num:
  ans[i -1] = 1
cnt = 0
for i in ans:
  if i == 0:
    cnt += 1
print(cnt)

Measured memory_bytes: 20004
import java.util.*;

public class Main{
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String str = sc.next();
            String[] str2 = str.split("");
            if(str2[0].equals(str2[2])){
              System.out.println("Yes");
            } else {
              System.out.println("No");
            }
      }
}

Measured memory_bytes: 21716
n=int(input())
a=list(map(int,input().split()))
odd=0
even=0
ev=0 #4の倍数
for i in a:
    if i%4==0:
        ev+=1
    elif i%2==0:
        even+=1
    else:
        odd+=1
even%=2
odd+=even
if odd>ev+1:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 14252
#include <iostream>
#include <algorithm>
#include <vector> //動的配列
#include <string>
#include <list> //双方向リスト
#include <map> //連想配列
#include <set> //集合
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <bitset>
#include <numeric>
#include <tuple>




typedef long long ll;


using namespace std;

typedef pair<int, int> P;
#define FOR(i,a,b) for(int i=(int)(a) ; i < (int) (b) ; ++i )
#define rep(i,n) FOR(i,0,n)
#define sz(x) int(x.size())


template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

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

//小さい順から取り出すヒープ
//priority_queue<ll, vector<ll>, greater<ll> > pque1;

int gcd(int x,int y){
    if (y==0) return x;
    else return gcd(y,x%y);
}

int main(){
    int a,b;
  	cin>>a>>b;
  	a--;b--;
  	int ans=a*b;
    
    cout<<ans;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s,ans;
	cin >> s;
	int a=s.size();
	for(int i=0;i<a;i++){
		if(i%2==0){
			ans+=s[i];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
#include<iostream>
using namespace std;
long long a[200001],in[200001];
bool f[200001];
int main(){
  int n,k;
  cin>>n>>k;
  for(int i=0;i<n;i++){
    cin>>in[i];
  }

  for(int i=k;i<n;i++){
    if(in[i]>in[i-k]){
      cout<<"Yes"<<endl;
    }else{
      cout<<"No"<<endl;
    }

  }

  return 0;
}

Measured memory_bytes: 5232
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;
typedef long long ll;
int n;

int main(){
	cin >> n;
	vector<ll> a(n);
	rep(i, 0, n){
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	ll s = 1;
	if(a[0] != 1) {
		cout << 1 << endl;
		return 0;
	}
	rep(i, 1, n){
		//cout << a[i] << " "<< s << endl;
		if(a[i] > s + 1){
			cout << s + 1 << endl;
			return 0;
		}
		s+=a[i];
	}
	cout << s+1 << endl;
}

Measured memory_bytes: 1300