akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
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; }


int main() {
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> a(n);
    ll r = 1, l = 0;
    ll res, cnt;
    bool flag = true;
    for (ll i=1; i<(n); i++){
        if (s[i]=='R' && flag) r++;
        if (s[i]=='L'){
            if (flag) res = i;
            l++;
            flag = false;
        }
        if ((s[i]=='R' && !(flag)) || i==n-1){
            cnt = r + l;
            a[res-1] = cnt/2 + (r%2==1 && cnt%2==1);
            a[res] = cnt/2 + (l%2==1 && cnt%2==1);
            r = 1;
            l = 0;
            flag = true;
        }
    }
    rep1(i, n){
        if (i<n) cout << a[i] << " ";
        else cout << a[i] << endl;
    }
}

Measured memory_bytes: 4296
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cassert>
#include<cstdlib>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<bitset>
using namespace std;
#define pb push_back
#define x0 fuckcjb
#define x1 fuckshb
#define y0 fucksub
#define y1 fuckjtjl
int c[4010][4010],k,n,x,y,ans;
char ch;
inline int lowbit(int x){return x&(-x);}
void modify(int x,int y)
{
	c[x][y]++;
}
int get(int x,int y)
{
	return c[x][y];
}
int get_sum(int x1,int y1,int x2,int y2)
{
	return get(x2,y2)+get(x1-1,y1-1)-get(x1-1,y2)-get(x2,y1-1);
}
int query(int x,int y)
{
	return get_sum(x,y,x+k-1,y+k-1)+get_sum(x+k,y+k,x+2*k-1,y+2*k-1);
}
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d %c",&x,&y,&ch);
		if(ch=='B')
		{
			y-=k;
		}
		x=(x%(2*k)+2*k)%(2*k);
		y=(y%(2*k)+2*k)%(2*k);
		modify(x+1,y+1);
		modify(x+1+2*k,y+1);
		modify(x+1,y+1+2*k);
		modify(x+1+2*k,y+1+2*k);
	}
	for(int i=1;i<=4*k;i++)
	{
		for(int j=1;j<=4*k;j++)
		{
			c[i][j]+=c[i-1][j]+c[i][j-1]-c[i-1][j-1];
		}
	}
	for(int i=1;i<=2*k;i++)
	{
		for(int j=1;j<=2*k;j++)
		{
			ans=max(ans,query(i,j));
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

const ll INF = 1LL << 60;

int main(){
  char x,y; cin >> x >> y;
  if( x < y){ cout << "<" << endl;}
  else if( x == y){ cout << "=" << endl;}
  else{ cout << ">" << endl;}
  return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll int
 #define watch(x) cerr<<(#x)<<" is "<<x<<nl;
#define f(i,a,b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a; i>=b; i--)
#define mp make_pair
#define ff first 
#define ss second
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mem(v,a) memset((v),a,sizeof(v));
#define mll map<ll,ll>
#define vll vector<ll>
#define nl endl

void solve(){
string s;
cin>>s;
if(s=="ABC") cout<<"ARC";
else cout<<"ABC";
}

signed main(){  
 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t; 
t=1;
//~ cin>>t; 
for(int _=0;_<t;_++){
      solve();
// cout<<"Case # "<<t<<;
}
return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n,k;
    cin>>n>>k;

    ll ans=0;

    REP(i,k+1,n+1){
        ll m = i-k;
        ll x = n%i;

        ll base = (n)/i * m;
        ll bonus = max(0LL, (x-k+1));

        ans += base;
        ans += bonus;

    }
    if(k==0)ans -= n;

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


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

set<string> bdd;

void construct(string s){
  if(bdd.count(s))return;
  if(s.size() == 1)return;

  int n = s.size();
  string a = s.substr(0,n/2), b = s.substr(n/2);
  if(a == b){
    construct(a);
  }else{
    bdd.insert(s);
    construct(a); construct(b);
  } 
}

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

  construct(s);

  cout << bdd.size() << endl;
}

Measured memory_bytes: 1244
#include <iostream>
#include <algorithm>
#include <set>

using namespace std;

int main(){
    int N;
    cin >> N;
    pair<int, int> red[N], blue[N];
    for(int i=0; i<N; i++){
        int a, b;
        cin >> a >> b;
        red[i] = {b, a};
    }
    for(int i=0; i<N; i++){
        int c, d;
        cin >> c >> d;
        blue[i] = {c, d};
    }
    sort(red, red + N, greater<>() ); sort(blue, blue + N);
    bool r_u[N], b_u[N]; fill(r_u, r_u + N, true); fill(b_u, b_u + N, true);
    int ans = 0;
    for(int j=0; j<N; j++){
        for(int i=0; i<N; i++){
            if(r_u[i] && b_u[j] && blue[j].first > red[i].second && blue[j].second > red[i].first){
                r_u[i] = false;
                b_u[j] = false;
                ans ++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
	int n;
	pair <int, int> a[100001];
	
	cin>>n;
	for(int i=0;i<n;i++){
		int tmp; cin>>tmp;
		a[i]=make_pair(tmp,i+1);
	}
	sort(a,a+n);
	
	for(int i=0;i<n;i++) cout<<a[i].second<<' ';
	return 0;
}

Measured memory_bytes: 1536
T = list(str(input()))
length = len(T)
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]


for i in range(length):
    if T[i] == "?":
        T[i] = "D"

T=''.join(T)
print(T)


Measured memory_bytes: 10620
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
ll gcd(ll a,ll b){if(a>b)swap(a,b);for(;a>0;b%=a,swap(a,b));return b;}
int modpow(ll a,ll n,int m){if(a==0)return a;ll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(int)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
vpll v;
ll n, a;
ll ans[100001];

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 1, n+1){
    cin >> a;
    v.pb(mp(a, -i));
  }
  v.pb(mp(0, 0));
  sort(rng(v));
  ll idx = linf;
  FORR(i, n, 1){
    mins(idx, -v[i].se);
    ans[idx] += (v[i].fi - v[i-1].fi) * (n+1-i);
  }
  FOR(i, 1, n+1) cout << ans[i] << "\n";
  return 0;
}

Measured memory_bytes: 3568
n = int(input())
a = [int(v) for v in input().split()]
a.sort()
a.append(-1)
d = 1
for i in range(0, n):
    if(a[i] == a[i + 1]):
        d = 0
        print("NO")
        break
if(d == 1):
    print("YES")


Measured memory_bytes: 31052
// AOJ 2444: Substring
// 2017.10.10 bal4u@uu

#include <stdio.h>
#include <ctype.h>

#define HASHSIZ 600011LL
unsigned long long hash[HASHSIZ+3], *hashend = hash + HASHSIZ;

#define M	1000000007
#define MAX 300000
char s[MAX+3];
unsigned long long hv[MAX+3], bv[MAX+3];

int insert(unsigned long long n)
{
	unsigned long long *p = hash + n % HASHSIZ;
	while (*p) {
		if (*p == n) return 0;
		if (++p == hashend) p = hash;
	}
	*p = n;
	return 1;
}

int main()
{
	int n, m, i, l, r, ans;
	char buf[10];

	scanf("%d%d%s", &n, &m, s);
	bv[0] = 1; for (i = 1; i <= n; i++) bv[i] = bv[i-1]*M;
	ans = 0, l = 0, r = 1, hv[0] = 0, hv[1] = s[0];
	while (m-- > 0) {
		scanf("%s", buf);
		if (*buf == 'R') {
			if (*(buf+1) == '+') {
				if (hv[++r] == 0) hv[r] = hv[r-1]*M + s[r-1];
			} else r--;
		} else {
			if (*(buf+1) == '+') l++; else l--;
		}
		ans += insert(hv[r] - hv[l] * bv[r-l]);
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 11328
#include<bits/stdc++.h>
using namespace std;
#define Maxn 100010
int n, m, a[Maxn], b[Maxn], Mod;
long long x[Maxn], C[Maxn];
vector<pair<int, int> >G[Maxn];

inline long long pow(long long pow_a, int pow_x)
{
    long long tmp=1ll;
    for (; pow_x; pow_x>>=1)
    {
        if (pow_x&1) tmp=(tmp*pow_a)%Mod;
        pow_a=(pow_a*pow_a)%Mod;
    }
    return tmp;
}


inline void Insert(int u, int v, long long w)
{
    G[u].push_back(make_pair(v, w));
    G[v].push_back(make_pair(u, pow(w, Mod-2)));
}

inline bool dfs(int u, long long cost)
{
    if (C[u])
    {
        if (C[u]==cost) return true;
        else return false;
    }
    else C[u]=cost;
    
    for (auto v:G[u])
    {
        if (!dfs(v.first, (cost*v.second)%Mod)) return false;
    }
    return true;
}

inline void Go()
{
    for (int i=1; i<=n; i++) G[i].clear();
    for (int i=1; i<=m; i++) Insert(a[i], b[i], x[i]);
    memset(C, 0, sizeof(C));
    for (int i=1; i<=n; i++)
        {
            if (!C[i])
            {
                if (!dfs(i, 1ll))
                {
                    puts("No");
                    exit(0);
                }
            }
        }
}

int main()
{
    scanf("%d%d", &n, &m);
    for (int i=1; i<=m; i++)
    {
        scanf("%d%d%lld", &a[i], &b[i], &x[i]);
    }
    Mod = 1000000007;
    Go();
    Mod = 1000000009;
    Go();
    Mod = 1000000033;
    Go();
    puts("Yes");
}



Measured memory_bytes: 13772
#include <bits/stdc++.h>
    using namespace std;
    #define uint unsigned int
    #define ull  unsigned long long
    typedef string str;
    typedef long long ll;
    typedef pair<int, int> pii;
    typedef vector<int> vi;
    typedef vector<bool> vb;
    #define pb push_back
    #define fi first
    #define se second
    #define ins insert
    #define all(x) (x).begin(), (x).end()
    #define fr(i, n) for(int i = 0; i < n; i++)
    #define rall(x) (x).rbegin(), (x).rend()
    #define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
    const int INF = 1e9 + 5;


    void solve(){
        int a, b;
        cin >> a >> b;
    
        cout << (ceil((double)(b-1)/(a-1)));
        
    }


    int main(){
        speed();
        int t = 1;
        //cin >> t;
        while(t--)solve();
    }

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int n,ans=0; cin>>n;
    vector<int> cnt(100000,0);
    rep(i,n){
        int a; cin>>a;
        cnt[a]++;
    }
    ans=max(cnt[0]+cnt[1],cnt[99999]+cnt[99998]);
    for(int i=1;i<=99998;i++){
        ans=max(ans,cnt[i-1]+cnt[i]+cnt[i+1]);
    }
    cout<<ans<<endl;
}


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

using ll = long long;
#define REP(i, n) for(int (i)=0; (i)< (n); ++i)
#define REPR(i, n) for(int (i)=(n); (i)>=0; --i)
#define FOR(i, n, m) for(int (i)=(n); (i)<(m); ++i)
//constexpr int INF = 1e9;
constexpr ll INF = 1LL << 61;
constexpr int mod = 1e9+7;

vector<vector<int>> g;
vector<bool> gengo, homon;
void dfs(int v){
  for (auto nv : g[v]){
    if(homon[nv]) continue;
    homon[nv] = true;
    dfs(nv);
  }
}
int main(){
  int N, M;
  cin >> N >> M;
  g.resize(M), gengo.resize(M, false), homon.resize(M, false);
  REP(j, N){
    int K;
    cin >> K;
    vector<int> L(K); 
    REP(i, K){
      cin >> L[i];
      L[i]--;
      gengo[L[i]] = true;
    }
    REP(i, K-1){
      int a=L[i], b=L[i+1];
      g[a].push_back(b);
      g[b].push_back(a);
    }
  }
  REP(i, M){
    if(gengo[i]){
      homon[i] = true;
      dfs(i);
      break;
    }
  }
  bool ans = true;
  REP(i, M){
    if(!homon[i] && gengo[i]){
      ans = false;
    }
  }
  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}


Measured memory_bytes: 5632
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    long long n, div = 5;
    cin>> n;
    if(n%2){
        cout << "0\n";
    }else{
        n /= 2;
        long long ans = 0;
        while(n/div > 0){
            ans += n/div;
            div *= 5;
        }
        cout << ans << "\n";
    }

}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	o := Scan()
	e := Scan()
	for i := 0; i < len(e); i++ {
		fmt.Print(string(o[i]))
		fmt.Print(string(e[i]))
	}
	if len(o) > len(e) {
		fmt.Print(string(o[len(o)-1]))
	}
	fmt.Println("")
}


Measured memory_bytes: 1772
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
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; }
//#define int long long

void solve() {
	int n; string s; cin >> n >> s;
    int ans = 0;
    for(int k = 0; k <= 999; ++k) {
        string t = "000";
        if(k >= 100) {
            t[0] = '0' + (k/100);
        }
        if(k >= 10) {
            t[1] = '0' + ((k%100)/10);
        }
        t[2] = '0' + (k%10);
        
        bool c0 = false, c1 = false, c2 = false;
        rep(i, n) {
            if(!c0) {
                if(s[i] == t[0]) {
                    c0 = true;
                }
            } else if(!c1) {
                if(s[i] == t[1]) {
                    c1 = true;
                }
            } else if(!c2) {
                if(s[i] == t[2]) {
                    c2 = true;
                    ans ++;
                    break;
                }
            }
        }
    }
    cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

using namespace std;

int N;
int price[10];
int ans = 0;

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

	for (int i = 0; i < N; i++)
	{
		scanf("%d", &price[i]);
	}

	int maxPrice = 0;
	for (int i = 0; i < N; i++)
	{
		if (maxPrice < price[i]) maxPrice = price[i];
	}

	for (int i = 0; i < N; i++)
	{
		ans += price[i];
	}

	ans = ans - maxPrice / 2;

	printf("%d", ans);

	return 0;
}

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

using ll = long long;

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

int A, B;

int main() {
  cin.tie(0);cout.tie(0);
  ios_base::sync_with_stdio(false);
  
  cin>>A>>B;
  
  if(A%2 && B%2)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}


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

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
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 = (1 << 30) - 1;
const ll INFL = 1LL << 60;
const ll mod = 998244353;



int main() {

	int a = 0;
	int w = 0;
	int r = 0;
	int t = 0;

	int n;
	cin >> n;
	REP(i, n) {
		string s;
		cin >> s;
		if (s[0] == 'A')a++;
		else if (s[0] == 'T')t++;
		else if (s[0] == 'W')w++;
		else r++;
	}

	cout << "AC x " << a << endl;
	cout << "WA x " << w << endl;
	cout << "TLE x " << t << endl;
	cout << "RE x " << r << endl;


}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
int cnt[500005];
int main() {
  IOS;
  int n;
  cin >> n;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      for (int k = 1; k <= 100; k++) {
        cnt[i * i + j * j + k * k + i * j + j * k + i * k]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << cnt[i] << endl;
  }
}

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

int main() {
  long long a,b,c;

  cin >> a >> b >> c;
  long long l_term = 4 * a * b;
  long long r_term = (c - a - b) * (c - a - b);
  if(c-a-b<0){
    cout << "No";
    return 0;
  }

  if(l_term < r_term){
    cout << "Yes";
  }else{
  cout << "No";
  }


}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int n;
  cin >> n;
  vector<long long int> capacity(5);
  for(int i=0; i<5; i++){
    cin >> capacity[i];
  }
  sort(capacity.begin(),capacity.end());
  if (n%capacity[0]==0){
    n -= capacity[0];
  }
  cout << (n / capacity[0]) + 5;
}


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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int a,b;
    cin>>a>>b;

    int ans = max(0,a-(b*2));

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

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


int main()
{
	ll a,b,ans=1;
	cin>>a>>b;
	for(int i=1;i<a;i++)
	{
		ans*=(b-1);
	}
	ans*=b;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskC {
        public void solve(int testNumber, MyReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong();
            long[] f = new long[100005];
            for (int i = 0; i < n; i++) {
                long a = in.nextLong();
                long b = in.nextLong();
                f[(int) a] += b;
            }

            long rem = k;
            for (int i = 1; i < 100005; i++) {
                if (f[i] == 0) continue;

                if (rem <= f[i]) {
                    out.println(i);
                    return;
                } else {
                    rem -= f[i];
                }
            }
        }

    }

    static class MyReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public MyReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 44812
#include <iostream>
#include <iomanip>
#include <math.h>
#include <complex>

using namespace std;

int A, B, H, M;

int main() {
  cin >> A >> B >> H >> M;

  double x = ((double)(H*60 + M) / 2);
  double y = ((double)(M * 6));

  // cout << x << endl << y << endl;

  double theta = M_PI / 180 * x;
  double phi = M_PI / 180 * y;

  complex<double> P(A * sin(theta), A * cos(theta)), Q(B * sin(phi), B * cos(phi));

  cout << setprecision(20) << abs(P-Q) << endl;
}

Measured memory_bytes: 4104
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
    char str[105];
    scanf("%s",str);
    int len = strlen(str);
    for(int i = 0;i < len;i++){
        str[i] = 'x';
    }
    printf("%s\n",str);
    return(0);
}


Measured memory_bytes: 256
N = input()

def f(x):
  p = 1
  i = 1
  cnt = 0
  while p > 0:
    p = x // (5**i) // 2
    cnt += p
    i += 1
  return cnt

if int(N[-1])%2 == 1:
  print(0)
else:
  print(f(int(N)))

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

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

  int h;
  int cnt = 0;
  int max = 0;
  for (int i = 0; i < n; i++) {
    cin >> h;
    if (max <= h) {
      max = h;
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string>
#include<cctype>
#include<cmath> 
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
 
int main(){
  int N,M,ans;
  cin >> N >> M;
  ans=(N-1)*(M-1);

  cout << ans << endl;


  return 0;
}



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


def dfs(node):
    if sum([1 for v in visited if v]) == N:
        return 1
    ret = 0
    for n in graph[node]:
        if visited[n]:
            continue
        visited[n] = True
        ret += dfs(n)
        visited[n] = False
    return ret


graph = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)

visited = [False for _ in range(N)]
visited[0] = True
print(dfs(0))


Measured memory_bytes: 9124
N = int(input())
S = input().strip()
while True:
    lv = 0
    lmin = len(S)
    for i in range(len(S)):
        if S[i]=="(":
            lv += 1
        else:
            lv -= 1
        lmin = min(lmin,lv)
    if lmin<0:
        S = "("*(-lmin)+S
    else:break
lv = 0
for i in range(len(S)):
    if S[i]=="(":
        lv += 1
    else:
        lv -= 1

if lv>0:
    S = S+")"*lv
print(S)

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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

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

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

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

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  ll ans=LINF;
  reps(i,1000005){
    if(n%i==0){
      chmin(ans,i+n/i);
    }
  }
  cout<<ans-2<<endl;
}

Measured memory_bytes: 256
ken_num, city_num = map(int,input().split())
city_list = [None for _ in range(city_num)]
ken_list = [1 for _ in range(ken_num+1)]
id_list = [None for _ in range(city_num)]
for index in range(city_num):
    city_list[index] = list(map(int,input().split()))
    city_list[index].append(index)
city_list = sorted(city_list, key=lambda x: x[1])

for index,city in enumerate(city_list):
    id_list[city[2]] = str(city[0]).zfill(6) + str(ken_list[city[0]]).zfill(6)
    ken_list[city[0]] += 1

for ans in id_list:
    print(ans)

Measured memory_bytes: 41852
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<math.h>
using namespace std;
using ll = int64_t;
using Graph = vector<vector<int> >;
const ll M = 1000000007;

int main(){
    string s;
    cin >> s;
    vector<int> c(s.size(),0);

    int i=0;
    while(i<s.size()){
        if(s.at(i)=='R'){
            int f=1;
            while(s.at(i+f)!='L'){
                f++;
            }
            if(f%2==0) {
                c.at(i+f)+=f/2;
                c.at(i+f-1)+=f/2;
            }else{
                c.at(i+f-1)+=f/2+1;
                c.at(i+f)+=f/2;
            }
            i+=f;
        }else{
            int f=1;
            if(i<s.size()){
                while(i+f<s.size() && s.at(i+f)!='R'){
                    f++;
                }
            }
            if(f%2==0){
                c.at(i)+=f/2;
                c.at(i-1)+=f/2;
            }else{
                c.at(i)+=f/2+1;
                c.at(i-1)+=f/2;
            }
            i+=f;
        }

        //for(int i=0;i<s.size();i++) cout << c.at(i) << ' ';
        //cout << endl;
    }

    for(int i=0;i<s.size();i++) cout << c.at(i) << ' ';
    cout << endl;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
//#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl


signed main(void){
    string N;
    cin >> N;
    int Ans=0;
    int kuri=0;
    RREP(i,N.size()){
        int d = N[i]-'0';
        d+=kuri;kuri=0;
        if(d==0)continue;
        if(d==10){
            kuri=1;
            continue;
        }
        if(d<=4 || (d==5 && i!=0 && N[i-1]<'5') || (d==5 && i==0)){
            Ans+=d;
        }else{
            Ans+=10-d;
            kuri=1;
        }
    }
    Ans+=kuri;
    cout << Ans << endl;
    
    return 0;
}



Measured memory_bytes: 1412
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
int ans=0,sum=0;
int a[5];
set<int> si;
void dfs(int b){
  if(si.count(b)) return;
  si.insert(b);
  for(int i=0;i<n;i++){
    int tmp=0;
    for(int j=0;j<(1LL<<n);j++){
      if(((j>>i)&1LL)&&((b>>j)&1LL)) tmp++;
    }
    if(tmp>a[i]) return;
    for(int j=i+1LL;j<n;j++){
      tmp=0;
      for(int k=0;k<(1LL<<n);k++){
	if(((k>>i)&1LL)&&((k>>j)&1LL)&&((b>>k)&1LL)) tmp++;
      }
      if(tmp>1LL) return;
    }
  }
  int tmp=0;
  for(int i=0;i<(1LL<<n);i++){
    if((b>>i)&1) tmp+=__builtin_popcountll(i)-1LL;
  }
  ans=min(ans,sum-tmp);
  
  for(int i=0;i<(1LL<<n);i++){
    if((b>>i)&1) continue;
    if(__builtin_popcountll(i)<=1) continue;
    dfs(b+(1LL<<i));
  }
  
}
signed main(){
  cin>>n;
  for(int i=0;i<n;i++) cin>>a[i];
  for(int i=0;i<n;i++) sum+=a[i];
  ans=sum;
  dfs(0);
  cout<<ans<<endl;
  return 0;
}

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

const ll MOD = 1e9 + 7;
const int S = 2048;

ll modinv(ll a, ll mod) {
  ll b = mod, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= mod;
  if (u < 0) u += mod;
  return u;
}

vector<ll> mf(S, -1);
ll modfact(ll n, ll mod) {
  if (mf[n] != -1) return mf[n];
  if (n == 0) return mf[0] = 1;
  return mf[n] = n * modfact(n-1, mod) % mod;
}

vector<ll> mif(S, -1);
ll modinvfact(ll n, ll mod) {
  if (mif[n] != -1) return mif[n];
  if (n == 0) return mif[0] = 1;
  return mif[n] = modinv(n, mod) * modinvfact(n-1, mod) % mod; 
}

ll modcomb(ll n, ll k, ll mod) {
  return modfact(n, mod) * modinvfact(k, mod) % mod * modinvfact(n-k, mod) % mod;
}

int main() {
  int s;
  cin >> s;
  ll ans = 0;
  for (int k = 1; k * 3 <= s; k++) {
    ans += modcomb(s-2*k-1, k-1, MOD);
    ans %= MOD;
  }
  if (ans < 0) ans += MOD;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3680
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
using namespace std;
int N;
long long int A[100005];

long long int MOD = 1000000007;

long long int mcd(long long int a, long long int b) {

	if (a < b) { return mcd(b, a); }

	if (b == 0) { return a; }

	return mcd(b, a%b);
}

long long int lcm(long long int a, long long int b) {
	long long int tmp = a/mcd(a, b);

	return tmp*b;
}

long long int POW(long long int a, long long int k) {
	if (k == 0) { return 1; }
	else if (k == 1) { return a; }

	if (k % 2 == 1) { return (POW(a, k - 1)*a) % MOD; }

	long long int tmp = POW(a, k / 2);

	return (tmp*tmp) % MOD;
}

long long int INV(long long int a) {
	return POW(a, MOD - 2);
}


set<int> S;

int check[1000005];
vector<int> P;

long long int cnt[1000006];

int main(void) {

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

	for (int i = 2; i <= 1000000; i++) {
		if (check[i] == 0) {
			for (int j = 2; i*j <= 1000000; j++) {
				check[i*j] = 1;
			//	cout << j << endl;
		}
		}
	}

	for (int i = 2; i <= 1000000; i++) {
		if (check[i] == 0) { P.push_back(i); }
	}

	for (int i = 1; i <= N; i++) {
		long long int tmp = A[i];
		for (int j = 0; P[j] * P[j] <= A[i]; j++) {
			long long int num = 0;
			while (tmp%P[j] == 0) { tmp /= P[j]; num++; }
			cnt[P[j]] = max(cnt[P[j]], num);
		}
		if (tmp>1) { cnt[tmp]=max(cnt[tmp],1LL); }
	}

	long long int X = 1;

	for (int i = 2; i <= 1000000; i++) {
		if (cnt[i] > 0) { X *= POW((long long int)i,(long long int) cnt[i]); X %= MOD; }
	}

	//cout << X << endl;

	long long int ans = 0;

	for (int i = 1; i <=N;i++){
	
		ans += (X*INV(A[i]))%MOD;
		ans %= MOD;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 12792
import itertools
import numpy as np
n,m,q=map(int, input().split())  
a=[list(map(int, input().split())) for i in range(m)]
b=[list(map(int, input().split())) for i in range(q)]

x=[[0]*(501) for i in range(501)]
x=np.array(x)
for i in range(m):
    x[a[i][0],a[i][1]]+=1



for i in range(501):
    x[i] = list(itertools.accumulate(x[i]))
  
for i in range(501):
    x[:,i] = list(itertools.accumulate(x[:,i]))



for i in range(q):
    print(x[b[i][1],b[i][1]]-x[b[i][1],b[i][0]-1]-x[b[i][0]-1,b[i][1]]+x[b[i][0]-1,b[i][0]-1])



 







Measured memory_bytes: 80012
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<map>
using namespace std;

int main() {
    int N; cin >> N;
    map<int, int> A;
    for (int i = 1; i <= N; i++) {
        int a; cin >> a; a--;
        A[a] = i;
    }
    for (int i = 0; i < N; i++) {
        cout << A[i];
        if (i < N - 1) cout << " ";
    }
    cout << endl;
}


Measured memory_bytes: 5504
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }

map<long long, int> prime_factorize(long long n) {
    map<long long, int> res;
    for (long long p = 2; p * p <= n; ++p) {
        while (n % p == 0) { ++res[p]; n /= p; }
    }
    if (n != 1) res[n] = 1;
    return res;
}

int main() {
    long long a, b; cin >> a >> b;
    cout << prime_factorize(gcd(a, b)).size() + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
 for(;;){
  string s;
   int count = 0 ;
   int count2 = 0 ;
   cin >> s;
  if (cin.eof()) break;

   for (int i = 0; i < s.size()-2; i++) {
       if (s[i] == 'J' && s[i+1] == 'O' && s[i+2] == 'I') {
           count++;
         }
       if (s[i] == 'I' && s[i+1] == 'O' && s[i+2] == 'I') {
           count2++;
         }
       }
   cout << count<<endl;
   cout << count2<<endl;
}
}



Measured memory_bytes: 3184
N = int(input())
nums = list(map(int, input().split()))
ans = [0] * len(nums)
count = 0
for i in range(len(nums)-1):
    if nums[i] >= nums[i+1]:
        count += 1
        ans[i] = count
    else:
        ans[i] = count
        count = 0
print(max(ans))

Measured memory_bytes: 14252
import itertools
                                                                                                                           
n = int(input())
index = [0, 1, 2, 3, 4]
count = [0, 0, 0, 0, 0]
result = 0
for i in range(n):
  x = input()[0]
  if x == 'M':
    count[0] += 1
  elif x == 'A':
    count[1] += 1
  elif x == 'R':
    count[2] += 1
  elif x == 'C':
    count[3] += 1
  elif x == 'H':
    count[4] += 1
  else:
    pass
        
for cs in list(itertools.combinations(index, 3)):
  result += count[cs[0]]*count[cs[1]]*count[cs[2]]

print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define Sort(x) sort((x).begin(), (x).end())
#define Reverse(x) reverse((x).begin(), (x).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for (int i = m; i < n; i++)
#define INF INT_MAX
#define fcout cout << fixed << setprecision(15) // 15桁まで表示
#define en '\n'
using str = string;
using ll = long long;
using ull = unsigned long long;
using ui = unsigned int;
using puu = pair<ui, ui>;
using P = pair<int, int>;
using vi = vector<int>;
int gcd(int a, int b) {
  return b ? gcd(b, a % b) : a;
};
int lcm(int a, int b) {
  return a / gcd(a, b) * b;
};
int floor(int a, int b) {
  return (a + b - 1) / b;
};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
};
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
};
const ll mod = 1000000007;
const double PI = acos(-1.0);
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << setiosflags(ios::fixed);
  int n, a, b, c, d;
  str s;
  s += "###";
  cin >> n >> a >> b >> c >> d >> s;
  a--;
  b--;
  c--;
  d--;
  if (c < d) {
    while (s[b + 1] == '.' or s[b + 2] == '.') {
      if (s[b + 1] == '.')
        b++;
      else
        b += 2;
      if (b == d)
        break;
    }
    if (b != d) {
      cout << "No" << en;
      return 0;
    }
    while (s[a + 1] == '.' or s[a + 2] == '.') {
      if (s[a + 1] == '.')
        a++;
      else
        a += 2;
      if (a == c)
        break;
    }
    if (a != c) {
      cout << "No" << en;
    } else {
      cout << "Yes" << en;
    }
  } else {
    while (s[b + 1] == '.' or s[b + 2] == '.') {
      if (s[b - 1] == '.' and s[b + 1] == '.' and b != c or b == d)
        break;
      if (s[b + 1] == '.')
        b++;
      else
        b += 2;

    }

    if (b > d) {
      cout << "No" << en;
      return 0;
    }
    s[b] = '#';
    while (s[a + 1] == '.' or s[a + 2] == '.') {
      if (s[a + 1] == '.')
        a++;
      else
        a += 2;
      if (a == c)
        break;
    }
    if (a != c) {
      cout << "No" << en;
      return 0;
    }
    while (s[b + 1] == '.' or s[b + 2] == '.') {
      if (b == d)
        break;
      if (s[b + 1] == '.')
        b++;
      else
        b += 2;

    }
    if (b != d) {
      cout << "No" << en;
    } else
      cout << "Yes" << en;
  }
}

Measured memory_bytes: 3760
#include <stdio.h>

int main(){
  int n,i,j,a[101][101],x,y,z;

  for(i=0;i<101;i++){
    for(j=0;j<101;j++){
      a[i][j]=0;
    }
  }

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d%d",&x,&y);
    for(j=1;j<=y;j++){
      scanf("%d",&z);
      a[x][z]=1;
    }
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      printf("%d",a[i][j]);
      if(j!=n){
	printf(" ");
      }
    }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2132
package main

import (
        "fmt"
        "strconv"
)

func main() {
        var st string
        fmt.Scan(&st)

        sum := 0
        for _, i := range st {
                j := fmt.Sprintf("%c", i)
                k, _ := strconv.Atoi(j)
                sum += k
        }
        fmt.Println(sum)

}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
    int chara[26][50]={};
    int n,max=0;
    cin>>n;
    string ans;
    vector<string> str(n);

    for(int i=0;i<n;i++){
        cin>>ans;
        for(char ss: ans)++chara[ss-'a'][i];
    }

    for(int k=0;k<26;k++){
        int copype=*min_element(chara[k],chara[k]+n);

        for(int i=0;i<copype;i++){
                cout<<char(k+'a');
            }
    }

    cout<<endl;
    return 0;



}

