akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cassert>
#include <vector>
#define all(x) x.begin() , x.end()
#define fi first
#define se second
#define pb push_back
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define set multiset
#define null NULL
#define ort (b+s)/2

using namespace std;

typedef long long Lint;
typedef long double db;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef pair<db,db> dd;
typedef pair<int,string> is;

const int maxn = 1000020;
const int K = 320;
const int MOd = 1e9 + 7;

int a, b, pre[maxn], dad[maxn], used[maxn];
ii ar[maxn];
vector<int> ans;
vector<ii> w[maxn];
int ok;

void dfs( int n, int back, int s ) {
	used[n] = 1;
	for(int i=0;i<w[n].size();i++)
		if( w[n][i].fi != back && !used[ w[n][i].fi ] ) dfs( w[n][i].fi, n, w[n][i].se );

	if( pre[n] && back != -1 ) {
		pre[n] ^= 1;
		pre[back] ^= 1;
		ans.pb( s );
	}
	if( n != 0 && back == -1 && pre[n] ) ok = 0;
}

void solve() {
	scanf("%d %d",&a,&b);
	for(int i=1;i<=a;i++) {
		scanf("%d %d",&ar[i].fi,&ar[i].se);
	}
	sort( ar+1, ar+1+a );
	for(int i=1;i<=a;i++) {
		pre[i] = (ar[i].se != ar[i+1].se);
		// printf("var %d %d\n",i,pre[i]);
	}
	
	for(int i=1;i<=a;i++) dad[i] = i;

	for(int i=1,j,k;i<=b;i++) {
		scanf("%d %d",&j,&k);
		j = lower_bound( ar+1, ar+1+a, ii( j, 0 ) ) - ar - 1;
		k = upper_bound( ar+1, ar+1+a, ii( k, 123123123 ) ) - ar - 1;
		//printf("bound %d %d\n",j,k);
		// if( i == 1 ) printf(" --- -------> %d %d\n",j,k);
		// if( i == 7 ) printf(" --- -------> %d %d\n",j,k);
		// if( i == 8 ) printf(" --- -------> %d %d\n",j,k);
		// if( i == 9 ) printf(" --- -------> %d %d\n",j,k);
		// if( i == 11 ) printf(" --- -------> %d %d\n",j,k);
		w[j].pb( ii( k, i ) );
		w[k].pb( ii( j, i ) );
	}
	ok = 1;
	for(int i=0;i<=a;i++)
		if( !used[i] )
			dfs( i, -1, -1 );

	if( !ok ) {
		printf("-1\n");
		return;
	}
	printf("%d\n",(int)ans.size());
	sort( all( ans ) );
	for(int i=0;i<ans.size();i++)
		printf("%d ",ans[i]); printf("\n");
}

int main(  ) {


    int n = 1;
    //scanf("%d",&n);
    while( n-- ) solve();

    return 0;
}

Measured memory_bytes: 43388
c=list(list(map(int,raw_input().split())) for i in range(3))

diff_list_x=[]
diff_list_y=[]
for i in range(3):
	diff_list_x.append([c[i][0]-c[i][1],c[i][1]-c[i][2]])
for i in range(3):
	diff_list_y.append([c[0][i]-c[1][i],c[1][i]-c[2][i]])

if diff_list_x[0]==diff_list_x[1]==diff_list_x[2] and diff_list_y[0]==diff_list_y[1]==diff_list_y[2]:
	print "Yes"
else:
	print "No"


Measured memory_bytes: 2692
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
using Graph = vector<vector<int>>;
Graph G;

int dfs(int v, vector<bool> &seen) {
    bool end = true;
    for (int i=0; i < seen.size(); ++i) {
        if (!seen[i] && i != v) {
            end = false;
        }

    }

    if (end) {
        return 1;
    }

    int res = 0;
    seen[v] = true;
    for (auto nv : G[v]) {
        if (seen[nv]) {
            continue;
        }

        res += dfs(nv, seen);
    }

    seen[v] = false;
    return res;
}

