akhauriyash/Code-Regression huggingface dataset:
// /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;

#include <bits/stdc++.h>

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

const ll INF = 1e18 + 5;
const ll MAX_N = 1e5 + 5;
const ll MODD = 1e9 + 7;

ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}

ll modd(ll a){if(a<0LL) return a*-1LL;return a;}
double modd(double a){if(a<0.0) return a*-1.0;return a;}

ll modulo(ll a){return a % MODD; }

ll power(ll k, ll p){
    if (p == 0)
        return 1LL;
 
    ll P = power(k, p/2LL);
    P = (P * P) % MODD;
 
    if (p % 2 == 1)
        P = (P * k) % MODD;
 
    return P;
}


struct p_str{
    ll a, b;
};

void solve(){
    ll n;
    cin >> n;
    ld p[n + 1];
    for(ll i = 1; i <= n; i++) {
        cin >> p[i];
    }

    ld dp[n+1][n+1]; // dp[j][i] => prob. of 1st i-coins having j-heads...
    for(ll i = 0; i <= n; i++) {
        for(ll j = 0; j <= n; j++) {
            dp[i][j] = 0.0;
        }
    }

    dp[0][1] = 1.0 - p[1];
    dp[1][1] = p[1];
    for(ll i = 2; i <= n; i++) {
        ld h = p[i] * 1.0;
        ld t = 1.0 - p[i] * 1.0;
        for(ll j = 0; j <= i; j++) {
            dp[j][i] = dp[j][i - 1] * t;
            if(j > 0) {
                dp[j][i] += dp[j - 1][i - 1] * h;
            }
        }
    }

    // cout << "dp \n";
    // for(ll i = 0; i <= n; i++) {
    //     for(ll j = 1; j <= n; j++) {
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    // cout << endl;

    ld ans = 0.0;
    for(ll i = (n / 2LL) + 1; i <= n; i++) {
        ans += dp[i][n] * 1.0;
    }

    cout << setprecision (9) << fixed << ans << endl;
}