Measured memory_bytes: 256
n=int(input())
S=[]
for i in range(1200):
    S.append(0)

for i in range(n):
    k=input().split()
    b=int(k[0])
    f=int(k[1])
    r=int(k[2])
    v=int(k[3]) 
    S[(b-1)*30+(f-1)*10+r-1]+=v
for i in range(4):
    for j in range(3):
        msg=""
        for t in range(10):
            msg+=" "+str(S[i*30+j*10+t])
        print(msg)
    if i<3:
        print("####################")



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

using namespace std;

int main()
{
    string a;
    cin >> a;
    int cnt=0;  
    for(int i=0;i<a.size();i++)
    {
        if(a[i]=='C')
            cnt=1;   
        if(a[i]=='F'&&cnt==1)
        {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <queue>
#include <algorithm>
#include <string.h>
#include <vector>
#define se second
#define fi first
using namespace std;
const int maxN = 1e5 + 9, MOD = 1e9 + 7;

typedef long long ll;
typedef pair<int, int> ii;

int main() {
  ios::sync_with_stdio(false);
  
  int n, k;
  cin >> n;

  for(int i = 0; i <= n; i += 4){
    if((n - i) % 7 == 0){
      cout << "Yes\n";return 0;
    }
  }
  cout << "No\n";
}

Measured memory_bytes: 256
#!/usr/bin/env python3

n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'
flg = True

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5 == 0:
            pass
        else:
            flg = False

if flg == False:
    ans = 'DENIED'

print(ans)


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

namespace ABC042_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var param = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
            var N = param[0];
            var dislike = Console.ReadLine().Split(' ').Select(str => str[0]).ToList();

            while (true)
            {
                var str = $"{N}";
                if (dislike.Any(c => str.IndexOf(c) != -1))
                {
                    N++;
                    continue;
                }
                Console.WriteLine(N);
                return;
            }
        }
    }
}


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

