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

int main() {
  int N, M;
  cin >> N >> M;
  map<int, int> height;
  for (int i = 0; i < N; i++) {
    int H;
    cin >> H;
    height[i] = H;
  }
  map<int, vector<int>> road;
  for (int i = 0; i < N; i++) {
    road[i] = {};
  }
  for (int j = 0; j < M; j++) {
    int A, B;
    cin >> A >> B;
    road.at(A-1).push_back(height.at(B-1));
    road.at(B-1).push_back(height.at(A-1));
  }
  vector<bool> good(N, false);
  for (int i = 0; i < N; i++) {
    if (road.at(i).empty()) {
      good.at(i) = true;
    }
    else {
      sort(road.at(i).begin(), road.at(i).end());
      reverse(road.at(i).begin(), road.at(i).end());
      if (height.at(i) > road.at(i).at(0)) {
         good.at(i) = true;
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    if (good.at(i)) {
      cnt++;
    }
  }
  cout << cnt << endl;
}

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

int main(void)
{
    int n,i,j,l;
    char string[100][11];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",string[i]);
    }   
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(strcmp(string[i],string[j])==0){
                printf("No\n");
                return 0;
            }   
        }   
    }   
    for(i=0;i<(n-1);i++){
        l=strlen(string[i]);
        if(string[i][l-1]!=string[i+1][0]){
            printf("No\n");
            return 0;
        }   
    }   
    printf("Yes\n");
    return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vchar = vector<char>;
using vvchar = vector<vchar>;
using vp = vector<P>;
using vpp = vector<pair<P, P>>;
using vvp = vector<vp>;

#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
istream &operator>>(istream &is, P &a)
{
    return is >> a.first >> a.second;
}
ostream &operator<<(ostream &os, const P &a) { return os << "(" << a.first << "," << a.second << ")"; }

template <typename T>

void view(const std::vector<T> &v)
{
#ifndef ONLINE_JUDGE
    for (const auto &e : v)
    {
        std::cout << e << " ";
    }
    std::cout << std::endl;
#endif
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv)
{
    for (const auto &v : vv)
    {
        view(v);
    }
}
#pragma endregion

