akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ri register int
using namespace std;

string s;

int len,f;

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

Measured memory_bytes: 384
use proconio::{fastout, input};
use std::cmp::{max, min};
#[allow(unused_mut)]
#[fastout]
fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
        x: usize,
        y: usize
    }
    let a_b_min = if x < y { (a, x) } else { (b, y) };
    let a_b_max = if x > y { (a, x) } else { (b, y) };
    let all_ab = c * max(x, y) * 2;
    let sub_ab = c * a_b_min.1 * 2 + (a_b_max.1 - a_b_min.1) * a_b_max.0;
    let all_a_b = a * x + b * y;
    let res = min(all_ab, min(sub_ab, all_a_b));
    println!("{}", res);
}


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


int main() {
  int n, d;
  cin >> n >> d;
  vector<vector<int>> vec(n, vector<int>(d));
  rep(i,n){
    rep(j,d){
      cin >> vec[i][j];
    }
  }
  int ans;
  ans = 0;
  for(int i = 0; i < n-1; i++){
    for(int j = i + 1; j < n; j++){
      int a = 0;
      rep(k,d){
        a += (vec[i][k] - vec[j][k]) * (vec[i][k] - vec[j][k]);
      }
      
      for(int l = 0; l < a + 1; l++){
        if(l * l == a){
          ans = ans + 1;
        }
      }
    }
  }
  cout << ans;
}

Measured memory_bytes: 3592
#include <stdio.h>
#include <string.h>

int main(void)
{
    int n;
    char str[1024];
    int len;
    int i;

    scanf("%d", &n);
    fgets(str, 1023, stdin);
    while (n-- > 0){
        fgets(str, 1023, stdin);
        len = strlen(str);
        if (str[len - 1] == '\n'){
            str[len - 1] = '\0';
            len--;
        }

        for (i = 0; i < len; i++){
            if (strncmp(str + i, "Hoshino", 7) == 0){
                str[i + 6] = 'a';
                i += 6;
            }
        }
        printf("%s\n", str);
    }

    return (0);
}

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

signed main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    
    int3(n, k, m);

    vi cnt(n, 0);
    rep(i, m) {
        Int(tmp);
        cnt[tmp-1]++;
    }

    rep(i, n) {
        cout << ((cnt[i] + k > m) ? "Yes" : "No") << endl;
    }

    return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;

int main()
{
    int a,b;
    cin >> a >> b;
    cout << a - b + 1;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;


int main(){
    int N, M, A, B, C;
    string s1, s2, s3;
    char a;
    cin >> a;
    if(a - 'a' >= 0) cout << 'a' << endl;
    else cout << 'A' << endl;

}

Measured memory_bytes: 3620
# frozen_string_literal: true

a, b, c, d = gets.split.map(&:to_i)

nc = b/c - (a - 1)/c
nd = b/d - (a - 1)/d
ncd = b/(c.lcm(d)) - (a - 1)/(c.lcm(d))

n = nc + nd - ncd

puts b - a - n + 1


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

typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) (in).begin(),(in).end()
#define ALL(in,K) (in),(in)+(K)

#define INF 1e18
#define MOD 1000000007
#define SIZE 10005
#define PI 	3.14159265358979323846

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a, b)*b; } //最小公倍数

ll input(){
  ll a;
  cin >> a;
  return a;
}

int main(){
  int n;
  cin >> n;
  cout << n*n*n << endl;
}

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

import sys


def main():
    def input(): return sys.stdin.readline().rstrip()
    def mi():    return map(int, input().split())
    def lmi():   return list(map(int, input().split()))

    def move(from_i, from_j, to_i, to_j, ans):
        y, x = from_i, from_j
        while not (y == to_i and x == to_j):
            # print(f"{y} {x} {to_i} {to_j}")
            if (y % 2 == 0 and x == w - 1) or (y % 2 == 1 and x == 0):
                # 下へ
                ans.append("{} {} {} {}".format(y+1, x+1, y+2, x+1))
                y += 1
            elif y % 2 == 0:
                # 右へ
                ans.append("{} {} {} {}".format(y+1, x+1, y+1, x+2))
                x += 1
            else:
                # 左へ
                ans.append("{} {} {} {}".format(y+1, x+1, y+1, x))
                x -= 1
    
    h, w = mi()
    L = [lmi() for _ in range(h)]
    coin_odd = []
    for i in range(h):
        if i % 2 == 0:
            for j in range(w):
                if L[i][j] % 2 == 1:
                    coin_odd.append((i, j))
        else:
            for j in range(w-1, -1, -1):
                if L[i][j] % 2 == 1:
                    coin_odd.append((i, j))              

    ans = []
    # 偶数コインが置かれた、っていう表現は 0 枚を含まないと思うのですが...
    # 質問によると含むらしい。それなら実装はかなり単純
    coin_odd.reverse()
    # print(coin_odd)
    while len(coin_odd) >= 2:
        from_i, from_j = coin_odd.pop()
        to_i, to_j = coin_odd.pop()
        move(from_i, from_j, to_i, to_j, ans)
        L[from_i][from_j] -= 1
        L[to_i][to_j] += 1

    print(len(ans))
    for line in ans:
        print(line)
    
    # for l in L:
    #     print(*l)


