akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define pb push_back
#define dbg(x) cerr << #x << " " << x << "\n"
const int M = 1e5;
int pos[M];
int seq[1 + M];
ll sumSeq[1 + M];

int main () {
    ios::sync_with_stdio (false);
    cin.tie (0); cout.tie (0);
    ll n; int x, m;
    cin >> n >> x >> m;
    seq[1] = x;
    int index = 1;
    sumSeq[1] = x;
    int nxt = (1ll * x * x) % m;
    while (index < n && not pos[nxt]) {
        seq[++index] = nxt;
        sumSeq[index] = sumSeq[index - 1] + nxt;
        pos[nxt] = index;
        nxt = (1ll * nxt * nxt) % m;
    }
    if (index == n) {
        cout << sumSeq[n] << "\n";
        return 0;
    }
    int period = index - pos[nxt] + 1;
    int start = pos[nxt];
    if (start > n) {
        cout << sumSeq[n] << "\n";
    }
    else {
        ll ans = 0;
        ans += sumSeq[start - 1];
        n -= start - 1;
        ans += (sumSeq[start + period - 1] - sumSeq[start - 1]) * (n / period);
        ans += (sumSeq[start + n % period - 1] - sumSeq[start - 1]);
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 4568
n = int(input())
class Odds_of_oddness:
  def __init__(self,n):
    self.n = n
    self.l = range(1,n+1) 
    self.count = 0
  def solve(self):
    for i in self.l:
      if i % 2 == 1:
        self.count += 1
    return self.count/len(self.l)    
  
ooo = Odds_of_oddness(n)
ans = ooo.solve()  
print(ans)


Measured memory_bytes: 2940
//056A
#include <bits/stdc++.h>
using namespace std;
int main(void){
    char a, b =' ';
    cin >> a >> b;
    if (a=='H'){
        if (b=='H'){
            cout << 'H';
        }else{
            cout << 'D';
        }
    }else{
        if (b=='H'){
            cout << 'D';
        }else{
            cout << 'H';
        }
    }
}

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

using i8  = int8_t;   /* -128 ~ 127 */
using u8  = uint8_t;  /* 0 ~ 255 */
using i16 = int16_t;  /* -32,768 ~ 32,767 */
using u16 = uint16_t; /* 0 ~ 65,535 */
using i32 = int32_t;  /* -2,147,483,648 ~ 2,147,483,647 */
using u32 = uint32_t; /* 0 ~ 4,294,967,295 */
using i64 = int64_t;  /* -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 */
using u64 = uint64_t; /* 0 ~ 18,446,744,073,709,551,615 */
using f32 = float;    /* (-3.4 * 10^38) ~ (3.4 * 10^38) */
using f64 = double;   /* (-1.7 * 10^308) ~ (1.7 * 10^308) */
using f80 = __float80;
template <class T> using Vec = vector<T>;
constexpr i64 INF = 1010000000000000017;
constexpr i64 MOD = 1e9 + 7;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define ALL(v) v.begin(), v.end()
#define GCD(a, b) __gcd(a, b) /* 最大公約数 */
#define LCM(a, b) a / __gcd(a, b) * b /* 最小公倍数 */

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

void Main() {
    u64 H;
    u32 N;
    cin >> H >> N;
    u64 sum = 0;
    for (u32 i = 0; i < N; i++) {
        u32 A;
        cin >> A;
        sum += A;
    }
    if (sum >= H) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,k,a[200005],p[200005],m,d;
bool vis[200005];
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;++i)
	 cin>>a[i];
	int i=a[1];p[0]=1;
	vis[1]=1;
	while(!vis[i])
	{
		vis[i]=1;
		++d;
		p[d]=i;
		i=a[i];
	}
	++d;
	for(int j=0;j<=d;++j)
	 if(p[j]==i){m=j;break;}
	if(k<=m)
	{
		cout<<p[k];
		return 0;
	}
	d-=m;k=(k-m)%d;
	cout<<p[k+m];
	return 0;
}

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

#define int long long
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define fr(i,j,k) for(i = j; i < (k); i++)
#define all(x) x.begin(), x.end()
#define el '\n'
#define remax(a,b) a = max(a, b)
#define remin(a,b) a = min(a, b)
#define sz(x) int32_t(x.size())

typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
// --------------------------------------------------------------------

const pii dxy[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} };
const int mod = 1e9 + 7;
const int INF = 2e18;
const ld EPS = 1e-9;
const int NN = 3e5 + 2;

const int maxn = NN;
int fact[maxn], inv[maxn], invFact[maxn];