int main(){


    #ifndef ONLINE_JUDGE 

    // For getting input from input.txt file 
    freopen("input.txt", "r", stdin); 

    // Printing the Output to output.txt file 
    freopen("output.txt", "w", stdout); 
    #endif 


    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    



    ll t=1;


    // cin>>t;
    


    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 144316
import datetime
from decimal import Decimal, ROUND_DOWN
import heapq
from fractions import gcd
from functools import reduce
from collections import deque
# from math import factorial
import itertools
import collections
import math
import sys
sys.setrecursionlimit(2000000)
# import statistics
# import numpy as np
# n = int(input())
# n, m, p = list(map(int, input().split()))
# a = list(map(int, input().split()))
#
#  abc = [int(input()) for i in range(5)]
n = int(input())
#n, m = list(map(int, input().split()))
# a, b = list(map(int, input().split()))
l = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
# n = int(input())
# a = list(map(int, input().split()))
# b = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
# data = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))
# for i in range(1, int(n**0.5)+1):
count = 0
data = []
for a, b, c in itertools.combinations(l, 3):
    if a+b > c and b+c > a and c+a > b:
        data.append([a, b, c])

#data = list(map(list, set(map(tuple, data))))
for i in range(len(data)):
    if data[i][0] != data[i][1] and data[i][0] != data[i][2] and data[i][1] != data[i][2]:
        count += 1

# print(data)
# print(len(data))
print(count)


Measured memory_bytes: 27028
N, M = map(int, input().split())
S = input()
T = input()
from fractions import gcd

g = gcd(N, M)
flag = True
for k in range(g):
  if S[k * N // g] != T[k * M // g]:
    flag = False

if flag:
  print(N * M // g)
else:
  print(-1)

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

int N;

int P[20];

int main(void)
{

    int min=0;
    int ans=0;

    int answer=0;
    cin >> N;
    for(int i=0;i<N;i++)cin >> P[i]; 

    for(int i=0;i<N;i++)
    {
        if(min<P[i])
        {
            min=P[i];

            ans =i;
        }
    } 

    for(int i=0;i<N;i++)
    {
        if(i==ans)
        {
            answer+=P[i]/2;
        }
        else answer+=P[i];
    } 

    cout << answer << endl;
    

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimise("Ofast,unroll-loops,no-stack-protector,fast-math");
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")
          
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
          
using namespace std;
using namespace __gnu_pbds;
          
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
          
using matrix = vector<vector<ll>>;
template<typename T>
using kawaii_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
          
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).rend()
//#define int long long
          
void FAST_IO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifndef _offline
    //freopen("trains.in", "r", stdin);
    //freopen("trains.out", "w", stdout);
    #endif
}

signed main() {
    FAST_IO();
    int n;
    cin >> n;
    vector<pii> ans;
    if (n % 2 == 1) {
        vector<pii> pairs;
        for (int a = 1; ; ++a) {
            int b = n - a;
            if (b < a) {
                break;
            }
            pairs.push_back({a, b});
        }
        for (int i = 0; i < pairs.size(); ++i) {
            for (int j = i + 1; j < pairs.size(); ++j) {
                ans.emplace_back(pairs[i].first, pairs[j].first);
                ans.emplace_back(pairs[i].first, pairs[j].second);
                ans.emplace_back(pairs[i].second, pairs[j].first);
                ans.emplace_back(pairs[i].second, pairs[j].second);
            }
        }
        for (int i = 1; i < n; ++i) {
            ans.emplace_back(i, n);
        }
    }
    else {
        vector<pii> pairs;
        for (int a = 1; ; ++a) {
            int b = n + 1 - a;
            if (b < a) {
                break;
            }
            pairs.push_back({a, b});
        }
        for (int i = 0; i < pairs.size(); ++i) {
            for (int j = i + 1; j < pairs.size(); ++j) {
                ans.emplace_back(pairs[i].first, pairs[j].first);
                ans.emplace_back(pairs[i].first, pairs[j].second);
                ans.emplace_back(pairs[i].second, pairs[j].first);
                ans.emplace_back(pairs[i].second, pairs[j].second);
            }
        }
    }
    cout << ans.size() << '\n';
    for (pii p : ans) {
        cout << p.first << ' ' << p.second << '\n';
    } 
    return 0;
}

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



int main() {
    ull N, M;
    cin >> N >> M;

    ull ai, accA[N+1] = {};
    map<ull, ull> cntM{};
    cntM[0] = 1;
    rep(i, N) {
        cin >> ai;
        accA[i+1] = (accA[i] + ai) % M;
        cntM[accA[i+1]]++;
    }

    ull ans = 0;
    for (auto itr = cntM.begin(); itr != cntM.end(); itr++) {
        ull cnt = itr->second;
        if (cnt > 0) 
            ans += cnt * (cnt - 1) / 2;
    }

    cout << ans << endl;

    return 0;
}

 

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

using namespace std;

#define local
#ifdef local

template<class T>
void _E(T x) { cerr << x; }

void _E(double x) { cerr << fixed << setprecision(6) << x; }

void _E(string s) { cerr << "\"" << s << "\""; }

template<class A, class B>
void _E(pair<A, B> x) {
    cerr << '(';
    _E(x.first);
    cerr << ", ";
    _E(x.second);
    cerr << ")";
}

template<class T>
void _E(vector<T> x) {
    cerr << "[";
    for (auto it = x.begin(); it != x.end(); ++it) {
        if (it != x.begin()) cerr << ", ";
        _E(*it);
    }
    cerr << "]";
}

void ERR() {}

template<class A, class... B>
void ERR(A x, B... y) {
    _E(x);
    cerr << (sizeof...(y) ? ", " : " ");
    ERR(y...);
}

#define debug(x...) do { cerr << "{ "#x" } -> { "; ERR(x); cerr << "}" << endl; } while(false)
#else
#define debug(...) 114514.1919810
#endif
#define _rep(n, a, b) for (ll n = (a); n <= (b); ++n)
#define _rev(n, a, b) for (ll n = (a); n >= (b); --n)
#define _for(n, a, b) for (ll n = (a); n < (b); ++n)
#define _rof(n, a, b) for (ll n = (a); n > (b); --n)
#define oo 0x3f3f3f3f3f3f
#define ll long long
#define db long double
#define eps 1e-3
#define bin(x) cout << bitset<10>(x) << endl;
#define what_is(x) cerr << #x << " is " << x << endl
#define met(a, b) memset(a, b, sizeof(a))
#define all(x) x.begin(), x.end()
#define pii pair<ll, ll>
#define pdd pair<db, db>
#define endl "\n"
#define ls ch[now][0]
#define rs ch[now][1]
const ll mod = 998244353;
const ll maxn = 2e5 + 10;


ll qpow(ll a, ll b) {
    ll ret = 1;
    for (; b; a = a * a % mod, b >>= 1) {
        if (b & 1) {
            ret = ret * a % mod;
        }
    }
    return ret;
}

vector<ll> f(maxn), invf(maxn);

ll inv(ll a) {
    return qpow(a, mod - 2);
}

void prework() {
    f[0] = 1;
    _rep(i, 1, maxn - 1) {
        f[i] = f[i - 1] * i % mod;
    }
    invf[maxn - 1] = qpow(f[maxn - 1], mod - 2);
    for (ll i = maxn - 2; i >= 0; i--) {
        invf[i] = invf[i + 1] * (i + 1) % mod;
    }

}

ll C(ll n, ll m) {
    if (n > m || m < 0)return 0;
    if (n == 0 || m == n) return 1;
    ll res = (f[m] * invf[m - n] % mod * invf[n]) % mod;
    return res;
}

vector<ll> G[maxn];


signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll  n, d, res = 0;
    cin >> n >> d;
    _rep(i, 1, n){
        ll x, y;
        cin >> x >> y;
        if(x*x + y*y <= d*d){
            res++;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 11028
import java.util.*;

public class Main{
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int dataset = sc.nextInt();
			long left = 0, right = 0;
			while(dataset-- > 0){
				String pos = sc.next();
				char c = sc.next().charAt(0);
				int time = sc.nextInt();
				if(c == '('){
					left += time;
				}
				else{
					right += time;
				}
				if(left == right){
					System.out.println("Yes");
				}
				else{
					System.out.println("No");
				}
			}
		}
	}
	
	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}
}

Measured memory_bytes: 42592
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };


int main() {
	int n;
	cin >> n;
	vector<ll> vll(n);
	int nzeroidx = 9999999;
	REP(i, n) {
		cin >> vll[i];

		if (vll[i] != 0)
			nzeroidx = min(nzeroidx, i);
	}
	ll sum = 0;
	ll ans = 0;
	REP(i, n) {
		if (i == 0) {
			if (vll[i] <= 0) {
				ans += (1 - vll[i]);
				sum = 1;
			}
			else {
				sum += vll[i];
			}
		}
		else {
			if (sum < 0 && sum + vll[i] <= 0) {
				ans += abs(1 - (sum + vll[i]));
				sum = 1;
			}
			else
				if (sum > 0 && sum + vll[i] >= 0) {
					ans += abs(-1 - (sum + vll[i]));
					sum = -1;
				}
				else {
					sum += vll[i];
				}
		}
	}
	sum = 0;
	ll ans2 = 0;
	REP(i, n) {
		if (i == 0) {
			if (vll[i] >= 0) {
				ans2 += abs(-1 - vll[i]);
				sum = -1;
			}
			else {
				sum += vll[i];
			}
		}
		else {
			if (sum < 0 && sum + vll[i] <= 0) {
				ans2 += abs(1 - (sum + vll[i]));
				sum = 1;
			}
			else
				if (sum > 0 && sum + vll[i] >= 0) {
					ans2 += abs(-1 - (sum + vll[i]));
					sum = -1;
				}
				else {
					sum += vll[i];
				}
		}
	}
	cout << min(ans, ans2) << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main(){
	int n,a;
	cin >> n;
	cin >> a;
	if(n % 500 <= a) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int N,M;
    cin >> N >> M;
    vector<int>ans(N);
    vector<int>ok(N);
    vector<int>flag(N);
    for(int i = 0; i < M; i++) {
        int s,c;
        cin >> s >> c;
        if(s == 1 && c == 0) {
            if(N != 1) {
            cout << -1 << endl;
            return 0;
            }
        }
        if(ok[s-1] == c || flag[s-1] == 0) {
            ans[s-1] = c;
            ok[s-1] = c;
            flag[s-1]++;
        }
        else {
            cout << -1 << endl;
            return 0;
        }
    }
    if(N == 1) {
        cout << ans[0];
    }
    else {
    for(int i = 0; i < N; i++) {
        if(i == 0) {
            if(ans[i] == 0 && flag[i] == 0) {
                cout << 1;
            }
            else {
                cout << ans[i];
            }
        }
        else {
            cout << ans[i];
        }
    }
    }
    cout << endl;
}


Measured memory_bytes: 256
while line=gets
	d = line.chomp.split(" ").map(&:to_f)
	printf("%.03f %.03f\n", 0 + (d[2]*d[4] - d[1]*d[5]) / (d[0]*d[4] - d[1]*d[3]), 0 + (d[2]*d[3] - d[0]*d[5]) / (d[1]*d[3] - d[0]*d[4]))
end

Measured memory_bytes: 8640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n) + 1; i++)
#define all(vecto) vecto.begin(), vecto.end()
#define max3(a,b,c) max(a,max(b,c))
typedef long long ll;

int main()
{
    int a,b;
    cin >> a >> b;
    int sum = 1;
    int count = 0;
    while (sum<b){
        sum = sum - 1 + a;
        count++;
    }
    cout << count << endl;

}

Measured memory_bytes: 256
while True:

    n,k = map(int,input().split())
    if n == 0:
        break

    c = []
    zex = 0
    for i in range(k):
        C = int(input())

        if C == 0:
            zex = 1
        else:
            c.append(C)

    c.sort()

    ans = 0
    l = 0
    r = 0


    for i in range(len(c) - 1):

        if c[i] + 1 == c[i+1]:
            r += 1

        elif zex == 1 and c[i] + 2 == c[i+1]:
            l = r
            r = 1
        else:
            l = 0
            r = 1

        ans = max(ans,l+r+zex)

    print (ans)



Measured memory_bytes: 9128
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using E = System.Linq.Enumerable;
 
class Program
 {
  
        static Dictionary<int,int> Query;
        static int H;  
  
        static int[] A;
  
        static void Main(string[] args)
        {
          //入力を受け取る
          int N = int.Parse(Console.ReadLine());
          A= Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
          int[] result = new int[N]; 
          
          for(int i = 0; i < N ; i++){
            result[A[i]-1] = i+1;
          }
          
          Console.WriteLine(String.Join(" ",result)); 
        }

 }