if __name__ == "__main__":
    main()


Measured memory_bytes: 28224
#include<cstdio>
#include<vector>
#include<map>
int N,V,x[200010],fa[3600010],tot;
std::vector<int>ch[3600010];
int addc(int x){
	int y=++tot;
	fa[y]=x;ch[x].push_back(y);
	return y;
}
std::map<std::vector<int>,bool>M;
bool dfs(std::vector<int>v,int d){
	if(v.size()>d)return 0;
	if(!v.size())return 1;
	if(M.count(v))return M[v];
	int cs=0;
	for(int i=0;i<v.size();i++)cs+=ch[v[i]].size();
	for(int i=0;i<v.size();i++)if(cs-ch[v[i]].size()<d){
		std::vector<int>w;
		for(int j=0;j<v.size();j++)if(j!=i){
			int c=v[j];
			for(int k=0;k<ch[c].size();k++)w.push_back(ch[c][k]);
		}
		if(dfs(w,d-1))return M[v]=1;
	}
	return M[v]=0;
}
int get_sz(int i){
	if(!ch[i].size())return 1;
	int sz=0;
	for(int j=0;j<ch[i].size();j++)sz+=get_sz(ch[i][j]);
	return sz;
}
bool res[200010];
int main(){
	scanf("%d%d",&N,&V);
	int cur=0,d=0;
	for(int i=0;i<N;i++){
		scanf("%d",x+i);
		while(d&&x[i]-x[i-1]>V>>d-1)cur=fa[cur],--d;
		while(V>>d)cur=addc(cur),++d;
		cur=addc(cur);++d;
	}
	if(ch[0].size()<=d){
		int cnt=0;
		for(int i=0;i<ch[0].size();i++){
			std::vector<int>v;
			bool r=1;
			for(int j=0;j<ch[0].size()&&r;j++)if(j!=i){
				int c=ch[0][j];
				if(v.size()+ch[c].size()>=d)r=0;
				else for(int k=0;k<ch[c].size();k++)v.push_back(ch[c][k]);
			}
			if(r)r=dfs(v,d-1);
			for(int t=get_sz(ch[0][i]);t--;)res[cnt++]=r;
		}
	}
	for(int i=0;i<N;i++)puts(res[i]?"Possible":"Impossible");
}

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


const int MAX_V=1000;
const int INF=1e9;

struct edge{
    int to,cap,rev;
    edge(int to=0,int cap=0,int rev=0)
        :to(to),cap(cap),rev(rev){}
};

vector<edge>G[MAX_V];
bool used[MAX_V];

void add_edge(int from,int to,int cap){
    G[from].push_back(edge(to,cap,G[to].size()));
    G[to].push_back(edge(from,0,G[from].size()-1));
}

int dfs(int v,int t,int f){
    if(v==t)return f;
    used[v]=true;

    for(int i=0;i<G[v].size();i++){
        edge &e=G[v][i];
        if(e.cap==0||used[e.to])continue;
        int d=dfs(e.to,t,min(f,e.cap));
        if(d){
            e.cap-=d;
            G[e.to][e.rev].cap+=d;
            return d;
        }
    }
    return 0;
}

int max_flow(int s,int t){
    int flow=0;
    while(true){
        fill_n(used,MAX_V,false);
        int f=dfs(s,t,INF);
        if(f)flow+=f;
        else return flow;
    }
}

int main(){
    int S=998,T=999;

    int n;cin>>n;


    for(int i=0;i<n;i++){
        add_edge(S,i*2,1);
        add_edge(i*2,i*2+1,1);
    }

    for(int i=n;i<n+31;i++){
        add_edge(i*2,i*2+1,1);
        add_edge(i*2+1,T,1);
    }

    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        a--;b--;
        for(int j=n+a;j<=n+b;j++)add_edge(i*2+1,j*2,1);
    }

    int f=max_flow(S,T);
    cout<<f*100+(31-f)*50<<endl;
    return 0;
}

Measured memory_bytes: 1260
import math
A, B, H, M = map(int, input().split())


arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60) 
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)


Measured memory_bytes: 9480
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
using namespace std;

int N, K, pos_st;
vector<int> v;

long long calc(int l, int r){
  long long res = 0LL;
  if(v[l] < 0 && v[r] > 0){
     res += min(2*abs(v[l]) + abs(v[r]), abs(v[l]) + 2*abs(v[r]));
  }
  else if(v[l] >= 0 && v[r] >= 0){
    res += abs(v[r]);
  } 
  else{
    res += abs(v[l]);
  }
  return res;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N >> K;
  v.resize(N);
  pos_st=-1;
  for(int i=0; i<N; ++i){ cin >> v[i];
    if(v[i] >= 0 && pos_st == -1)
      pos_st = i;
  }
  if(pos_st == -1) pos_st = N-1;
  long long res = 1e15 + 5;
  for(int i=0; i+K<=N && i <= pos_st; ++i){
    long long p = calc(i, i+K-1) ;
    res = min(p, res);
  }
  cout << res << "\n";
  return 0;
}


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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ld PI = 3.14159265359;