int ncr(int n, int r){
	if(n < 0 || r < 0 || n < r) return 0;

	int v = (invFact[r] * invFact[n-r]) %mod;
	return (v*fact[n])%mod;
}

void pre(){
	int i;
	fact[0] = fact[1] = 1;
	for(i = 2; i < maxn; i++) {
		fact[i] = (fact[i-1]*i)%mod;
	}

	inv[0] = 0;
	inv[1] = 1;
	for (i = 2; i < maxn; i++) {
		inv[i] = mod - ((int) (mod / i) * inv[mod % i] % mod);
	}

	invFact[0] = 1;
	for (i = 1; i < maxn; i++) {
		invFact[i] = (inv[i] * invFact[i - 1] % mod);
	}
}

vvi g(NN);
vi sub(NN), dp(NN), ans(NN);
void dfs(int u, int p) {
	sub[u] = 1;
	int v = 1;
	for(int child : g[u]) {
		if(child == p) continue;
		dfs(child, u);
		v = (v * dp[child]) % mod;
		v = (v * invFact[sub[child]]) % mod;
		sub[u] += sub[child];
	}
	dp[u] = (v * (fact[sub[u] - 1])) % mod;
	if(u > 1) ans[u] = v;
	else ans[u] = dp[u];
}

int pow(int a, int b, int m) {
	a %= m;
	int res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}

void dfs_(int u, int p) {
	// remove from ans[p]
	if(u > 1) {
		int t = ans[p] * invFact[sub[1] - 1] % mod;
		// int uContri = dp[u] * invFact[sub[u]] % mod;
		t = t * pow(dp[u], mod - 2, mod) % mod;
            t = t * fact[sub[u]] % mod;
		t = t * fact[ sub[1] - sub[u] - 1 ] % mod;
            t = t * invFact[ sub[1] - sub[u] ]% mod;
		ans[u] = ans[u] * t % mod;
		ans[u] = ans[u] * fact[sub[1] - 1] % mod;
	}
	for(int child : g[u]) {
		if(child == p) continue;
		dfs_(child, u);
	}
}

void solve() {
	int i = 0, j = 0, k = 0, n = 0;
	cin >> n;
	fr(i, 1, n) {
		int u, v; cin >> u>>v;
		g[u].pb(v);
		g[v].pb(u);
	}

	dfs(1, 0);
      dfs_(1, 0);

      fr(i, 1, n + 1) cout << ans[i] << el;
}

int32_t main() {
	ios::sync_with_stdio(false); cin.tie(0);
	int T = 1;
	// cin >> T;
	pre();
	for(int tc = 1; tc <= T; tc++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 31088
fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
    if(n%10 == 3) {
      println("bon")
    }else if(n%10==0 || n%10==1 || n%10==6 || n%10==8){
      println("pon")
    }else {
      println("hon")
    }
}

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

const int MAX = 510000;
const int MOD = 1e9 + 7;

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

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;
  }
}

ll COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll powMod(ll x, ll k) {
  if (k == 0) return 1;
  if (k % 2 == 0)
    return powMod(x * x % MOD, k / 2);
  else
    return x * powMod(x, k - 1) % MOD;
}

int main() {
  COMinit();
  int n;
  cin >> n;
  vector<int> a(n + 1), b(n);
  rep(i, n + 1) cin >> a[i];
  int left, right;
  rep(i, n + 1) {
    if (b[a[i] - 1] == 0) {
      b[a[i] - 1] = 1;
    } else {
      right = i;
      rep(j, i) {
        if (a[i] == a[j]) left = j;
      }
    }
  }

  vector<ll> ans(n + 1);
  for (int i = 1; i <= n + 1; i++) {
    ans[i - 1] = COM(n + 1, i);
    ans[i - 1] %= MOD;
  }

  for (int i = 0; i <= n - right + left; i++) {
    ans[i] += MOD - COM(n - right + left, i);
    ans[i] %= MOD;
  }

  rep(i, n + 1) cout << ans[i] << endl;
}

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

void solve(){
    long long n;
    cin>>n;
    long long ans=0;
    for(long long i=1;i<=n;i++){
        long long l=i;
        long long h=(n/i);
        h*=i;
        long long c=h/i - l/i;
        c+=1;
        ans+=(c*(l+h))/2;
    }
    cout<<ans<<endl;
}

int main()
{
    long long t;
    solve();
}