int main() {
    int N, M;
    cin >> N >> M;
    G.assign(N, vector<int>());
    for (int i=0; i<M; i++) {
        int n, m;
        cin >> n >> m;
        G[n-1].emplace_back(m-1);
        G[m-1].emplace_back(n-1);
    }

    vector<bool> seen(N, false);
    int res = dfs(0, seen);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>

int main(){
    int n;
    int min = 1e9;
    int max = -1;
    std::cin >> n;
    for(int i = 0; i < n; i++){
        int t;
        std::cin >> t;
        min = std::min(min, t);
        max = std::max(max, t);
    }
    std::cout << max - min << std::endl;
}


Measured memory_bytes: 256
# coding: utf-8
import sys
from collections import deque

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
graph = [[] for _ in range(N+1)]  # 1-indexed
for _ in range(M):
    a, b = lr()
    graph[a].append(b)
    graph[b].append(a)

def bfs(x):
    dist = [None] * (N+1)
    que = deque([1])
    dir = [None] * (N+1)
    popleft = que.popleft; append = que.append    
    while que:
        x = popleft()
        d = dist[x]
        for next in graph[x]:
            if dir[next] != None:
                continue
            dir[next] = str(x)
            append(next)
    return dir

dir = bfs(1)
print('Yes')
print('\n'.join(dir[2:]))


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

ll n,m,x[100005],dist[100005],ans=0;

int main(){
	cin>>n>>m;
	for(int i=0; i<m; i++)cin>>x[i];
	sort(x,x+m);
	for(int i=0; i<m-1; i++)dist[i]=x[i+1]-x[i];
	sort(dist,dist+m-1);
	for(int i=0; i<m-n;i++)ans+=dist[i];
	cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, a, b) for (int i = (a); i < (int)(b); i++)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;


VS Main(int N, int K, int Q, VI& A)
{
    VS ans(N);
    VI scores(N, 0);
    REP(i, Q) scores[A[i]-1]++;
    REP(i, N) ans[i] = (K + scores[i] - Q > 0) ? "Yes" : "No";
    return ans;
}

int main(void){
    int N, K, Q;
    cin >> N >> K >> Q;
    VI A(Q);
    REP(i, Q) cin >> A[i];
    VS out = Main(N, K, Q, A);
    REP(i, N) cout << out[i] << endl;
    return 0;
}

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

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

#define PRIME_SIZE 1000001

typedef long long ll;
using namespace std;
int mod = 1000000007;

const int MAX = 1000001;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

ll power(ll x, int n){
    ll temp = 1ll;
    rep(i, n) temp *= x;
    return temp;
}

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

//これを使うときにはCOMinit();を忘れずに

bool prime[PRIME_SIZE];
int min_factor[PRIME_SIZE];

void make_prime_list(){
    int loop = sqrt(PRIME_SIZE);
    for(int i = 2; i <= loop; i++){
        for(int j = (i << 1); j < PRIME_SIZE; j += i){
            prime[j] = false;
            if(min_factor[j] == j) min_factor[j] = i;
        }
    }
}

void PRIMEinit(){
    rep(i, PRIME_SIZE) prime[i] = true;
    prime[0] = prime[1] = false;
    rep(i, PRIME_SIZE) min_factor[i] = i;
    make_prime_list();
}

int main(void){
    COMinit();
    PRIMEinit();
    int N; cin >> N;
    map<ll, int> mp;
    ll A[N];

    rep(i, N){
        int a; cin >> a;
        A[i] = a;
        //aの素因数
        while(a > 1){
            int num = min_factor[a];
            int cnt = 0;
            while(a % num == 0){
                a /= num;
                cnt++;
            }
            if(mp.count(num) == 0){
                mp[num] = cnt;
            }
            else mp[num] = max(mp[num], cnt);
        }
    }

    ll res = 1;
    for(auto iter = mp.begin(); iter != mp.end(); iter++){
        ll x = iter->first;
        int n = iter->second;
        res = (res * power(x, n)) % mod;
    }
    ll ans = 0;
    rep(i, N){
        ans = (ans + res*inv[A[i]]) % mod;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 29312
//  atcodder.xcode
//  main.cpp
//  Created by conan1024hao on 2019/11/09.
//  Copyright © 2019 conan1024hao. All rights reserved.
//  専用ライブラリ
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll>P;
#define INF 10e16
#define MOD 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define fi first
#define se second
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define PI acos(-1.0)
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
ll cmp(P a,P b){
        if(a.fi!=b.fi)
        return a.fi>b.fi;
        else
        return a.se<b.se;
}
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    ll n;
    cin>>n;
    vector<ll>a(n),b(n);
    for(ll i=0;i<n;i++){
        cin>>a[i]>>b[i];
    }
    ll ans=0;
    vector<ll>c(n);
    for(ll i=0;i<n;i++){
        c[i]=a[i]+b[i];
    }
    sort(all(c));reverse(all(c));
    for(ll i=0;i<n;i++){
    if(i%2==0)
        ans+=c[i];
    }
    for(ll i=0;i<n;i++){
        ans-=b[i];
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------




Measured memory_bytes: 2560
'use strict'
function main(input) {
    const tmp = input.split('\n');
    const n = parseInt(tmp[0], 10);
    const p = tmp[1].split(' ').map((t) => parseInt(t, 10));

    let count = 0;
    for (let start = 0; start + 2 < n; start++) {

        const numbers = [p[start], p[start + 1], p[start + 2]];
        const sortedNumbers = numbers.slice().sort((num1, num2) => num1 - num2);

        if (numbers[1] === sortedNumbers[1]) {
            count++;
        }
    }
    console.log(count);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

l = int(input())
s = [input() for _ in range(3)]

ans = 0
for a, b, c in zip(*s):
    if a == b == c:
        pass
    elif a == b or b == c or c == a:
        ans += 1
    else:
        ans += 2

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define vl vector<ll>
#define pl pair<ll,ll>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,b) for(ll i=0;i<b;i++)
#define RFOR(i,a,b) for(ll i=b-1;i>=a;i--)
#define rsort(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(),(v).end()
using namespace std;
ll mod=1000000007;
ll dp[100005];
signed main() {
    ll n,m,a;
    cin>>n>>m;
    rep(i,100005)dp[i]=1;
    rep(i,m){
        cin>>a;
        dp[a]=0;
    }
    for(ll i = 2; i <= n; i++)if(0<dp[i])dp[i] = (dp[i-1]+dp[i-2])%mod;
    cout<<dp[n]<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <iomanip>
using namespace std;

#define Rep(b, e, i) for(ll i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define putsp(x) cout << x << ' ';
#define putbd cout << "---------------------------------------------" << endl;
#define putln(x) cout << x << endl;
#define debug(x) cerr << #x << "=" << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;
typedef vector <int> vec;
typedef vector <ll> vecll;
typedef vector <double> vecd;
typedef vector <vec> mat;
typedef vector <vecll> matll;
typedef vector <vecd> matd;

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

const int MAX = 200020;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const ll INFL = 1e18;
const int MOD = 1e9+7;

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

//********************************template END****************************************//

void solve(void){

	int N, i;
	cin >> N >> i;
	cout << N - i + 1 << endl;

}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;
typedef pair<ll  ,ll > pll;

const ll maxn =8e5+5;
const ll mod = 1e9+7;
const ld PI = 4 * atan((ld) 1);

#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
#define ms(x , y) memset(x , y , sizeof x);
ll pw(ll a, ll b) {
    return (!b ? 1 : (b & 1 ? a * pw(a * a % mod, b / 2) % mod : pw(a * a % mod, b / 2) % mod));
}

ll h[maxn] , n , k , a[maxn];

int main(){
    migmig
    cin >> n >> k;
    for (int i = 0 ; i < n ; i ++){
        cin >> h[i];
    }
    sort(h , h + n);
    reverse(h , h + n);
    for (int i = 0 ; i < k ; i ++){
        h[i] = 0;
    }
    ll sum = 0 ;
    for (int i = 0 ; i < n ; i ++){
        sum += h[i];
    }
    cout << sum;
    return(0);
}


//When we hit our lowest point, we are open to the greatest change.
//If I try, I fail. If I don't try, I'm NEVER GOING TO GET IT.
//Sometimes, life is like this dark tunnel. You can't always see the light at the end of the tunnel. But if you just keep moving... you will come to a better place.
//It is important to draw wisdom from diffrent places. If you take it from only one place it becomes rigid and stale.


Measured memory_bytes: 2432
def f_unfair_nim():
    from functools import reduce
    from operator import xor
    N = int(input())
    A = [int(i) for i in input().split()]

    s = sum(A[:2])
    x = reduce(xor, A[2:], 0)
    if (s - x) % 2 != 0 or (((s - x) // 2) & x) != 0:
        return -1

    a = (s - x) // 2
    for i in range(60, -1, -1):
        if (x & (1 << i)) != 0 and (a ^ (1 << i) <= A[0]):
            a ^= 1 << i
    return A[0] - a if A[0] >= a > 0 else -1

print(f_unfair_nim())

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

#define rep(i,n) for(int i=0;i<(n);++i)
const int INF = 1e9;

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

  int dp[N+1];
  rep(i, N+1) dp[i] = INF;
  dp[0] = 0;
  rep(i, N) {
    dp[i+1] = min(dp[i+1], 1 + dp[i]);
    rep(j, 2)
      for (int unit = j*3+6; unit <= N; unit *= j*3+6)
        rep(k, 5) {
          if (i + unit * k <= N)
            dp[i+unit*k] = min(dp[i+unit*k], k + dp[i]);
        }
  }
  printf("%d\n", dp[N]);

  return 0;
}


Measured memory_bytes: 640
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
char s[105];
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1),num=0;
	for(int i=1;i<=n;i++)
	  if(s[i]=='o')num++;
	num+=15-n;
	if(num>=8)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 128
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn main() {
    let s = read::<String>();
    let n = s.len();

    if n < 2 {
        println!("{}", 0);
        return;
    }

    let mut v = s.chars().collect::<Vec<char>>();
    let count0 = v.iter().filter(|&c| *c=='0').count() as i32;
    let count1 = v.iter().filter(|&c| *c=='1').count() as i32;

    let sa = (count0 - count1).abs() as usize;

    println!("{}", n - sa);

    /*
    loop {
        let len = v.len();
        if len == 0 {break;}
        for i in 0..len-1 {
            if v[i] == 'X' {
                continue;
            } else if v[i+1] != 'X' && v[i] != v[i+1] {
                v[i] = 'X';
                v[i+1] = 'X';
            }
        }

        let xcount = v.iter().filter(|&c| *c=='X').count();
        if xcount == 0 {
            break;
        } else {
            count += xcount;
        }
        v = v.iter().filter(|&c| *c!='X').map(|&c| c).collect::<Vec<char>>();
    }

    println!("{}", count);
    */

    /*
    let mut f = false;
    let mut a = v[0];
    let mut count = 1;
    let mut total = 0;
    for i in 1..n {
        if f == false { // 準備フェーズ
            if v[i] == a {
                count += 1;
            } else {
                a = v[i];
                f = !f;
                total += 2;
                count -= 1;
            }
        } else { // 回収フェーズ
            if v[i] == a {
                if count == 0 {
                    f = !f;
                    count += 1;
                } else {
                    total += 2;
                    count -= 1;
                }
            } else {
                f = !f;
                count = 1;
            }
        }
    }
    println!("{}", total);
    */


    /* vec input
    let v = read_vec::<u32>();
    let a = v[0];
    let b = v[1];
    let c = v[2];
    */

    /* loop pattern
    let mut count = 0;
    loop {
        if  { break; }
        count += 1;
    }
    println!("{}", count);
    */

    /* yes/no pattern
    yn(a == b);
    */
}


Measured memory_bytes: 4352
#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define SENTINEL 1000000001

#define min(a,b) ((a)>(b)?(b):(a))
#define max(a,b) ((a)>(b)?(a):(b))

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

struct OwnNode
{
	ll index;
	ll value;

	OwnNode(int index, int value):index(index),value(value){}

	bool operator==(const OwnNode& o)const
	{
		return value == o.value;
	}

	bool operator<(const OwnNode& o)const
	{
		return value < o.value;
	}

	bool operator>(const OwnNode& o)const
	{
		return value > o.value;
	}
};

ll a[1000010];

int main() {
	ll N, L;
	priority_queue<OwnNode, vector<OwnNode>, greater<OwnNode>> pq;
	scanf("%lld %lld", &N, &L);
	for (ll i = 0; i < N; i++)
	{
		scanf("%lld", &a[i]);
	}
	for (ll i = 0; i < N; i++)
	{
		pq.push(OwnNode(i, a[i]));
		while (pq.top().index + (L - 1) < i)
		{
			pq.pop();
		}
		if (i >= (L - 1))
		{
			if (i == (L - 1))
			{
				printf("%lld", pq.top().value);
			}
			else
			{
				printf(" %lld", pq.top().value);
			}
		}
	}
	printf("\n");
	return 0;
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long INF = 1LL << 60;
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}

signed main()
{   
    gearup;
    double a,b,x; cin >> a >> b >> x;
    double s = x/a; //体積を面積に変換
    if(s == a*b){
        //ゼロじょさんが起こるため場合分
        cout << 0 << endl;
    }
    else{
        if(s > a*b/2){ //傾けが45度より小さい時
            double b2 = (2*s/a) -b; //b2は台形の上の幅
            double s1 = a*b2;
            double s2 = s-s1; //s2は残った三角形の面積
            double a2 = 2*s2/(b-b2);
            double rad = atan((b-b2)/a2);
            cout << fixed << setprecision(10) << rad * (180/PI) << endl;
        }
        else{
        double a2 = 2*s/b;
        double rad = atan(b/a2);
        cout << fixed << setprecision(10) << rad * (180/PI)<< endl;
        }
    }
}


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

#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f
#define all(x) x.begin(),x.end()
#define show(x) cerr<<#x<<" : "<<x<<'\n';
#define yogeshk972() cerr<<"\nTime Taken : "<<(float)(clock()-time_p)/CLOCKS_PER_SEC<<"\n";
#define pt pair<double,double>
clock_t time_p=clock();

using namespace std;
const int N=1e3+10, mod=998244353;
const double eps= 1e-9;

int n;	pt p[51];


double min_radius(double x,double y){

	double radius=0;
	for(int i=0;i<n;i++){
		double cur = sqrt( (x-p[i].xx)*(x-p[i].xx) + (y-p[i].yy)*(y-p[i].yy)   );
		radius= max(radius,cur);
	}
	return radius;
}

double f(double x){
	double l=0,r=1000, ans=1e18;
	while( r-l>=eps ){
		double ma=l+(r-l)/3.0, mb= r-(r-l)/3.0;
		double t1= min_radius(x,ma)  ,t2 =min_radius(x,mb);
		ans=min(ans,min(t1,t2) );
		
		if(  t1< t2 ) r=mb-eps;
		else l=ma+eps;
	}
	return ans;
}


int main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	
	cin>>n;
	for(int i=0;i<n;i++)cin>>p[i].xx>>p[i].yy;
	
	double l=0,r=1000, ans=1e18;
	while( r-l>=eps ){
		double ma=l+(r-l)/3.0, mb= r-(r-l)/3.0;
		double t1=f(ma), t2=f(mb);
		ans=min(ans,min(t1,t2));
		
		if( t1<t2) r=mb-eps;
		else l=ma+eps;
	}
	
	cout<<fixed<<setprecision(10)<<ans;
	
	
	
    yogeshk972();
}


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

namespace tes
{
	class contest
	{
		static void Main(string[] args)
		{
			 
			 var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var list = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            var memo = new long[list.Length];
            var turnMemo = new int[list.Length];
            long[] cl = (long[])list.Clone();

            long ans = long.MaxValue;

            for (int i = 0; i < list.Count(); i++)
            {
                long temp = (long)input[1] * i;
                for(int j =0; j<list.Count(); j++)
                {
                    cl[j] = Math.Min(cl[j] , list[(j-i+input[0])%input[0]]);
                    temp += cl[j];

                }
                ans = Math.Min(ans, temp);

            }
            Console.WriteLine(ans);
			 
            
		}

	}
}

Measured memory_bytes: 3288
using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
using static System.Console;

namespace testConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Array.ConvertAll(ReadLine().Split(), int.Parse);
            WriteLine(n[1] * n[0] / 2);
        }
    }
}

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

long d[3][111111];
int main() {
	int n, k, p = 1e9 + 7;
	cin >> n >> k;
	int m = sqrt(n);
	fill(d[0], d[0] + m + 1, 1);
	d[0][0] = m;
	d[2][0] = 1;
	for (int i = 1; i <= k; i++) {
		long x = 0, y = d[(i + 1) % 3][0];
		d[i % 3][0] = 0;
		for (int a = m; a; a--) {
			(d[i % 3][a] = x + (n / a - m)*y + d[(i + 2) % 3][0]) %= p;
			(x += (n / a - m)*d[(i + 1) % 3][a]) %= p;
			(y -= d[(i + 1) % 3][a] - p) %= p;
			(d[i % 3][0] += d[i % 3][a]) %= p;
		}
	}
	cout << d[k % 3][1] << endl;
	return 0;
}



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


int main(){
    string S;
    cin >> S;
    
    if (S.length() == 2)
    {
        cout << S << endl;
    }
    else{
        rep(i, S.length()) cout << S[ S.length()-i-1];
        cout << endl;
    }
       return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

/**
 * @author yoshizaki
 *
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int num = scanner.nextInt();
        int base = scanner.nextInt();
        String ans = Integer.toString(num, base);
        System.out.println(ans.length());
    }
}


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

using namespace std;

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

  int n;
  cin >> n;

  for (int i = 1; i <= 9; ++i) {
    for (int j = 1; j <= 9; ++j) {
      if (n == i * j) {
        cout << "Yes"s << '\n';
        return 0;
      }
    }
  }
  cout << "No"s << '\n';

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const int INF=1e8;
int main()
{
    int h, w; cin>>h>>w;
    string a[1001];
    queue<P> que;
    int d[1001][1001];
    for(int i=0; i<h; i++){
        cin>>a[i];
        fill(d[i], d[i]+w, INF);
        for(int j=0; j<w; j++){
            if(a[i][j]=='#') que.push(P(i, j)), d[i][j]=0;
        }
    }
    int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
    int ans=0;
    while(!que.empty()){
        P p=que.front(); que.pop();
        int x=p.first, y=p.second;
        ans=max(ans, d[x][y]);
        for(int k=0; k<4; k++){
            int x1=x+dx[k], y1=y+dy[k];
            if(x1<0 || x1>=h || y1<0 || y1>=w) continue;
            if(d[x1][y1]>d[x][y]+1){
                d[x1][y1]=d[x][y]+1;
                que.push(P(x1, y1));
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

#define mod 1000000007
#define int long long

signed main() {
    int n, k;
    cin>>n>>k;
    
    vector<int> arr(n+1);
    for(int i=1; i<=n; i++){
        cin>>arr[i];
    }
    
    vector<vector<int>> dp(n+1, vector<int> (k+1, 0));
    
    for(int i=0; i<=k; i++){
        if(i<=arr[1]) dp[1][i]=1;
        else break;
    }
    
    if(n!=1){
        for(int i=1; i<=k; i++){
            dp[1][i]=(dp[1][i]%mod+dp[1][i-1]%mod)%mod;
        }
    }
    
    for(int i=2; i<=n; i++){
        for(int j=0; j<=k; j++){
            int a=j-arr[i];
            if(a>0) dp[i][j]=(dp[i][j]%mod+(dp[i-1][j]-dp[i-1][a-1]+mod)%mod)%mod;
            else dp[i][j]=(dp[i][j]%mod+dp[i-1][j]%mod)%mod;
        }
        if(i!=n){
            for(int j=1; j<=k; j++){
                dp[i][j]=(dp[i][j]%mod+dp[i][j-1]%mod)%mod;
            }
        }
    }
    
    cout<<dp[n][k]%mod<<endl;
}

Measured memory_bytes: 83088
import sys
import math
input = sys.stdin.readline


class Vector():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __add__(self, vec):
        return Vector(self.x+vec.x, self.y+vec.y)

    def __sub__(self, vec):
        return Vector(self.x-vec.x, self.y-vec.y)

    def __mul__(self, sc):
        return Vector(self.x*sc, self.y*sc)

    def __truediv__(self, sc):
        return Vector(self.x/sc, self.y/sc)

    def __iadd__(self, vec):
        self.x += vec.x
        self.y += vec.y
        return self

    def __isub__(self, vec):
        self.x -= vec.x
        self.y -= vec.y
        return self

    def __imul__(self, sc):
        self.x *= sc
        self.y *= sc
        return self

    def __itruediv__(self, sc):
        self.x /= sc
        self.y /= sc
        return self

    def __str__(self):
        return '{:.9f} {:.9f}'.format(self.x, self.y)

    def __eq__(self, vec):
        return self.x == vec.x and self.y == vec.y

    def dot(self, vec):
        return self.x * vec.x + self.y * vec.y

    def cross(self, vec):
        return self.x * vec.y - self.y * vec.x

    def abs(self):
        return (self.x*self.x + self.y*self.y)**0.5

    def ortho(self):
        return Vector(-self.y, self.x)


for _ in [0]*int(input()):
    x0, y0, x1, y1, x2, y2, x3, y3 = map(int, input().split())
    v = Vector(x1-x0, y1-y0)
    u = Vector(x3-x2, y3-y2)

    if v.cross(u) == 0:
        print(2)
    elif v.dot(u) == 0:
        print(1)
    else:
        print(0)



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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

int main()
{

    int Q;
    cin >> Q;
    double p = 3.1415926535;

    cout << 2 * Q * p << endl;

    return 0;
}


Measured memory_bytes: 3776
S = input()
cheack1 = False
cheack2 = False
cheack3 = False
count = 0

if S[0]=='A':
    cheack1=True
    S = S.replace("A", "a")

if S[1]=="C" or S[int(len(S))-1]=="C":
    cheack2==False
else:
    for i in range(2, int(len(S))-1):
        if S[i]=="C":
            count += 1

    if count==1:
        cheack2=True
        S = S.replace("C","c")

cheack3 = S.islower()

#print(str(cheack1)+" "+str(cheack2)+" "+str(cheack3))
if cheack1 and cheack2 and cheack3:
    print("AC")
else:
    print("WA")

Measured memory_bytes: 3064
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include <iomanip>
#include<utility>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21 
llfor;ll mod=1000000007;
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)*fact(n-r)/fact(r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll a,b,c;
//おいしくない解毒剤入り、おいしい解毒剤入り、おいしい毒入り
 cin>>a>>b>>c;
 ll ans;
 if(c-1<=a+b)ans=b+c;
 else ans=(a+b+1)+b;
 pr(ans);
return 0;}


Measured memory_bytes: 3608
c1=list(map(int,input().split()))
c2=list(map(int,input().split()))
c3=list(map(int,input().split()))

if c1[1]-c1[0]==c2[1]-c2[0]==c3[1]-c3[0] and c1[2]-c1[1]==c2[2]-c2[1]==c3[2]-c3[1]:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <cstdio>
#include <algorithm>
#include <queue>
#include <string.h>

using namespace std;

typedef long long LL;

const LL INF = 1e17;

LL ans, A[1005][3], N, M;
priority_queue<LL> Q;

void Test(int t0, int t1, int t2)
{
	int i;
	while (!Q.empty()) Q.pop();
	for (i = 1; i <= N; ++i)
		Q.push(A[i][0]*t0+A[i][1]*t1+A[i][2]*t2);
	LL tmp = 0;
	for (i = 1; i <= M; ++i)
		tmp += Q.top(), Q.pop();
	ans = max(ans, tmp);
	return;
}

int main()
{
	int i, j, k;
	scanf("%lld%lld", &N, &M);
	for (i = 1; i <= N; ++i)
		for (j = 0; j < 3; ++j)
			scanf("%lld", &A[i][j]);
	for (i = -1; i <= 1; ++i)
		for (j = -1; j <= 1; ++j)
			for (k = -1; k <= 1; ++k)
				if (i && j && k) Test(i, j, k);
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <numeric>
#include <queue>
#include <tuple>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i))
#define whole(x) begin(x), end(x)
using ll = long long;
using namespace std;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

struct disjoint_sets {
    vector<int> data;
    disjoint_sets() = default;
    explicit disjoint_sets(size_t n) : data(n, -1) {}
    bool is_root(int i) { return data[i] < 0; }
    int find_root(int i) { return is_root(i) ? i : (data[i] = find_root(data[i])); }
    int set_size(int i) { return - data[find_root(i)]; }
    int unite_sets(int i, int j) {
        i = find_root(i); j = find_root(j);
        if (i != j) {
            if (set_size(i) < set_size(j)) swap(i,j);
            data[i] += data[j];
            data[j] = i;
        }
        return i;
    }
    bool is_same(int i, int j) { return find_root(i) == find_root(j); }
};

int main() {
    // input
    int n; scanf("%d", &n);
    vector<int> x(n), y(n); repeat (i, n) scanf("%d%d", &x[i], &y[i]);
    // solve
    reversed_priority_queue<tuple<int, int, int> > que;
    auto add_edges_with = [&](function<int (int, int)> f) {
        vector<int> indices(n);
        iota(whole(indices), 0);
        sort(whole(indices), [&](int i, int j) { return f(x[i], y[i]) < f(x[j], y[j]); });
        repeat (k, n - 1) {
            int i = indices[k];
            int j = indices[k + 1];
            int dist = min(abs(x[i] - x[j]), abs(y[i] - y[j]));
            que.emplace(dist, i, j);
        }
    };
    add_edges_with([](int x, int y) { return x; });
    add_edges_with([](int x, int y) { return y; });
    ll result = 0;
    disjoint_sets ds(n);
    while (not que.empty()) {
        int dist, i, j; tie(dist, i, j) = que.top(); que.pop();
        if (not ds.is_same(i, j)) {
            result += dist;
            ds.unite_sets(i, j);
        }
    }
    // output
    printf("%lld\n", result);
    return 0;
}


Measured memory_bytes: 5996
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,a,b,sum=0,k,rem=0;
    cin>>n>>a>>b;
    if(n<=a)
    cout<<n<<endl;
    else if(n<=a+b)
    cout<<a<<endl;
    else
    {
        sum=a+b;
        k=n/sum;
        rem=n%sum;
        if(rem==0)
        cout<<k*a<<endl;
        else if(rem<=a)
        cout<<k*a+rem<<endl;
        else
        cout<<k*a+a<<endl;
    }
}

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

odd = {}
even = {}

for idx in range(N):
  if idx%2 == 0:
    if V[idx] in even:
      even[V[idx]] += 1
    else:
      even[V[idx]] = 1
  else:
    if V[idx] in odd:
      odd[V[idx]] += 1
    else:
      odd[V[idx]] = 1
sorted_odd = sorted(odd.items(), key=lambda x: -x[1])
sorted_even = sorted(even.items(), key=lambda x: -x[1])
fs_odd = sorted_odd[0][0]
fs_even = sorted_even[0][0]
if fs_odd == fs_even:
  if sorted_odd[0][1] > sorted_even[0][1]:
    fs_even = sorted_even[1][0]
    print(N-odd[fs_odd]-even[fs_even])
  elif sorted_odd[0][1] < sorted_even[0][1]:
    fs_odd = sorted_odd[1][0]
    print(N-odd[fs_odd]-even[fs_even])
  else:
    if len(sorted_odd) == 1:
      print(N//2)
    else:
      if sorted_odd[1][1] > sorted_even[1][1]:
        fs_odd = sorted_odd[1][0]
        print(N-odd[fs_odd]-even[fs_even])
      else:
        fs_even = sorted_even[1][0]
        print(N-odd[fs_odd]-even[fs_even])
else:
  print(N-odd[fs_odd]-even[fs_even])



Measured memory_bytes: 63852
#include <bits/stdc++.h>
using namespace std;
int main()
{
    // 整数の入力
	int n,a,b;
  	int chage;
 
    cin >> n >> a >> b;
  	if(n*a>b){
      chage = b;
    }else{
      chage = n*a;
    }
    cout << chage <<endl;
  	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 2019;
const int INF = 1 << 30;

int main() {
    int l, r;
    cin >> l >> r;

    if (r - l > 10000) {
        cout << 0 << endl;
        exit(0);
    }

    l %= MOD;
    r %= MOD;
    if (l > r) r += MOD;

    int res = INF;

    for (int i = l; i <= r; i++) {
        for (int j = i+1; j <= r; j++) {
            int p = i * j;
            p %= MOD;
            res = min(res, p);
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
// INCLUDES
#include <bits/stdc++.h>
#include<assert.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
//DEFINES
#define MAX 1000001
#define pii pair<int, int>
#define F first
#define S second
#define all(s) begin(s),end(s)
#define MIN3POS(a, b, c) (a) =< (b) ? ((a) =< (c) ? 1 : 3) : ((b) =< (c) ? 2 : 3)
#define MAX3POS(a,b,c) (a) >= (b) ? ((a) >= (c) ? 1 : 3) : ((b) >= (c) ? 2:3)
#define endl '\n'
#define int long long
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define FOR(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define IOS   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
//NAMESPACES
using namespace __gnu_pbds; 
using namespace std;
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
//HELPERS

vector<int> powers2(32,0);void initialize(){ for(int i=1;i<powers2.size();i++) powers2[i] = powers2[i-1]*2;}
int32_t main()
{
IOS
string s1,s2;
cin>>s1>>s2;
int  flag = 1;
for(int i=0;i<s1.size();i++) if(s1[i]!=s2[i]) flag=0;
if(s2.size()!=s1.size()+1) flag = 0;
if(flag) cout<<"Yes";
else cout<<"No";
return 0;
}
// Use emplace back in place of pushback
// Use tie function , for object destructuring

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(A: "List[List[int]]", N: int, b: "List[int]"):
    
    line = [a for a in A]
    
    line.append([A[i][0] for i in range(3)])
    line.append([A[i][1] for i in range(3)])
    line.append([A[i][2] for i in range(3)])
    line.append([A[0][0], A[1][1], A[2][2]])
    line.append([A[0][2], A[1][1], A[2][0]])

    #print(line)
    #print(b)
    for Al in line:
        #print(Al)
        if len(set(b) & set(Al)) == 3:
            print(YES)
            sys.exit()
    print(NO)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = [[int(next(tokens)) for _ in range(3)] for _ in range(3)]  # type: "List[List[int]]"
    N = int(next(tokens))  # type: int
    b = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(A, N, b)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int A, B, C;

    scanf("%d%d%d", &A, &B, &C);

    if(A <= C && C <= B){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 1624
#include <iostream>
#include <fstream>
#include <algorithm>
#include <utility>
#include <vector>
#include <unordered_map>

using ll = long long;
class KnapsackZDD {
	const int n;
	const int W;
	const int* w;
	const ll* v;
	using P = std::pair<int, int>;
	struct Node { int value; P child[2]; Node() : value(-1) { child[0] = child[1] = P(0, 0); } };
	std::vector<std::unordered_map<int, Node>> g;
public:
	KnapsackZDD(int n, int W, int* w, ll* v) : n(n), W(W), w(w), v(v) {}

	int getRoot(int& state) const {
		state = 0;
		return n;
	}

	// n + 0 : 1-end
	// n + 1 : 0-end
	int getChild(int& state, int level, int value) const {
		if (value == 1) state += w[level];
		++level;
		if (state > W) return n + 1; // infeasible
		return level;
	}

	void construct() {
		int vRoot = 0;
		g.resize(getRoot(vRoot) + 1);
		g[0][vRoot] = Node();
		g[n][0] = g[n][1] = Node();

		for (int i = 0; i < n; ++i) {
			for (auto& pair : g[i]) {
				auto& node = pair.second;
				int state = pair.first;
				for (int x = 0; x < 2; ++x) {
					int nextLevel = getChild(state, i, x);
					if (nextLevel >= n) {
						node.child[x] = P(n, n + 1 - nextLevel);
					}
					else {
						if (!g[i + 1].count(state)) {
							g[i + 1][state] = Node();
						}
						node.child[x] = P(i + 1, state);
					}
				}
			}
		}
	}

	ll evaluate() {
		return evalNode(0, 0);
	}
	ll evalNode(const P& pair) { return evalNode(pair.first, pair.second); }
	ll evalNode(const int& level, const int& state) {
		auto& res = g[level][state].value;
		{ // check memo
			if (res != -1) return res;
		}
		if (level == n) return res = state ? 0 : (1 << 31);
		auto&& node = g[level][state];
		return res = std::max(evalNode(node.child[0]), evalNode(node.child[1]) + v[level]);
	}
};

constexpr int MAX_N = 102;
int w[MAX_N];
ll v[MAX_N];
int main() {
	int n, W;
	auto input = [&](std::istream& ifs) {
		ifs >> n >> W;
		for (int id = 0; id < n; ++id) {
			ifs >> v[id] >> w[id];
		}
	};
	//std::ifstream ifs("in.txt");
	//input(ifs);
	input(std::cin);

	KnapsackZDD knapsack(n, W, w, v);
	knapsack.construct();

	std::cout << knapsack.evaluate() << std::endl;
	return 0;
}


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

int N;
long long sum = 0;
vector< pair<int, int> > adjlist[100005];
vector<int> centroids;

int dfs(int x, int p, int pw) {
	int ans = 1;
	int mx = 0;
	for (int i = 0; i < adjlist[x].size(); i++) {
		if (adjlist[x][i].first != p) {
			int val = dfs(adjlist[x][i].first, x, adjlist[x][i].second);
			mx = max(mx, val);
			ans += val;
		}
	}
	mx = max(mx, N - ans);
	if (mx * 2 <= N) centroids.push_back(x);
	sum += (long long)min(ans, N - ans) * pw * 2;
	return ans;
}
map< pair<int, int>, int> W;

int main() {
	scanf("%d", &N);
	int minedge = 1000000000;
	for (int i = 0; i < N-1; i++) {
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);a--;b--;
		adjlist[a].push_back(make_pair(b, c));
		W[make_pair(a, b)] = W[make_pair(b, a)] = c;
		adjlist[b].push_back(make_pair(a, c));
	}
	dfs(0, -1, 0);
	if (centroids.size() == 1) {
		for (int i = 0; i < centroids.size(); i++) {
			for (int j = 0; j < adjlist[centroids[i]].size(); j++) minedge = min(minedge, adjlist[centroids[i]][j].second);
		}
	} else {
		minedge = W[make_pair(centroids[0], centroids[1])];
	}
	
	printf("%lld\n", sum - minedge);
}


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

int main(){
  ull n,t;
  cin >> n >> t;
  vector<ull> v(n);
  rep(i,n) cin >> v.at(i);
  
  ull ans = 0;
  rep(i,n){
    if( i == n-1 ){
      ans += t;
      break;
    }
    if( v.at(i+1) - v.at(i) >= t ){
      ans += t;
    }else{
      ans += v.at(i+1) - v.at(i);
    }
  }
  cout << ans << endl;
  return 0;
}


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

int a[100010];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)	cin>>a[i];
	sort(a,a+n,greater<>());
	ll m=0,q=0;
	int f1=1;
	for(int i=0;i<n-1;i++){
		if(a[i]==a[i+1]){
			if(f1)  m=a[i],i++,f1=0;
			else {
				q=a[i];
				break;
			}
		}
	}
	ll sum = m*q;
	cout<<sum<<'\n'; 
	return 0;
 } 

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;
// ------------------------------

int main() {
    string S;
    int w;
    cin >> S >> w;
    rep(i, S.size()) if (i % w == 0) cout << S[i];
    cout << endl;
    return 0;
}

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

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

    if(s == "ARC") cout << "ABC" << endl;
    else cout << "ARC" << endl;

    return 0;
}

Measured memory_bytes: 3628
import Foundation
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

func check(_ a: Int, _ b: Int, _ c: Int) -> Bool {
  if a != b , b != c , a != c {
    if a + b > c , b + c > a , c + a > b {
      return true
    }
  }
  return false
}
let n = Int(readLine()!)!
let li = readInts()
guard li.count != 1 else { print(0); exit(0) }
var ans = 0
for i in 0..<n-2 {
  for j in i+1..<n-1 {
    for k in j+1..<n {
      if check(li[i], li[j], li[k]) {
        ans += 1
      }
    }
  }
}
print(ans)

Measured memory_bytes: 13404