int main(){
  long long N,M; cin >> N >> M;
  long long result;
  long long div=1e9+7;
  if(abs(N-M)>1){
    result=0;
  }else if(abs(N-M)==1){
    //N!*M!
    result=1;
    for(long long i=1; i<max(N,M); i++){
      result*=i;
      result%=div;
      result*=i;
      result%=div;
    }
    result*=max(N,M);
    result%=div;
  }else{
    //N!*M!*2
    result=2;
    for(long long i=1; i<=N; i++){
      result*=i;
      result%=div;
      result*=i;
      result%=div;
    }
  }
  cout << result << endl;
}

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


def solve(S: int):
    S = '{:04}'.format(S)
    a = int(S[:2])
    b = int(S[2:])
    if 0<a and a<13 and 0<b and b<13:
        print('AMBIGUOUS')
    elif 0<a and a<13:
        print('MMYY')
    elif 0<b and b<13:
        print('YYMM')
    else:
        print('NA')
    return


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

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
from collections import Counter
n = int(input())
S = input()
Do = Counter(S)
Ans = 0
i = 0
if Do[S[0]] == 1:
    Ans = 3
    i += 1
    sig = 1
else:
    Ans = 6
    i += 2
    sig = 2
while not i >= n:
    if Do[S[i]] == 1:
        if sig == 1:
            Ans *= 2
        else:
            Ans *= 1
        sig = 1
        i +=1
    else:
        if sig == 1:
            Ans *=2
        else:
            Ans *=3
        sig = 2
        i += 2
    Ans = Ans%(10**9+7)
print(Ans)

Measured memory_bytes: 9440
n = int(input())
a = tuple(map(int, input().split()))
b = map(int, input().split())
c = tuple(map(int, input().split()))
s = sum(b)
for i in range(n-1):
  if a[i+1]-a[i] == 1:
    s += c[a[i]-1]
print(s)


Measured memory_bytes: 3060