const ll MOD = (ll) 998244353ll;
const ll MAXN = (ll) 2e5 + 10;
const ll INF = (ll) 2242545357980376863;
const ld EPS = (ld) 1e-8;



int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cout << "Christmas ";
	ll d;
	cin >> d;
	d = 25 - d;
	for(int i = 0; i < d; i++) cout << "Eve ";

	return 0;
}


/*

                                 ____              ,----..               ,----..
   ,---,                       ,'  , `.           /   /   \             /   /   \
  '  .' \                   ,-+-,.' _ |          /   .     :           /   .     :
 /  ;    '.              ,-+-. ;   , ||         .   /   ;.  \         .   /   ;.  \
:  :       \            ,--.'|'   |  ;|        .   ;   /  ` ;        .   ;   /  ` ;
:  |   /\   \          |   |  ,', |  ':        ;   |  ; \ ; |        ;   |  ; \ ; |
|  :  ' ;.   :         |   | /  | |  ||        |   :  | ; | '        |   :  | ; | '
|  |  ;/  \   \        '   | :  | :  |,        .   |  ' ' ' :        .   |  ' ' ' :
'  :  | \  \ ,'        ;   . |  ; |--'         '   ;  \; /  |        '   ;  \; /  |
|  |  '  '--'          |   : |  | ,             \   \  ',  /          \   \  ',  /
|  :  :                |   : '  |/               ;   :    /            ;   :    /
|  | ,'                ;   | |`-'                 \   \ .'              \   \ .'
`--''                  |   ;/                      `---`                 `---`
                       '---'

*/



Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

for i in range(len(a)):
    a[i] -= i + 1

a.sort()
b = [0]
for i in a:
    b.append(b[-1] + i)
hi = len(a)
lo = 0


def score(index):
    return abs(abs((index + 1) * a[index] - b[index+1]) + abs(b[-1] - b[index+1] - (len(a) - index - 1) * a[index]))


for i in range(10000):
    lft = (hi + 2 * lo) // 3
    rgt = (2 * hi + lo) // 3
    ltmp = score(lft)
    rtmp = score(rgt)
    if ltmp <= rtmp:
        lo = lft
    else:
        hi = rgt

print(min([score(i) for i in range(len(a))]))


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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define CYES cout << "Yes" << endl
#define CNO cout << "No" << endl
#define SPC(x) cout << fixed << setprecision(x)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;
typedef vector<vector<ll>> vll;
typedef pair<int, int> P;
typedef complex<ld> Point;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int MAX_V = 1e5 + 5;
const int MAX_N = 1e5 + 5;
const double PI = acos(-1);

int main() {
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;
    if (s == u) {
        a--;
    } else {
        b--;
    }
    cout << a << " " << b << endl;
    return 0;
}


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

int main() {
  int n;
  string s, t;
  cin >> n >> s >> t;
  rep(i, n) cout << s[i] << t[i];
  cout << endl;
  return 0;
}

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

using namespace std;


#define PI 3.14159265
#define int long long




