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

using namespace std;
using ll = long long;
using IP = pair<int, int>;

const ll INF = 1LL << 62;
const int dx[4] = { 1,0,-1,0 };
const int sy[4] = { 0,1,0,-1 };

#define atcoder (int)1e9+7
#define Endl endl
#define mp make_pair
#define all(v) v.begin(),v.end()
#define pb push_back
#define pr(x) cout << x << endl
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define rep(i,n) for(int i= 0;i<n;i++)

ll gcd(ll a, ll b) {//最大公約数
	if (a%b == 0)return b;
	else gcd(b, a%b);
}

ll lcm(ll a, ll b) {//最小公倍数
	return (a / gcd(a, b))*b;
}

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

	if (-a + b <= 0)pr("delicious");
	else if (-a + b <= x )pr("safe");
	else pr("dangerous");

	
	return 0;
}

Measured memory_bytes: 256
n=int(input())
card=[[False for i in range(13)] for j in range(4)]

for i in range(n):
    mark,suit=input().split()
    if mark=='S':
        mark_num=0
    elif mark=='H':
        mark_num=1
    elif mark=='C':
        mark_num=2
    elif mark=='D':
        mark_num=3
    card[mark_num][int(suit)-1]=True

for j in range(4):
    for i in range(13):
        if card[j][i]==False:
            if j==0:
                print('S',i+1)
            elif j==1:
                print('H',i+1)
            elif j==2:
                print('C',i+1)
            elif j==3:
                print('D',i+1)


Measured memory_bytes: 5612
N=int(input())

alist=[0]
for i in range(N):
  alist.append(int(input()))
#print(alist)

answer=0
pos=1
set_pos=set()
while True:
  if pos==2:
    print(answer)
    break
  else:
    pos=alist[pos]
    answer+=1

  if pos in set_pos:
    print(-1)
    break
  else:
    set_pos.add(pos)
    

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

// atcoder
const int mod = 1000000007;
struct mint {
  ll x;  // typeINF long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

struct combination {
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
  mint p(int n, int k) { return fact[n] * ifact[n - k]; }
} c(1000005);

int main() {
  ll n, m;
  cin >> n >> m;
  mint ans = 0;
  rep(i, n + 1) {
    mint now = c(n, i) * c.p(m - i, n - i);
    if (i & 1) now *= -1;
    ans += now;
  }
  ans *= c.p(m, n);

  cout << ans.x << endl;
  return 0;
}


Measured memory_bytes: 18608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int dp[6005][3005][2];
int n,m;
int main(){
	cin>>n>>m;
	rep(i,n+1) dp[0][i][!i] = 1;
	for(int i=0;i<2*m;i++){
		for(int j=0;j<=n;j++){
			if(i%2 == 0){
				if(j){
					rep(k,2) dp[i+1][j-1][k|j==1] = (dp[i+1][j-1][k|j==1]+dp[i][j][k])%mod;
				}
				if(j!=n){
					rep(k,2) dp[i+1][j][k] = (dp[i+1][j][k]+dp[i][j][k])%mod;
				}
			}
			else{
				{
					rep(k,2) dp[i+1][j][k] = (dp[i+1][j][k]+dp[i][j][k])%mod;
				}
				{
					rep(k,2) dp[i+1][j+1][k] = (dp[i+1][j+1][k]+dp[i][j][k])%mod;
				}
			}
		}
	}
	ll ans = 0;
	rep(i,n+1) ans = (ans+dp[2*m][i][1])%mod;
	cout<<ans<<endl;
}

Measured memory_bytes: 141184
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
int comp( const void *c1, const void *c2 );

int main(void)
{
	char s[8001];
	int  x, y, i, j, c, xx[8000]={0}, yy[8000]={0}, xm=0, ym=0;
    
	scanf("%s", s);
	scanf("%d %d", &x, &y);
	
	c = 0; j = 0;
	for(i = 0; i <= strlen(s); i++){
	    if(s[i] == 'F'){
	        c++;
	    }else{
	        if(j%2){
	            yy[j] = c;
	        }else{
	            xx[j] = c;
	        }
	        c = 0;
	        j++;
	    }
	}
	xm = xx[0];
	xx[0] = 0;
	qsort( xx, strlen(s), sizeof(int), comp);
	qsort( yy, strlen(s), sizeof(int), comp);

	for(i = 0; xx[i] != 0; i++){
	    if(xm <= x){
	        xm += xx[i];
	    }else{
	        xm -= xx[i];
	    }
	}
	for(i = 0; yy[i] != 0; i++){
	    if(ym <= y){
	        ym += yy[i];
	    }else{
	        ym -= yy[i];
	    }
	}

	printf("%s\n", xm==x&&ym==y?"Yes":"No");
	return 0;
}

int comp( const void *c1, const void *c2 )
{
  int tmp1 = *(int *)c1;
  int tmp2 = *(int *)c2;
 
  if( tmp1 > tmp2 )  return -1;
  if( tmp1 == tmp2 ) return  0;
  if( tmp1 < tmp2 )  return  1;
}

Measured memory_bytes: 256
/*
* Author. Silviase(@silviasetitech)
* For AtCoder
*/

import java.util.*;
import java.lang.*;
import java.math.*;


public class Main {
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);