Measured memory_bytes: 3624
/*2019/07/29 */
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define MOD 1000000007
typedef long long int ll;
void llswap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
void swap(int *x,int *y){int tmp;tmp=*x;*x=*y;*y=tmp;}
int rmax(int x,int y){return x>y?x:y;}
int rmin(int x,int y){return x>y?y:x;}
ll llrmax(ll x,ll y){return x>y?x:y;}
ll llrmin(ll x,ll y){return x>y?y:x;}
int asc(const void *a,const void *b){return *(int*)a-*(int*)b;}
int desc(const void *a,const void *b){return *(int*)b-*(int*)a;}
/*
int asc_t(const void *a,const void *b){return ((user_t*)a)->score - ((user_t*)b)->score;}
int desc_t(const void *a,const void *b){return ((user_t*)b)->score - ((user_t*)a)->score;}
*/

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

    int x[3];
    x[0]=a+b;
    x[1]=a-b;
    x[2]=a*b;

    int max=-9999;
    for(int i=0;i<3;i++){
        if(max<x[i]){
            max=x[i];
        }
    }
    printf("%d\n",max);
    return 0;
    
}

Measured memory_bytes: 128
#include <iostream>
#include <math.h>
using namespace std;

int e,minimum;

int solve(){
    minimum = e;
    for(int z=0;z*z*z<=e;z++){
        for(int y=0;y*y <= e-z*z*z;y++){
            int x = e - z*z*z - y*y;
            if(x>=0)
                minimum = min(x+y+z,minimum);
        }
    }
    return minimum;
}

int main(){
    while(cin >> e && e!=0){
        cout << solve() << endl;
    }
}

Measured memory_bytes: 1160
import java.util.*;
import java.math.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long valueLCM = 0;
    if(N==1){
      System.out.println(sc.nextLong());
      return;
    }
    ArrayList<Long> list = new ArrayList<>();
    for(int i=0;i<N;i++){
      list.add(sc.nextLong());
    }
    for(int i=0; i<list.size()-1; i++) {
       if(i==0){
         valueLCM = calcLCM(list.get(i),list.get(i+1));
       }else{
         valueLCM = calcLCM(valueLCM,list.get(i+1));
       }
    }    
    System.out.println(valueLCM);
  }
  
  
   private static long calcLCM(long val1, long val2) {
        long maxValue = Math.max(val1, val2);
        long minValue = Math.min(val1, val2);
        long val3;
        if(minValue==0) return maxValue;
        long temp;
        while( (temp=maxValue%minValue)!=0 ) {
            maxValue=minValue;
            minValue=temp;
        }
        //最大公約数でval1,val2を割って、小さいほうにじゃないほうvalをかければオーバーフローしない
        long val1d=val1/minValue;
        long val2d=val2/minValue;
     if(val1d>=val2d){
       return val2d*val1;
     }else{
       return val1d*val2;
     }
  }
  
}


Measured memory_bytes: 21844
#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, PP> PPP;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef complex<double> Point;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

bool operator < (const Point & a, const Point & b){
	return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}

bool use[10001][2000];
map<P, int> u;

int main(){
	int N, M, r, q;
	while(cin >> N >> M && (N || M)){
		cin >> r;
		memset(use, false, sizeof(use));
		for(int i = 0; i < r; i++){
			int t, n, m, s;
			cin >> t >> n >> m >> s;
			if(s == 1){
				u[P(n, m)] = t;
			}else{
				int e = u[P(n, m)];
				for(int i = e; i < t; i++) use[m][i] = true;
				u[P(n, m)] = 0;
			}
		}
		cin >> q;
		int ts, te, m;
		for(int i = 0; i < q; i++){
			cin >> ts >> te >> m;
			int res = 0;
			for(int j = ts; j < te; j++) if(use[m][j]) res++;
			cout << res << endl;
		}
	}
	return 0;
}

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

using namespace std;
#define int int64_t
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define gsort(x) sort((x).begin(), (x).end(), greater<int>())
#define rv(s) reverse((s).begin(), (s).end())
#define pii pair<int, int>
#define re(s) reverse((s).begin(), (s).end())
#define setout(n, x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10);
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).flont_back(a)
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1e9 + 7;

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

   int a, b, c, cntg = 0, ans = 0;
   string s, v;
   vector<int> x, y;

   cin >> s >> v;
   cin >> a >> b;
   string r;
   cin >> r;

   if (r == s)
   {
      cout << a - 1 << ' ' << b << '\n';
   }
   else
   {
      cout << a << ' ' << b - 1 << '\n';
   }
}

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

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e18)
#define PI (acos(-1))

#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define concat(xs, ys) (xs).insert((xs).end(), (ys).begin(), (ys).end())

const int mod = 1000000007;