Measured memory_bytes: 28508
fn main() {
    proconio::input! {
        n: usize,
    }
    let mut v=1;
    for b in 2..n {
        for p in 2..n {
            let a=b.pow(p as u32);
            if a>n {
                break;
            }
            v=v.max(a);
        }
    }
    println!("{}",v);
}

Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main(){
    ll n,m;cin>>n>>m;
    vector<ll> v[n+1];
    ll k;
    ll l;
    vector<ll> la[m+1];
    rep(i,1,n){
        cin>>k;
        rep(j,0,k-1){
            cin>>l;
            v[i].pb(l);
            la[l].pb(i);
        }
    }
    bool seen[n+1];rep(i,1,n)seen[i]=false;
    bool sen[m+1];rep(i,1,m)sen[i]=false;
    queue<ll> q;
    q.push(1);
    while(q.size()>0){
        ll p=q.front();q.pop();
        if(seen[p])continue;
        seen[p]=true;
        rep(i,0,v[p].size()-1){
            if(sen[v[p][i]])continue;
            sen[v[p][i]]=true;
            ll r=v[p][i];
            rep(j,0,la[r].size()-1){
                if(seen[la[r][j]])continue;
                q.push(la[r][j]);
            }
        }
    }
    rep(i,1,n){
        if(!seen[i]){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    
    
    return 0;
}



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

int main(){

    string s;
    cin>>s;
    set<char> c;
    bool different=true;
    for(int i=0;i<s.size();i++){
        if(c.count(s[i])) different=false;
        c.insert(s[i]);
    }

    cout<<(different?"yes":"no")<<endl;



    return 0;
}

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

int main(){
	int N,W;
	cin>>N>>W;
	vector<vector<long long> > dp(N+1,vector<long long> (W+1,0));
	
	vector<long long> w(N+1),v(N+1);
	for(int i=1;i<=N;i++){
		cin>>w[i]>>v[i];
	}
	for(int i=1;i<=N;i++)
        {
            for(int j=1;j<=W;j++)
            if(w[i]<=j)
            {
                dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);
            }
            else
            dp[i][j]=dp[i-1][j];
        }
	
	
	cout<<dp[N][W]<<endl;
	return 0;
	
}

Measured memory_bytes: 80256
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
	int N;
	string S;
	cin>>N;
	cin>>S;
	int i;
	int Max=0;
	int x=0;
	for (i=0;i<N;i++){
		if (S[i]=='I'){
			x++;
			if (Max<x){
				Max=x;
			}
		}else{
			x--;
		}
	}
	cout<<Max<<endl;
	return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_DIGIT = (int)(4e1 + 5);
const int MAX_N = (int)(1e5 + 5);

int n;
ll k;
ll a[MAX_N];

int bit_cnt[MAX_DIGIT];
ll choice[MAX_DIGIT];

vector<ll> ansvec;
ll ans = -1;

ll calc(ll x) {
  ll ret = 0;
  for (int i = 0; i < n; ++i) {
    ret += x ^ a[i];
  }
  return ret;
}

int main(void) {
  // Here your code !
  scanf("%d %lld", &n, &k);

  for (int i = 0; i < n; ++i) {
    scanf("%lld", &(a[i]));
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < MAX_DIGIT; ++j) {
      if ((a[i] >> j) & 1LL) bit_cnt[j] += 1;
    }
  }

  for (int i = 0; i < MAX_DIGIT; ++i) {
    if (bit_cnt[i] > (n - bit_cnt[i])) {
      choice[i] = 0;
    }
    else {
      choice[i] = 1;
    }
  }

  ll kplus1 = k + 1;

  ll acc = 0;
  ll minusacc = 0;

  for (int i = 0; i < MAX_DIGIT; ++i) {
    if ((kplus1 >> i) & 1LL) {
      minusacc += (1LL << i);
      ansvec.push_back(kplus1 - minusacc + acc);
    }
    acc += (1LL << i) * choice[i];
  }

  for (auto e: ansvec) {
    ans = max(ans, calc(e));
  }

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 1024
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

// End of template.


int main(){
    cout << fixed << setprecision(15);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    rep(i, 10) rep(j, 10) {
        if (i * j == n) {
            print("Yes");
            return 0;
        }
    }

    print("No");

    return 0;
}



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

#define int long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int mod = 1e9 + 7;
const int N = 2e5 + 5;
const int inf = 1e16 + 2;


void solve(int z) {
    int x , cnt = 0;
    cin >> x;
    int t = 100;
    while(t < x) {
        cnt ++;
        t += (t / (100));
    }
    cout << cnt << '\n';
}

/*
 */

int32_t main()
{
    fastio
    int testcase = 1;
    //cin >> testcase;
    int x = 1;
    while(testcase --) {
        solve(x ++);
    }
    
    return 0;
}
 



Measured memory_bytes: 3652
# include <iostream>
# include <stdio.h>
# include <cmath>
# include <iomanip>
// # include <cstring>
// # include <string>
// # include <cctype>
// # include <algorithm> //transformの関数はaslgorithmライブラリに入っているみたい。
using namespace std;
int main(){
  int n;
  cin >> n;
  int x[n],y[n];
  double p1,p2,p3,p_8;
  p1 =0;
  p2 =0;
  p3 =0;
  p_8=0;
  for(int i = 0;i < n;i++){
    cin >> x[i];
  }
  for(int i = 0;i < n;i++){
    cin >> y[i];
  }
  for (int i = 0;i < n;i++){
    // p = 1
    p1 += abs(x[i]-y[i]);
    p2 += pow(abs(x[i]-y[i]),2);
    p3 += pow(abs(x[i]-y[i]),3);
    if(abs(x[i]-y[i]) > p_8){
      p_8 = abs(x[i]-y[i]);
    }
  }
  cout << fixed;
  cout << setprecision(6);
  cout << p1 << endl;
  cout << sqrt(p2) << endl;
  cout << pow(p3,1.0/3.0) << endl;
  cout << p_8 << endl;
  return 0;
}


Measured memory_bytes: 3476
import java.util.*;

public class Main{
    Scanner in = new Scanner(System.in);

    void solve(){
        String s = in.nextLine();
        long ans = 0;
        for(int i = 0; i < s.length(); i++){
            for(int j = i + 1; j <= s.length(); j++){
                long t = Long.parseLong(s.substring(i, j));
                ans += t * Math.pow(2,Math.max(0, i - 1) + Math.max(0, s.length() - j - 1));
            }
        }


        System.out.println(ans);
    }

    public static void main(String[] args){
        new Main().solve();
    }
}

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

int main() {
  cout << fixed << setprecision(12);
  int A, B, H, M;
  cin >> A >> B >> H >> M; 
  
  int t = 60*H + M;
  double theta = 11 * t * M_PI / 360;

  double x = A*A + B*B - 2*A*B*cos(theta);

  cout << sqrt(x); 

  return 0;
}


Measured memory_bytes: 4200
#include<stdio.h>

int selectionSort(int A[],int N){
  int i,j,minj,sw=0,t;
  for(j=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j] < A[minj]) minj = j;
    }
    t = A[i]; A[i] = A[minj]; A[minj] = t;
    if(i != minj) sw++;
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++) scanf("%d",&A[i]);

  sw =  selectionSort(A,N);

  for(i=0;i<N;i++){
    if(i>0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",sw);

  return 0;
}



Measured memory_bytes: 2140
fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt)
    var result = 99999
    for (i in 0 until A.size) {
        val q = check(A[i])
        if(result > q) result = q
    }
    println(result)
}