        String s = sc.next();
        int count0 = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0'){
                count0++;
            }else{
                count1++;
            }
        }
        System.out.println(2*Math.min(count0, count1));

        
        sc.close();
    }


    public static long gcd(Long m, long n) {
        if(m < n) {
            return gcd(n, m);
        }
        if(n == 0){
            return m;
        } 
        return gcd(n, m % n);
    }

    public static long[][] Combination_nCk(long n, long k) {
        n++; k++;
        long[][] ans = new long[(int)n][(int)k];
        for (int i = 0; i < n; i++) {
            ans[i][0] = 1;
        }
        for (int i = 0; i < n-1; i++) {
            for (int j = 0; j < k-1; j++) {
                if (i < j) {
                    ans[i][j] = 0;
                }else{
                    ans[i+1][j+1] = ans[i][j] + ans[i][j+1];
                }
            }
        }
        return ans;
    }

    public static double[][] Probability_nCk(int n, int k) {
        n++; k++;
        double[][] ans = new double[n][k];
        for (int i = 0; i < n; i++) {
            if (i == 0) {
                ans[i][0] = 1;
            }else{
                ans[i][0] = ans[i-1][0]/2;
            }
        }
        for (int i = 0; i < n-1; i++) {
            for (int j = 0; j < k-1; j++) {
                if (i < j) {
                    ans[i][j] = 0;
                }else{
                    ans[i+1][j+1] = (ans[i][j] + ans[i][j+1])/2;
                }
            }
        }
        return ans;
    }
}

Measured memory_bytes: 25840
#include<stdio.h>

#define MAX 100005
#define NIL -1

using namespace std;

struct Node_struct{
  int p, s, l, r, d;
  Node_struct(){ s = -1; }
};
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX], H[MAX];

void print(int u){
  int i, c;
  printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ", u, T[u].p, T[u].s, T[u].d, D[u], H[u]);

  if(T[u].p == NIL) printf("root");
  else if(T[u].l == NIL && T[u].r == NIL) printf("leaf");
  else printf("internal node");
  printf("\n");
}

void calcHeight(int u, int p){
  if(T[u].l == NIL && T[u].r == NIL){
    H[u] = p;
    if(T[u].p != NIL)calcHeight(T[u].p, p+1);
    return;
  }else{
    if(H[u] < p) H[u] = p;
    if(T[u].p != NIL)calcHeight(T[u].p, p+1);
  }
}

void calcDepth(int u, int p){
  D[u] = p;
  if(T[u].l == NIL && T[u].r == NIL)calcHeight(u, 0);
  if(T[u].l != NIL) calcDepth(T[u].l, p+1);
  if(T[u].r != NIL) calcDepth(T[u].r, p+1);
}

int main(){
  int i, j;
  int n;
  int id, left, right, child;
  int root = NIL;
  scanf("%d", &n);
  for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL, T[i].d = 0;

  for(i=0; i<n; i++){
    scanf("%d %d %d", &id, &left, &right);
    if(left != NIL)T[left].p = id, T[left].s = right,T[id].l = left, T[id].d++;
    if(right != NIL)T[right].p = id, T[right].s = left,T[id].r = right, T[id].d++;
  }

  //根を求める (find the root)
  for(i=0; i<n; i++){
    if(T[i].p == -1) {
      root = i;
      break;
    }
  }

  //それぞれのノードの深さを求める (find depth of each node)
  calcDepth(root, 0);
  
  //出力 (output)
  for(i=0; i<n; i++) print(i);

  return 0;
}


Measured memory_bytes: 4692
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <tuple>
 
using namespace std;
 
template<typename E>
using Matrix = std::vector<std::vector<E> >;
 
typedef long long LL;
typedef long double LD;
typedef std::pair<LL ,LL> LP;
 
#define INF		1e9
#define EPS		1e-9
#define gcd 	__gcd
#define make_matrix(rows, col, type, default) 			\
					std::vector< std::vector<type> >( 	\
						rows, 						  	\
						std::vector<type>(col, default) \
					);
 
#define repeat(n)	for(LL __x = 0; __x < n; __x++)
#define watch(x)	cout << (#x) << " is " << (x) << "\n";
#define DEG_TO_RAD(x) (x * PI / 180.0)
#define RAD_TO_DEG(x) (x * 180.0 / PI)
#define FILL_1(collection) for(LL __i = 0; std::cin>>collection[__i]; __i++);
#define FILL_2(collection, n) for(LL __i = 0; std::cin>>collection[__i/n][__i%n]; __i++);

auto cost(LL i, LL j) -> LL {
    return abs(i-j);
}

auto main() -> int {
    LL n, max_w;

    std::cin >> n >> max_w;
    vector<LP> items;

    for(LL i = 0, a, b; i < n && std::cin>>a>>b; i++) items.push_back({a, b});
    Matrix<LL> memo = make_matrix(n+1, max_w+1, LL, 0);

    for(LL r = 1; r <= n; r++) { //  item
        for(LL c = 0; c <= max_w; c++) { // weight
            if(c < items[r-1].first) memo[r][c] = memo[r-1][c];
            else { 
                memo[r][c] = max(items[r-1].second + memo[r-1][c - items[r-1].first], 
                                  memo[r-1][c]);
            }
        }
    }
    std::cout << memo[n][max_w];
}

Measured memory_bytes: 80256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, l, r, x=0;
  cin >> N;
  
  for(int i=0; i<N; i++){
    cin >> l >> r;
    x += r-l+1;
  }
  
  cout << x << endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main{

  public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    int L=s.nextInt();
    int R=s.nextInt();
    int d=s.nextInt();
    int ans=0;
    for(int i=L;i<=R;i++){
      if(i%d==0) ans+=1;
    }
    System.out.println(ans);

  }  
}

