akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */

void trace (vector<int> const & a) {
    int n = a.size();
    for(int i=0; i<n; ++i) {
        if(i) cout << " ";
        cout << a[i];
    }
    cout << endl;
}

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

    int n; cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; ++i) cin >> a[i];
    
    int cnt = 0;
    for(int i=0; i<n; ++i) {
        int minj = i;
        for(int j=i+1; j<n; ++j) {
            if(a[j] < a[minj]) minj = j;
        }
        if(minj != i) swap(a[minj], a[i]), ++cnt;
    }
    trace(a);
    cout << cnt << endl;


    return 0;
}



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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  VI h(n);
  rep(i, n) cin >> h[i];
  bool ans = true;
  for(int i = n-1; i >= 0; --i) {
    if(h[i] < h[i-1] - 1) {
      ans = false;
      break;
    }
    else if(h[i-1] - 1 == h[i]) h[i-1]--;
  }
  puts(ans ? "Yes" : "No");
  return 0;
}


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

typedef vector<int> veci;
typedef pair<int, int> pii;
typedef vector<pii> vecii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vecl;
typedef vector<pll> vecll;
#define EPS (1e-9)
#define MOD (1e9 + 7)
#define fi first
#define se second
#define endl '\n'

void solve() {
    bool mul[101] = {0,};

    for (int i=1; i<10; ++i) {
        for (int j=1; j<10; ++j) {
            mul[i*j] = 1;
        }
    }

    int num;
    cin >> num;

    cout << (mul[num] ? "Yes" : "No") << endl;
}

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL_TEST
    (void)argc;
    const string strpath = string(argv[0]) + string("-test.in");
    freopen(strpath.c_str(), "r", stdin);
    int tcs;
    cin >> tcs;
    while (tcs-- > 0)
#endif
        solve();
}


Measured memory_bytes: 256
def inpl(): return list(map(int, input().split()))

S = input()

