akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define vec2(name,i,j) vector<vector<ll>> name(i,vector<ll>(j))
#define vec2f(name,i,j,k) vector<vector<ll>> name(i,vector<ll>(j,k))
#define vec3(name,i,j,k) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k)))
#define vec3f(name,i,j,k,l) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k,l)))
#define vec4(name,i,j,k,l) vector<vector<vector<vector<ll>>>> name(i,vector<vector<vector<ll>>>(j,vector<vector<ll>>(k,vector<ll>(l))))
#define vec4f(name,i,j,k,l,m) vector<vector<vector<vector<ll>>>> name(i,vector<vector<vector<ll>>>(j,vector<vector<ll>>(k,vector<ll>(l,m))))
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.141592653
#define INF 100000000000000 //14
//cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

int main(){
    ll n; cin >> n;
    ll ans = 0;
    FOR(i,1,n){
        ll x = n/i;
        ans+=((x+x*x)*i)/2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3600
import sys,math
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
 
s=input()

def check(s):
    j=len(s)-1
    i=0
    while i<j:
        
        if s[i]!=s[j]:
            return 0
        i+=1
        j-=1
    return 1

if len(s)%2==0:
    print("No")
else:
    if check(s)==0:
        print("No")
    else:
        n=len(s)
        s1=[s[i] for i in range(0,n//2)]
        s2=[s[i] for i in range(n//2+1,n)]
        if check(s1)==1:
            print("Yes")
        else:
            print("No")
            



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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define fastio          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);


int32_t main() {
    fastio
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    float R;
    cin >> R;
    float circum = 2.0000 *  3.1415926535 * R;
    if (circum == 0)
        cout << "0.000" << endl;
    else
        cout << circum;
    return 0;
}

Measured memory_bytes: 3796
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m; cin >> n >> m;
    if(n == 1){
        cout << m << '\n';
        return 0;
    }
    int ans = -1;
    for(int i = 1; i*i <= m; i++){
        if(m%i == 0){
            if((ll) i*n <= m){
                ans = max(ans, i);
            }
            if(i >= n){
                ans = max(ans, m/i);
            }
        }
    }
    assert(ans != -1);
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
x, y = map(int, input().split())
mod = 10**9 + 7
if (x + y) % 3:
    print(0)
    exit()
n = (x + y) // 3
a = (2 * y - x) // 3
b = (2 * x - y) // 3
if a < 0 or b < 0:
    print(0)
    exit()
if a == 0 or b == 0:
    print(1)
    exit()


def neko(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p * (n - i) % mod
        q = q * (i + 1) % mod
    return p * pow(q, mod - 2, mod) % mod


print(neko(n, a))


Measured memory_bytes: 3064
#include<cstdio>
using namespace std;
typedef long long ll;
const int N=220;
int i,j,k,m,nm,ch,ff,l,r;
ll n;
int a[N],b[N];
void R(ll &x) {
	x=0;ch=getchar();
	while (ch<'0' || '9'<ch) { if (ch=='-') ff=1;ch=getchar();}
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
	if (ff) x=-x;
}
int main() {
	R(n);nm=0;
	while (n>2) {
		if (n&1) a[++m]=1;
		else a[++m]=2;
		nm+=a[m];
		n=(n-a[m])>>1;
	}
	a[++m]=n;
	nm+=a[m];
	for (i=1;i<=nm;i++) b[i]=i;
	l=1;r=nm;
	j=nm+nm;
	for (i=1;i<=m;i++) {
		if (a[i]==1) b[j]=r--;
		else {
			b[j]=l++;
			b[j-1]=r--;
		}
		j-=a[i];
	}
	printf("%d\n",nm+nm);
	for (i=1;i<=nm+nm;i++) printf("%d ",b[i]);
	puts("");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef double db;
#define fi first
#define se second
#define pb push_back
#define vi vector<int>
#define SZ(x) (int)(x.size())
#define sci(x) scanf("%d",&(x))
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define syn ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
ll modpow(ll x,ll n,ll mod){ll res=1;for(;n;n>>=1,x=x*x%mod)if(n&1)res=res*x%mod;return res;}
const db eps=1e-8,PI=acos(-1.0);
const int N=1e5+10,M=1e6+10,INF=0x3f3f3f3f,mod=1e9+7;//998244353
int n,k;
ll ans,num[N];
int main(){
	sci(n),sci(k);
	rep(i,1,k){
		num[i]=modpow(k/i,n,mod);
	}
	per(i,k,1){
		for(int j=i+i;j<=k;j+=i){
			num[i]=(num[i]-num[j]+mod)%mod;
		}
		ans=(ans+1ll*num[i]*i%mod)%mod;
	}
	printf("%lld\n",ans);
    return 0;
}

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

#define ll             long long
#define LL             long long
#define pii            pair<int, int>
#define pll            pair<ll, ll>
#define pil            pair<int, ll>
#define pli            pair<ll, int>
#define vi             vector<int>
#define vl             vector<ll>
#define vii            vector<pii>
#define vll            vector<pll>
#define vil            vector<pil>
#define vli            vector<pli>
#define pb             push_back
#define ppb            pop_back
#define mp             make_pair
#define ff             first
#define ss             second
#define TN             typename
#define all(v)         v.begin(), v.end()
#define fill(a, b)     memset(a, b, sizeof a)
#define endl           '\n'

template <TN T> T gcd(T a, T b) {
    return !b ? a : gcd(b, a % b);
}

template <TN T> T lcm(T a, T b) {
    return a * (b / gcd(a, b));
}

template <TN T> T sqr(T a) {
    return a * a;
}

template <TN T> T cube(T a) {
    return a * a * a;
}

template <TN T> inline void smin(T &a, T b) {
    a = a < b ? a : b;
}

template <TN T> inline void smax(T &a, T b) {
    a = a > b ? a : b;
}

int in() {
    int n;
    scanf("%d", &n);
    return n;
}

ll Lin() {
    ll n;
    scanf("%lld", &n);
    return n;
}

double Din() {
    double n;
    scanf("%lf", &n);
    return n;
}

const ll inf = (ll)1e17;
const ll mod = (ll)1e9 + 7;
const int N = 1e6 + 5;

struct CHT_INC_MAX {
    vl m, b;

    bool bad(int f1, int f2, int f3) {
        return 1.0 * (b[f2] - b[f1]) * (m[f1] - m[f3]) > 1.0 * (b[f3] - b[f1]) * (m[f1] - m[f2]);
    }

    void add(ll M, ll B) {
        m.pb(M), b.pb(B);
        int sz = (int)m.size();
        while(sz >= 3 && bad(sz - 3, sz - 2, sz - 1)) {
            m.erase(m.end() - 2);
            b.erase(b.end() - 2);
            sz--;
        }
    }

    ll f(int idx, ll X) {
        return m[idx] * X + b[idx];
    }

    ll query(ll X) {
        int low = 0, high = (int) m.size() - 1;
        while (high - low >= 5) {
            int mid1 = (low + low + high) / 3;
            int mid2 = (low + high + high) / 3;
            if (f(mid1, X) <= f(mid2, X)) {
                low = mid1 + 1;
            } else {
                high = mid2 - 1;
            }
        }
        ll res = f(low, X);
        for (int i = low + 1; i <= high; i++) {
            res = max(res, f(i, X));
        }
        return res;
    }
};

pair<pll, ll> p[N];

int solve() {
  int n = in(), d = in() * 2 + 1;
  int ans = n / d + (n % d > 0);
  cout << ans << endl;
    return 0;
}

int main() {
    int test = 1, tc = 0;
    //scanf("%d", &test);
    while (test--) {
        //printf("Case %d: ", ++tc);
        solve();
    }
    return 0;
}









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

using namespace std;

#define tubo 3.305785
 
double ans(int a, int b)
{
    return (a * b) / tubo; 
}
 
int main()
{
    int a, b;
    cin >> a >> b;
    printf("%.6f\n", ans(a, b));
    return 0;
}

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

using namespace std;


const int N = 100100;
#define ll long long
#define fr(i,a,n) for (int i=a;i<n;i++)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vipb(v) int x;cin>>x;v.pb(x);
#define vllpb(v) ll x;cin>>x;v.pb(x);
#define in(x) cin>>x;
#define in2(x,y) cin >> x >> y;
#define in3(x,y,z) cin>>x>>y>>z;
#define in4(a,x,y,z) cin>>a>>x>>y>>z;
#define in5(a,b,x,y,z) cin>>a>>b>>x>>y>>z;


typedef vector<int> VI;
typedef vector<ll> VL;


string s;
ll n, m, k;

int main() {
	cin >> n >> m;
	while (n) {
		k++;
		n /= m;
	}
	cout << k << endl;
	return 0;
}

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

using namespace std;

int main()
{
 int small[3001];
 int large[3001];
 int i = 0;
 int left, right;
 while (scanf("%d %d", &left, &right), left+right)
 {
  if (left > right)
  {
   large[i] = left;
   small[i] = right;
  }
  else
  {
   large[i] = right;
   small[i] = left;
  }
  i++;
 }
 i = 0;
 while (!(large[i] + small[i] == 0))
 {
  cout << small[i] << " " << large[i] << endl;
  i++;
 }
 return 0;
}




Measured memory_bytes: 3160
#include<stdio.h>
#define Max 10000
#define None -1

typedef struct{
  int parent, left ,right;
}Node;
Node Tree[Max];
int n,Depth[Max],Height[Max];
int Dep(int,int);
int  Hei(int);
void print_out(int );
int Sibling(int);
int main()
{
  int v,l,r,i;
  int root =0;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    Tree[i].parent=None;
    for(i=0;i<n;i++){
      scanf("%d%d%d",&v,&l,&r);
      Tree[v].left=l;
      Tree[v].right=r;
      if(l!=None)Tree[l].parent=v;
      if(r!=None)Tree[r].parent=v;
    }
    for(i=0;i<n;i++)if(Tree[i].parent==None)root=i;

    Dep(root,0);
    Hei(root);
    for(i=0;i<n;i++)print_out(i);
    return 0;
}

  Dep(int u,int d){
  if(u==None) return;
  Depth[u] = d;
  Dep(Tree[u].left,d+1);
  Dep(Tree[u].right,d+1);
}
int Hei(int u){
  int h1=0;
  int h2=0;
  if(Tree[u].left!=None)
    h1=Hei(Tree[u].left)+1;
  if(Tree[u].right!=None)
    h2= Hei(Tree[u].right)+1;
      if(h1>h2)return Height[u]=h1;
      else return Height[u]=h2;
}

int Sibling(int u){
  if(Tree[u].parent==None)return None;
  if(Tree[Tree[u].parent].left!=u&&Tree[Tree[u].parent].left!=None)
    return Tree[Tree[u].parent].left;
  if(Tree[Tree[u].parent].right!=u&&Tree[Tree[u].parent].right!=None)
    return Tree[Tree[u].parent].right;
     return None;
     }
  void print_out(int u){
    printf("node %d: ",u);
    printf("parent = %d, ",Tree[u].parent);
    printf("sibling = %d, ",Sibling(u));
    int deg =0;
    if(Tree[u].left!=None)deg++;
    if(Tree[u].right!=None)deg++;
    printf("degree = %d, ",deg);
    printf("depth = %d, ", Depth[u]);
    printf("height = %d, ",Height[u]);

    if(Tree[u].parent ==None){
      printf("root\n");
    }  else if(Tree[u].left == None && Tree[u].right == None){
    printf("leaf\n");
      }else{
    printf("internal node\n");
      }
    }

Measured memory_bytes: 620
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n; cin>>n;
    vector<vector<pii>>edge(n,vector<pii>());
    rep(i,n){
        int r; cin>>r;
        --r;
        int k; cin>>k;
        rep(j,k){
            int to; cin>>to;
            edge[r].push_back(pii(to-1,1));
        }
    }
    int p; cin>>p;
    rep(_,p){
        priority_queue<pii,vector<pii>,greater<pii>>que;
        int from,to,cost; cin>>from>>to>>cost;
        --to,--from;
        vector<int>d(n,INF);
        d[from]=0;
        que.push(pii(0,from));
        while(!que.empty()){
            pii now=que.top(); que.pop();
            if(now.second==to)break;
            if(d[now.second]<now.first)continue;
            for(int i=0; i<edge[now.second].size();i++){
                pii next=edge[now.second][i];
                if(d[next.first]<now.first+next.second)continue;
                d[next.first]=now.first+next.second;
                que.push(pii(now.first+next.second,next.first));
            }
        }
        if(d[to]<cost)cout<<d[to]+1<<endl;
        else cout<<"NA"<<endl;
    }
}

Measured memory_bytes: 3108
import fractions
from functools import reduce

N, X = list(map(int, input().split()))
x = list(map(int, input().split()))
L = []
for i in range(N):
  L.append(abs(X-x[i]))

def gcd(*numbers):
  return reduce(fractions.gcd,numbers)

print(gcd(*L))

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

int main() {
	int H, W;
	cin >> H >> W;
	vector<string> C(H);
	for (int i = 0;i < H;++i) {
		cin >> C[i];
	}
	for (int i = 0;i < H;++i) {
		cout << C[i] << endl;
		cout << C[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
char p[201000];
int n, q[201000];
long long res = 0;
int main() {
	int i, c = 0;
	scanf("%s", p);
	for (i = 0; p[i]; i++);
	n = i;
	for (i = n - 1; i >= 0; i--) {
		if (p[i] == 'A') {
			if (c && q[c - 1] == 'B') {
				res += c / 2;
			}
			else {
				c = 0;
			}
		}
		else {
			if (p[i] == 'B') {
				if (!c || q[c - 1] == 'B') {
					c = 0;
				}
				else {
					q[c++] = 'B';
				}
			}
			if (p[i] == 'C') {
				if (c && q[c - 1] == 'C')c = 0;
				q[c++] = 'C';
			}
		}
	}
	printf("%lld\n", res);
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

int cost[1010][1010];
string s[1010];

int main(){
    int h, w;
    cin >> h >> w;
    rep(i, h) cin >> s[i];

    rep(i, h) rep(j, w) {
        if (s[i][j] == '.') cost[i][j] = INF;
        else if (s[i][j] == '#') cost[i][j] = 0;
    }

    rep(i, h){
        for(int j = 1; j < w; j++){
            cost[i][j] = min(cost[i][j], cost[i][j-1]+1);
            if (i > 0) cost[i][j] = min(cost[i][j], cost[i-1][j]+1);
            if (i < h-1) cost[i][j] = min(cost[i][j], cost[i+1][j]+1);
        }
    }
    rep(i, h){
        for(int j = w - 2; j >= 0; j--){
            cost[i][j] = min(cost[i][j], cost[i][j+1]+1);
            if (i > 0) cost[i][j] = min(cost[i][j], cost[i-1][j]+1);
            if (i < h-1) cost[i][j] = min(cost[i][j], cost[i+1][j]+1);
        }
    }

    rrep(i, h){
        for(int j = 1; j < w; j++){
            cost[i][j] = min(cost[i][j], cost[i][j-1]+1);
            if (i > 0) cost[i][j] = min(cost[i][j], cost[i-1][j]+1);
            if (i < h-1) cost[i][j] = min(cost[i][j], cost[i+1][j]+1);
        }
    }
    rrep(i, h){
        for(int j = w - 2; j >= 0; j--){
            cost[i][j] = min(cost[i][j], cost[i][j+1]+1);
            if (i > 0) cost[i][j] = min(cost[i][j], cost[i-1][j]+1);
            if (i < h-1) cost[i][j] = min(cost[i][j], cost[i+1][j]+1);
        }
    }


    int ans = 0;
    rep(i, h){
        rep(j, w)  {
            ans = max(ans, cost[i][j]);
            // cout << cost[i][j] << " ";
        }
        // cout << endl;
    }

    cout << ans << endl;

    return 0;
}


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

#define ll long long int

int main()
{
    ll n,m,cnt=0;
    double sum=0.0,a;
    vector<double>v;
    cin>>n>>m;
    for(ll i=1;i<=n;i++)
    {
        cin>>a;
        sum=sum+a;
        v.push_back(a);
    }
    sort(v.begin(),v.end());
    double tm=sum/(4.0*(m*1.0));

    for(ll i=v.size()-1;i>=0;i--)
    {
        if(v[i]>=tm)
        {
            cnt=cnt+1;
        }
    }
    if(cnt>=m)
            {
                cout<<"Yes"<<endl;
            }
            else
            {
                cout<<"No"<<endl;
            }
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  ll n,k;cin>>n>>k;
  ll ans=0;
  if(k==0){
    cout<<n*n<<endl;
    return 0;
  }
  for(ll b=k+1;b<=n;b++){
    ans+=n/b*(b-k);
    ll d=n%b-(k-1);
    if(d>0)ans+=d;
    //cout<<ans<<" "<<d<<endl;
  }
  cout<<ans<<endl;
}

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

namespace すごろく
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int count = 0, ans = 0;
            for (int i = 0; i < n; i++)
            {
                if (a[i] == 1) { count++; }
                if (a[i] == 0) { ans = Math.Max(ans, count + 1);count = 0; }
            }
            ans = Math.Max(ans, count + 1);
            Console.WriteLine(ans);
        }
    }
}



Measured memory_bytes: 20308
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Security;
using System.Xml.Serialization;

namespace AtCoderCs
{

    class Program
    {

        const int Mod = 1000000007;

        static void Main()
        {

            var arg = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            Console.WriteLine((arg[1] - 1) / (arg[0] - 1) + ((arg[1] - 1) % (arg[0] - 1) != 0 ? 1 : 0));

        }



    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
	T i=0;char c;
	while(!isdigit(c=getchar())&&c!='-');
	bool neg=c=='-';
	neg?c=getchar():0;
	while(i=i*10-'0'+c,isdigit(c=getchar()));
	return neg?-i:i;
}
template<class T1,class T2>inline void apmax(T1 &a,const T2 &b){if(a<b)a=b;}
template<class T1,class T2>inline void apmin(T1 &a,const T2 &b){if(b<a)a=b;}
template<class T>inline void mset(T a,int v,int n){memset(a,v,n*sizeof(a[0]));}
int main(){
	const int a=ni,b=ni,c=ni;
	int ans=next_num<lint>()&1?(b-a):(a-b);
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    int N; cin >> N;
    string S; cin >> S;
    int ans = 0;
    F0R(x, 10) {
        F0R(y, 10) {
            F0R(z, 10) {
                int d[] = {x, y, z};
                int p = 0;
                F0R(i, N) {
                    if (p != 3 && d[p] == S[i] - '0') p++;
                }
                if (p == 3) ans++;
            }
        }
    }
    cout << ans << endl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343



Measured memory_bytes: 384
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string.h>
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
typedef unsigned long long ui64;
typedef long long i64;

int main() {
	int a, b;
	cin >> a >> b;
	if (a + b == 15) {
		cout << "+" << "\n";
	}
	else if(a * b == 15) {
		cout << "*" << "\n";
	}else {
		cout << "x" << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
using namespace std;
int main(){
    int D,N;
    cin >> D >> N;
    
    int D2 = 1;
    for(int i=0;i<D;i++){
        D2 = D2*100;
    }
    
    int present;
    if(N<=99){
            present = N*D2;
    }else{
        present = 101*D2;
    }
    cout << present << endl;
return 0;
}



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

using i64 = int64_t;

int main(){
    int a, b;
    cin >> a >> b;
    string s, t;
    for(int i=0;i<b;++i)s.push_back(a+'0');
    for(int i=0;i<a;++i)t.push_back(b+'0');
    cout << min(s, t) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)

using namespace std;

typedef long long ll;
using pii = pair<int, int>;

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 100001;
static const ll MOD = 1000000007;


//--global--//

string make(int n){
    string str = to_string(n);
    while(str.size()<3){
        str = '0' + str;
    }
    return str;
}

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

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//
    
    int n;
    string s;
    cin >> n >> s;
    bool isOk[1001];
    fill(isOk, isOk+1000, false);
    rep(i, 1000){
        string str = make(i);
        bool ok = true;
        int tmp = 0;
        rep(k, 3){
            char t = str[k];
            ok = false;
            while(tmp<s.size()){
                if(s[tmp] == t){
                    ok = true;
                    tmp++;
                    break;
                }
                tmp++;
            }
            if(!ok){
                break;
            }
            if(ok && k==2){
                isOk[i]=true;
            }
        }
    }
    int res = 0;
    rep(i, 1000){
        if(isOk[i]){
            res++;
        }
    }
    cout << res << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <vector>
#define llint long long

using namespace std;
typedef pair<llint, llint> P;

struct UnionFind{
	int size;
	vector<int> parent;
	
	UnionFind(){}
	UnionFind(int size){
		this->size = size;
		parent.resize(size+1);
		init();
	}
	void init(){
		for(int i = 0; i <= size; i++) parent[i] = i;
	}
	int root(int i){
		if(parent[i] == i) return i;
		return parent[i] = root(parent[i]);
	}
	bool same(int i, int j){
		return root(i) == root(j);
	}
	void unite(int i, int j){
		int root_i = root(i), root_j = root(j);
		if(root_i == root_j) return;
		parent[root_i] = root_j;
	}
};

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

//ax+by = gcd(a, b)を満たす(x, y)を求めgcd(a, b)を返す
llint extgcd(llint a, llint b, llint &x, llint &y)
{
	if(b == 0){
		x = 1, y = 0;
		return a;
	}
	llint xx, yy;
	llint d = extgcd(b, a%b, xx, yy);
	x = yy, y = xx-(a/b)*yy;
	return d;
}

//a^{-1} (mod m)を求める。存在しない場合(gcd(a, m)!=1)は-1を返す
llint mod_inverse(llint a, llint m)
{
	llint x, y;
	if(extgcd(a, m, x, y) != 1) return -1;
	return (x%m + m) % m;
}

//ax = b (mod m)を満たすx(mod m/gcd(a, m))を求める。存在しない場合(b%gcd(a, m)!=0)は(0, -1)を返す
P congruence(llint a, llint b, llint m)
{
	llint d = gcd(a, m);
	if(b % d) return make_pair(0, -1);
	a /= d, b /= d, m /= d;
	return make_pair(b * mod_inverse(a, m) % m, m);
}

//連立合同方程式a_i*x = b_i (mod m_i)(i = 1, 2, ..., n)の解(x, M)を求める。存在しない場合(0, -1)を返す
P SimultaneousCongruence(llint a[], llint b[], llint m[], llint n)
{
	llint x = 0, M = 1;
	for(int i = 1; i <= n; i++){
		P res = congruence(a[i]*M, (b[i]-a[i]*x%m[i]+m[i])%m[i], m[i]);
		if(res.second == -1) return res;
		x += M*res.first, M *= res.second;
	}
	return make_pair(x, M);
}

llint n;
llint p[205], q[205];
llint pinv[205];
UnionFind uf(205);
vector<llint> vec[205];
llint a[205], b[205], m[205];

int main(void)
{
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> p[i];
	for(int i = 1; i <= n; i++) cin >> q[i];
	for(int i = 1; i <= n; i++) pinv[p[i]] = i;
	
	for(int i = 1; i <= n; i++){
		llint x = p[i], mn = -1, cnt = 0;
		do{
			if(x == i) mn = cnt;
			x = q[x];
			cnt++;
		}while(x != p[i]);
		if(mn == -1){
			cout << -1 << endl;
			return 0;
		}
		a[i] = 1, b[i] = mn, m[i] = cnt;
	}
	
	//for(int i = 1; i <= n; i++) cout << a[i] << " " << b[i] << " " << m[i] << endl;
	
	P res = SimultaneousCongruence(a, b, m, n);
	if(res.second == -1) cout << -1 << endl;
	else cout << res.first << endl;
	
}


Measured memory_bytes: 3124
#include<iostream>
#include<cmath>
#include<algorithm>
#include <cassert>
#include<string>
int main() {
	using namespace std;
	long long int a = 0, b = 0, c = 0, d = 0, e[10][10], f[10000], g[10000], h[10000], count = 0, x = 0, y = 0, z = 0;
	long long ab[100000], abc = 0;
	char rikka, toka[100000];
	string saya, homu, kyok, mami, mado[50];
	bool gg;
	cin >> a >> b;
	cin >> saya >> homu;
	count = 1;
	c = max(a, b);
	d = min(a, b);
	while (count != 0) {
		count = c % d;
		c = d;
		d = count;
	}
	count = c * (a / c)*(b / c);
	if (saya[0] != homu[0]) {
		cout << "-1" << endl;
		return 0;
	}
	c = 1;
	d = 1;
		for (int j = 0; c<count&&d<count; j++) {
			if(c<=d){
				c = c + count / a;
				
			}
			else { d = d + count / b; }
			//cout << c << ' ' << d << endl;
			if (c == d) {
				//cout << saya[(c - 1) / (count / a)] << homu[(d - 1) / (count / b)] << endl;
				if (saya[(c - 1) / (count / a)] != homu[(d - 1) / (count / b)]) {
					
					cout << "-1" << endl;
					return 0;
				}
			}

			
		}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=18,M=998244353,Inv=M/2+1;
int p[1<<N],s,n;
int ksm(int x,int y){
	int ans=1;
	for (;y;y>>=1,x=x*x%M)
		if (y&1)(ans*=x)%=M;
	return ans%M;
}
void FWT(int y[],int m,int opt){
	for (int i=1;i<1<<m;i<<=1)
		for (int j=0,p=i<<1;j<1<<m;j+=p)
			for (int k=j;k<j+i;k++){
				int u=y[k],v=y[k+i];
				y[k]=(u+v)%M;
				y[k+i]=(M+u-v)%M;
				if (opt==-1)y[k]=y[k]*Inv%M,y[k+i]=y[k+i]*Inv%M;
			}
}
signed main(){
	scanf("%lld",&n);
	for (int i=0;i<1<<n;i++)scanf("%lld",&p[i]),(s+=p[i])%=M;
	s=ksm(s,M-2);
	for (int i=0;i<1<<n;i++)(p[i]*=s)%=M; 
	FWT(p,n,1);s=0;
	for (int i=0;i<1<<n;i++)p[i]=(M+1-p[i])*Inv%M;
	for (int i=0;i<1<<n;i++)p[i]=ksm(p[i],M-2),(s+=p[i])%=M;
	FWT(p,n,1);
	for (int i=0;i<1<<n;i++)p[i]=(M+s-p[i])*Inv%M;
	for (int i=0;i<1<<n;i++)printf("%lld\n",p[i]);
	return 0;
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    int N,X,Y;
    cin>>N>>X>>Y;
    X--;
    Y--;
    map<int,int> m;
    rep(i,N-1){
        for(int j=i+1;j<N;j++){
            int x=min(j-i,min(abs(Y-i)+1+abs(X-j),abs(Y-j)+1+abs(X-i)));
            m[x]++;
        }
    }
    for(int i=1;i<N;i++){
        cout << m[i] << endl;
    }




}


Measured memory_bytes: 384
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    printf("%.2lf",2*3.14159*n);

    return 0;
}


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

using namespace std;
using   ll=long long;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int
#define pll				pair<int , int>

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353 

ll mod_pow(ll a,ll b,ll m) 
{
    ll res = 1;
    while(b)	
    {
        if(b&1) 	
        {
        	res=(res*a) % m;
        }
        a=(a*a) % m;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a) 
{
	return mod_pow(a , mod-2 , mod);
}

void solve()
{
	int n;
	
	cin >> n;
	
	int bit[64] {};
	
	for(int i = 0; i < n; ++i) {
		int x;
		
		cin >> x;
		
		for(int i = 0; i < 60; ++i) {
			if(((1LL<<i)&x)) {
				bit[i]++;
			}
		}
	}
	
	int ans = 0;
	
	for(int i = 0; i < 60; ++i) {
		int tm = pow(2 , i); 
		
		tm %= mod;
		
		int mt = (bit[i]*(n-bit[i])) % mod;
		
		ans = (ans + (tm*mt) % mod) % mod;
	}
	
	cout << ans;
}

signed main() {
    fast;
    
    int t = 1;
    
	//cin >> t;
    
    while(t--) {
        solve();
    }
 
    return 0;
}


Measured memory_bytes: 4060
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  ui N; cin >> N;
  double T, A; cin >> T >> A;
  vector<double> H(N);
  for(auto& h : H)
  {
    double tmp; cin >> tmp;
    h = std::abs(T - tmp * 0.006 - A);
  }
  auto res = boost::min_element(H);
  cout << std::distance(H.begin(), res) + 1 << CRLF;
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define dbg(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;

int main(){
  ll I,O,T,J,L,S,Z;
  cin>>I>>O>>T>>J>>L>>S>>Z;

  ll ans=O+(J/2)*2+(L/2)*2+(I/2)*2;

  if(I%2+L%2+J%2==3)ans+=3;
  else if(I%2+L%2==2&&J>0)ans+=1;
  else if(I%2+J%2==2&&L>0)ans+=1;
  else if(L%2+J%2==2&&I>0)ans+=1;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % MOD2;
}

ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
ll dp[3001][3001]={0};
string s,t ;
ll lcs(ll n,ll m)
{   if(n==-1||m==-1)
     return 0;
     else if(dp[n][m]!=-1)
     return dp[n][m] ;
  else	if(s[n]==t[m])
	{   
		{
			dp[n][m]=1+lcs(n-1,m-1) ;
		}
		
	}
	else
	{  
		dp[n][m]=max(lcs(n-1,m),lcs(n,m-1)) ;
		
	}
	return dp[n][m] ;
}
int main(int argc, char** argv)
{   sws ;

   // tcase
    {
    string ans ;
    cin>>s>>t ;

    ll n=s.length(),m=t.length() ;
    forn(i,n)
    forn(j,m)
    dp[i][j]=-1 ;
    ll p=n-1,q=m-1 ;
   ll k= lcs(n-1,m-1);

	while(p>-1&&q>-1)
	{
		if(s[p]==t[q])
		{   ans+=s[p];
			p--;
			q--;
		}
		else
		{   if(p>0&&q>0)
		    {
			
			if(dp[p-1][q]>dp[p][q-1])
			p-- ;
			else 
			q-- ;
		    }
		    else if(p>0)
		    p-- ;
		    else 
		    q--;
		}
	}
	for(int i=ans.length()-1; i>=0;i--)
	cout<<ans[i];
    
    }
return 0 ;
}

Measured memory_bytes: 74276
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a + b + c == 17) cout << "YES" << endl;
  else cout << "NO" << endl;
}


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

long long MOD = 1e9+7;
int MAX_INT = 1e9;

// 最大公約数
long long gcd(long long a, long long b){
  if(b == 0) return a;
  return gcd(b, a % b);
}
// 最小公倍数
long long lcm(long long a, long long b) {
  return a / gcd(a, b) * b;
}

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

  long long N, M;
  cin >> N >> M;

  if(abs(N - M) >= 2) {
    cout << 0 << endl;
  }
  else if (abs(N - M) == 1) {
    long long pow_N = N % MOD, pow_M = M % MOD;
    for(int i = 1; i < N; i++) {
      pow_N *= i;
      pow_N %= MOD;
    }
    for(int i = 1; i < M; i++) {
      pow_M *= i;
      pow_M %= MOD;
    }
    cout << (pow_N * pow_M) % MOD << endl;
  }
  else {
    long long pow_N = N % MOD, pow_M = M % MOD;
    for(int i = 1; i < N; i++) {
      pow_N *= i;
      pow_N %= MOD;
    }
    for(int i = 1; i < M; i++) {
      pow_M *= i;
      pow_M %= MOD;
    }
    cout << 2 * (pow_N * pow_M) % MOD << endl;
  }

  return 0;
}


Measured memory_bytes: 3628
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-03-28 20:30:25
*/

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

#define all(x) (x).begin(),(x).end()
#define rep(x, y) for (int x = 0; x < y; x++)
#define MOD 1000000007
#define INF 1000000

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod) {
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod) {
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod) {
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

ostringstream oss_global;
string s_global = oss_global.str();

LL f(LL n) {
    if (n % 2 == 0) return n/2;
    else return 3*n + 1;
}

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

    map<LL, int> memo;
    int ans;
    LL prev;
    for (int i = 1; i <= INF; i++) {
        if (i == 1) {
            memo[s]++;
            prev = s;
        } else {
            LL temp = f(prev);
            if (memo[temp] > 0) {
                ans = i;
                break;
            } else {
                memo[temp]++;
                prev = temp;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import sys

N,Y = map(int,input().split())

for i in range(N+1):
    if Y < i * 10000:
        continue
    for j in range(N+1):
        k = N - i - j
        if k >= 0 and Y == i * 10000 + j * 5000 + k * 1000:
            print(i,j,k)
            sys.exit()
print("-1 -1 -1")


Measured memory_bytes: 2940
#include <iostream>
#include <cstring>

using namespace std;

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

    bool f[m];
    memset(f, true, sizeof(f));
    for (int i = 0; i < n; i++) {
        int k;
        cin >> k;
        int t[m];
        memset(t, 0, sizeof(t));
        for (int j = 0; j < k; j++) {
            int a;
            cin >> a;
            t[a-1] = true;
        }

        for (int j = 0; j < m; j++) {
            if (!t[j]) {
                f[j] = false;
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < m; i++) {
        ans += f[i];
    }

    cout << ans << endl;

    return 0;
}

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

#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop,~))(__VA_ARGS__)
#define loop(n) rep2(_loop_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i = (int)(begin), i##_end = (int)(end); i < i##_end; ++i)
#define repN(a) repX a
#define repX(a0,a1,a2,x,...) x

void solve(int A, int B, string S){
	bool ans = true;
	if(S.size() != A + B + 1) ans = false;
	rep(i, A + B + 1){
		if((i == A) ^ (S[i] == '-')) ans = false;
	}
	puts(ans ? "Yes" : "No");
}

int main(void){
	int A;
	int B;
	scanf("%d", &A);
	scanf("%d", &B);
	string S;
	cin >> S;
	solve(A, B, S);
	return 0;
}


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


#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> // find_by_order(); order_of_key();
#define mod 1000000007
#define ll long long int
#define mk make_pair
#define pb push_back
#define xx first
#define yy second



double pi=3.141592653589793238;
const int M = 1e9+7;
const int Nmax=5005;
const int MM = 1e7+1;
const int N=100005;



int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int T=1;
//cin>>T;
while(T--){

int n;
cin>>n;
int ans=0;
for(int i=1;i<=n;i++){
    int x;
    cin>>x;
    if(i&1){
        if(x&1)ans++;
    }
}
cout<<ans<<"\n";
}
return 0;
}


Measured memory_bytes: 3604
import collections

H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input())

for i in range(H):
    a[i] = '#' + a[i] + '#'
    
border = '##'
for i in range(W):
    border += '#'

print(border)
for i in range(H):
    print(a[i])
print(border)


Measured memory_bytes: 3316
import static java.util.Comparator.comparing;

import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    // ==========================================================
    public void solve() {
    	int N = ni();
    	int K = ni();
    	int R = ni();
    	int S = ni();
    	int P = ni();
    	char[] C = ns().toCharArray();
    	long ans = 0;
    	for (int i = 0; i < N; i++) {
			if(i < K || C[i-K] != C[i]) {
				if(C[i] == 'r')			ans += P;
				else if(C[i] == 's')	ans += R;
				else if(C[i] == 'p')	ans += S;
			} else {
				C[i] = 'X';
			}
		}
    	out.println(ans);
    }
    // ------------------------------------------
    // 入力
    // ------------------------------------------
    public int ni() {
    	return sc.nextInt();
    }
    public long nl() {
    	return sc.nextLong();
    }
    public String ns() {
    	return sc.next();
    }
    public char[] nc() {
    	return sc.next().toCharArray();
    }
    public int[] ndi(int N) {
    	int[] ans = new int[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ni();
		}
    	return ans;
    }
    public long[] ndl(int N) {
    	long[] ans = new long[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = nl();
		}
    	return ans;
    }
    public String[] nds(int N) {
    	String[] ans = new String[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ns();
		}
    	return ans;
    }
    public char[][] ndc(int N) {
    	char[][] ans = new char[N][];
    	for (int i = 0; i < N; i++) {
			ans[i] = nc();
		}
    	return ans;
    }
    public int[][] nddi(int N, int S) {
    	int[][] ans = new int[N][S];
    	for (int i = 0; i < N; i++) {
			for (int j = 0; j < S; j++) {
				ans[i][j] = ni();
			}
		}
    	return ans;
    }
}


Measured memory_bytes: 27092
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	as := make([]int, m)
	bs := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&as[i], &bs[i])
	}

	uf := newUnionFind(n + 1)

	cs := make([]int, 0)
	sum := n * (n - 1) / 2
	cs = append(cs, sum)
	for i := m - 1; i >= 1; i-- {
		a, b := as[i], bs[i]
		if uf.same(a, b) {
			cs = append(cs, sum)
			uf.unite(a, b)
			continue
		}

		ac := uf.size(a)
		bc := uf.size(b)
		uf.unite(a, b)

		sum -= ac * bc
		cs = append(cs, sum)
	}

	for i := m - 1; i >= 0; i-- {
		fmt.Println(cs[i])
	}
}

// UnionFind .
type UnionFind struct {
	par   []int
	rank  []int
	sizes []int
}

func newUnionFind(n int) UnionFind {
	u := UnionFind{}
	u.par = make([]int, n)
	u.rank = make([]int, n)
	u.sizes = make([]int, n)

	for i := 0; i < n; i++ {
		u.par[i] = i
		u.rank[i] = 0
		u.sizes[i] = 1
	}

	return u
}

func (u UnionFind) unite(x, y int) {
	x = u.root(x)
	y = u.root(y)
	if x == y {
		return
	}

	if u.rank[x] < u.rank[y] {
		u.par[x] = y
		u.sizes[y] += u.sizes[x]
	} else {
		u.par[y] = x
		u.sizes[x] += u.sizes[y]
		if u.rank[x] == u.rank[y] {
			u.rank[x]++
		}
	}
}

func (u UnionFind) root(x int) int {
	if u.par[x] == x {
		return x
	}
	u.par[x] = u.root(u.par[x])
	return u.par[x]
}

func (u UnionFind) same(x, y int) bool {
	return u.root(x) == u.root(y)
}

func (u UnionFind) size(x int) int {
	return u.sizes[u.root(x)]
}


Measured memory_bytes: 10752
//
// Created by Akifumi Ohata on 2017/10/03.
//


#include<iostream>
#include <vector>
#include <numeric>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <iomanip>

using namespace std;

using ll =  long long int;

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

    int N, M;



    cin >> N >> M;





    cout  << (N-1)*(M-1) << endl ;

    return 0;
}

Measured memory_bytes: 256
/*input
1
1

*/
 
/*
                                                    ______________
                                                          |       )
                                                          |   )   /
                                                          |______/
                                                    |     |      \
                                                    |     |   )   \
                                                    |_____|_______)
 
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
#include <fstream>
#include <stack>

using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll , ll> PLL;
typedef long double ld;
 
#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
int mod = 1000000007;
const int inf = 1034567891;
const ll LL_INF = 1234567890123456789ll;
#define PI 3.14159265
#define endl '\n'
#define F first
#define S second
#define debug(x) cout << #x << " = " << x << endl;
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
 
 
template < typename T > T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > string toString(T a)       { return to_string(a); }
template < typename T > void toInt(string s, T &x) { stringstream str(s); str >> x;}
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % mod;}
inline int powr(int a, ll b){
  int x = 1 % mod;
  while(b){
    if(b & 1) x = mul(x, a);
    a = mul(a, a);
    b >>= 1;
  }
  return x;
}
inline int inv(int a){ return powr(a, mod - 2);}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  int a, b, c;
  cin >> a >> b >> c;
  swap(a, b);
  swap(a, c);
  cout << a << " " << b << " " << c << endl;  

  return 0;
}

Measured memory_bytes: 256