main(){


	int a, b, c, d, e;

	cin >> a >> b >> c >> d >> e;


	int ans = 0;

	ans += (a + 9) / 10;
	ans += (b + 9) / 10;
	ans += (c + 9) / 10;
	ans += (d + 9) / 10;
	ans += (e + 9) / 10;

	int m = 10;

	if(a % 10) m = min(m, a % 10);
	if(b % 10) m = min(m, b % 10);
	if(c % 10) m = min(m, c % 10);
	if(d % 10) m = min(m, d % 10);
	if(e % 10) m = min(m, e % 10);


	if(m == 0){
		cout << ans * 10 << endl;
	}else{
		cout << (ans - 1) * 10 + m << endl;
	}

	


	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <map>
#include <set>
#include <queue>
#include <list>
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define crep(i) for(char i='a';i<='z';i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define ALL(x) (x).begin(),(x).end()
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main(){
    ll n;
    cin >> n;
    vector<pair<ll, ll>> r(n), b(n);
    for(int i = 0; i < n; ++i){
        cin >> r.at(i).first >> r.at(i).second;
    }
    for(int i = 0; i < n; ++i){
        cin >> b.at(i).first >> b.at(i).second;
    }

    sort(r.begin(), r.end());
    ll ans = 0;
    vector<bool> used(n, false);
    for(int i = n - 1; i >= 0; --i){
        ll j = -1;
        for(int k = 0; k < n; ++k){
            if(!used.at(k) &&
               r.at(i).first < b.at(k).first && r.at(i).second < b.at(k).second &&
               (j == -1 || b.at(k).second < b.at(j).second)){
                j = k;
            }
        }
        if(j == -1){ continue; }
        ans++;
        used.at(j) = true;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

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

	public void run() {
		
		while(sc.hasNext()){
			double a,b,c,d,e,f;
			a=sc.nextInt();
			b=sc.nextInt();
			c=sc.nextInt();
			d=sc.nextInt();
			e=sc.nextInt();
			f=sc.nextInt();
			
			double x=new BigDecimal((c*e-b*f)/(a*e-b*d))
				.setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue();
			double y=new BigDecimal((c*d-a*f)/(b*d-a*e))
				.setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue();
			ln(String.format("%.3f %.3f",x,y));
		}
	}

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

	public static void pr(Object o) {
		System.out.print(o);
	}

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
 
using namespace std;
 
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define pb push_back
#define endl '\n'
#define snd second
#define fst first
#define fastio cin.tie(NULL),cout.sync_with_stdio(true)

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector <int> vi;
typedef pair <ll,ll> ii; 
typedef pair <ii,int> iii;
 
const int inf = 0x3F3F3F3F;
const ull mod = 998244353;

void solve(){
	string a,b,ans;
	int n;
	cin >> n >> a >> b;
	for(int i = 0; i < n; i++)ans += a[i], ans += b[i];
	cout << ans << endl;
}

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


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

int cnt[200]={0};
string str[10]={"AC","WA","TLE","RE"};

int main(){
   int n;
   scanf("%d",&n);
   getchar();
   string s;
   while(n--){
    cin>>s;
    cnt[s[0]]++;
   }
   for(int i=0;i<4;i++){
        cout<<str[i];
        int t=str[i][0];
        printf(" x %d\n",cnt[t]);
   }
    return 0;
}


Measured memory_bytes: 3788
package main

import "fmt"

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

const large = 1000000000

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

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

	dp := make([]int, 10e5+5)
	for i := 0; i <= k; i++ {
		for j := 0; j < n; j++ {
			if i+a[j] <= k {
				dp[i+a[j]] = max(
					dp[i]^1,
					dp[i+a[j]],
				)
			}
		}
	}

	if dp[k] == 1 {
		fmt.Println("First")
		return
	}

	fmt.Println("Second")
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define MOD 100000007LL
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
int n;
vector<int> G[101];
vector<int> rG[101];
vector<int> vs;
bool used[101];
int cmp[101];
double pro[101];
vector<int> uG[101];
int data[101][101];

void add(int f,int t){
	G[f].push_back(t);
	rG[t].push_back(f);
}

void dfs(int v){
	used[v]=true;
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]])dfs(G[v][i]);
	}
	vs.push_back(v);
}

void rdfs(int v,int k){
	used[v]=true;
	cmp[v]=k;
	for(int i=0;i<rG[v].size();i++){
		if(!used[rG[v][i]])rdfs(rG[v][i],k);
	}
}

int scc(){
	memset(used,0,sizeof(used));
	vs.clear();
	for(int v=0;v<n;v++){
		if(!used[v])dfs(v);
	}

	memset(used,0,sizeof(used));
	int k=0;
	for(int i=vs.size()-1;i>=0;i--){
		if(!used[vs[i]])rdfs(vs[i],k++);
	}
	return k;
}
double raw;
double p[101];
int m[101],a[101][101];

void getdfs(int v){
	used[v]=true;
	bool flag=false;
	for(int i=0;i<uG[v].size();i++){
		if(!used[uG[v][i]]){
			flag=true;
			getdfs(uG[v][i]);
		}
	}
	if(uG[v].size()==0){
		raw*=1.0-pro[v];
	}
}

int main(void){
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			G[i].clear();
			rG[i].clear();
			uG[i].clear();

		}
		for(int i=0;i<n;i++){
			scanf("%lf%d",&p[i],&m[i]);
			for(int j=0;j<m[i];j++){
				scanf("%d",&a[i][j]);
				a[i][j]--;
				G[i].push_back(a[i][j]);
				rG[a[i][j]].push_back(i);
			}
		}
		int k=scc();
		for(int i=0;i<k;i++){
			pro[i]=1.0;
			for(int j=0;j<n;j++){
				if(cmp[j]==i){
					pro[i]*=p[j];
				}
			}
		}
		memset(data,0,sizeof(data));
		for(int i=0;i<n;i++){
			for(int j=0;j<m[i];j++){
				if(data[cmp[i]][cmp[a[i][j]]]==0){
					data[cmp[i]][cmp[a[i][j]]]=1;
					if(cmp[i]!=cmp[a[i][j]])uG[cmp[a[i][j]]].push_back(cmp[i]);
				}
			}
		}
		memset(used,false,sizeof(used));
		double ans=1.0;
		for(int i=k-1;i>=0;i--){
			raw=1.0;
			if(!used[i])getdfs(i);
			ans=ans*raw;
		}
		printf("%.10f\n",ans);
	}
	return 0;
}

Measured memory_bytes: 3416
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[8] = { 0,0,1,-1, 1,1,-1,-1 };// 前４つで４近傍
const int c_Dy[8] = { 1,-1,0,0 ,1,-1,1,-1};// 全部で８近傍
const int c_div = 1000000007; //10^9 + 7
const double PI = 3.14159265358979323846;