Measured memory_bytes: 35644
#include <iostream>
using namespace std;
int main(void)
{
  int a,b,c; cin>>a>>b>>c;
  if((a==5&&b==5&&c==7)||(a==5&&b==7&&c==5)||
     (a==7&&b==5&&c==5))cout<<"YES"<<endl;
  else cout<<"NO"<<endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
lst = [[] for i in range(N)]
for i in range(N):
    mlst = list(map(int, input().split()))
    mlst.reverse()
    lst[i] = mlst

lst.sort()
lst = lst + [[0, 0]]

time = lst[0][1]
i = 0
while i < N and time <= lst[i][0]:
    time += lst[i+1][1]
    i += 1

if i == N:
    print('Yes')
else:
    print('No')



Measured memory_bytes: 52208
#include<iostream>
#include<algorithm>

using namespace std;

#define REP(s,e) for(int i=(s);i<(e);i++)

int main(){
    string A,B,C;
    int sa='A'-'a';

    cin>>A>>B>>C;

    cout<<(char)(sa+A[0])<<(char)(sa+B[0])<<(char)(sa+C[0])<<endl;
}


Measured memory_bytes: 504
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する

ll gcd(ll a,ll b){
    if(a < b) swap(a,b);
    if(a % b == 0) return b;
    return gcd(b, a % b);

}

ll lcm(ll a,ll b){
    return a / gcd(a,b) * b;
}

int main() {
    int N;
    cin >> N;
    int K;
    cin >> K;
    ll max_v = 0;
    ll gc = -1;
    rep(i,0,N){
        ll tmp;
        cin >> tmp;
        if(gc == -1){
            gc = tmp;
        }else{
            gc = gcd(tmp,gc);
        }
        max_v = max(max_v,tmp);
    }
    if(max_v < K){
        cout << "IMPOSSIBLE" << endl;
    }else if(max_v == K){
        cout << "POSSIBLE" << endl;
    }else{
        if((K - max_v) % gc){
            cout << "IMPOSSIBLE" << endl;
        }else{
            cout << "POSSIBLE" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 384
package main

import(
	"fmt"
	"os"
	"bufio"
	"strings"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var s string
	if sc.Scan() {
		s = sc.Text()
	}

	sei := strings.Split(s, " ")

	a, _:= strconv.Atoi(sei[0])
	b, _:= strconv.Atoi(sei[1])

	ans := (a + b) / 2

	if a - ans < 0{
		a = (a - ans) * - 1
	}else{
		a = a -ans
	}

	if b - ans < 0{
		b = (b - ans) * - 1
	}else{
		b = b -ans
	}

	if a != b{
		fmt.Println("IMPOSSIBLE")
	}else{
		fmt.Println(ans)
	}
}

Measured memory_bytes: 640
import java.util.*;

/*
問題文
高橋君は九九を覚えたので、1 以上 9 以下の 2 つの整数の積を計算することができます。

整数 N が与えられるので、N を 1 以上 9 以下の2 つの整数の積として表すことができるか
判定し、できるなら Yes を、できないなら No を出力して下さい。

制約
1≤N≤100
N は整数である。

*/

public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        
        long a = 0;
        long b = 0;

        for (int i = 1; i <= Math.sqrt(n); i++) {
          if (n%i == 0) {
            if (i > a) {
              a = i;
              b = n/i;
            }
          }
        }

        System.out.println(a + b - 2);
    }
}

Measured memory_bytes: 23764
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <list>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <cstring>
typedef long long ll;
using namespace std;

int weight[100005];
int n, k;

bool FillUp(int p)
{
	ll num = 0, cur = 0;
	for (int j = 0; j < k; ++j)
	{
		cur = 0;
		while (cur + weight[num] <= p)
		{
			cur += weight[num];
			++num;
			if (num == n)
				return true;
		}
	}
	return false;
}


ll solve()
{
	ll left = 0;
	ll right = 100000 * 10000;
	while (right - left > 1)
	{
		ll mid = (right + left) / 2;
		if (FillUp(mid))
			right = mid;
		else
			left = mid;
	}
	return right;
}

bool CanSum[400005]{ false };
vector<int> v;
int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	cin >> n;
	int t, m;
	for (int i = 0; i != n; ++i)
	{
		cin >> t;
		CanSum[t] = true;
		int len = v.size();
		for (int i = 0; i < len; ++i)
		{
			m = v[i] + t;
			if (!CanSum[m])
			{
				CanSum[m] = true;
				v.push_back(m);
			}
		}
		v.push_back(t);
	}
	
	cin >> n;
	for (int i = 0; i != n; ++i)
	{
		cin >> t;
		printf("%s\n", CanSum[t] ? "yes" : "no");
	}
	return 0;
}

Measured memory_bytes: 3172
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int32_t main()
{
	FIO;
	int n, m; cin >> n >> m;
	vector<vi> adj(n + 1);
	vi h(n + 1);

	for (int i = 1; i <= n; ++i)
		cin >> h[i];

	while (m--)
	{
		int i, j; cin >> i >> j;
		adj[i].pb(j);
		adj[j].pb(i);
	}

	int ans = 0;

	for (int i = 1; i <= n; ++i)
	{
		int is = 1;

		for (int id : adj[i])
			if (h[id] >= h[i])
			{
				is = 0;
				break;
			}

		ans += is;
	}

	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 9820
#include<iostream>
using namespace std;
int main(){
  int m,n;
  int sum=0;
  cin>>n>>m;
  int arr[m];
  for(int i=0;i<m;i++){
    cin>>arr[i];
  }
  for(int i=0;i<m;i++){
    sum+=arr[i];
  }
  if(sum>n)
    cout<<"-1";
  else if(sum<=n)
    cout<<(n-sum);
  
}

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

//////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////// ここからコピペ ////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////
// 凸包 //
//////////

// pointsはソートされる
// 左->下->右->上->左
std::vector<std::complex<long double>> convexHull(std::vector<std::complex<long double>>& points)
{
	constexpr long double epsilon{1e-7};
	std::sort(points.begin(), points.end(),
		[](const auto& a, const auto& b)
		{
			if (std::abs(a.real() - b.real()) >= epsilon) return a.real() < b.real();
			else return a.imag() < b.imag();
		}
	);

	std::vector<std::complex<long double>> ch;
	for (int i{}; i < (int)points.size(); i++)
	{
		while (ch.size() >= 2 && ((points[i] - ch.back()) / (ch[ch.size() - 2] - ch.back())).imag() >= epsilon)
			ch.pop_back();
		ch.push_back(points[i]);
	}
	int rightmost{(int)ch.size()};
	for (int i{(int)points.size() - 2}; i >= 0; i--)
	{
		while (ch.size() >= rightmost + 1 && ((points[i] - ch.back()) / (ch[ch.size() - 2] - ch.back())).imag() >= epsilon)
			ch.pop_back();
		ch.push_back(points[i]);
	}
	return std::move(ch);
}

int main()
{
	constexpr long double epsilon{1e-7};
	int n;
	scanf("%d", &n);
	std::vector<std::complex<long double>> points(n);
	for (auto& e: points)
	{
		long double x, y;
		scanf("%Lf%Lf", &x, &y);
		e.real(x);
		e.imag(y);
	}
	auto ch{convexHull(points)};
	if (std::abs(ch.front() - ch.back()) < epsilon) ch.pop_back();

	int begin{};
	for (int i{}; i < (int)ch.size(); i++)
		if (ch[i].imag() < ch[begin].imag() - epsilon)
			begin = i;

	printf("%d\n", ch.size());
	for (int i{}; i < (int)ch.size(); i++)
		printf("%d %d\n", (int)std::round(ch[(begin + i) % ch.size()].real()), (int)std::round(ch[(begin + i) % ch.size()].imag()));

	return 0;
}


Measured memory_bytes: 9552
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
const int INF = 1e9;
int n,m;
const int max_v = 100;
int unip[max_v],unir[max_v];
void init(int n){
  for(int i=0 ; i<n ; i++){
    unip[i] = i;
    unir[i] = 0;
  }
}
int find(int x){
  if(unip[x] == x){
    return x;
  }else{
    return unip[x] = find(unip[x]);
  }
}
void unite(int x, int y){
  x = find(x);  y = find(y);
  if(unip[x] == unip[y]){
    return;
  }
  if(unir[x] < unir[y]){
    unip[x] = y;
  }else{
    unip[y] = x;
    if(unir[x] == unir[y]){
      unir[x]++;
    }
  }
}
bool same(int x, int y){
  return find(x) == find(y);
}
int main(){
  cin >> n >> m;
  vector<pair<int, int> > v;
  for(int i=0 ; i<m ; i++){
    int x, y; cin >> x >> y;
    --x;  --y;
    v.push_back(make_pair(x,y));
  }
  int ans = 0;
  for(int i=0 ; i<m ; i++){
    init(n);
    for(int j=0 ; j<m ; j++){
      if(i !=j){
        unite(v[j].fi, v[j].se);
      }
    }
    for(int j=0 ; j<m ; j++){
      if(!same(j,j+1)){
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;
typedef long long ll;
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll

const int md = 1000000007;
const int INF = 1<<30;

int main(){
    map<int,int> m;
    int n; cin >> n;
    vi a(n-1); cin >> a;

    rep(i,n-1){
        m[a[i]]++;
    }

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


Measured memory_bytes: 13524
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	while (b > 0) {
		if (b & 1) {res = (res * a); b--;}
		a = (a * a);
		b >>= 1;
	}
	return res;
}
ll n;
ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}


int main() {
	ll h,w;
	cin>>h>>w;
	char c[h][w];
	for(ll i=0;i<h;i++)
		for(ll j=0;j<w;j++)
			cin>>c[i][j];
	ll dp[h+1][w+1];
	
	for(ll i=0;i<h;i++){
		for(ll j=0;j<w;j++){
				dp[i][j]=0;
		}
	}
	dp[0][0]=c[0][0]=='.'?1:0;
	for(ll i=0;i<h;i++){
		for(ll j=0;j<w;j++){
			if(c[i][j]=='.'){
				if(i>0)
					dp[i][j]=(dp[i][j]+dp[i-1][j])%MOD;
				if(j>0)
					dp[i][j]=(dp[i][j]+dp[i][j-1])%MOD;
			}
		}
	}
	cout<<dp[h-1][w-1]<<"\n";
}

Measured memory_bytes: 12344
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld; 
typedef tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> pbds;

ll dp[111][111111];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	vector<ii> vec;
	int n; ll w; cin>>n>>w;
	vec.pb(mp(-1,-1));
	for(int i=0;i<n;i++)
	{
		ll x,y; cin>>x>>y; vec.pb(mp(x,y));
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=w;j++)
		{
			dp[i][j]=dp[i-1][j];
			if(j-vec[i].fi>=0) dp[i][j]=max(dp[i][j],dp[i-1][j-vec[i].fi]+vec[i].se);
		}
	}
	ll ans=0;
	for(int j=0;j<=w;j++) ans=max(ans,dp[n][j]);
	cout<<ans<<'\n';
}


Measured memory_bytes: 87424
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

fn f(x: i32) -> i32 {
    if x == 1 {
        300000
    } else if x == 2 {
        200000
    } else if x == 3 {
        100000
    } else {
        0
    }
}

fn main() {
    input! {
        x: i32,
        y: i32,
    }
    let mut ret = f(x) + f(y);

    if x == 1 && y == 1 {
        ret += 400000;
    }

    println!("{}", ret);
}


Measured memory_bytes: 2128
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int n;
	int a,b,c;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a >> b >> c;
		vector<int> v;
		v.push_back(a);
		v.push_back(b);
		v.push_back(c);
		sort(v.begin(),v.end());
		if(v[2]*v[2]==v[1]*v[1] + v[0]*v[0]){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:1048576")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;
typedef tuple <int, int, int> t3;

int IT_MAX = 1 << 18;
const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 1234567890123456789ll;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<(n);i++)

int gcd(int a, int b) {
	return (a == 0) ? b : gcd(b%a, a);
}
int in[100050];

int main() {
	int N, K, i;
	scanf("%d %d", &N, &K);
	for (i = 1; i <= N; i++) scanf("%d", &in[i]);
	sort(in + 1, in + N + 1);

	int g = 0;
	for (i = 1; i <= N; i++) g = gcd(in[i], g);
	
	if (K % g == 0 && in[N] >= K) return !printf("POSSIBLE\n");
	return !printf("IMPOSSIBLE\n");
}

Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int x;
    cin >> x;
    int ans = 8;
    if (x < 600) {
        ans = 8;
    } else if (x < 800) {
        ans = 7;
    } else if (x < 1000) {
        ans = 6;
    } else if (x < 1200) {
        ans = 5;
    } else if (x < 1400) {
        ans = 4;
    } else if (x < 1600) {
        ans = 3;
    } else if (x < 1800) {
        ans = 2;
    } else {
        ans = 1;
    }

    cout << ans << endl;
}


Measured memory_bytes: 3152
#include<bits/stdc++.h>
using namespace std;
int main()
{
    double nless,sum=0,val;
    int a[105],n,m,i;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>a[i];
        sum=sum+a[i];
    }
    nless=(1.0/(4*m));
    sort(a,a+n,greater<int>());
    int cnt=0;
    for(i=0; i<m; i++)
    {
        val=(a[i]*1.0)/sum;
            if(val>=nless)
        {
            continue;
        }
        else
        {
            cnt++;
            break;
        }
    }
    if(cnt==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define endll           "\n"
#define INIT(n,m)       memset(n,m,sizeof(n))
#define REP(i,n)        for(ll i=0;i<n;i++)
#define FOR(i,a,b)      for(ll i=a;i<=b;i++)
#define FORD(i,a,b)     for(ll i=a;i>=b;i--)
#define PB              push_back
#define IN(a,b)         substr(a,b-a+1)
#define FF              first
#define SS              second
#define LEN(x)          ((ll)x.size())
#define MM              1000000007
#define CHECK(x,y)      (((x%=y)+=y)%=y)
#define DEBUG(x)        {cout<<#x<<" = ";cout << (x) << endll;}
#define PR(v)           {cout<<#v<<" = ";for(auto _:v)cout<<_<<' ';cout<<endll;}
#define PRR(a,b,n)      {cout<<#a<<" = ";FOR(_,b,n)cout<<a[_]<<' ';cout<<endll;} 
#define FOREACH(it, c)  for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it)
#define FILE_IO(a,b)    {freopen(a,"r",stdin);freopen(b,"w",stdout);}
struct  IO              {IO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}}_;
typedef long long ll;
typedef pair<ll,ll> ii;
ll n,m,len,k,t,a,b;

bool isPrime[1000010];
vector<ll> primes;
void sieve(){
	INIT(isPrime,true);
	FOR(i,2,1000000) if(isPrime[i]){
		for(ll j=i*i;j<=1000000;j+=i) isPrime[j] = false;
		primes.PB(i);
	}	
}

ll key(ll x){
	vector<ll> ret;
	for(auto cur:primes){
		if(cur*cur > x) break;
		if(x%cur == 0) ret.PB(cur);
		while(x%cur == 0) x/=cur;
	}
	if(x!=1) ret.PB(x);
	ll ans = ret.back(); ret.pop_back();
	ll sum = 0; for(auto cur:ret) sum += cur;
	return ans-sum;
	
}

int main(){
	sieve();
	while(cin >> a >> b){
		if(a == 0 && b == 0) return 0;
		if(key(a) >= key(b)) cout << "a\n";
		else cout << "b\n";
	}
	return 0;
}

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

int main() {

	int N;
	int ac = 0, wa = 0, tle = 0, re = 0;
	cin >> N;
	string S[100001];

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

	for (int i = 0; i < N; i++) {
		if (S[i] == "AC")	ac++;
		else if (S[i] == "WA")	wa++;
		else if (S[i] == "TLE")	tle++;
		else if (S[i] == "RE")	re++;
	}

	cout << "AC x " << ac << endl;
	cout << "WA x " << wa << endl;
	cout << "TLE x " << tle << endl;
	cout << "RE x " << re << endl;
	return 0;
}

Measured memory_bytes: 6772
# -*- coding: utf-8 -*-
S = input()
T = input()

ans = len(T)

for i in range(len(S) - len(T) + 1):
    diff = 0
    for t in range(len(T)):
        if T[t] != S[i + t]:
            diff += 1

    ans = min(ans, diff)

print(ans)

Measured memory_bytes: 9088
#include<iostream>
using namespace std;
int main(){
    int x;
    int n = 1;
    int i = 0;
    while(n == 1){
        i += 1;
        cin >> x;
        if(x == 0) break;
        cout << "Case " << i << ": " << x << endl;
        
    }
    return 0;
}


Measured memory_bytes: 2996
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <cstdio>

using namespace std;

int main(){
  long long n;
  long c4 = 0;
  long c2 = 0;
  long c1 = 0;
  cin >> n;
  for (long long i=0;i<n;i++) {
    long long a;
    cin >> a;
    if (a % 4 == 0) {
      c4++;
    } else if (a % 2 == 0) {
      c2++;
    } else {
      c1++;
    }
  }
  if (c4 >= c1 || (c1 - c4 == 1 && c1 + c4 == n)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	long long v, a, b, c, d, e;
	cin >> v >> a >> b >> c >> d >> e;
	long long slow = min({a, b, c, d, e});
	cout << (v + slow-1)/ slow + 4;
	return 0;
}

Measured memory_bytes: 3584
#include <stdio.h>
int main(){
	double a,b,c,x;
	int count1=0,count2=0;
	
	while(~scanf("%lf,%lf,%lf",&a,&b,&c)){
		x=a*a-(c/2)*(c/2);
		if(a*a+b*b==c*c) count1++;//長方形
		if(a==b) count2++;
	}
		printf("%d\n%d\n",count1,count2);
	return 0;
}

Measured memory_bytes: 620
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
const int Nmax = 50;
int N, P[Nmax];

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

	vector<pair<int, int>> pi;
	for(int i=0; i<N; i++) pi.push_back({P[i], i});

	sort(pi.begin(), pi.end());
	int n = 0;
	for(int i=0; i<N; i++){
		if(pi[i].second!=i) n++;
	}

	if(n<=2) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

typedef std::uint64_t u64;
typedef std::int64_t  i64;
typedef std::uint32_t u32;
typedef std::int32_t  i32;

using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(0)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl

int main(int argc, const char* argv[]) {
	u64 n, k;
	string s;

	cin >> n >> s >> k;

	char sk = s[k-1];

	rep(i, n) {
		if(s[i] != sk) {
			s[i] = '*';
		}
	}

	cout << s << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,x,y;
  cin>>a>>b>>c>>x>>y;
  int ans=0,cnt;
  if(a+b>c*2){
    cnt=min(x,y);
    if(x<y&&b>c*2)b=c*2;
    if(x>y&&a>c*2)a=c*2;
    cout<<c*cnt*2+a*(x-cnt)+b*(y-cnt)<<endl;
  }else cout<<a*x+b*y<<endl;
  return 0;
}


Measured memory_bytes: 256
import fractions

n, X = map(int, input().split())
x = list(map(int, input().split()))

xx = []

for i in range(n):
    xx.append(abs(x[i]-X))

if n == 1:
    print(xx[0])
else:
    xg = xx[0]
    for i in range(1,n):
        xg = fractions.gcd(xg,xx[i])
    print(xg)


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int a;
    cin >> a;
    if(a < 1200) cout << "ABC" << endl;
    else cout << "ARC" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1e9 + 7;
int main()
{
  string S; cin>>S;
  vector<unsigned> dp{1,0,0,0};
  for(char& c : S)
  {
    if(c >= 'A')
    {
      dp[c-'A'+1] += dp[c-'A'];
      dp[c-'A'+1] %= MOD;
    }
    else
    {
      for(int i=3; i>=0; i--)
      {
        dp[i] *= 3;
        if(i>0) dp[i] += dp[i-1];
        dp[i] %= MOD;
      }
    }
  }
  cout<<dp[3]<<endl;
  return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    int h,w;std::cin>>h>>w;
    std::vector<int>ckd(h+w-1);
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            char c;std::cin>>c;
            if(c=='#'&&std::exchange(ckd.at(i+j),true)){
                std::cout<<"Impossible"<<'\n';
                return 0;
            }
        }
    }
    std::cout<<"Possible"<<'\n';
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <cmath>      // sqrt
#include <cstdlib>    // exit
#include <algorithm>  // min,max
using namespace std;
#define forr(i,m,n) for (int i=(m); i<=(n); i++)
#define forv(i,m,n) for (int i=(m); i>=(n); i--)
#define forall(it,p) for (auto it = p.begin(); it != p.end(); ++it)
#define R 1000000007
#define DBG 1

#define MAXN 100001
int a[MAXN];
int b[MAXN];
int dboss[MAXN];
int sz[MAXN];
int foo[MAXN];
long ans[MAXN];

int boss(int i) {
  int j = i;
  int cnt = 0;
  while (dboss[j] != -1) {
    foo[cnt++] = j;
    j = dboss[j];
  }
  forr(k,0,cnt-1)
    dboss[foo[k]] = j;
  return j;
}

void setboss(int k, int i) {
  int j = i;
  while(j != k) {
    int nxt = dboss[j];
    dboss[j] = k;
    j = nxt;
  }
}

int main() {
  int n, m;
  cin >> n >> m;
  forr(i,0,m-1) {
    int aa, bb;
    cin >> aa >> bb;
    a[i] = aa-1;
    b[i] = bb-1;
  }
  forr(i,0,n-1) {
    dboss[i] = -1;
    sz[i] = 1;
  }
  long sum = long(n) * (n-1) / 2;
  ans[m-1] = sum;
  forv(z, m-1, 1) {
    int x = a[z];
    int y = b[z];
    int i = boss(x);
    int j = boss(y);
    if (i==j) {
      ans[z-1] = sum;
      continue;
    }
    long p = sz[i];
    long q = sz[j];
    if (sum>0)
      sum -= ((p+q)*(p+q-1)-p*(p-1)-q*(q-1))/2;
    int k = min(i,j);
    if (k==i)
      dboss[j] = k;
    else
      dboss[i] = k;
    //setboss(k,x);
    //setboss(k,y);
    sz[k] = p+q;
    ans[z-1] = sum;
  }
  forr(i,0,m-1)
    cout << ans[i] << endl;
}


Measured memory_bytes: 3712
#include <stdio.h>
#include <string.h>
int main(void)
{
	char s[11];
	int n,i,z=0,y=0;
	scanf("%s",s);
	n=strlen(s);
	for(i=2; i<n-1; i++){
		if(s[i]=='C'){
			z=z+1;
		}
		if('a'<=s[i] && s[i]<='z'){
			y=y+1;
		}
	}
	if(z==1 && y==(n-4) && s[0]=='A' && 'a'<=s[1] && s[1]<='z' && 'a'<=s[n-1] && s[n-1]<='z'){
		printf("AC\n");
	}else{
		printf("WA\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(a < b){
		if(b < c)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else{
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 580
// AOJ ITP1_11_B Dice II
// 2018.4.29 bal4u
 
#include <stdio.h>
 
int face[7][7][4] = {
{{0},{0},{0},{0},{0},{0},{0}},
{{0},{0},{0,1,2,3},{0,1,3,5},{0,1,4,2},{0,1,5,4},{0}},
{{0},{0,2,1,4},{0},{0,2,3,1},{0,2,4,6},{0},{0,2,6,3}},
{{0},{0,3,1,2},{0,3,2,6},{0},{0},{0,3,5,1},{0,3,6,5}},
{{0},{0,4,1,5},{0,4,2,1},{0},{0},{0,4,5,6},{0,4,6,2}},
{{0},{0,5,1,3},{0},{0,5,3,6},{0,5,4,1},{0},{0,5,6,4}},
{{0},{0},{0,6,2,4},{0,6,3,2},{0,6,4,5},{0,6,5,3},{0}}};
int assign[7];
 
int main()
{
    int q, i, t, f;
 
    for (i = 1; i <= 6; i++) scanf("%d", assign+i);
    scanf("%d", &q);
    while (q--) {
        scanf("%d%d", &t, &f);
        for (i = 1; i <= 6; i++) {
            if (assign[i] == t) t = i;
            if (assign[i] == f) f = i;
        }
        printf("%d\n", assign[face[t][f][3]]);
    }
    return 0;
}


Measured memory_bytes: 2056
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    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;
    }
}
 
 
#define comuse Comuse()
 
ll combi(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 lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll a=1000000007;
  
  ll n,k;
  	ci(n>>k);
  
  vpll A(n);
  
  FOR(i,0,n){
	ci(A[i].fi)
  }
  
  ll ans=0;
  ll count=0;
  
  FOR(i,0,n){
    FOR(j,0,n){
      if(i<j&&A[i].fi>A[j].fi){
        ans++;//同じ群で何個あるか
      }
      if(A[i].fi>A[j].fi){
        count++;
      }
    }
    A[i].se=count;
    count=0;
    ans%=a;
  }

  ans*=k;
  ans%=a;
  
  FOR(i,0,n){
	ans+=k*(k-1)/2%a*A[i].se%a;
  }
  
  co(ans%a)
}


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

int main() {
	// your code goes here
	string a, b;
	cin >> a >> b;
	b.pop_back();
	if(a == b)
	    std::cout <<  "Yes" << std::endl;
	 else 
	    cout << "No" << endl;
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  vector<int> Max;
  int tmp;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++){
      if(A.at(i) > A.at(j)){
        tmp = A.at(i);
        A.at(i) = A.at(j);
        A.at(j) = tmp;
      }
    }
  }
  int Alice = 0;
  int Bob = 0;
  for(int i=0;i<N;i++){
    if((i+1)%2==0){
      Bob += A.at(N-i-1);
    }
    else{
      Alice += A.at(N-i-1);
    }
  }
  cout << Alice - Bob << endl;
}

Measured memory_bytes: 256
# -*- coding utf-8 -*-

MOD = 10 ** 9 + 7

n = int(input())
an = list(map(int, input().split()))
an = [[an[i - 1], i] for i in range(1, n + 1)]
an.sort()

ans = ' '.join(map(lambda x: str(x[1]), an))

print(ans)


Measured memory_bytes: 26820
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n,i,k;
  string s;
  cin>>n>>k;
  cin>>s;
  for(i=0;i<n;i++)
  {
    if(i==k-1)
      s[i]=s[i]+32;
  }
  cout<<s;
  return 0;
}


Measured memory_bytes: 256
import numpy as np
N, M = list(map(int, input().split()))
A = np.array([int(i) for i in input().split()])
BC_array = np.array([[int(i) for i in input().split()] for i in range(M)])
BC_array_sorted = BC_array[np.argsort(BC_array[:,1])[::-1]]
D = np.array(np.zeros(N, dtype = int))
index = 0
for b, c in BC_array_sorted:
    D[index:min(index+b, N)] = c
    index += b
    if(N < index):
        break
E = np.concatenate((A, D))
E = np.sort(E)
ans = sum(E[N:2*N])
print(ans)

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

int main(){
    vector<vector<int>> A(3, vector<int>(3));
    rep(i, 3){
        rep(j, 3){
            cin >> A[i][j];
        }
    }
    int N;
    cin >> N;
    vector<int> b(N);
    rep(i, N) cin >> b[i];

    rep(i, N){
        rep(j, 3){
            rep(k, 3){
                if (A[j][k] == b[i]) A[j][k] = 0;
            }
        }
    }

    string ans = "No";
    rep(i, 3){
        if (A[i][0] == 0 && A[i][1] == 0 && A[i][2] == 0) ans = "Yes";
    }
    rep(i, 3){
        if (A[0][i] == 0 && A[1][i] == 0 && A[2][i] == 0) ans = "Yes";
    }
    if (A[0][0] == 0 && A[1][1] == 0 && A[2][2] == 0) ans = "Yes";
    if (A[0][2] == 0 && A[1][1] == 0 && A[2][0] == 0) ans = "Yes";

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;
struct UnionFind {

	UnionFind(long long N, vector<long long>&par) {
		for (long long i = 0; i < N; i++) par[i] = -1;
	}

	long long root(long long x, vector<long long>& par) {
		if (par[x] < 0) return x;
		return par[x] = root(par[x], par);
	}

	void unite(long long x, long long y, vector<long long>& par) {
		long long rx = root(x, par);
		long long ry = root(y, par);
		if (rx == ry) return;
		par[ry] += par[rx];
		par[rx] = ry;
	}
	bool same(long long x, long long y, vector<long long>& par) {
		long long rx = root(x, par);
		long long ry = root(y, par);
		return rx == ry;
	}
	long long size(long long x, vector<long long>& par) {
		return -par[root(x, par)];
	}
};

int main() {
	long long N, M;
	cin >> N >> M;
	vector<pair<long long, long long>> E(M);
	for (long long i = 0; i < M; i++) cin >> E[i].first >> E[i].second;
	vector<long long> Ans(M);
	vector<long long> par(N);
	UnionFind Nums(N, par);
	Ans[M - 1] = N * (N - 1) / 2;
	for (long long i = M - 1; i >= 1; i--) {
		long long a = E[i].first, b = E[i].second;
		Ans[i - 1] = Ans[i];
		if (!Nums.same(a - 1, b - 1,par)) {
			Ans[i - 1] -= Nums.size(a - 1, par) * Nums.size(b - 1, par);
			Nums.unite(a - 1, b - 1, par);
		}
	}
	for (long long a : Ans) cout << a << endl;
}


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

using namespace std;

int main()
{
    int n;
    cin >> n;
    long long a[5];
    for(int i=0;i<5;i++) a[i]=0;
    char s[100];
    for(int i=0;i<n;i++)
    {
        scanf("%s",s);
        if(s[0]==' ') continue;
        char c=s[0];
        if(c=='M') a[0]++;
        if(c=='A') a[1]++;
        if(c=='R') a[2]++;
        if(c=='C') a[3]++;
        if(c=='H') a[4]++;
    }

    long long ans=0;
    for(int i=0;i<4;i++)
    {
        for(int j=i+1;j<5;j++)
        {
            long long ma=1;
            for(int k=0;k<5;k++)
            {
                if(k!=i&&k!=j) ma*=a[k];
            }
            ans+=ma;
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 256
while True:
    try:
        lst = list(map(int, input().split()))

        num = lst[2] + 100*lst[1] + 10000*lst[0]

        if num >= 19890108:
            era = "heisei"
            lst[0] = lst[0] - 1988

        elif num >= 19261225:
            era = "showa"
            lst[0] = lst[0] - 1925

        elif num >= 19120730:
            era = "taisho"
            lst[0] = lst[0] - 1911

        elif num  >= 18680908:
            era = "meiji"
            lst[0] = lst[0] - 1867

        else:
            era = "pre-meiji"
            lst[0] = 0

        if lst[0] == 0:
            print(era)
        
        else:
            print(era + " " + str(lst[0]) + " " + str(lst[1]) + " " + str(lst[2]))
        
    except EOFError:
        break


Measured memory_bytes: 5596
N, M = gets.strip.split.map(&:to_i)

mod = 10 ** 9 + 7

# bf: broken floors
bf = {}
M.times.map { bf[gets.strip.to_i] = 1 }

dp = Array.new(N + 1){0}

dp[0] = 1
dp[1] = 1 if bf[1].nil?

(2..N).each do |i|
  next unless bf[i].nil?
  dp[i] = dp[i - 1] + dp[i - 2]
end

puts dp[N] % mod


Measured memory_bytes: 433020