tailrec fun check(n: Int, ans: Int =0): Int {
    if (n%2==1) return ans
    return check(n/2, ans+1)
}

Measured memory_bytes: 37860
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(){
  int N, K, C, total = 0, ans = 0, abledays = 0, count = 0 ;
  cin >> N >> K >> C ;
  char S[N] ;
  int greed[K], revgreed[K] ;
  cin >> S ;
  for(int i=0;i<N;i++){
    if(count) count-- ;
    else if(S[i] != 'x'){
      if(abledays == K) return 0 ;
      greed[abledays] = i ;
      abledays++ ;
      count = C ;
    }
  }
  count = 0 ;
  for(int i=(N-1);i>=0;i--){
    if(count) count-- ;
    else if(S[i] != 'x'){
      abledays-- ;
      revgreed[abledays] = i ;
      count = C ;
    }
  }
  for(int i=0;i<K;i++){
    if(greed[i] == revgreed[i]){
      cout << (greed[i]+1) << endl ;
    }
  }
  return 0 ;
}  

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

using namespace std;

int main()
{
    int M, D;   cin >> M >> D;
    int ans = 0;

    for (int m = 1; m <= M; ++m) {
        for (int d = 1; d <= D; ++d) {
            int d1 = d % 10, d10 = d / 10;
            if (d1 >= 2 && d10 >= 2 && d1 * d10 == m) {
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int a;
	int b;
	int c;

	scanf("%d %d %d", &a, &b, &c);

	if (a<=b && b<=c){
	printf("%d %d %d\n",a,b,c);
}else if(a<=b && c<=b && a<=c){
	printf("%d %d %d\n",a,c,b);
}else if(a>=b && c>=a){
	printf("%d %d %d\n",b,a,c);
}else if(a>=b && c<=a && b<=c){
	printf("%d %d %d\n",b,c,a);
}else if(c<=b && a<=b && c<=a){
	printf("%d %d %d\n",c,a,b);
}else{
	printf("%d %d %d\n",c,b,a);
}

	return 0;
}


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

int main()
{
  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  if (x-r>=0 && x+r<=w && y-r>=0 && y+r<=h) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}



Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
const ll INF = 1LL << 60;

int main(){
	int x, y, z; cin >> x >> y >> z;
	cout << (x-z)/(y+z) << endl;
}


Measured memory_bytes: 256
// / #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
 
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <bitset>
#include <time.h>
#include <stack>
#include <sstream>
#include <regex>
 
#define prev asasddlsa
#define rank aljds
 
using namespace std;
 
typedef long long ll;
typedef long double dbl;

// mt19937 mrand(random_device{} ());
// int rnd(int x = INT_MAX) {
//     return mrand() % x;
// }

template<typename T>
void print(const vector<T>& s){
    for (auto x : s)
        cout << x + 1 << ' ';
    // cout << endl;
}
 
template<class T>
void print(const T* s, int n){
    for (int i = 0; i < n; i++){
        cout << s[i] << ' ';
    }
    cout << endl;
}
 
template<class T>
void print(vector<vector<T>> s){
    for (int i = 0; i < s.size(); i++)
        print(s[i]);
}

int main(){
    srand(time(0));
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> s(n);
    set<int> unused;
    vector<int> deg(n);
    for (int i = 0; i < n; i++){
        cin >> s[i];
        s[i]--;
        deg[s[i]]++;
        unused.insert(i);
    }
    vector<int> order;
    while (unused.size() > 8){
        // bool ok = false;
        for (int x : unused){
            if (order.size() == 0 || s[order.back()] != x){
                if (unused.count(s[x]) && deg[s[x]] + 1 == unused.size()){
                    order.push_back(s[x]);
                    unused.erase(s[x]);
                    deg[s[s[x]]]--;
                } else {
                    order.push_back(x);
                    unused.erase(x);
                    deg[s[x]]--;
                }
                break;
            }
        }
    }
    vector<int> p;
    for (int x : unused)
        p.push_back(x);
    int t = order.size() ? order.back() : -1;
    do {
        if (t != -1 && s[t] == p[0])
            continue;
        bool ok = true;
        for (int i = 0; i + 1 < p.size(); i++){
            if (s[p[i]] == p[i + 1]){
                ok = false;
                break;
            }
        }
        if (ok){
            print(order);
            print(p);
            cout << endl;
            return 0;
        }
    } while (next_permutation(p.begin(), p.end()));
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 6272
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    string s;
    cin >> s;
    
    int ans = 100100100;
    rep(i, s.size()) {
        int x = 0;
        int cnt = 0;
        rep(j, i) {
            if (s[j] != s[i]) ++cnt;
            else {
                x = max(x, cnt);
                cnt = 0;
            }
        }
        x = max(cnt, x);
        int y = s.size() - i - 1;
        ans = min(ans, max(x, y));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define ll long long int
int main()
{
    ll ans=3,n,mod=1e9+7;
    cin>>n;
    string s1,s2;
    cin>>s1>>s2;
    int i=0;
    if(s1[0]==s2[0])
    {
        ans=3;
        i=1;
    }
    else
    {
        ans=6;
        i=2;
    }
    for(;i<n;)
    {
        if(s1[i]==s2[i]&&s1[i-1]!=s2[i-1])
        {
            i++;
        }
        else if(s1[i]==s2[i]&&s1[i-1]==s2[i-1])
        {
            ans=(ans*2)%mod;
            i++;
        }
        else if(s1[i]!=s2[i]&&s1[i-1]==s2[i-1])
        {
            i+=2;
            ans=(ans*2)%mod;
        }
        else
        {
            i+=2;
            ans=(ans*3)%mod;
        }
    }
    cout<<ans;
}


Measured memory_bytes: 256
A, B, M = [int(i) for i in input().split(" ")]

a = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
C = []

for i in range(M):
  c = [int(i) for i in input().split(" ")]
  C.append(c)

m = min(a) + min(b)

for c in C:
  cost = a[c[0] - 1] + b[c[1] - 1] - c[2]
  if m >= cost:
    m = cost

print(m)

Measured memory_bytes: 32492
N = int(input())
li = list(map(int,input().split()))
print(*li)

for i in range(1,N):
    v = li[i]
    j = i - 1
    while j >= 0 and li[j] > v:
        li[j+1] = li[j]
        j -= 1
    li[j+1] = v
    print(*li)


Measured memory_bytes: 5976
use std::io::{stdout, Write, BufWriter};

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: i32,
        a: i32,
        b: i32,
        s: String,
    }
    let s = s.as_bytes();
    let out = stdout();
    let mut out = BufWriter::new(out.lock());

    let mut n_q = 0;
    let mut rank = 1;
    for &p in s {
        match p {
            b'a' if n_q < a + b => {
                n_q += 1;
                writeln!(out, "Yes").unwrap();
            },
            b'b' if n_q < a + b && rank <= b => {
                n_q += 1;
                rank += 1;
                writeln!(out, "Yes").unwrap();
            },
            _ => {writeln!(out, "No").unwrap();},
        }
    }
}


Measured memory_bytes: 4732
#include <bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define trav(x,c) for(auto &x:c)
using namespace std;

int toint(string s) {
  int ans = 0;
  for(char x: s) ans = ans*10 + (x - '0');
  return ans;
}

int sum(int x) {
  int s = 0;
  while(x) {
    s += x%10;
    x /= 10;
  }
  return s;
} 

int main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(a > c){swap(a,c); swap(b,d);}
  int ans = 0;
  // complete 
  if(a <= c && b >= d) {ans = d-c;}
  // none
  else if(b < c) {ans = 0;}
  // partial
  else {ans = b-c;}
  cout<<ans;
}

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

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

  int w, a, b;
  cin >> w >> a >> b;
  if (b > a) swap(a, b);
  cout << max(0, a - (b + w)) << '\n';
  return 0;
}

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

int main(int argc, char *argv[]){
    char n[200000];
    cin >> n;
    int c=0;
    int i=0;
    while(n[i]!='\0'){
        c+=n[i]-'0';
        c%=9;
        i++;
    }
    if(c==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

int main(){

  int N;//展望台の数
  int M;//道の数
  cin >> N >> M;

  vector<int> H(N);
  for(int i=0;i<N;i++){
    int h;
    cin >> h;
    H[i] = h;
  }

  vector<int> edge[N];

  for(int i=0;i<M;i++){
    int a,b;
    cin >> a >> b;a--;b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }

  int count = 0;

  cout << endl;

  for(int i=0;i<N;i++){
    if(edge[i].size()==0)count++;
    else{
      for(int j=0;j<edge[i].size();j++){
        if(H[i] <= H[edge[i][j]]) break;
        else if(j==(edge[i].size()-1)) count++;
      }
    }
  }

  cout << count << endl;
}

Measured memory_bytes: 8804
#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)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647 >> 1); // 10^9 + 5000
static const ll LLINF = (9223372036854775807 >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;

namespace Kunitaka{
    template<
        typename TYPE,
        std::size_t SIZE
    >
    std::size_t array_length(const TYPE (&array)[SIZE])
    {
        return SIZE;
    }
}
using namespace Kunitaka;
namespace Printer{
    void br(){
        cout << endl;
    }

    void loop_cnt(int i){
        cout << "i = " << i << endl;
    }

    void loop_cnt(int i, int j){
        cout << "i = " << i << ", " << "j = " << j << endl;
    }

    template<class T>
    void print(T x){
        cout << x << endl;
    }

    template<class T, class S>
    void print(T x, S y){
        cout << x << "," << y << endl;
    }

    template<class T, class S, class U>
    void print(T x, S y, U z){
        cout << x << "," << y << "," << z << endl;
    }

    template<class T, class S>
    void print(pair<T, S> p){
        cout << p.first << ", " << p.second << endl;
    }

    template<
        typename TYPE,
        std::size_t SIZE
    >
    void print(const TYPE (&array)[SIZE]){
        int lim = array_length(array);
        for(int i=0; i<lim; i++){
            if(i) cout << " ";
            cout << array[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<S> v){
        for(int i=0; i<v.size(); i++){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    template<class S>
    void print(vector<vector<S> > vv){
        for(int i=0; i<vv.size(); i++){
            for(int j=0; j<vv[i].size(); j++){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }

    void yesno(bool x){
        if(x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
};
using namespace Printer;

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//


    // input
    cout << fixed << setprecision(10);

    ll N, R; cin >> N >> R;
    ll K = 0;
    // variable
    ll ans = 0;
    // solve
    if(N < 10){
        K = R + 100 * (10 - N);
    }
    else{
        K = R;
    }
    ans = K;

    print(ans);
    
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i = 1;
        int x = 1;
        while (true){
          x = sc.nextInt();
          if (x == 0) break;
          System.out.println( "Case " + i + ": " + x );
          i++;
        }
      }
    }



Measured memory_bytes: 41564
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//var min, min2, count: Int!
//for i in 1...10 {
//    let x = Int(readLine()!)!
//    if i == 1 {
//        min = x
//        count = 1
//    } else if x < min {
//        min2 = min
//        min = x
//        count = 1
//    } else if x == min && count == 1 {
//        min2 = x
//        count = 2
//    }
//}
//print(min2)

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (A, B) = (input[0], input[1])
let S = readLine()!.toArray()
var ans = "Yes"
for (i, c) in S.enumerate() {
    if i == A {
        if c != "-" {
            ans = "No"
            break
        }
    } else {
        if c == "-" {
            ans = "No"
            break
        }
    }
}
print(ans)


Measured memory_bytes: 7400
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

int main(){
    string S, S_; cin >> S; S_ = S;
    ll N = S.size();
    int cnt1=0, cnt2=0;
    for(int i = 0; i < N-1; i++){
        if(S[i] == S[i+1]){
            cnt1++;
            if(S[i] == '0') S[i+1] = '1';
            else if(S[i] == '1') S[i+1] = '0';
        }
    } 

    for(int i = N-1; i > 0; i--){
        if(S_[i] == S_[i-1]){
            cnt2++;
            if(S_[i] == '0') S_[i-1] = '1';
            else if(S_[i] == '1') S_[i-1] = '0';
        }
    } 
    cout << min(cnt1, cnt2) << endl;

}

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
vector<string>split(string s, char c = ' ') {
	vector<string>vec;
	string h = "";
	for (int i = 0; i < s.size();) {
		int j = i;
		while (j < s.size() && s[j] != ' ') {
			h += s[j++];
		}
		if (h.size() > 0) vec.push_back(h);
		h = "";
		i = j + 1;
	}
	return vec;
}
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
int a[300000];
signed main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i] -= i + 1;
	}
	sort(a, a + n);
	ll k = a[n / 2];
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		ans += abs(a[i] - k);
	}
	cout << ans << endl;
}

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

#define var long long

var knapsack(var weights[], var values[], var dp[][101], var w, var n) {
	if(dp[w][n] != -1) {
		return dp[w][n];
	}
	if(w == 0 || n == 0) {
		return dp[w][n] = 0;
	}
	if(weights[n-1] > w) {
		return dp[w][n] = knapsack(weights, values, dp, w, n-1);
	}
	return dp[w][n] = max(values[n-1] + knapsack(weights, values, dp, w-weights[n-1], n-1), knapsack(weights, values, dp, w, n-1));
}

int main() {
	// your code goes here
	var n, w;
	cin >> n >> w;
	var weights[n], values[n];
	for(var i=0; i<n; i++) {
		cin >> weights[i] >> values[i];
	}
	var dp[w+1][101];
	for(var i=0; i<=w; i++) {
		for(var j=0; j<=n; j++) {
			dp[i][j] = -1;
		}
	}
	cout << knapsack(weights, values, dp, w, n) << endl;
	return 0;
}

Measured memory_bytes: 79104
#include<bits/stdc++.h>
using namespace std;
//typedef unsigned long long ull;
class gfg 
{ 
 public : int gcd(int a, int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
 } 
 
  int lcm(int a, int b)  
 {  
    return (a*b)/gcd(a, b);  
 }  
} ; 

int main()  
{  
    gfg g; 
    int n; cin>>n; 
    int x = g.lcm(360, n);
    cout<<x/n<<endl;
    return 0;  
}  

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> X(M, 0);
  for (int i = 0; i < M; ++i) {
    cin >> X[i];
  }
  sort(X.begin(), X.end());
  vector<int> L(M - 1, 0);
  for (int i = 0; i < M - 1; ++i) {
    L[i] = X[i + 1] - X[i];
  }
  sort(L.begin(), L.end());	
  
  int ans = 0;
  for (int i = 0; i < M - N; ++i) {
    ans += L[i];
  }
  
  cout << ans << endl;
}

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

int main(){
	while(1){
		int n, count=0; 
		long h[101]={0}, c[100]={0};
		
		scanf(" %d", &n);
		if(n==0) break;
		for(int i=0; i<=n; ++i)
			scanf(" %ld", &h[i]);
			
		for(int i=0; i<=n; ++i){
			int count=0;
			
			for(int j=0; j<=n; ++j){ 
				if(i!=j){
					c[count]=h[j];
					++count;
				}
			}
			bool flag=true;
			
			for(int j=1; j<n; ++j){
 				if(c[1]-c[0]!=c[j]-c[j-1]) flag=false;
 			}
 			
 			if(c[1]<=c[0]) flag=false;
 			
 			if(flag){
 				printf("%ld\n", h[i]);
 				break;
 			}
 		}
 		
 	}
 		
	return 0;
}

Measured memory_bytes: 1192
#include<cstdio>
const int N=1000005;
int n,he[128],nx[N],a,qu[N*2],hd,tl,d;char s[N],t[N];
inline int mx(int x,int y){return x>y?x:y;}
int main()
{
	scanf("%d%s%s",&n,s+1,t+1),hd=n+1,tl=n;
	for(int i=1;i<=n;++i)nx[i]=he[s[i]],he[s[i]]=i;
	for(int i=n;i;--i)
	{
		if(hd>tl||i<qu[hd]-d)
		{
			hd=n+1,tl=n,d=0;
			if(s[i]!=t[i])
			{
				for(;he[t[i]]&&he[t[i]]>=i;he[t[i]]=nx[he[t[i]]]);
				if(!he[t[i]])return printf("-1"),0;
				qu[--hd]=he[t[i]],qu[++tl]=i;
			}
		}
		else
		{
			if(s[qu[hd]-d]!=t[i])
			{
				for(;he[t[i]]&&he[t[i]]>=qu[hd]-d;he[t[i]]=nx[he[t[i]]]);
				if(!he[t[i]])return printf("-1"),0;
				for(;qu[tl]-d>i;--tl);++d,qu[--hd]=he[t[i]]+d,qu[++tl]=i+d;
			}
		}
		a=mx(a,tl-hd);
	}
	printf("%d",a);
	return 0;
}

Measured memory_bytes: 11452