int main()
{
    int n;
    cin >> n;
    vint l(n);
    rep(i, n) cin >> l[i];

    int ans = 0;
    rep(i, n) for (int j = i + 1; j < n; j++) for (int k = j + 1; k < n; k++)
    {
        if (i == j || j == k || i == k)
            continue;
        if (l[i] == l[j] || l[j] == l[k] || l[i] == l[k])
            continue;

        int c = max(l[i], max(l[j], l[k]));
        int a, b;
        if (c == l[i])
        {
            a = l[j];
            b = l[k];
        }
        else if (c == l[j])
        {
            a = l[i];
            b = l[k];
        }
        else
        { // l[k] = a
            a = l[i];
            b = l[j];
        }

        if (a + b > c)
        {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;

int main(void) {
	int N;
	cin >> N;
	vector<int> W(N);
	int sum = 0;
	for (int i = 0; i < N; ++i) {
		cin >> W[i];
		sum += W[i];
	}
	int res = (1 << 28);
	for (int T = 1; T < N; ++T) {
		int now = 0;
		for (int i = 0; i < T; ++i) {
			now += W[i];
		}
		res = min(abs(sum-(2*now)),res);
	}
	cout << res << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    int ans=0;
    cin>>a>>b;
    while(a<=b){
        int p=a/10000;
        int q=(a/1000)%10;
        int r=(a/100)%10;
        int s=(a/10)%10;
        int t=a%10;
        if(p==t&&q==s)ans++;
        a++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct string {
  char str[101];
  size_t len;
};

int comp(const void* str1, const void* str2) {
  return strncmp(((struct string*)str1)->str,
      ((struct string*)str2)->str,
      ((struct string*)str1)->len);
}

#define BUF_SIZE 10200
int main(void) {
  FILE* fp = stdin;
  char line[BUF_SIZE];
  int i;
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num, len;
  sscanf(line, "%d %d", &num, &len);
  struct string *words = malloc(sizeof(struct string)*num);

  for(i = 0; i < num; i++) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    strncpy(words[i].str, line, len+1);
    words[i].len = len;
  }
  qsort(words, num, sizeof(struct string), comp);

  char buf[BUF_SIZE];
  int pos = 0;
  for(i = 0; i < num; i++) {
    char* b = words[i].str;
    char* tmp;
    for(tmp = b; *tmp != '\n'; tmp++) {
      buf[pos++] = *tmp;
    }
  }
  buf[pos] = '\0';

  printf("%s\n", buf);

  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    int a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    cout << min(min(a,b),c)+min(d,e)-50 << endl;
    
    
    return 0;
}


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

using namespace std;

int main(){
  int n;
  std::cin >> n;

  vector<int> a(n, 0);
  for(int idx = 0; idx < a.size(); idx++){
    std::cin >> a[idx];
    a[idx]--;
  }

  bool accept = false;
  int count = 0;
  int idx = 0;
  for(int i = 0; i < a.size(); i++){
    idx = a[idx];
    count++;
    if(idx == 1){
      accept = true;
      break;
    }
  }
  if(accept){
    std::cout << count << '\n';
  }else{
    std::cout << -1 << '\n';
  }

  return 0;
}


Measured memory_bytes: 1272
//#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
using namespace std;
#define AC 0
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector< vector<int> > a(n, vector<int>(n));
	vector<long long> dp(1 << n);
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cin >> a[i][j];
	for (int i = 0; i < 1 << n; i++)
		for (int j = 0; j < n; j++)
			if (1 << j & i)
				for (int k = j + 1; k < n; k++)
					if (1 << k & i)
						dp[i] += a[j][k];
	for (int i = 0; i < 1 << n; i++)
		for (int j = i & (i - 1); j > 0; j = (j - 1) & i)
			dp[i] = max(dp[i], dp[j] + dp[i ^ j]);
	cout << dp[(1 << n) - 1];
	return AC;
}

Measured memory_bytes: 3708
#include <iostream>

using namespace std;
using ll = long long;
ll full[51];
ll len[51];

ll cnt(int lv, ll x) {
    ll pl = len[lv - 1];
    if (lv == 0) return x;
    if (x == 0) return 0;
    if (x <= pl + 1) return cnt(lv - 1, x - 1);
    if (x == pl + 2) return full[lv - 1] + 1;
    if (x < pl * 2 + 2) return full[lv - 1] + 1 + cnt(lv - 1, x - pl - 2);
    return full[lv];
}

int n;
ll gx;

int main(){
    cin >> n >> gx;
    full[0] = 1;
    len[0] = 1;
    for (int i = 1; i <= n; ++i) {
        full[i] = 1 + full[i - 1] * 2;
        len[i] = 3 + len[i - 1] * 2;
    }

    cout << cnt(n, gx) << endl;
}

Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define ll long long
using namespace std;

int main(void){
  ll num;
  cin >> num;
  vector<string>  str(num);
  for(int i = 0;i < num;i++){
    cin >> str[i];
  }
  sort(str.begin(),str.end());
  int maxi =  0;
  vector<string> ans;
  int cuml = 0;
  string prev = "";
  string now;
  for(int i = 0;i < num;i ++){
    now = str[i];
    if(prev == now){
      cuml ++;
    }else{
      cuml = 1;
      prev = now;
    }
    if(cuml==maxi){
      ans.insert(ans.end(),now);
    }else if(cuml>maxi){
      maxi=cuml;
      ans = {};
      ans.insert(ans.end(),now);
    }
  }
  for(int i = 0;i < ans.size();i ++){
    cout << ans[i] << endl;
  }
  
  return 0;
}

Measured memory_bytes: 17924
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            Console.WriteLine(s.Substring(0, 1) + (s.Length-2).ToString() + s.Substring(s.Length - 1, 1));
        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();


//Console.WriteLine(ans);

Measured memory_bytes: 25880
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int main(){
  int N, M;
  while(cin >> N >> M && N){
    const int goal = (1 << N) - 1;
    int start[3] = {};
    int s_top[3] = {};
    memset(s_top, -1, sizeof(s_top));
    REP(i, 3){
      int k; cin >> k;
      REP(j, k) {
        int t; cin >> t;
        start[i] |= 1 << (t - 1);
        s_top[i] = max(s_top[i], t - 1);
      }
    }
    int ans = INF;
    for(int iter = 0; iter < 2; iter++){
      int last_move = iter; // 0 : A<->B, 1 : B<->C
      int state[3];
      int top[3];
      memcpy(state, start, sizeof(state));
      memcpy(top, s_top, sizeof(top));
      for(int time = 0; time <= M; time++){
        if(state[0] == goal || state[2] == goal){
          ans = min(ans, time);
          break;
        }
        int a, b;
        if(last_move == 0){
          last_move = 1;
          a = 1, b = 2;
        }else{
          last_move = 0;
          a = 0, b = 1;
        }
        if(top[a] > top[b]) swap(a, b);
        assert(top[b] >= 0); // i can move it
        top[a] = top[b]; 
        state[a] |= 1 << top[a]; // add top[a]
        state[b] &= ~(1 << top[a]); // remove top[a]
        // find next top
        for(int i = top[a] - 1; i >= -1; i--){
          if(i == -1 || (state[b] >> i & 1)){
            top[b] = i;
            break;
          }
        }
      }
    }
    if(ans == INF) ans = -1;
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
typedef long long LL;
const LL N=100005;
LL n,m; 
struct qq	{LL a,b,id;}s[N];
LL fa[N];
LL find_fa (LL x)	{return fa[x]==x?x:fa[x]=find_fa(fa[x]);}
bool cmp (qq x,qq y)	{return x.a==y.a?x.b>y.b:x.a<y.a;}
LL id[N];
bool vis[N];
vector<LL> vec[N],e[N];
bool tf;
LL tot[N];
void dfs (LL x,LL lim)
{
//	printf("YES:%lld %lld %lld\n",x,lim,lim-(tot[x]-s[x].b));
	if (lim-(tot[x]-s[x].b)>=max(s[x].a,s[x].b))	{tf=true;return ;}
	LL siz=vec[x].size();
	for (LL u=0;u<siz;u++)
	{
		LL y=vec[x][u];
		LL t=lim-(tot[x]-tot[y]-s[x].b);
		if (t>=max(s[x].b,s[x].a)) dfs(y,t-s[x].b);
	}
}
void dfs1 (LL x)
{
	tot[x]=s[x].b;
	LL siz=vec[x].size();
	for (LL u=0;u<siz;u++)	{dfs1(vec[x][u]);tot[x]=tot[x]+tot[vec[x][u]];}
}
int main()
{
//	freopen("rescue.in","r",stdin);
//	freopen("rescue.out","w",stdout);
	scanf("%lld%lld",&n,&m);
	for (LL u=1;u<=n;u++) fa[u]=u,vis[u]=false;
	LL l=0,r=0,lalal=-1;
	for (LL u=1;u<=n;u++)	
	{
		scanf("%lld%lld",&s[u].a,&s[u].b);
		l=l+s[u].b;
		r=r+s[u].a+s[u].b;
		s[u].id=u;
	}
	sort(s+1,s+1+n,cmp);
	for (LL u=1;u<=n;u++) id[s[u].id]=u;
	for (LL u=1;u<=m;u++)
	{
		LL x,y;
		scanf("%lld%lld",&x,&y);
		x=id[x];y=id[y];
		e[x].push_back(y);e[y].push_back(x);
	}
	//printf("YES!\n");
	for (LL u=1;u<=n;u++)
	{
		//printf("a:%lld b:%lld\n",s[u].a,s[u].b);
		LL siz=e[u].size();vis[u]=true;
		for (LL i=0;i<siz;i++)
		{
			LL y=find_fa(e[u][i]);
			if (vis[y]==false) continue;
			if (y==u) continue;
			fa[y]=u;vec[u].push_back(y);
			//printf("link:%lld %lld\n",u,y);
		}
	}
	dfs1(n);
//	dfs(n,1000005483);
	/*for (LL u=1;u<=n;u++) printf("%lld %lld\n",s[u].a,s[u].b);
	for (LL u=1;u<=n;u++) printf("%lld ",tot[u]);printf("\n");*/
//	printf("YES:%lld %lld\n",l,r);
	while (l<=r)
	{
		LL mid=(l+r)>>1;
		tf=false;dfs(n,mid);
		if (tf)	{lalal=mid;r=mid-1;}
		else l=mid+1;
	}
	printf("%lld\n",lalal);
	return 0;
}

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

int main()
{   
    long N; cin >> N;
    long yaku[100005];
    long shisuu[100005];
    int ind = 0;
    long kazu = N;
    for(long i=2l; i*i<=N;i++){
        if(kazu%i==0){
            long temp = 0;
            while(kazu%i == 0l){
                kazu /= i;
                temp++;
            }
            yaku[ind] = i;
            shisuu[ind] = temp;
            ind++;
        }
    }
    //REP(i, ind) cout << yaku[i] << " " << shisuu[i] << endl;
    if(N==1) cout << 0 << endl;
    else if(ind==0) cout << 1 << endl;
    else{
        long ans = 0l;
        REP(i, ind){
            long first = 1l;
            while(shisuu[i] >= first){
                shisuu[i] -= first;
                first++;
            }
            first--;
            ans += first;
        }
        if(kazu > 1l) ans++;
        cout << ans << endl;
    }

    
    
    return 0;
}



Measured memory_bytes: 3644
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let (N, H, W) = get!(i64, i64, i64);
    let (A, B): (Vec<_>, Vec<_>) = get!(i64, i64; N).into_iter().unzip();

    let ans = A.iter()
        .zip(B.iter())
        .filter(|&(&a, &b)| a >= H && b >= W)
        .count();

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

Measured memory_bytes: 4352
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int R = sc.nextInt();
		int G = sc.nextInt();
		int B = sc.nextInt();
		int N = sc.nextInt();
		long ans = 0;
		for(int i = 0; i <= N; i++) {
			for(int j = 0; j <= N; j++) {
				if(R*i+G*j <= N && (N-(R*i+G*j)) % B == 0)
					ans++;
			}
		}
		System.out.println(ans);

	}

}

Measured memory_bytes: 21844
from sys import stdin

n = int(stdin.readline())

for i in range(1,n+1):
    x = i
    if x % 3 == 0:
        print('', i, end='')
    else:
        while x:
            if x % 10 == 3:
                print('', i, end='')
                break
            else:
                x //= 10
print() #最後の改行


Measured memory_bytes: 6160
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

// long long gcd(long long a, long long b){
//     if (a < b){
//         a ^= b;
//         b ^= a;
//         a ^= b;
//     }
//     return b ? gcd(b, a % b) : a;
// }

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

int main(){
    int n;
    cin >> n;
    char s[n];
    cin >> s;
    
    if(n%2 != 0){
        cout << "No" << endl;
        return 0;
    }
    
    rep(i,n/2){
        if(s[i] != s[i+(n/2)]){
            cout << "No" << endl;
            return 0;
        }
    }
    
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#define SUBMIT

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_D
// Search - Allocation

#include <iostream>
#include <vector>
#include <limits>
#include <numeric>

using namespace std;
using i64 = long long;

i64 compute_can_convey_n_packages(const vector<int>& w, int k, i64 P) {
    i64 i = 0;
    auto n = static_cast<int>(w.size());
    for (int j = 0; j < k; ++j) {
        auto curr_load = 0;
        // load the j-th track with the w[i] package
        while (curr_load + w[i] <= P) {
            curr_load += w[i];
            i++;
            if (i == n) {
                return n;
            }
        }
    }

    return i;
}

// find best P by binary search.
i64 find_best_maximum_load(const vector<int>& w, int k) {
    auto n = w.size();
    i64 left = 0;
    i64 right = accumulate(w.begin(), w.end(), 0);

    while (left != right) {
        auto middle = (left + right) / 2;
        auto v = compute_can_convey_n_packages(w, k, middle);
        if (n <= v) {
            right = middle;
        } else {
            left = middle + 1;
        }
    }

    return right;
}

int main() {
    int n, k;
    vector<int> w;
#ifdef SUBMIT
    cin >> n >> k;
    w.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> w[i];
    }
#else
    n = 5;
    k = 3;
    w = {8, 1, 7, 3, 9};
#endif
    auto ans = find_best_maximum_load(w, k);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3120
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
// #include <bits/stdc++.h> all

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

int main(void){

  int h,a; cin >> h >> a;
  cout << (h + a - 1)/a << endl;
  return 0;
}

Measured memory_bytes: 384
using System;
using System.Collections.Generic;
public class ABC132A {
    public static void Main() {
        int n = 0, nA = 0, nB = 0;
        char cA = '\0', cB = '\0';
        string str = Console.ReadLine();
        cA = str[0];
        n++;
        nA++;
        for (int i = 1; i < 4; i++) {
            if (str[i] != cA) {
                if (n == 1) {
                    cB = str[i];
                    n++;
                    nB++;
                } else {
                    if (str[i] == cB) {
                        nB++;
                    } else {
                        Console.WriteLine("No");
                        return;
                    }
                }
            } else {
                nA++;
            }
        }
        if (n == 2 && nA == 2 && nB == 2) Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define print(x,n) for(int i=0;i<=n;i++)cout<<x[i]<<" "
using namespace std;

// dp[coins][heads]
double dp[3005];

int main() {
	int n;
	cin >> n;
	vector<double> coins(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> coins[i];
	}

	for (int i = 1; i <= n; i++) {
		for (int j = n; j >= 0 ; j--) {
			if (i < j) {
				dp[j] = 0;
			}
			else if (i == 1 && j == 1) {
				dp[j] = coins[i - 1];
			}
			else if (i == 1 && j == 0) {
				dp[j] = (1 - coins[i - 1]);
			}
			else {
				double prev = dp[j];
				dp[j] = 0;
				dp[j] += (prev * (1 - coins[i - 1]));
				dp[j] += (j - 1 >= 0) ? dp[j - 1] * coins[i - 1] : 0;
			}
		}
	}

	double ans = 0;
	for (int i = n / 2 + 1; i <= n; i++) {
		ans += dp[i];
	}

	cout << fixed << setprecision(10) << ans << endl;
	return 0;
}


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

int main() {
  int x1, y1, x2, y2, x3, y3, x4, y4;
  cin >> x1 >> y1 >> x2 >> y2;
  x3 = x2 + y1 - y2;
  x4 = x1 + y1 - y2;
  y3 = y2 + x2 - x1;
  y4 = y1 + x2 - x1;
  cout << x3 << " " <<  y3 << " " << x4 << " " << y4 << endl;
}


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

int main() {

  double d;
  cin >> d;

  if ( d < 1 ) {
    cout << setprecision(12) << d * sqrt(2) << endl;
  }else if ( d <= sqrt(2) ) {
    cout << setprecision(12) << 2.00 << endl;
  }else if ( d < 2 ) {
    cout << setprecision(12) << d * sqrt(2) << endl;
  }else {
    cout << setprecision(12) << max( 3.00, d * sqrt(2) ) << endl;
  }

  return 0;

}

Measured memory_bytes: 1280
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// x ** n % mods を求める
fn mod_pow(x: i64, n: i64, mods: i64) -> i64 {
    if n == 0 {
        return 1;
    }
    let mut res = mod_pow(x * x % mods, n / 2, mods);
    if n % 2 == 1 {
        res = res * x % mods;
    }
    return res;
}

// (1/n) % mods を求める
fn mod_inv(n: i64, mods: i64) -> i64 {
    return mod_pow(n, mods-2, mods);
}

// nCk % mods を求める
fn mod_comb(n: i64, k: i64, mods: i64) -> i64 {
    let sum1 = (n-k+1..n+1).fold(1, |ac, x| ac * x % mods);
    let sum2 = (1..k+1).fold(1, |ac, x| ac * x % mods);
    return sum1 * mod_inv(sum2, mods) % mods;
}

// nCk の組み合わせを列挙する
fn combination(n: usize, k: usize) -> Vec<Vec<usize>> {
    let mut ans = Vec::new();
    if k == 1 {
        for i in 1..n+1 {
            let mut tmp = Vec::new();
            tmp.push(i);
            ans.push(tmp);
        }
    }
    else {
        for iter in combination(n-1, k-1) {
            let max = iter.iter().max().unwrap();
            for j in *max+1..n+1 {
                let mut tmp = iter.clone();
                tmp.push(j);
                ans.push(tmp);
            }
        }
    }
    ans
}


fn main() {
    input!{
        s: chars,
        t: chars,
    }
    for i in 0..s.len() {
        if s[i] != t[i] {
            println!("No");
            return;
        }    
    }
    println!("Yes");
}


Measured memory_bytes: 2104
a,b,c,d = map(int,input().split())
tk = 0
ao = 0
if c % b != 0:
  tk = c//b + 1
else:
  tk = c//b
if a % d != 0:
  ao = a//d + 1
else:
  ao = a//d
if tk <= ao:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9188
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	r := nextInt()

	fmt.Println(r * r)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long int
const ll MOD = 1e9 + 7;
using namespace std;
ll powmod(ll a, ll b, ll MOD = MOD){
    if(!a and !b)	return 1ll;
    if(!a)	return a;
    ll res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)	res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
void panda() {
    long double r;
    cin>>r;

        cout<<setprecision(2)<<fixed<<2*(3.14)*r<<"\n";



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


Measured memory_bytes: 3812
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
const int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }


void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  sort(all(a));
  cout << a[n / 2] - a[n / 2 - 1] << endl;
}


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

namespace _0034
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = "";
            while (!((str = Console.ReadLine()) == null))
            {
                double[] line = str.Split(',').Select(double.Parse).ToArray();
                double railLength = line[0] + line[1] + line[2] + line[3] + line[4] +
                    line[5] + line[6] + line[7] + line[8] + line[9];
                double v1 = line[10];
                double v2 = line[11];
                double s = railLength / (v1+v2);
                double cross = v1 * s;
                double length = 0;
                for (int i = 0; i < 10; ++i)
                {
                    length += line[i];
                    if (length >= cross)
                    {
                        Console.WriteLine(i+1);
                        break;
                    }
                }
            }
        }
    }
}



Measured memory_bytes: 16432
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf  1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)

int p[400002],p2[400002];
int r[400002],r2[400002];

void init(int n){
    for (int i = 0; i < n; ++i) {
        p[i]=i;
        r[i]=0;
    }
}


int find(int x){
	if(x != p[x]){
		p[x] = find(p[x]);
    }
   	return p[x];
}
     
void union_set(int x,int y){
	x = find(x);
	y = find(y);
	if(x==y) return;
	if(r[x] < r[y]){
		p[x] = y;	
	}else{
		p[y] = x;
		if(r[x] == r[y])r[x]++;
	}
	return ;
}

int main(){
	int n,h,w;
	cin >> n >> h >> w;
	init(400000);
	bool flag = 0;
	vector<int>x(n),y(n);
	rep(i,n){
		cin >> x[i] >> y[i];
		if(x[i]==1||x[i]==h||y[i]==1||y[i]==w){
			flag = 1;
		}
	}
	rep(i,n){
		union_set(i,x[i]+100010);
		union_set(i,y[i]+200020);
	}
	set<int> st;
	rep(i,n){
		if(st.count(find(i))==0){
			st.insert(find(i));
		}
	}
	int ans = n-1 + st.size();
	if(flag)ans--;
	if(st.size()==1){
		ans = n-1;	
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7504
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    int n,k;
    cin>>n>>k;
    ll a[n];
    rep(i,n)cin>>a[i];
    ll ans=longinf;
    rep(i,n-k+1){
        if(a[i]*a[i+k-1]<=0)ans=min(ans,a[i+k-1]-a[i]+min(abs(a[i]),abs(a[i+k-1])));
        else ans=min(ans,max(abs(a[i]),abs(a[i+k-1])));
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
// AtCoder Regular Contest 062
// D - AtCoDeerくんと変なじゃんけん / AtCoDeer and Rock-Paper

#include <cstdio>
#include <cstring>
#define MAX_N 100000
using namespace std;


int N;
char s[MAX_N + 2];
int res[2][2] = {
  { 0, -1 },
  { 1, 0 }
};
int ans;

int main() {

  scanf("%s", s);
  N = strlen(s);
  ans = 0;
  for (int i = 0; i < N; i++) {
    ans += res[s[i] == 'p' ? 0 : 1][(i + 1) % 2];
  }
  printf("%d\n", ans);

  return 0;

}




Measured memory_bytes: 256
n, m = map(int, input().split())
AB = [[int(i) for i in input().split()] for i in range(n)]
CD = [[int(i) for i in input().split()] for i in range(m)]

for a, b in AB:
    dist = [abs(a - c) + abs(b - d) for c, d in CD]
    print(dist.index(min(dist)) + 1)

Measured memory_bytes: 3060
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1LL << 60;

int main() {
  //
  string s, t;
  cin >> s;
  cin >> t;
  vvl app(26);
  rep(i, s.size()) { app[s[i] - 'a'].push_back(i); }
  ll ans = -1;
  ll cur = INF;
  rep(i, t.size()) {
    char ch = t[i] - 'a';
    if (app[ch].size() == 0) {
      cout << -1 << endl;
      return 0;
    }
    bool up = false;
    vl::iterator it = upper_bound(ALL(app[ch]), cur);
    if (it == app[ch].end()) {
      ans++;
      cur = app[ch][0];
    } else {
      cur = *it;
    }
    // cout << ans << "," << cur << endl;
  }
  ll result = s.size() * ans + cur + 1;
  cout << result << endl;
  return 0;
}


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

using namespace std;

#define MAX 1000
typedef pair<int, int> pii;

int W, H, N;
int X1[MAX], Y1[MAX], X2[MAX], Y2[MAX];
bool fld[MAX*6][MAX*6];

int compress(int *x1, int *x2, int w)
{
    vector<int> xs;
    for (int i = 0; i < N; i++) {
        for (int d = -1; d <= 1; d++) {
            int tx1 = x1[i] + d, tx2 = x2[i] + d;
            if (0 <= tx1 && tx1 < w) xs.push_back(tx1);
            if (0 <= tx2 && tx2 < w) xs.push_back(tx2);
        }
    }
    sort(xs.begin(), xs.end());
    xs.erase(unique(xs.begin(), xs.end()), xs.end());
    
    for (int i = 0; i < N; i++) {
        x1[i] = lower_bound(xs.begin(), xs.end(), x1[i]) - xs.begin();
        x2[i] = lower_bound(xs.begin(), xs.end(), x2[i]) - xs.begin();
    }
    return xs.size();
}

int solve()
{        
    W = compress(X1, X2, W);
    H = compress(Y1, Y2, H);

    memset(fld, 0, sizeof(fld));
    for (int i = 0; i < N; i++) {
        for (int y = Y1[i]; y < Y2[i]; y++) {
            for (int x = X1[i]; x < X2[i]; x++) {
                fld[y][x] = 1;
            }
        }
    }

    const int dx[] = {-1, 0, 1, 0};
    const int dy[] = {0, -1, 0, 1};
    int res = 0;
    for (int y = 0; y < H; y++) {
        for (int x = 0; x < W; x++) {
            if (fld[y][x]) continue;
            res++; fld[y][x] = 1;
            queue<pii> Q; Q.push(pii(x, y));
            while (!Q.empty()) {
                pii p = Q.front(); Q.pop();
                for (int i = 0; i < 4; i++) {
                    int nx = p.first + dx[i];
                    int ny = p.second + dy[i];
                    if (0 <= nx && nx < W && 0 <= ny && ny < H &&
                        !fld[ny][nx]) {
                        fld[ny][nx] = 1;
                        Q.push(pii(nx, ny));
                    }
                }
            }            
        }
    }
    return res;
}

int main()
{
    while (cin >> W >> H >> N, W) {
        for (int i = 0; i < N; i++) {
            cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
        }
        cout << solve() << endl;
    }
    return 0;
}

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

using namespace std;

#ifdef DGC
#include "debug.h"
#else
#define debug(...) 9715
#endif
typedef long long ll;
typedef long double ld;
typedef complex<double> point;
#define F first
#define S second

ll dp[305][305][305];

int main()
{
	#ifdef DGC
		//freopen("a.in", "r", stdin);
		//freopen("b.out", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n, K;
	cin >> n >> K;
	vector<int> a(n);
	for (auto &i : a) cin >> i;

	memset(dp, 63, sizeof dp);
	a.insert(a.begin(), 0);

	dp[0][0][0] = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j <= i; ++j)
			for (int k = 0; k <= i; ++k)
			{
				dp[i+1][i+1][k] = min(dp[i+1][i+1][k], dp[i][j][k] + a[i+1] - min(a[i+1], a[j]));
				dp[i+1][j][k+1] = min(dp[i+1][j][k+1], dp[i][j][k]);
			}

	ll ans = dp[n][0][K];
	for (int j = 0; j <= n; ++j)
		ans = min(ans, dp[n][j][K]);

	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 221952
from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

  a, b = map(int, input().split())

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()


Measured memory_bytes: 5048
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,-1,0,1};



int main(){
    int n;cin >> n;
    vector<P> hp(n);
    for (int i = 0; i < n; i++) {
        LL h,p;cin >> h >> p;
        hp[i] = mp(h+p,p);
    }
    sort(ALL(hp));
    vector<LL> dp(n+1,LINF);
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j > 0; j--) {
            if(dp[j-1] <= hp[i].fs - hp[i].sc) dp[j] = min(dp[j], dp[j-1] + hp[i].sc); 
        }
    }
    int ans = 0;
    for (int i = 0; i <= n; i++) {
        if(dp[i] != LINF) ans = i;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define lli long long int
#define pb(a) push_back(a)
#define forr(a,n) for(lli i=a;i<n;i++)
#define forrr(j,a,n) for(lli j=a;j<n;j++)
#define all(x) x.begin(),x.end()
#define pi2  1.57079632679489661923

using namespace std;
void print(lli a[],lli n){
forr(0,n){cout<<a[i]<<" ";}
cout<<"\n";
}
lli power(lli x){
lli u=0;
while(x%2==0){
    u++;
    x=x/2;
}
return u;
}

lli powM(lli x,lli y,lli m)
{
    if(m==1){return 0;}
    lli ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
int powm(lli a, lli b) {
	lli res = 1;
	while (b) {
		if (b & 1)
			res = (res * a);
		a = (a * a);
		b >>= 1;
	}
	return res;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n % 2 == 0 || n % 3 == 0)
        return false;

    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;

    return true;
}
/*
vector <lli> adj[100001];
lli vis[100001]={0};
void dfs(lli a){
    vis[a]=1;
    forr(0,adj[a].size()){
    if(vis[adj[a][i]]){continue;}
    else{
        dfs(adj[a][i]);
    }
    }
}
lli level[100001];
void bfs(lli a){
queue <lli> q;
vis[a]=1;
level[a]=0;
q.push(a);
while(!q.empty()){
    lli p=q.front();
    q.pop();
    forr(0,adj[p].size()){
    if(vis[adj[p][i]]==0){
        level[adj[p][i]]=level[p]+1;
        q.push(adj[p][i]);
        vis[adj[p][i]]=1;
    }
    }

}

}

vector <pair<lli,lli> > dj[100001];
lli dist[100001];
vector<lli> ans[100001];
void dijkstra(lli a){
dist[a]=0;
ans[a].pb(a);
multiset<pair<lli,lli> > s;
s.insert({0,a});
while(s.size()!=0){
    lli x=(*s.begin()).second;
    s.erase(s.begin());
    if(vis[x]){continue;}
    vis[x]=1;
    forr(0,dj[x].size()){
    lli e=dj[x][i].first;
    lli we=dj[x][i].second;
    if(dist[x]+we<dist[e]){
        dist[e]=dist[x]+we;
        ans[e].clear();
        ans[e].pb(x);
        s.insert({dist[e],e});
    }
    }
}

}
*/

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
   cout.tie(0);
   //freopen("outpu.txt","w",stdout);
int t1=1;
//cin>>t1;
lli M =1e9+7;
while(t1--){
lli n,k;
cin>>n>>k;
lli a[n];
forr(0,n){cin>>a[i];}
lli p=0;
forr(k,n){
if(a[i]>a[p]){
    cout<<"Yes\n";
}
else{cout<<"No\n";}
p++;
}

}
     return 0;
}


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

int main(){
    int n,m;
    cin >> n >> m;
    vector<string> a(n), b(m);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    for(int i = 0; i < m; i++){
        cin >> b[i];
    }
    string ans = "No";
    for(int i = 0; i <= n - m; i++){
        for(int j = 0; j <= n - m; j++){
            bool f = true;
            for(int k = 0; k < m; k++){
                if(b[k] != a[i + k].substr(j, m)){
                    f = false;
                    break;
                }
            }
            if(f) ans = "Yes";
        }
    }
    cout << ans << endl;
}

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


void solve(long long N){
    if (N % 2 == 0) {
        cout << (float(N)/2)/float(N) << endl;
    } else {
        cout << (float(N+1)/2)/float(N) << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 3824
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
	  Scanner scn = new Scanner(System.in);
	 String a = scn.next();
	 String b = scn.next();
	 int[][]dp = new int[a.length()+1][b.length()+1];
	 for(int i=a.length()-1;i>=0;i--)
	 {
		 for(int j=b.length()-1;j>=0;j--)
		 {
			 if(a.charAt(i)==b.charAt(j))
			 {
				 dp[i][j]=1+dp[i+1][j+1];
			 }else {
				 int o1 = dp[i+1][j];
				 int o2 = dp[i][j+1];
				 dp[i][j]=Math.max(o1, o2);
			 }
		 }
	 }
	 String res="";
	 int i=0,j=0;
	 while(i<a.length()&&j<b.length())
	 {
		 if(a.charAt(i)==b.charAt(j)&&dp[i][j]==dp[i+1][j+1]+1)
		 {
			 res+=a.charAt(i);
			 i++;
			 j++;
		 }else if(dp[i][j]==dp[i+1][j])
		 {
			 i++;
		 }else {
			 j++;
		 }
	 }
	 System.out.println(res);
	 
}
}


Measured memory_bytes: 87096
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;

typedef unsigned long long ull;
const ull M = 1000000007;

//べき乗 x^n mod M
ull power(ull x, ull n){
	ull res = 1;
	if(n > 0){
		res = power(x, n / 2);
		if(n % 2 == 0) res = (res * res) % M;
		else res = (((res * res) % M) * x ) % M;
	}
	return res;
}

//階乗

ull memo[100005];
ull factorial(ull x){
	if(memo[x]) return memo[x];
	ull res = 1;
	range(i,1,x + 1){
		res*= i;
		res%= M;
		memo[i] = res;
	}
	return res;
}

//nCr コンビネーション (1,1)から(w,h)だと、引数は(w - 1, h - 1, M)
ull combination(ull n, ull r){
	if(n < r || n == 0) return 0;
	r = r > n - r ? n - r : r;
	ull a = factorial(n) % M;
	ull b = factorial(r) % M * factorial(n - r) % M;
	return a * power(b, M - 2) % M;
}

//完全順列（a[i] != iとなるような順列）の数を返す
ull derangement(ull n /*長さ*/){
	ull dp[1000000] = {0};
	dp[2] = 1;
	range(i,3,n + 1){
		dp[i] = (i - 1) * (dp[i - 1] + dp[i - 2]);
		dp[i] %= M;
	}
	return dp[n];
}

int main(){
	factorial(100001);

	int n;
	cin >> n;

	vector<pair<int, int>> a;
	rep(i,n + 1){
		int x;
		cin >> x;
		a.emplace_back(make_pair(x,i));
	}
	if(n == 1){
		cout << 1 << endl << 1 << endl;
		return 0;
	}

	sort(all(a));

	int l = -1 ,r = -1;
	rep(i,n){
		//cout << a[i].first << a[i].second << endl;
		//cout << a[i + 1].first << a[i + 1].second << endl;
		if(a[i].first == a[i + 1].first){
			l = min(a[i].second, a[i + 1].second);
			r = max(a[i].second, a[i + 1].second);
			break;
		}
	}
	assert(l >= 0 && r >= 0);
	r = n - r;

	rep(i,n + 1){
		if(i == 0) cout << n << endl;
		else cout << (combination(n + 1,i + 1) - combination(l + r, i) + M) % M << endl;
		//show(combination(n + 1,i + 1))
	}
}


Measured memory_bytes: 2932
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int ans,a[10000000],n;
int main(){
  cin>>n;
  r(i,n)cin>>a[i];
  for(int i=1;i<=n;i++)if(n%i==0){
    int c=0;
    r(j,i)for(int k=j;k<n;k+=i)
      if(a[k]!=a[j])c++;
    if(!c)ans=max(ans,n/i);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3872
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>
//#include<bits/stdc++.h>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,s,n) for(int i=(s);i<(n);++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define REPR(i,s,n) for(int i=(s);i>=(n);--(i))
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
typedef vector<P> vP;
using Edge = pair<int, ll>;
using Graph = vector<vector<Edge> >;
const ll mod = 1e9 + 7;
ll dx[4] = { 1,0,-1,0 };
ll dy[4] = { 0,1,0,-1 };

void printvll(vll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) cout << v[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}
void printvvll(vvll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) {
		rep(j, v[i].size()) {
			cout << v[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void prints(string s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) cout << s[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}

void printvs(vs s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) {
		rep(j, s[i].size()) {
			cout << s[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Yes(bool x) {
	if (x) cout << "Yes\n";
	else cout << "No\n";
}

void YES(bool x) {
	if (x) cout << "YES\n";
	else cout << "NO\n";
}

void yes(bool x) {
	if (x) cout << "yes\n";
	else cout << "no\n";
}

ll  d, n, r, l, k, ans = 0, ret = M;
bool flag = false, flag2 = false;
string s, t;
ll a, b, c;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	/*vll v(5);
	rep(i, 5) {
		cin >> v[i];
		//cout << v[i] << endl;
	}
	cin >> k;
	if (v[4] - v[0] > k) cout << ":(" << endl;
	else cout << "Yey!\n";*/
	vll v(5);
	rep(i, 5) {
		cin >> v[i];
		if (v[i] % 10 != 0) {
			if (ret > v[i] % 10) {
				ret = min(ret, v[i] % 10);
				a = v[i];
				b = i;
			}
		}
	}
	if (ret == M) a = v[0];
	rep(i, 5) {
		if (i == b) continue;
		if(v[i] % 10 != 0) ans += (v[i] / 10 + 1) * 10;
		else ans += v[i];
		//cout << ans << endl;
	}
	//cout << ret << endl;
	cout << ans + a << endl;
	return 0;

}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < n; ++i)
#define RANGE(i, x, n) for(ll i = x; i < n; ++i)
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;

void accelerate()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

int main()
{
    accelerate();
    string s;
    int n;
    cin >> n;
    cin >> s;
    int r = 0, b = 0;
    for(auto x: s) {
        if(x == 'R') ++r;
        else ++b;
    }
    if(r > b) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <iostream>
using namespace std;
int str[100005];
int main()
{
	int a,b,c,i,j,k,n,l,r,l1,r1;
	string s;
	memset(str,0,sizeof(str));
	cin>>s;
	for(i=0;i<s.length();i++)
	{
		if((i==0||s[i-1]=='L')&&s[i]=='R')
		{
			r=i;
		}
		if(s[i]=='R'&&s[i+1]=='L')
			r1=i;
		if(s[i]=='L'&&s[i-1]=='R')
			l1=i;
		if(s[i]=='L'&&(s[i+1]=='R'||i==(s.length()-1)))
			{
				j=0; k=0;
				l=i;
				if((r1-r+1)%2==1)
                {
						j+=(r1-r+1)/2+1;
						k+=(r1-r+1)/2;
                }
  				else
  				{
  					j+=(r1-r+1)/2;
  					k+=(r1-r+1)/2;
  				}
  				if((l-l1+1)%2==1)
  				{
  					k+=(l-l1+1)/2+1;
  					j+=(l-l1+1)/2;
  				}
  				else
  				{
  					j+=(l-l1+1)/2;
  					k+=(l-l1+1)/2;
  				}
  				str[r1]=j;
  				str[l1]=k;
			}
	}

	for(i=0;i<s.length();i++)
		printf("%d ",str[i]);
	printf("\n");

	return 0;


}


Measured memory_bytes: 1024
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
	int i;
	int count=0;
	int max=0;
	char S[10];
	scanf("%s", S);

	char A[10];

	for(i=0;i<10;i++){
		if(S[i]=='A' || S[i]=='T' || S[i]=='G' || S[i]=='C'){
			count++;
			//printf("%d:%d ",i, count);
		}else{
			if(max < count){
				max = count;
				count = 0;
			}
		}
	}

	if(max<count) max = count;
	
	printf("%d", max);

}

Measured memory_bytes: 128