void  bubbleSort(int number[],int length);

int main() {

	char S[300];
	scanf("%s", S);

	for (int i = 2; i < strlen(S); i += 2) {
		int half = (strlen(S) - i) / 2;
		for (int j = 0; j < half; j++) {
			if (S[j] != S[half + j]) {
				break;
			}
			else if (j == half - 1) {
				printf("%d", half * 2);
				return 0;
				
			}
		}

	}













}



//---配列を降順ソート（だんだん小さくなる）----
void  bubbleSort(int number[], int length) {
	for (int i = 0; i < length; i++)
		for (int j = i + 1; j < length; j++)
			if (number[i] < number[j]) {
				int tmp = number[i];
				number[i] = number[j];
				number[j] = tmp;
			}
}

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

int T, N, K, X[1000000+10], A[1000000+10];
int main() {
  cin >> T; // Read in number of data sets
  for (int t=0; t<T; ++t) {
    cin >> N >> K;
    for (int i=0; i<N; ++i) cin >> X[i]; // Read house locations
    for (int i=0; i+1<N; ++i) A[i] = X[i+1]-X[i]; // House intervals

    sort(A, A+N-1); // sort house intervals, ascending

    int ans = 0; // initialize answer 
    for (int i=0; i<N-K; ++i) ans += A[i]; // sum of intervals to N-1-(K-1)

    cout << ans << endl;
  }
}
    
    

       

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

#define int long long
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

const int INF = 1e18;

int N, A, B, C;
vector<int> l;

int rec(int idx, int a, int b, int c) {
  if (idx >= N) {
    if (a == 0 || b == 0 || c == 0) return INF;
    return abs(a - A) + abs(b - B) + abs(c - C);
  }

  int ret = INF;
  // A
  chmin(ret, rec(idx+1, a+l[idx], b, c) + (a > 0 ? 10 : 0));
  // B
  chmin(ret, rec(idx+1, a, b+l[idx], c) + (b > 0 ? 10 : 0));
  // C
  chmin(ret, rec(idx+1, a, b, c+l[idx]) + (c > 0 ? 10 : 0));
  // 使わない
  chmin(ret, rec(idx+1, a, b, c));

  return ret;
}

signed main() {
  cin >> N >> A >> B >> C;
  l.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> l[i];
  }

  int ans = rec(0, 0, 0, 0);

  cout << ans << endl;

  return 0;
}

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

int main(){
  int n, k, x, ans = 0;
  cin >> n >> k;
  for(int i = 0; i < n; i++){
    cin >> x;
    if(x >= k - x){
  	  ans += (k - x) * 2;
    }else if(x < k - x){
  	  ans += x * 2;
    }
  }
  cout << ans;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,k,a,b,c,d,s,ct;
    cin>>n>>k;
    a=0;
    while(n)
    {
        a++;
        n/=k;
    }
    cout<<a<<endl;
}




Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <functional>
#include <iterator>
#include <string>
#include <bitset>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <vector>
#include <cmath>

typedef unsigned long long int ulli;
typedef   signed long long int slli;
const ulli MAX_ULLI = 0xFFFFFFFFFFFFFFFF;
const ulli MIN_ULLI = 0x0000000000000000;
const slli MAX_SLLI = 0x7FFFFFFFFFFFFFFF;
const slli MIN_SLLI = 0x8000000000000000;
const ulli MOD = 1e9 + 7;

#ifdef __USE_REAL__
typedef long double real;
const real MATH_PI =  3.141592653589793238462643383279502884197169399375105820974944;
const real MATH_E  =  2.718281828459045235360287471352662497757247093699959574966967;
const real eps = 1e-14;
#endif /* __USE_REAL__ */

#ifdef __DEBUG__
template<typename T, typename U=T>
std::string to_string(
	const std::list<T>& l, 
	std::function<U(T)> conv = [](const T& v){ return v; },
	const std::string delim = ","
)
{
	std::stringstream ss;
	auto itr = l.begin();
	while(itr != l.end())
	{
		ss << conv(*itr);
		++itr;
		if(itr != l.end()) ss << delim;
	}
	return ss.str();
}

template<typename T, typename U=T>
std::string to_string(
	const std::vector<T>& v, 
	std::function<U(T)> conv = [](const T& v){ return v; },
	const std::string delim = ","
)
{
	std::stringstream ss;
	for(ulli i=0; i<v.size(); ++i)
	{
		ss << conv(v[i]);
		if((i + 1) < v.size()) ss << delim;
	}
	return ss.str();
}
#endif

template<typename T, class InputIterator>
inline bool have(
	InputIterator first, 
	InputIterator last, 
	const T &val
)
{
	return std::find(first, last, val) != last;
}

template<class InputIterator, class UnaryPred>
inline bool have_if(
	InputIterator first, 
	InputIterator last, 
	UnaryPred pred
)
{
	return std::find_if(first, last, pred) != last;
}