if 1 <= int(S[:2]) <= 12:
    if 1 <= int(S[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= int(S[2:]) <= 12:
        print("YYMM")
    else:
        print("NA")

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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef long long ll;
const long long MOD = 1000000000 + 7;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint
{
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

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

int main(){
    int n;
    cin >> n;
    if(n<2){
        cout << 0 << endl;
        return 0;
    }
    if(n==2){
        cout << 2 << endl;
        return 0;
    }
    mint tot = 1;
    rep(i,n){
        tot *= 10;
    }
    mint w_one = 1;
    rep(i, n)
    {
        w_one *= 9;
    }
    mint w_two = 1;
    rep(i, n)
    {
        w_two *= 8;
    }
    mint out;
    out = tot - w_one;
    out -= w_one;
    out += w_two;
    cout << out << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

const lint MOD = pow(10, 9) + 7;

lint gcd(lint a, lint b) {
	//aとbの最大公約数を返す
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	return gcd(a % b, b);
}

lint lcm(lint a, lint b) {
	//aとbの最小公倍数を返す
	return a / gcd(a, b) * b;
}

/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/


int main() {
	int N, A, B;
	cin >> N >> A >> B;
	vector<int>P(N);
	rep(i, N) {
		cin >> P[i];
	}
	sort(P);
	int a, b, c;
	a = upper(P, A) - P.begin();
	b = upper(P, B) - lower(P, A + 1);
	c = P.end() - lower(P, B + 1);
	a = min(a, b);
	a = min(a, c);
	cout << a << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb  push_back
#define FOR(i,n) for(int i=0;i<(n);i++)
#define FORA(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
int main()
{FAST
ll sum=0;
int x,y,a,c,b;
cin>>x>>y>>a>>b>>c;
int p[a],q[b],r[c];
FOR(i,a)
{
	cin>>p[i];
}
FOR(i,b)
{
	cin>>q[i];
}
FOR(i,c)
{
	cin>>r[i];
}
sort(p, p+a, greater<int>()); 
sort(q, q+b, greater<int>()); 
sort(r, r+c, greater<int>()); 
vector<int> v;
int count =0;
FOR(i,x)
{
	v.pb(p[i]);
}
FOR(i,y)
{
		v.pb(q[i]);
}

sort(v.begin(),v.end());
FOR(i,x+y)
{
   if(v[i]<r[count]&&count<c)
   {
   	sum+=r[count];
   	count++;
   }	
   else
   {
   		sum+=v[i];
   }
}
cout<<sum;

return 0;
}






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

typedef long long ll;
const ll INF = 1010000000000000017LL;
const ll MOD = 1000000007LL;

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

//#define DEBUG(fmt, ...)
#define DEBUG(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)

int main(){
    std::cout<<std::fixed<<std::setprecision(10);

    ll N;

    cin >> N;

    cout << ((N%1000 == 0) ? 0 : (1000 - (N%1000))) << endl;
}

Measured memory_bytes: 3616
s=int(input())
a=[s]
a_before=s
ans=1
while True:
    buf=0
    ans+=1
    if a_before%2==0:
        buf=a_before//2
    else:
        buf=3*a_before+1
    if buf in a:
        break
    a.append(buf)
    a_before=buf
print(ans)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        double r = sc.nextDouble();
        double pi = Math.PI;
        double area = (r*r*pi);
        double length = (2*r*pi);
        System.out.printf("%f %f", area, length);

        sc.close();
    }
}


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

int main(){

ios_base::sync_with_stdio(false);

long long n,d,k,ans,i;


cin>>n>>d;

k=1+d;
ans=1;
i=2;

while((k+d)<n){
	
	k=i*(1+d)+(i-1)*d;
	ans++;
i++;}

cout<<ans<<endl;

return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define len(v) ((int)((v).size()))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb push_back
#define endl '\n'
#define mod 1000000007
using namespace std;
//for debugging array
void debugv(std::vector<ll> v);
//for printing array
void printv(std::vector<ll> v);
//for taking input in array
void inputv(std::vector<ll> &v);
//solve



void solve()
{
	ll d, t, s;
	cin >> d >> t >> s;
	// cout << d << " " << t << " " << s << "\n";
	double time = (double)d / s;
	// cout << time << "\n";
	if (time <= t)
	{
		cout << "Yes";
		return;
	}
	cout << "No";
}
//main method
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("error.txt", "w", stderr);
#endif

	long long t; //cin >> t;
	t = 1;
	while (t--)
	{
		solve();
		cout << "\n";
	}
	return 0;
}

//for debugging array
void debugv(std::vector<ll> v)
{
	ll size = v.size();
	for (ll i = 0; i < size; i++)
	{
		cerr << v[i] << " ";
	}
	cout << endl;
}
//for printing array
void printv(std::vector<ll> v)
{
	ll size = v.size();
	for (ll i = 0; i < size; i++)
	{
		cout << v[i] << " ";
	}
	cout << endl;
}
//for taking input in array
void inputv(std::vector<ll> &v)
{
	for (auto& i : v)
	{
		cin >> i;
	}
}

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

int main()
{
	int n;
	double v[50];
	double m = 0;
	
	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> v[i];

	sort(v, v + n);

	m = v[0];

	for (int i = 1; i < n; i++)
		m = (m + v[i]) / 2;

	cout << m << endl;

	return 0;
}

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
const ll zero=0;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0,buf1=0,buf2=0,buf3=0,buf4=0,sum=0;
  bool judge = true;
  ll n,h,w;cin>>n>>h>>w;
  vector<ll>a(n),b(n);
  for(i=0;i<n;i++)cin>>a[i]>>b[i];
  for(i=0;i<n;i++){
    if(a[i]>=h&&b[i]>=w)res++;
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int i,spr[3],n,win,lose,te[5];

  do{
    scanf("%d",&n);
    if(!n) break;
    win=-1,lose=-1;
    for(i=0;i<3;i++) spr[i]=0;
    spr[n-1]++;
    te[0]=n-1;
    for(i=0;i<4;i++){
      scanf("%d",&n);
      spr[n-1]++;
      te[i+1]=n-1;
    }
    if(spr[0]*spr[1]*spr[2]==0){
      if(spr[0]*spr[1]){
	win=0;
	lose=1;
      }else if(spr[1]*spr[2]){
	win=1;
	lose=2;
      }else if(spr[2]*spr[0]){
	win=2;
	lose=0;
      }
    }
    for(i=0;i<5;i++)
      if(win==te[i]) printf("1\n");
      else if(lose==te[i]) printf("2\n");
      else printf("3\n");
  }while(1);
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
long int block = 0;
const long int N = 5e5 + 100;
long int tree[4*N]={0};
void update(long int node,long int l,long int r,long int ind, long int val)
{
    if(l==r)
    tree[node]=val;
    else
    {
       long int mid = (l+r)/2;
       if(ind<=mid)
       update(2*node+1,l,mid,ind,val);
       else
       update(2*node+2,mid+1,r,ind,val);
       tree[node] = tree[2*node+1] + tree[2*node+2];
    }
}
long int query(long int node,long int l,long int r,long int L,long int R)
{
    if(R<l || r<L)
    return 0;
    if(L<=l && R>=r)
    return tree[node];
    long int mid = (l+r)/2;
    return query(2*node+1,l,mid,L,R) + query(2*node+2,mid+1,r,L,R);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	long int n,q;
	cin>>n>>q;
	long int a[n+1],p[n+1],cnt[n+1]={0};
	for(long int i=1;i<=n;i++)
	cin>>a[i],p[i]=-1;
	vector<pair<long int, long int>> x[n+1];
	long int ans[q]={0};
	long int aa,bb;
	for(long int i=0;i<q;i++)
	{
	    cin>>aa>>bb;
	    x[bb].push_back({aa,i});
	}
	for(long int i=1;i<=n;i++)
	{
	    if(p[a[i]]!=-1)
	    {
	      cnt[p[a[i]]]--;
	      update(0,1,n,p[a[i]],0);
	    }
	      p[a[i]]=i;
	      cnt[i]++;
	      update(0,1,n,i,1);
	      for(long int j=0;j<x[i].size();j++)
	      {
	          ans[x[i][j].ss] = query(0,1,n,x[i][j].ff,i);
	      }
	}
	for(long int i=0;i<q;i++)
	cout<<ans[i]<<endl;
	return 0;
}


Measured memory_bytes: 52460
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
 
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()

using namespace std;
 
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
 
const int INF=1<<29;
const double EPS=1e-9;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

string s;
long long int res = 0;


void eval(string ss){
	long long int sum = 0,num = 0;
	for(int i = 0;i < ss.length();i++){
		if(ss[i] == '+'){
			sum += num;
			num = 0;
		}
		else{
			num = num * 10 + ss[i] - '0';
		}
	}
	sum += num;
	res += sum;
}

void make_s(string ss,int n){
	if(n == s.length()){
		eval(ss);
		return;
	}
	make_s(ss + s[n],n + 1);
	if(n != 0) make_s(ss + "+" + s[n],n + 1);
}


int main(){
	cin >> s;
	make_s("",0);
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::collections::HashMap;
fn main(){
    input!{
        n:i64,
        tn:[(i64,i64,i64);n],
    }
    let mut now = (0,0,0);
    let mut ans = false;
    for &(t,x,y) in &tn {
        let distance =  (x-now.1).abs() + (y-now.2).abs();
        if distance <= (now.0 -t).abs() && (now.0-t).abs() % 2 == distance % 2 {
            ans = true;
        } else {
            ans = false;
            break;
        }
        now = (t,x,y);
    }
    println!("{}" ,if ans {"Yes"} else {"No"});
}

Measured memory_bytes: 8444
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define swap(p,q) r=(p);(p)=(q);(q)=r
#define INF 1000000000000//10^12
#define INFINT 2000000001//2*10^9+1
#define ALL(a) (a).begin(),(a).end()

using namespace std;




int main(void)
{
	//変数の宣言
	char s[110];
	ll int n;

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	int ans=0;
	int count=0;
	int temp,temp1,temp2;
	int max,min;
	int len;
	int sum=0;



	//データの読み込み


	scanf("%s",&s);
//	scanf_s("%s",&s,110);

	scanf("%lld",&n);
//	scanf_s("%lld",&n);


/*	for(i=0;i<n;i++){
//		scanf("%lld",&t[i]);
		scanf_s("%lld",&t[i]);
	}*/
	
	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	if(n>100) n=100;  
	for(i=0;i<n;i++){
		if(s[i]!='1'){
			printf("%c",s[i]);
			return 0;
		}
	}


	//	printf("計算部分終了\n");

	//出力

	printf("%c",s[n-1]);

	//	printf("結果の出力終了\n");


	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)
using namespace std;
using ll = int64_t;

int solve(const vector<bitset<100>>& v, const bitset<100>& rem) {
  if (rem.none()) return 0;
  bitset<100> b;
  int mx = 0;
  vector<int> cnt(100, 0);
  for(auto&& t : v) {
    int n = (rem & t).count();
    if (n > mx) {
      b = t;
      mx = n;
    }
    REP(i,100) {
      if (t[i]) ++cnt[i];
    }
  }
  set<int> s;
  REP(i,100) {
    if (rem[i]) {
      if (cnt[i] == 0) return 10000;
      if (cnt[i] == 1) s.insert(i);
    }
  }
  if (s.empty()) {
    vector<bitset<100>> tmp;
    for(auto&& t : v) {
      if (t != b) tmp.push_back(t);
    }
    return min(solve(tmp, rem & ~b) + 1, solve(tmp, rem));
  } else {
    vector<bitset<100>> tmp;
    bitset<100> next = rem;
    for(auto&& t : v) {
      bool use = false;
      for(auto&& i : s) {
        if (t[i]) {
          next &= ~t;
          use = true;
          break;
        }
      }
      if (use) continue;
      tmp.push_back(t);
    }
    return solve(tmp, next) + (v.size() - tmp.size());
  }
}

int main() {
  while(1) {
    int w,h;
    cin>>w>>h;
    if (!w) break;
    vector<vector<int>> t(h, vector<int>(w));
    REP(i,h)REP(j,w) cin>>t[i][j];
    REP(i,h)REP(j,w) {
      int m=min(h-i, w-j);
      FOR(k,1,m+1) {
        bool ok = true;
        REP(p,k)REP(q,k) {
          if (t[i+p][j+q]==0) ok=false;
        }
        if (ok) t[i][j] = k;
      }
    }
    vector<vector<bool>> maxi(h, vector<bool>(w, true));
    REP(i,h)REP(j,w) {
      if (t[i][j] == 0) maxi[i][j] = false;
      REP(p,i+1)REP(q,j+1) {
        if (p==i && q==j) continue;
        int d=max(i-p,j-q);
        if (t[p][q] >= t[i][j] + d) maxi[i][j] = false;
      }
    }
    vector<bitset<100>> v;
    REP(i,h)REP(j,w) {
      if (maxi[i][j]) {
        bitset<100> b;
        REP(p,t[i][j])REP(q,t[i][j]) {
          b[(i+p)*10+(j+q)] = true;
        }
        v.push_back(b);
      }
    }
    bitset<100> rem;
    REP(i,h)REP(j,w) {
      if (t[i][j]) rem[i*10+j] = true;
    }
    cout << solve(v, rem) << endl;
  }
  return 0;
}


Measured memory_bytes: 3064
#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e18;
long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W, x, y, z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
typedef long long ll;
typedef pair<ll, ll> Pa;

map<string, ll> mp;
int main() {
	cin >> N;
	rep(i, N){
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		if(mp.find(s) == mp.end()) mp[s] = 1;
		else mp[s]++;
	}
	ll ans = 0;
	for(auto itr = mp.begin(); itr != mp.end(); itr++){
		ans += (itr->second)*(itr->second-1)/2;
	}
	cout << ans;
}


Measured memory_bytes: 11136
#include<stdio.h>
long long int min(long long int a, long long int b){
	if(a<b)
	return a;
	else
	{
		return b;
	}
	
}
int main(){
	long long int i,j,l,r,rem=2020,temp;
	scanf("%lld%lld",&l,&r);

	if((r-l+1)>=2019){
		printf("0");
		return 0;
	}
	else{
		for(i=l;i<r+1;i++){
			for(j=i+1;j<r+1;j++){
				temp=(i*j)%2019;
				rem=min(rem,temp);
			}
		}
		printf("%lld",rem);
		return 0;
	}

}

Measured memory_bytes: 1700
#include <bits/stdc++.h>
#define rep(i, l, r) for (__typeof(l) i = (l); i <= (r); ++i)
#define per(i, r, l) for (__typeof(r) i = (r); i >= (l); --i)
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int read() {
	int f = 1, x = 0;
	char ch = getchar();
	while (ch < '0' || ch > '9') {
		if (ch == '-') f = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9') {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return f * x;
}
int qpow(int a, int b) {
	int res = 1;
	while (b) {
		if (b & 1) res = (ll)res * a % mod;
		a = (ll)a * a % mod;
		b >>= 1;
	}
	return res;
}
int inv (int x) {
	return qpow(x, mod - 2);
}
const int N = 200020;
int n, a[N], b[N];
ll fac[N], sz[N], dp[N], up[N], upsz[N], record[N], ans[N];
vector <int> g[N];
void dfs(int u, int pre) {
	sz[u] = 1;
	ll ans = 1;
	for (int i = 0; i < g[u].size(); ++i) {
		int v = g[u][i];
		if (v == pre) continue;
		dfs(v, u);
		sz[u] += sz[v];
		ans = ans * (dp[v] * inv(fac[sz[v]]) % mod) % mod;
	}
	record[u] = ans;
	dp[u] = ans * fac[sz[u] - 1] % mod;
}
void dfs2(int u, int pre) {
	if (u == 1) ans[u] = dp[u], up[u] = 1, upsz[u] = 0;
	else {
		ll upward_dp = up[pre] * inv(fac[upsz[pre]]) % mod * (record[pre] * inv(dp[u] * inv(fac[sz[u]]) % mod) % mod) % mod;
		ll upward_sz = upsz[pre] + sz[pre] - sz[u];
	//	cerr << upward_sz<< " " << upward_dp << endl;
		upward_dp = upward_dp * fac[upward_sz - 1] % mod;
		up[u] = upward_dp, upsz[u] = upward_sz;
		ll real_dp = record[u] * (upward_dp * inv(fac[upward_sz]) % mod) % mod;
		ans[u] = real_dp * fac[n - 1] % mod;
	}

	for (int i = 0; i < g[u].size(); ++i) {
		int v = g[u][i];
		if (v == pre) continue;
		dfs2(v, u);
	}
}
int main() {
	scanf ("%d", &n);
	fac[0] = 1;
	for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
	for (int i = 1; i < n; ++i) {
		int u, v;
		scanf ("%d%d", &u, &v);
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(1, 1);
	dfs2(1, 0);
	for (int i = 1; i <= n; ++i) {
		cout << ans[i] << endl;
	}
	return 0;
}


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

int main(void){
	int a,b,c,d,n;
	bool f=true;
	while(cin>>n,n){
		if(!f)cout<<endl;
		f=false;
		cin>>a>>b>>c>>d;
		int e,f,g,h;
		int s=10*a+50*b+100*c+500*d;
		s-=n;
		h=s/500;
		s%=500;
		g=s/100;
		s%=100;
		f=s/50;
		s%=50;
		e=s/10;
		s%=10;
		if(a-e>0)cout<<"10 "<<a-e<<endl;
		if(b-f>0)cout<<"50 "<<b-f<<endl;
		if(c-g>0)cout<<"100 "<<c-g<<endl;
		if(d-h>0)cout<<"500 "<<d-h<<endl;
	}
	return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main(int argc, char const *argv[]) {
	vector<int> c(5);
	rep(i, 5) cin >> c[i];
	int k;
	cin >> k;

	bool flg = false;
	rep(i, 5) REP(j, i, 5) {
		if (abs(c[i] - c[j]) > k) flg = true;
	}

	cout << (!flg ? "Yay!" : ":(") << endl;
	return 0;
}

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

int main(){
    int n, q;
    string s;
    cin >> n >> s >> q;
    set<int> t[26];
    for(int i = 0; i < n; i++)  t[s[i]-'a'].insert(i+1);
    for(int i = 0; i < 26; i++) t[i].insert(n+1);
    while(q--){
        int op;
        cin >> op;
        if(op == 1){
            int i;
            char c;
            cin >> i >> c;
            i--;
            t[s[i]-'a'].erase(i+1);
            s[i] = c;
            t[s[i]-'a'].insert(i+1);
        }else if(op == 2){
            int l, r;
            cin >> l >> r;
            int ans = 0;
            for(int i = 0; i < 26; i++) ans += *(t[i].lower_bound(l)) <= r;
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 24196
#include <bits/stdc++.h>
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); i++)
using P = pair<int,int>;
using pq = priority_queue<int>;
typedef long long ll;

int  main()
{ 
	ll a; string b; cin >> a >> b;
	b.erase(1, 1);
	int ib = stoi(b);
	printf("%lld", (ll)a*ib/100);
	// cout << b;
	return (0);
}

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

int main(){
    string s, t, p;
    int q, a, b;
    cin>>s >>q;
    for(int i=0;i<q;i++){
        
        cin>>t >>a >>b;
        if(t=="replace"){
            
            cin>>p;
            s = s.substr(0, a) + p + s.substr(b+1, s.size()-b-1);
        }else if(t=="print"){
            cout<<s.substr(a, b-a+1)<<endl;
        }else{
            string u = s.substr(a, b-a+1);
            reverse(u.begin(), u.end());
            s = s.substr(0, a) + u + s.substr(b+1, s.size()-b-1);
        }
    }
    return 0;
}



Measured memory_bytes: 3220
t = [17,21,3,1,17,11,14,3,10,20,25,2,25,14,20,24,19,20,9,13,9,6,2,4,18,3,10,5,20,8,2,5,7,1,6,1,12,17,12,3,14,4,14,11,13,2,15,13,15,6,10,24,24,6,19,24,22,7,11,13,4,25,12,19,25,1,10,11,15,21,17,24,12,18,12,3,8,10,10,14,8,22,4,15,5,4,11,20,3,7,8,15,14,5,11,9,1,8,19,1,19,4,21,16,1,10,23,14,1,3,2,14,2,12,22,25,16,13,11,25,10,15,25,2,6,7,4,2,14,19,10,7,18,18,20,21,24,24,11,21,26,4,21,16,19,12,19,22,12,23,13,2,24,19,23,3,20,23,1,18,6,3,6,2,22,10,8,21,3,14,4,7,10,14,14,9,14,15,18,6,16,22,7,1,6,11,1,24,2,6,20,26,13,6,10,1,13,19,25,22,18,22,8,18,5,17,25,21,14,26,13,15,11,13,10,21,24,15,18,15,13,13,22,2,9,14,18,12,18,7,2,12,6,6,14,8,4,21,3,3,8,10,12,19,4,1,11,15,10,5,1,23,4,18,9,8,11,25,24,3,25,6,18,14,3,5,19,9,23,26,21,8,3,1,8,26,10,22,8,26,24,11,9,7,16,2,5,17,23,23,15,17,9,14,14,10,21,23,17,15,20,20,6,18,16,9,6,9,12,6,17,23,9,22,7,17,24,11,1,25,11,8,10,5,1,25,8,8,24,9,21,22,3,18,4,4,25,10,12,10,16,12,12,13,1,7,21,23,25,9,2,24,17,12,8,16,23,22,14,23,2,21,23,13,22]
for i in range(365):
  print(t[i])

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

bool beki[1000];

int main()
{
    int K, S;
    int cnt = 0;
    cin >> K >> S;

    for (int x = 0; x <= K; ++x)
    {
        for (int y = 0; y <= K; ++y)
        {
            if (S - x - y >= 0 && S - x - y <= K)
            {
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
h, w, m = map(int, input().split())
s = []
r = [0] * (h + 1)
c = [0] * (w + 1)
for i in range(m):
    bh, bw = map(int, input().split())
    s.append([bh, bw])
    r[bh] += 1
    c[bw] += 1
R = max(r)
nr = {i for i, x in enumerate(r) if x == R}
C = max(c)
nc = {i for i, x in enumerate(c) if x == C}
count = sum(x in nr and y in nc for x, y in s)
print(R + C - (len(nr) * len(nc) == count))

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

int main(){
  int N,X,count,tot;
  cin>>N>>X;
  count=0;
  tot=0;
  for(int i=0;i<=N;i++){
      int l;
      cin>>l;
      if(tot<=X){
          count+=1;
      } 
      else{
          break;
      }
    tot += l;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

A, B = list(map(int, sys.stdin.buffer.readline().split()))

for n in range(100000):
    if int(n * 0.08) == A and int (n * 0.10) == B:
        print(n)
        exit()
print(-1)


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;

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

  int l=0,r=100000;
  rep(i,m){
    int nowl, nowr;
    cin >> nowl >> nowr;

    l = max(l,nowl);
    r = min(r,nowr);
  }
  //cout << l << " " << r << endl;
  cout << max(0,r-l+1);
}

Measured memory_bytes: 3632
class List
  class Node
    attr_reader :key
    attr_accessor :prev, :next

    def initialize(key)
      @key = key
      @prev = @next = self
    end
  end

  include Enumerable

  attr_reader :head

  def initialize
    @head = Node.new(nil)
  end

  def each
    node = @head.next

    while node != @head
      yield node
      node = node.next
    end
  end

  def insert(key)
    node = Node.new(key)
    node.next = @head.next
    @head.next.prev = node
    @head.next = node
    node.prev = @head
  end

  def delete(key)
    node = get(key)

    return unless node

    delete_node(node)
  end

  def delete_first
    node = @head.next
    delete_node(node) unless node == @head
  end

  def delete_last
    node = @head.prev
    delete_node(node) unless node == @head
  end

  private

  def get(key)
    each do |node|
      return node if node.key == key
    end

    nil
  end

  def delete_node(node)
    node.prev.next = node.next
    node.next.prev = node.prev

    node.prev = node.next = nil

    node
  end
end

n = gets.to_i

list = List.new

while line = gets
  command, key = line.split
  key = key.to_i

  case command
  when 'insert'
    list.insert(key)
  when 'delete'
    list.delete(key)
  when 'deleteFirst'
    list.delete_first
  when 'deleteLast'
    list.delete_last
  else
    raise "unknown command: #{command}"
  end
end

puts list.map(&:key).join(' ')

Measured memory_bytes: 82352
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    map<string, int> ma;
    cin >> n;
    FOR(i,1,n) {
        string s;
        cin >> s;
        ma[s]++;
    }
    cout << "AC x " << ma["AC"] << "\n";
    cout << "WA x " << ma["WA"] << "\n";
    cout << "TLE x " << ma["TLE"] << "\n";
    cout << "RE x " << ma["RE"] << "\n";
    return 0;
}


Measured memory_bytes: 3664
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

void solve(){
  int n, k, ans = 0, j = 0; cin >> n >> k;
  string s; cin >> s;
  queue<int> q;
  for(int i = 0; i < n;){
    while(s[i] == '1'){
      i++;
    }
    if(q.size() >= k){
      //cout << j << " ~ " << i << endl;
      ans = max(ans, i - j);
      j = q.front();
      q.pop();
    }
    while(s[i] == '0'){
      i++;
    }
    q.push(i);
  }
  //cout << j << endl;
  ans = max(ans, n - j);
  cout << ans << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 512
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());
        String strans = "";
        int intans = 0;
            if(a%b == 0){
                strans = "0";
            }else{
                strans = "1";
            }
        PrintWriter out = new PrintWriter(System.out);
        out.println(strans);
        out.flush();
        scan.close();
    }
}

Measured memory_bytes: 23636
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<random>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>

#define FOR(i,a,b) for(long long i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(long long i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll>pll;

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

    cout<<min(a,b)<<" "<<max(0,(a+b)-n)<<endl;
	
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,m,n) for(int i=(m);i<(n);i++)
#define debug(a,b) cout << "debug : " << a << " , "<< b << endl
#define ll long long
const ll INF=1LL<<60;
const ll mod=1E9+7;



int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int r=0,g=0,b=0;
  rep(i,n){
    if(s[i]=='R')r++;
    else if(s[i]=='G')g++;
    else if(s[i]=='B')b++;
  }
  ll all,part=0;
  all=(ll)r*g*b;
  for(int i=0;i<=n-3;i++){
    for(int k=1;i+2*k<n;k++){
      if(s[i]!=s[i+k]&&s[i+k]!=s[i+2*k]&&s[i]!=s[i+2*k])part++;
    }
  }
  cout << all-part;
}



Measured memory_bytes: 3636
using System.Linq;
using System.Collections.Generic;
using System;
using System.Collections;

class A {

    static void Main() {
        int[] Q = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        Array.Sort(Q);
        if (Q[0] == 5 && Q[1] == 5 && Q[2] == 7) {
            Console.WriteLine("YES");
        
        }
        else {
            Console.WriteLine("NO");
        }

    }
}

Measured memory_bytes: 3032
n = int(input())
dic = {}

for i in range(1, n+1):
    if i % 2 == 0:
        a = i
        cnt = 0
        while a % 2 == 0:
            a = a / 2
            cnt += 1
        dic.update({i: cnt})

if n == 1:
    print(1)
    exit()
elif n == 0:
    print(0)
    exit()

print([i for i in dic if dic[i] == max(dic.values())][0])


Measured memory_bytes: 3060
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    ll x;
    cin >> x;

    ll num = x / 11;

    ll rest = x - 11 * num;

    ll plus;
    if(rest==0){
        plus = 0;
    }
    else if(rest<=6){
        plus = 1;
    }else{
        plus = 2;
    }

    p(2*num + plus);

    return 0;
}

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

int main() {
  int c[3][3];
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++)
      cin>>c[i][j];
  }
  bool ans=true;
  if(c[0][1]+c[1][0]!=c[0][0]+c[1][1])
    ans=false;
  if(c[0][1]+c[1][2]!=c[0][2]+c[1][1])
    ans=false;
  if(c[1][0]+c[2][1]!=c[1][1]+c[2][0])
    ans=false;
  if(c[1][1]+c[2][2]!=c[1][2]+c[2][1])
    ans=false;
  
  if(ans) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 3624
n = int(input())
d = list(map(int,input().split()))
i = 0
j = 1
heal = 0
for i in range(n-1):
  for j in range(n):
    if ( i < j):
      heal = heal + d[i] * d[j]
      j += 1
    else:
      pass
  i +=1
  j +=1
print(heal)

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


struct P
{
    //string r;
    int x;
    long long y,z;

   /* bool operator<(const P &a)const{
       // if(y!=a.y)
       // return y>a.y;
              return y>a.y;
    }*/
};


vector<int> v[111];
//bitset<4001000> b;
int a,c,i,b,k,n,d,m;//dy[15]={0,1,0,-1,-1,1,-1,1},dx[15]={1,0,-1,0,1,1,-1,-1};//
int l[12];

int o[5][111455];
int dx[10]={0,1,0,-1,1,1,-1,-1},dy[10]={1,0,-1,0,-1,1,-1,1},dz[10]={0,0,0,0,1,-1};

int e;

long long x,y,mod=1000000007;
long long z[11];
P j[400];
P u[10],u1[100];
//stack<int> s;
//queue<int> q;
set<int> s;
priority_queue<int,vector<int>,greater<int> > q;
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_
//map<int,int> p;
//list<int> l;
string r1,r;
//char r[5][111][111];
//deque<int> de;

//20921
bool as(P a,P b)
{
    return a.x<b.x;
}

int main()
{
    scanf("%d",&a);
    for(int t=1;t<=a;t++)
    {
        long long x,y,z,n=1,m=1000000000;
        scanf("%lld %lld",&x,&y);
        if(x>y) swap(x,y);
        z=x*y;
        for(;n<m;)
        {
            long long u=(n+m)/2;
            if(u*u>=z) m=u;
            else n=u+1;
        }
        if(n*n>=z)
        {
            if(n*(n-1)>=z) printf("%lld\n",2*n-4);
            else
            {
                if(n*n==x*x) printf("%lld\n",2*n-2);
                else
                printf("%lld\n",2*n-3);
            }
        }


    }
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define INF 1 << 30
#define MAX 1000000000
#define SIZE 1000000000
char t[50][21], len[50];
int main() {
	int W, H, x, y, f = 0;
	scanf("%d%d%d%d", &W, &H, &x, &y);
	if (x * 2 == W && y * 2 == H)f = 1;
	printf("%f %d\n", (double)W * H / 2, f);
	return 0;
}

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

using namespace std;

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

	int X, Y;
	X = a * b;
	Y = c * d;

	if (X >= Y)
		cout << X << endl;
	else
		cout << Y << endl;
}

Measured memory_bytes: 256
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;


typedef long long ll;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;

#define rep(i,b) for(i=0;i<b;++i)
#define repp(i,a,b) for(i=a;i<b;++i)

int main() {
    ll a, b;
    cin >> a >> b;
    if (2 * b > a) cout << "0";
    else cout << (a - 2 * b );
  return 0;
}


Measured memory_bytes: 256
N = int(input())
inp = []
for k in range(N-1):
  a, b = map(int, input().split())
  if a > b:
    a, b = b-1, a-1
  else:
    a, b = a-1, b-1
  inp.append((a, b, k))
inp.sort(key = lambda x: x[0])
mark = [[] for _ in range(N)]
ans = [0 for _ in range(N-1)]
now = 0
cnt = 0
for item in inp:
  cnt += 1
  if now < item[0]:
    now = item[0]
    cnt = 1
  while cnt in mark[item[0]] or cnt in mark[item[1]]:
    cnt += 1
  mark[item[1]].append(cnt)
  mark[item[0]].append(cnt)
  ans[item[2]] = cnt
color = max(ans)
print(color)
for k in range(N-1):
  print(ans[k])

  

Measured memory_bytes: 113484
A,B,C,X,Y = map(int,input().split())
if A+B<2*C:
    print(A*X+B*Y)
else:
    if X<Y and B<2*C:
        print(X*2*C+(Y-X)*B)
    elif X>Y and A<2*C:
        print(Y*2*C+(X-Y)*A)
    else:
        m=max(X,Y)
        print(m*2*C)
        

    

Measured memory_bytes: 3060
#include<stdio.h>
#define MAXN 101000
int N, M;
int f[MAXN], dis[MAXN];
void init()
{
	for (int i = 0; i <= N; i++)
	{
		f[i] = i;
	}
}
int find(int x)
{
	if (f[x] == x)
		return x;
	else
	{
		int r = find(f[x]);
		dis[x] = dis[f[x]] + dis[x];
		return f[x] = r;;
	}
}
int find_father(int x,int y,int z)
{
	int fx = find(x);
	int fy = find(y);
	if (fx == fy)
	{
		return z == dis[y] - dis[x];
	}
	f[fy] = fx;
	dis[fy] = dis[x] + z - dis[y];
	return 1;
}
int main()
{
	int a = 1;
	scanf("%d %d", &N, &M);
	init();
	for (int i = 1; i <= M; i++)
	{
		int x, y, z;
		scanf("%d %d %d", &x, &y, &z);
		if (a)
			a = find_father(x, y, z);
	}
	if (a)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 896
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from math import gcd
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().rstrip().split()
def S(): return sys.stdin.readline().rstrip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

mod=10**9+7

n=I()
print((pow(10,n,mod)-pow(9,n,mod)*2+pow(8,n,mod))%mod)

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

typedef long long ll;  // 10^18 くらいまでいける

// gcdを実装する
ll gcd(ll x, ll y){
    if (y){
        return gcd(y, x%y);
    }else{
        return x;
    }
}

// 素因数分解する関数
/*
N = p * q    (p <= q, pとqは素因数) の時
p <= sqrt(N)    となる

つまり, sqrt(N) まで試して, 割り切れなかった(残った)ものは素因数と言える.
言い方を変えると, sqrt(N)以上の素因数は高々1個まで.

これから, 順番に割っていくのをsqrt(N)までやり, 残ったのが1じゃなければそれも素数.
これなら計算量 O(sqrt(N)) でいける.
*/
vector<pair<ll, int>> factorize(ll n){  // pair(素因数, その何乗か).  // pair: 2つの異なる型の値を保持する「組」を表現するためのクラス. https://cpprefjp.github.io/reference/utility/pair.html
    vector<pair<ll, int>> res;
    for (ll i=2; i*i <= n; ++i){
        if (n%i) continue;  // 割り切れなかったらcontinue.
        res.emplace_back(i, 0);  // vector.emplace_back: 新たな要素を末尾に追加する。 https://cpprefjp.github.io/reference/vector/vector/emplace_back.html
        while(n%i == 0){  // 割り切れる間は
            n /= i;  // 割っていく
            res.back().second++;  // その素数の乗数を++
        }
    }
    if (n != 1) res.emplace_back(n, 1);  // 最後に残ったのが1じゃなければ素数
    return res;
}


int main(){
    ll a,b;
    cin >> a >> b;
    ll g = gcd(a, b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin>>a;
	if(a/100000!=0){
		cout<<90909;
	}
	else if(a/10000!=0){
		cout<<910+a%100000-10000;
	}
	else if(a/1000!=0){
		cout<<909;
	}
	else if(a/100!=0){
		cout<<10+a%1000-100;
	}
	else if(a/10!=0){
		cout<<9;
	}
	else
		cout<<a;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e16
using namespace std;
typedef pair<ll, ll> P;

class UnionFind {
public:
	vector<int>par, rank, node;
	UnionFind(int n) :par(n), rank(n, 0), node(n, 1) {
		for (int i = 0;i < n;i++)par[i] = i;
	}
	
	//木の根が同じかどうかの判定
	int find(int x) {
		return par[x] == x ? x : par[x] = find(par[x]);
	}

	//同じ気に属するかの判定
	bool same(int x, int y) {
		return find(x) == find(y);
	}

	//木の高さ
	void unite_tree(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y)return;
		if (rank[x] < rank[y]) {
			par[x] = y;
		}
		else {
			par[y] = x;
			if (rank[x] == rank[y])rank[x]++;
		}
	}

	int root_size(int x) {
		return rank[find(x)];
	}

	int size(int x) {
		return node[find(x)];
	}

	//連結成分
	void unite_node(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y)return;
		if (size(x) < size(y))swap(x, y);
		node[x] += node[y];
		par[y] = par[x];
	}
};


int main(void) {
	int n, m, ans = 0, x = 0, y = 0;
	cin >> n >> m;
	vector<int>a(n);
	for (int i = 0;i < n;i++)cin >> a[i];
	UnionFind tree = UnionFind(n + 1);
	for (int i = 0;i < m;i++) {
		cin >> x >> y;
		tree.unite_tree(a[x - 1], a[y - 1]);
	}
	for (int i = 0;i < n;i++)if (tree.same(i + 1, a[i]))ans++;
	cout << ans << endl;
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> d(n);

    for(int i =0; i  <n; i++) {
        cin >> d[i];
    }

sort(d.begin(),d.end());
    if(d[n/2-1] == d[n/2]) {
        cout << "0" <<endl;
    }else {
        cout << d[n/2] - d[n/2-1] <<endl;
    }
}

Measured memory_bytes: 640