long depths[100005];

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

  long n;
  cin >> n;

  long cnt = 0;
  vector<P> a(n);
  rep(i, n) {
    long x;
    cin >> x;

    a[i] = {x, i};
  }

  sortv(a);

  rep(i, n) {
    if(i%2 && a[i].second%2==0) cnt++;
  }

  cout << cnt << endl;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main() {
    int a;
    int b;
    cin >> a ;
    cin >> b ;
    if ( a > b ){
    cout<< "a > b"<<endl;}
    if (a == b ){
    cout<< "a == b"<<endl;
    }
    if (a < b){
    cout << "a < b"<<endl;
    }
    
    
    
}


Measured memory_bytes: 3048
#include <stdio.h>

int main() {
  int a, b, c, i;
  int ans = 0;
  int z[10001];
  for (i = 0; i <= 10000; i++) z[i] = 0;
  scanf("%d%d%d", &a, &b, &c);
  for (i = 1; i <= c; i++) {
    if (c % i == 0) {
      z[i] = i;
    }
  }
  for (i = a; i <= b; i++) {
    if (z[i] != 0) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 636
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#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<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

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int N, K; cin >> N >> K;
    if(K > (N - 1) * (N - 2) / 2) {
        cout << -1 << endl; return 0;
    } else {
        int M = N - 1 + ((N - 1) * (N - 2) / 2) - K;
        cout << M << endl;
        Rep(i, 2, N + 1) {
            cout << 1 << " " << i << endl;
        } 
        int cnt = N - 1;
        Rep(i, 2, N) {
            Rep(j, i + 1, N + 1) {
                if(cnt >= M) return 0;
                cout << i << " " << j << endl;
                cnt ++;
            }
        }
    }
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int div_up(int a, int b){
    int res = a/b;
    if (a%b != 0){
        res += 1;
    }
    return res;
}

int main(){
    int n, d;
    scanf("%d %d", &n, &d);
    int res = div_up(n, 2*d + 1);
    printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 128
h, w = map(int, input().split())
res = 0
if w == 1 or h == 1:
  res = 1
elif h % 2 == 1:
  if w % 2 == 0:
    res = w//2 * (h//2) + w//2 * (h // 2 + 1)
  else:
    res = w//2 * (h//2) + (w//2 +1) * (h // 2 + 1) 
else:
    if w % 2 == 0:
      res = w * (h // 2)
    else:
      res = (w//2) * (h//2) + (w//2 + 1) * (h//2)

print(res)

Measured memory_bytes: 3064
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) {
  return (conj(a) * b).imag();
}

double x[4], y[4];
int main() {
  while (1) {
    for (int i = 0; i < 4; i++) cin >> x[i] >> y[i];
    if (!cin) break;
    xy_t a(x[0], y[0]), b(x[1], y[1]), c(x[2], y[2]), p(x[3], y[3]);
    double pab = cross_product(a-p, b-p);
    double pbc = cross_product(b-p, c-p);
    double pca = cross_product(c-p, a-p);
    bool ok = (pab * pbc > 0 && pab * pca > 0);
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main(){
        double a,b,x;
        cin >> a >> b >> x;
        if(x<=a*a*b/2) cout << fixed << setprecision(10) << 90-180/M_PI*atan(2*x/(a*pow(b,2))) << endl;
        else cout << fixed << setprecision(10) << 180/M_PI*atan((2*pow(a,2)*b-2*x)/pow(a,3)) << endl;
        return 0;
}

Measured memory_bytes: 4256
// 8/29 リアルタイム参加
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;

int main() {
    int D, T, S;
    cin >> D >> T >> S;

    if (S * T >= D) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }    
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		int sum = 0;
		for(int i = 0; i < N.length(); i++) {
			sum += N.charAt(i)-'0';
		}
		if(sum % 9 == 0) {
			System.out.print("Yes");
		}else if(sum == 0){
			System.out.print("Yes");
		}else {
			System.out.print("No");
		}
	}
}


Measured memory_bytes: 39972
import heapq

def main():

    n,v,e,a,b = 0,0,0,0,0
    g = []
    t = []
    inf = (1<<32)-1

    def solve():
        d = [[inf]*(1<<n) for _ in range(v)]
        pq = [[0.0,a,0]]
        d[a][0] = 0.0
        heapq.heapify(pq)
        while pq:
            cost,ver,bits = heapq.heappop(pq)
            if d[ver][bits] < cost:continue
            if ver == b:return cost

            for i in range(len(g[ver])):
                n_ver = g[ver][i][0]
                for j in range(n):
                    if bits&(1<<j):continue
                    n_bits = bits|(1<<j)
                    n_cost = cost+g[ver][i][1]/t[j]
                    if n_cost < d[n_ver][n_bits]:
                        d[n_ver][n_bits] = n_cost
                        heapq.heappush(pq,[n_cost,n_ver,n_bits])
        return 'Impossible'

    while True:
        n,v,e,a,b = map(int,input().split())
        if n == 0:break
        a -= 1
        b -= 1
        t = list(map(int,input().split()))
        g = [[] for _ in range(v)]
        for _ in range(e):
            x,y,d = map(int,input().split())
            g[x-1].append([y-1,d])
            g[y-1].append([x-1,d])
        print(solve())


if __name__ == '__main__':
    main()




Measured memory_bytes: 12296
/****************************************************************************************************
                                        SUBMITTED BY-

                                                AISH_07

****************************************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ll long long
#define sl set<ll>
#define vs vector<string>
#define pb push_back
#define vl vector<ll>
#define vi vector<int>
#define PI  3.14159265
#define mod 998244353

int main()
{

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

sort(a,a+n);

ll sum=a[n-1]/2;

for(int i=0;i<n-1;i++)
    sum+=a[i];

cout<<sum<<"\n";
return 0;
}


Measured memory_bytes: 3588
void main() {
	(rs.startsWith("YAKI") ? "Yes" : "No").writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

const int M = 1000005;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vector<int> cnt(M);
    for (int x : a) {
        if (cnt[x] != 0) {
            cnt[x] = 2;
            continue;
        }
        for (int i = x; i < M; i += x) {
            cnt[i]++;
        }
    }
    int ans = 0;
    for (int x : a) {
        if (cnt[x] == 1) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

map<int,int> num;

int main(void){
	int n,k;
	cin >> n >> k;

	rep(i,n){
		int a;
		cin >> a;
		num[a]++;
	}

	vector<int> ary;
	for(auto &it:num) ary.push_back(it.second);
	sort(rbegin(ary),rend(ary));

	int ans = n;
	chmin(k,int(ary.size()));
	rep(i,k) ans-=ary[i];
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 10748
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(11);
	}
};
initializer _____;

int N, M, K, T, Q;
signed main() {
	string S;
	cin >> S;
	int ans = 0;
	rep(i, S.size() / 2) {
		if (S[i] != S[S.size() - i - 1]) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset
typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
//void IO(){
//	#ifndef ONLINE_JUDGE
//	    freopen("input.txt", "r", stdin);
//	    freopen("output.txt", "w", stdout);
//	#endif
//}
// end of Template

ll n,k,b,r;
ll md = 1000000007;
ll f[10000];
ll pm (ll x, ll y){
    if(y==0)return 1;
    else if(y==1){return x;}
    else{
        ll t = pm (x,y/2);
        ll res = ((t%md)*(t%md))%md;
        if(y%2==1){res = ((res%md) * (x%md))%md ;}
        return res;
    }
}
ll invers(ll x){
    return pm(x,md-2);
}
ll conf(ll slot, ll sum){
    if(sum==0)return 1;
    else if(sum<0)return 0;
    else if(slot==1)return 1;
    else{
        ll bar = slot-1;
        ll up = f[sum+bar];
        ll d1 = f[bar];
        ll d2 = f[sum];
        ll d = ((d1%md)*(d2%md))%md;
        ll din = invers(d);
        ll star = ((up%md) * (din%md))%md;
        return star;
    }
}
ll solve(ll x){
    ll slot,sum,red,blue;
    slot = x + 1;
    sum = r - (x-1);
    red = conf(slot,sum);

    slot = x;
    sum = b - x;
    blue = conf(slot,sum);
    ll res = ((red%md)*(blue%md))%md;
    return res;
}
int main(){
	//IO();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>k;
    b = k;
    r = n - k;
    f[0] = 1;
    for(int i=1;i<=8000;i++){
        f[i] = ((f[i-1]%md)*(i%md))%md;
    }
    for(int i=1;i<=k;i++){
        cout<<solve(i)<<newl;
    }
}


Measured memory_bytes: 384
n,m,x = map(int,input().split())
C = []
A = []
for _ in range(n):
  c, *a = map(int,input().split())
  C.append(c)
  A.append(a)

queue = [(0,[0 for _ in range(m)],0)]
ans = float('inf')
while queue:
  cost, learn, index = queue.pop(-1)
  if all([l>= x for l in learn]):
    ans = min(ans, cost)
    continue
  if index == n:
    continue
  else:
    queue.append((cost, learn, index+1))
    queue.append((cost+C[index], [learn[i]+A[index][i] for i in range(m)], index+1))
    
print(ans if ans != float('inf') else -1)

Measured memory_bytes: 9240
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
using namespace std;
int n, l;
vector<int> ll;
int main(void) {
	cin >> n >> l;
	int tmp=1000;
	int ret = 0;
	for (int i = 0; i < n; i++){
		ll.push_back(l + i);
		ret += l + i;
		if (abs(tmp) > abs(l + i))
			tmp = l + i;
	}

	cout << ret - tmp << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int N, K;

int main() {
    scanf("%d%d", &N, &K);
    vector<int> a(N);
    int r = 0;
    int f = 1;
    for (int i=0; i < N; ++i) {
        cin>>a[i];
    }
    sort(a.begin(), a.end());
    for (int i=0; i < N; ++i) {
        cin>>a[i];
        K -= a[i];
        if (K < 0) {
            f = 0;
            break;
        }
        r += 1;
    }
    if (f == 1 and K != 0) {
        printf("%d", r-1);
    } else {
        printf("%d", r);
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int x, a, b;
	cin >> x >> a >> b;
	if(b <= a) {
		cout << "delicious" << endl;
	} else if(b <= a + x) {
		cout << "safe" << endl;
	} else {
		cout << "dangerous" << endl;
	}

	return 0;
}

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

using namespace std;

#define int long long int
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define se second
#define fi first

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> matrix;

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

inline int add(int x, int y) { x += y; if (x >= mod) x -= mod; return x;}
inline int sub(int x, int y) { x -= y; if (x < 0) x += mod; return x;}
inline int mul(int x, int y) { return ((x % mod) * (y % mod)) % mod;}
inline int power(int a, int b) {
	int x = 1;
	while (b) {
		if (b & 1) x = mul(x, a);
		a = mul(a, a);
		b >>= 1;
	}
	return x;
}
inline int inv(int a) { return power(a, mod - 2);}

const int N = 1e5+5;
int dp[N],a[N];

#undef int
int main() {
#define int long long int
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	clock_t start = clock();
	
	int n; cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	dp[1]=0;
	for(int i=2;i<=n;i++) {
		if(i==2) dp[i] = dp[i-1]+abs(a[i]-a[i-1]);
		else {
			dp[i] = dp[i-1]+abs(a[i]-a[i-1]);
			dp[i] = min(dp[i],dp[i-2]+abs(a[i]-a[i-2]));
		 }
	}
	cout<<dp[n]<<endl;
	
	clock_t end = clock();
	cerr << "Time: " << (double)(end - start) / CLOCKS_PER_SEC << " seconds" << endl;

	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<size_t I,class H,class...T>struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template<class H,class...T>struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class...T>istream&operator>>(istream&i,tuple<T...>&t){t=TupleReaderWriter<sizeof...(T),T...>::r(i);return i;}
template<class...T>ostream&operator<<(ostream&o,tuple<T...>&t){string delim=" ";TupleReaderWriter<sizeof...(T)-1,T...>::w(o,t,delim);return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int x;fixprec(int d):x(d){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.x);}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    string S;
    cin >> S;
    int N = S.size();
    int ans = 0;
    for(int i = 0; 2 * i < N; i++) {
        if(S[i] != S[N - 1 - i]) ans++;
    }
    cout << ans << endl;
    return 0;
}



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

// typedef
// -----------------------------------------------------------------------------
typedef long long ll;
typedef long double ld;

// container util
// -----------------------------------------------------------------------------
#define ALL(c)  (c).begin(),(c).end()
#define SZ(c) ((ll)(c).size())
#define MAX(c) *max_element(ALL(c))
#define MIN(c) *min_element(ALL(c))
#define SORT(c) sort((c).begin(),(c).end())

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

// constant
// -----------------------------------------------------------------------------
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

// debug
// -----------------------------------------------------------------------------
#define DUMP(x)  cerr << #x << " = " << (x) << endl


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    int N; cin >> N;
    vector<int> A(1000010, 0);
    REP(i, N) {
        int ai; cin >> ai;
        A[ai]++;
    }
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
        if(A[i] < 1) continue;
        if(A[i] == 1) ans++;
        for(int j = i; j <= 1000000; j += i) {
            A[j] = 0;
        }
    }
    cout << ans << "\n";
}

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

int main() {
  int A , B, C, D;
  cin >> A >> B >> C >> D;
  int S, W;
  S = A;
  W = C;
  while(S>0 && W>0){
    W = W-B;
    if(W<=0){
        cout << "Yes" << endl;
        break;
    }
    S = S-D;
    if(S<=0){
        cout << "No" << endl;
        break;
    }
  }
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

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 vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int m){if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}



signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    int n,m;
    cin>>n>>m;
    VVi a(100010);
    REP(i,0,n){
        int t1,t2;
        cin>>t1>>t2;
        a[t1].pb(t2);
    }
    priority_queue<int> pq;

    int ans=0;
    REP(i,0,m+1){
        for(auto x : a[i]){
            pq.push(x);
        }
        if(!pq.empty()){
            ans+=pq.top();
            pq.pop();
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 5632
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  string s; cin >>s;
  int n=s.size();
  if(s[n-1]=='1' or s[0]=='0'){
    print(-1);
    return 0;
  }
  s.pop_back();
  string t=s;
  reverse(s.begin(),s.end());
  if(s!=t){
    print(-1);
    return 0;
  }
  int h=0;
  rep(i,n-1){
    int f=s[i]-'0';
    print(h+1,i+2);
    if(f) h=i+1;
  }
}


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

int main(){
    vector<char> s(3);
    for(int i=0;i<3;i++){
        cin >> s.at(i);
    }
    sort(s.begin(),s.end());
    if(s.at(0)=='a') {
        if(s.at(1)=='b'){
            if(s.at(2)=='c'){
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
        else {
            cout << "No" << endl;
        }
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

template <typename T>
void print_vec(const vector<T>& v, int num=0){
  if(num == 0) num = (int)v.size();
  for(int i=0; i<num; i++){ cout << v[i]; if(i!=num-1) cout << " ";}
  cout << endl;
}

template <typename T>
void print_pairvec(const vector<T> &v, int num=0){
  if(num == 0) num = (int)v.size();
  for(int i=0; i<num; i++){ cout << v[i].first << v[i].second; if(i!=num-1) cout << " ";}
  cout << endl;
}

template <typename T>
void print_vec2(const vector<vector<T>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}

template <typename T>
void SWAP(T &a, T &b){
  a = a^b;// a^b 
  b = a^b;// (a^b)^b
  a = a^b;// (a^b)^(a^b^b)
}

template <typename T>
void insertionSort(vector<T> &a, T N){
  //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A&lang=ja
  print_vec(a);
  for(int i=0; i<N-1; i++){
    int j = i;
    while(j>=0 && a[j] > a[j+1]){
      SWAP(a[j], a[j+1]);
      j--;
    }
    print_vec(a);
  }
}
template <typename T>
void bubbleSort(vector<T> &a, int n){
  //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_A&lang=ja
  ll num = 0;
  for(int i=0; i<n; i++){
    for(int j=n-1; j>i; j--){
      if(a[j-1] > a[j]){
        SWAP(a[j-1], a[j]);
        num++;
      }
    }
  }
  print_vec(a);
  cout << num << endl;
  return;
}

template <typename T>
void selectionSort(vector<T> &a, int n){
  ll num = 0;
  for(int i=0; i<n; i++){
    int min_id = i;
    for(int j=i+1; j<n; j++){
      if(a[min_id] > a[j]) min_id = j;
    }
    if(min_id != i){
      num++;
      SWAP(a[i], a[min_id]);
    }
  }
  print_vec(a);
  cout << num << endl;
  return;
}

using cP = pair<char, int>;
void BubbleSort(vector<cP> &a, int n){
  for(int i=0; i<n; i++){
    for(int j=n-1; j>i; j--){
      if(a[j-1].second > a[j].second) swap(a[j-1], a[j]);
    }
  }
}

void SelectionSort(vector<cP> &a, int n){
  for(int i=0; i<n; i++){
    int min_id = i;
    for(int j=i+1; j<n; j++){
      if(a[i] > a[j]) min_id = j;
    }
    if(min_id != i) swap(a[i], a[min_id]);
  }
}
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++) cin >> a[i];
  insertionSort(a, n);
  // bubbleSort(a, n);
  // selectionSort(a, n);

  // vector<cP> a(n), b, c;
  // for(int i=0; i<n; i++) cin >> a[i].first >> a[i].second;
  // b = a;
  // c = a;
  // BubbleSort(b, n);
  // SelectionSort(c, n);

  // print_vec(b);
  // cout << "Stable" << endl;//BubbleSortは常に安定
  // print_vec(c);
  // if(b==c) cout << "Stable" << endl;
  // else cout << "Not stable" << endl;
  return 0;
}




Measured memory_bytes: 3108
#include <stdio.h>

int main(){
    int x, a, b;
    scanf("%d %d %d", &x, &a, &b);
    
    int s, t;
    if(a >x){
        s = a - x;
    }
    else{
        s = x - a;
    }
    
    if(b > x){
        t = b - x;
    }
    else{
        t = x - b;
    }
    
    if(s > t){
        printf("B\n");
    }
    else{
        printf("A\n");
    }
    
    return 0;
}


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

#define zton(i,n) for(int i=0;i<=n;i++)
#define oneton(i,n) for(int i=1;i<=n;i++)
#define fo(i,n) for(int i=0;i<n;i++)
#define fab(i,a,b) for(int i=a;i<b;i++)
#define loop(i,b,a) for(int i=a;i>=b;i--)
#define dsort(arr,n) sort(arr, arr + n, greater<int>())
#define vsortd(a) sort(a.begin(), a.end(), greater<double>())
#define vsort(a) sort(a.begin(), a.end())
#define ll long long int
#define test int tc;cin>>tc;while(tc--)
#define dbg(x) cout<<#x<<'='<<(x)<<endl;
#define dbg2(x,y) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl;
#define dbg3(x,y,z) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl;
#define dbg4(x,y,z,w) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl<<#w<<"="<<(w);
#define minheap priority_queue <int, vector<int>, greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define ff first
#define ss second
#define mpr make_pair
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define mkv vector<int>
#define allzero(dp) memset(dp,0,sizeof(dp))
#define endl "\n"
#define print(x) cout<<x<<endl;

const int mod=1e9+7;
using namespace std;
bool sortcol( const vector<int>& v1,const vector<int>& v2 ) {return v1[1] < v2[1];}

void fastio()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}

bool sortbysecdesc(const pair<ll,ll> &a,const pair<ll,ll> &b){
    if(a.first>b.first)return true;
    if(a.first==b.first)return a.second<b.second;
    return false;
}

ll power(ll x, ll y){
    ll res = 1;x=x%mod;
    while(y>0){
        if(y&1)res=(res*x)%mod;
        y=y>>1;x=(x*x)%mod;}
    return res;
}


void solve()
{
    int x;cin>>x;
    if(x>=30)print("Yes")
    else print("No")
}

int main()
{
  //  fastio();
 //   test
    solve();
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
constexpr int mod = 1e9 +7;
//constexpr int mod2 = 998244353;
constexpr int MAXNe5 = 1e5 +7;
constexpr int MAXNe6 = 1e6 + 7;
#pragma region 
inline long long read()
{
	char c = getchar();long long flag = 1, ans = 0;
	while(c < '0' || c > '9'){if(c == '-')flag = -1; c = getchar();}
	while(c >= '0' && c <= '9'){ans = ans * 10 + c - '0'; c = getchar();}
	return (ans * flag);
}
#pragma endregion
// C'est la vie
int main() {
	string s;
    cin >> s;
    if(s[0] == 'A' && s[1] == 'A' && s[2] == 'A' ||s[0] == 'B' && s[1] == 'B' && s[2] == 'B'  ) cout << "No";
    else cout << "Yes";
    #ifndef ONLINE_JUDGE
    system("pause");
    #endif
}

Measured memory_bytes: 504
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;

namespace AtCoder_Beginner_Contest_132
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        const long Mod = 1000000000 + 7;
        static void Main(string[] args)
        {
            var NK = Sarray();
            var N = NK[0];
            var K = NK[1];
            var tree = new List<long>[N];
            for (var i = 0; i < N; ++i)
            { tree[i] = new List<long>(); }
            for (var i = 0; i < N - 1; ++i)
            {
                var ab = Sarray();
                tree[ab[0] - 1].Add(ab[1] - 1);
                tree[ab[1] - 1].Add(ab[0] - 1);
            }
            WriteLine(bfs(tree, K));
        }
        public static long bfs(List<long>[] tree, long K)
        {
            var N = tree.Length;
            var vd = new long[N];
            for(var i=0;i<N;++i)
            { vd[i] = -1; }
            var q = new Queue<long>();
            q.Enqueue(0);
            vd[0] = 0;
            long cnt = K;
            while (q.Count!=0)
            {
                var n = q.Dequeue();
                var cmb = Math.Max(K - (vd[n] + 1), K - 2);
                foreach(var t in tree[n])
                {
                    if (-1 != vd[t]) continue;
                    q.Enqueue(t);
                    cnt = (cnt * cmb) % Mod;
                    --cmb;
                    vd[t] = vd[n] + 1;
                }
            }
            return cnt;
        }
    }
}

Measured memory_bytes: 33528