int main()
{
	const unsigned N = 3;
	std::vector<unsigned> a(N);
	for(unsigned n=0; n<N; ++n)
	{
		std::cin >> a[n];
	}
	std::sort(a.begin(), a.end());
	
	std::cout << ((a[0] == a[1] && a[1] == 5 && a[2] == 7) ? "YES" : "NO") << std::endl;
	
	return 0;
}

Measured memory_bytes: 256
n = int(input())
ans = 0
pre = -5
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))

for i in range(n):
  ans += b_list[a_list[i] - 1]

  if pre == a_list[i] - 1:
    ans += c_list[a_list[i] - 2]
  pre = a_list[i]


print(ans)

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

using namespace std;


int main() {
	int t, n, s, f, sum;

	while (cin >> t, t) {
		cin >> n;
		sum = 0;
		for (int i = 0; i < n; ++i) {
			cin >> s >> f;
			sum += f - s;
		}
		if (sum < t) {
			cout << t - sum << endl;
		}
		else {
			cout << "OK" << endl;
		}
	}

	return 0;
}



Measured memory_bytes: 3100
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define REP(i,n) for(int i=0,_n=(n);(i)<(int)_n;++i)
#define RANGE(i,a,b) for(int i=(int)a,_b=(int)(b);(i)<_b;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) REP(d0, D0) cout<<table[d0]<<" "; cout<<"\n";
#define PRINT2(table, D0, D1) REP(d0, D0) { REP(d1, D1) cout<<table[d0][d1]<<" "; cout<<"\n"; }
#define PRINT3(table, D0, D1, D2) REP(d0, D0) { REP(d1, D1) { REP(d2, D2) cout<<table[d0][d1][d2]<<" "; cout<<"\n"; } cout<<"\n"; }
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll N,w;
	while(cin>>N) {
		ll all = 1;
		ll allOdd = 1;
		REP(i, N) {
			cin>>w;
			all *= 3;
			allOdd *= w%2==0 ? 2 : 1;
		}
		
		cout<<all-allOdd<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
def isConcate(N, S):
	if N % 2 != 0:
		return 'No'
	else:
		if S[:N//2] == S[N//2:]:
			return 'Yes'
		else:
			return 'No'

if __name__ == '__main__':
  N = int(input())
  S = input()
  print(isConcate(N, S))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

/*************** using variables ***************/
int a, b, c, k;
/**********************************************/

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

    cin >> a >> b >> c >> k;

    int num = 1;
    REP(i, k) num *= 2;
    
    int aa = a * num + b + c, bb = b * num + a + c, cc = c * num + a + b;
    cout << max(max(aa, bb), cc) << endl;
}


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

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

signed main(){
	size_t n; cin >> n;
	vector<size_t> tri;
	tri.push_back(0);
	for(size_t i = 1;i*(i-1)/2 <= 1000000000; i++){
		tri.push_back((i*(i+1))/2);
	}
	//cerr << tri.back() << endl;
	//cerr << tri[tri.size()-2] << endl;

	auto lb = lower_bound(ALL(tri), n);
	size_t idx = distance(tri.begin(), lb);

	string ans = "";
	for(size_t i = 0; i < idx; i++) ans += ")";
	for(size_t i = 0; i < idx; i++) ans += "(";
	assert(*lb - n < idx);
	size_t diff = *lb - n;
	size_t j = idx-1;
	for(size_t i = 0; i < diff; i++, j--){
		swap(ans[j], ans[j+1]);
	}
	cout << ans << endl;

	return 0;
}




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

int main() {
  int n; cin >> n;
  vector<int> l(n);
  for (int i=0; i<n; i++){
    cin >> l.at(i);
  }
  sort(l.begin(), l.end());
  vector<pair<int,int>> combi;
  
  for (int i=0; i<n-2; i++){
    int iL = l.at(i);
    for (int j=i+1; j<n-1; j++){
      int jL = l.at(j);
      combi.push_back(make_pair(j,iL+jL));
      //
    }
  }
  int cnt = 0;
  
  for (int i=0; i<combi.size(); i++){
    for (int k=combi.at(i).first+1; k<n; k++){
      int kL = l.at(k);
      if (kL < combi.at(i).second){
        cnt++;
      }
    }
  }
  
  cout <<cnt <<endl;
}


Measured memory_bytes: 18796
import math

n = int(input())

m = []
for i in range(5):
	m.append(int(input()))

for i in range(4):
	if m[i] < m[i+1]:
		m[i+1] = m[i]

cnt = 5

cnt += math.ceil(n/m[0]) -1

l = []

for i in m:
	l.append(math.ceil(n/i))

for i in range(4):
	cnt +=(l[i+1] - l[i])

print(cnt)


Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
    int i,j,temp,x[5];
    for(i = 0; i < 5; i ++ )
        scanf("%d",&x[i]);
    for(i = 1;i < 5; i ++ ){
        j = i;
        while(j >= 1){
            if(x[j] > x[j - 1]){
                temp = x[j];
                x[j] = x[j - 1];
                x[j - 1] = temp;
            }
            j --;
        }
    }
    for(i = 0; i < 4; i ++ )
        printf("%d ",x[i]);
    printf("%d\n",x[4]);
    return 0;
}


Measured memory_bytes: 2052
import sys
input = sys.stdin.readline
def inputs():return [int(x) for x in input().split()]
N,m,x = inputs()
c = [inputs() for _ in range(N)]
cnt =[0]*(N)
ans = 10**8
for bit in range(1,1<<N):
    ans1 = 0
    cnt =[0]*(N)
    skill=[0]*m
    for j in range(N):
        if bit&1<<j:
            for i in range(1,m+1):
                skill[i-1]+=c[j][i]
            ans1+=c[j][0]
    snt =0
    for i in range(m):
        if(skill[i]>=x):
            snt+=1
        if(snt==m):
            ans=min(ans,ans1)
if ans==10**8:
    print(-1)
    exit()
print(ans)



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

typedef long long ll;
typedef long double ld;

const int M=1e5+5;
const ll mod=998244353;
ll ct[M];
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int mx=0;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int d;
		cin>>d;
		if(i==1 && d)
		{
			cout<<"0\n";
			return 0;
		}
		if(i>1 && d==0)
		{
			cout<<"0\n";
			return 0;
		}
		ct[d]++;
		mx=max(mx,d);
	}
	ll res=1;
	for(ll i=1;i<=mx;i++)
	{
		if(ct[i]==0)
			res=0;
		for(int j=0;j<ct[i];j++)
			res=(res*ct[i-1])%mod;
	}
	cout<<res<<"\n";
	return 0;
}


Measured memory_bytes: 1024
/*

*/
#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
  int a;cin>>a;
  cout<<a+a*a+a*a*a<<endl;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main() {
  ll N, Y;
  cin >> N >> Y;
  for (ll i = 0; i <= N; ++i) {
    for (ll j = 0; j <= (N - i); ++j) {
      // cout << i << ' ' << j << ' ' << N - i - j << "\n";
      if (i * 10000 + j * 5000 + (N - i - j) * 1000 == Y) {
        cout << i << ' ' << j << ' ' << N - i - j << "\n";
        return 0;
      }
    }
  }
  cout << -1 << ' ' << -1 << ' ' << -1 << "\n";
}


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

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 3584
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <limits>

using namespace std;
using ll = long long;

bool is_atcg_string(char c)
{
    if (c == 'A') {
        return true;
    }

    if (c == 'C') {
        return true;
    }

    if (c == 'G') {
        return true;
    }

    if (c == 'T') {
        return true;
    }

    return false;
}

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

    int max_count = 0;
    for (int i = 0; i < S.size(); ++i) {
        int count = 0;

        for (int j = i; j < S.size(); ++j) {
            if (!is_atcg_string(S[j])) {
                break;
            }
            ++count;
        }

        max_count = max(count, max_count);
    }

    cout << max_count << endl;

    return 0;
}


Measured memory_bytes: 256
/**
    AUTHOR:JUNSH
    TIME:19/5/25
**/
#include<bits/stdc++.h>
typedef long long ll;
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define rev(i,a,b) for(ll i=(a);i>=(b);--i)
using namespace std;
inline ll read(){
    ll 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;
}
const ll inf=0x3f3f3f3f;
map<ll,ll>mp;
set<ll> v;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,m;
    cin>>n>>m;
    rep(i,1,n){
        ll x;
        cin>>x;
        mp[x]++;
        v.insert(x);
    }
    while(m--){
        ll x,y;
        cin>>x>>y;
        mp[y]+=x;
        v.insert(y);
    }
    set<ll>::iterator pos=v.end()--;
    ll sum=0;
    pos--;
    while(n){
        int Pos=*pos;
        if(n>mp[Pos]){
            n-=mp[Pos];
            sum+=mp[Pos]*Pos;
            pos--;
            continue;
        }
        else {
            sum+=n*Pos;
            n=0;
            break;
        }
        if(pos==v.begin())break;
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 22144
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

int32_t main(){
    IOS;
    int a[3];
    for(int i=0;i<3;i++) cin>>a[i];
    sort(a,a+3);
    if(a[0]==a[1]&&a[1]!=a[2]) cout<<"Yes"<<endl;
    else if(a[1]==a[2]&&a[1]!=a[0]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 384
#include<iostream>
 using namespace std;
 int main()
{
  int a,b,c,tmp;
  cin >> a >> b >> c;
  if(a > b)
{
  tmp = a;
  a = b;
  b = tmp;
}
  if(b > c)
{
  tmp = b;
  b = c;
  c = tmp;
}
  if(a > b)
{
  tmp = a;
  a = b;
  b = tmp;
}  
 cout << a << " " << b << " " << c << endl;
 return 0;
}
  

Measured memory_bytes: 1164
#include<stdio.h>


int main(){
  double w,h;
  int x,y;
  scanf("%lf%lf%d%d",&w,&h,&x,&y);
  printf("%lf",(w*h)/2);
  if(x*2==w&&y*2==h){
    printf(" %d",1);
  }else{
    printf(" %d",0);
  }
  return 0;
}


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

int n[100000][13]={0};
int p[6] = {1,10,9,12,3,4};
int sp(int a ){
    a = a%6;
    return  p[a];
}

int main(){
    int a= 1;
    int pl =0 ;
    string s;
    cin >> s;
    reverse(s.begin(),s.end());
    rep(i,s.size()){
        if(s[i]!= '?'){
            s[i] -= '0';
            pl += s[i]*sp(i);
        }
    }
    pl %=13;
    n[0][pl]=1;
    int m = 0;
    rep(i,s.size()){     
        if(s[i]== '?'){
            int asa = sp(i);
            rep(j,10){
                rep(k,13){
                    n[m+1][(k+asa*j)%13] = (n[m+1][(k+asa*j)%13]+n[m][k]) %1000000007;
                    //cout << m+1<<'|'<<k << '|'<< n[m+1][k]<< endl;
                }
            }
            m++;
        }   
    }
    cout << n[m][5] << endl;
}

Measured memory_bytes: 5568
n,m=map(int,input().split())
a=[0]*(n+1)
if m>0:
  for _ in range(m):
    a[int(input())]+=1
dp=[0]*(n+1)
dp[0]=1
if a[1]!=1:
  dp[1]=1
if n==1:
  if a[1]==0:
    print(1)
    exit()
  else:
    print(0)
    exit()
for i in range(2,n+1):
  if a[i-2]==0 and a[i-1]==0:
    dp[i]=dp[i-2]+dp[i-1]
  elif a[i-1]!=0 and a[i-2]==0:
    dp[i]=dp[i-2]
  elif a[i-2]!=0 and a[i-1]==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=0
print(dp[n]%(10**9+7))    


Measured memory_bytes: 466408
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N;
    cin >> N;
    int ret = 0, prev = 0;
    set<Pii> conses;
    FOR(i, 0, N) {
        int a;
        cin >> a;
        if (prev > 0)
            conses.insert(Pii(prev, a));
        prev = a;
    }
    FOR(i, 0, N) {
        int b;
        cin >> b;
        ret += b;
    }
    
    FOR(i, 0, N - 1) {
        int c;
        cin >> c;
        if (conses.count(Pii(i + 1, i + 2)))
            ret += c;
    }
    
    cout << ret << endl;
    
    return 0;
};


Measured memory_bytes: 256
A,B,C,D=map(int,input().split())
a=A//D
b=C//B
if a>b:
  print('Yes')
  
if a==b:
  if A%D==0 and C%B!=0:
    print('No')
  else:
    print('Yes')
    
if a==b-1:
  if C%B==0 and A%D!=0:
    print('Yes')
  else:
    print('No')
    
if a<b-1:
  print('No')

Measured memory_bytes: 9184
#include <bits/stdc++.h>
#ifdef _DEBUG
#include "../../../debug_print.hpp"
#else
#define debug(...)
#endif
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
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;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

template <typename T, typename Compare>
T bisection(T left, T right, Compare cmp, const bool rev = false,
            const T end = -1) {
    left--;
    T ret       = right;
    const T MAX = !rev ? right : left;
    if (!rev) {
        while (1 < right - left) {
            T mid = left + ((right - left) / 2);
            if (cmp(mid)) {
                left = mid;
                ret  = left;
            } else {
                right = mid;
            }
        }
    } else {
        while (1 < right - left) {
            T mid = left + ((right - left) / 2);
            if (cmp(mid)) {
                right = mid;
                ret   = right;
            } else {
                left = mid;
            }
        }
    }
    return ret != MAX ? ret : end;
}

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

    ll N, K;
    scan(N, K);
    vector<ll> a(N), f(N);
    scan(a);
    scan(f);
    sort_(a);
    rsort(f);

    auto cmp = [&](ll x) -> bool {
        ll cnt = 0;
        rep(i, N) { cnt += max(0LL, a[i] - (ll)ceil(x / f[i])); }
        return cnt <= K;
    };

    ll ans = bisection(0LL, (ll)1e12 + 1, cmp, true);
    print(ans);

    return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <cmath>
#include <vector>
#include <utility>
#include <iomanip>

using namespace std;


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

    double radH, radM;
    radH = (H / 12.0) * 2*M_PI;
    radM = (M / 60.0) * 2*M_PI ;

    radH = radH + radM /12.0;

    double radtemp = radH - radM;
    if(radtemp > M_PI){
        radtemp =2 * M_PI -radtemp;
    }
    else if(radtemp < -1*M_PI){
        radtemp =-2* M_PI -radtemp;
    }

    double tempnum = (double)A*A +(double) B*B -2*A*B*cos(radtemp);
    tempnum = sqrt(tempnum);
    cout << fixed;
    cout<<std::setprecision(15) << tempnum <<endl;

}



Measured memory_bytes: 4256