akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for (int i=0, i##_limit=(n); i<i##_limit; ++i)
#define FOR(i, a, b) for (int i=(a), i##_limit=(b); i<i##_limit; ++i)
#define pb push_back
#define mp make_pair
using namespace std;
using ll = long long;
using pi = pair<int, int>;

int main()
{
    int N, M;
    cin >> N >> M;
    int A[M];
    REP(i, M) cin >> A[i];

    ll num[N+1];
    num[0] = 0;
    num[1] = 1;
    num[2] = 2;

    int escape = 0;
    if (escape < M && A[escape] == 1) { num[1] = 0; num[2] = 1; ++escape; }
    if (escape < M && A[escape] == 2) { num[2] = 0; ++escape; }

    FOR(i, 3, N+1)
    {
        if (escape < M && A[escape] == i) { num[i] = 0; ++escape; continue; }

        ll n1 = num[i-1];
        ll n2 = num[i-2];
        num[i] = (n1+n2)%1000000007;
    }

    cout << num[N] << endl;
    return 0;
}

Measured memory_bytes: 1408
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	int N;
	int[] L = {5,7,5,7,7};
	public void solve() {
		while(true){
			N = nextInt();

			if(N == 0)break;

			int[] word = new int[N];
			for(int i = 0;i < N;i++){
				word[i] = next().length();
			}

			int ans = 0;

			for(int i = 0;i < N;i++){
				int j = i;
				int w = 0;
				while(w < L.length){
					int sum = 0;
					while(j < N && word[j] + sum <= L[w]){
						sum += word[j];
						j++;
					}
					if(sum != L[w]){
						break;
					}

					w++;
				}

				if(w == L.length){
					ans = i + 1;
					break;
				}
			}
			out.println(ans);
		}
	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 25236
(defun solve (a b c)
  (if (or (= 2 (count a (list a b c)))
          (= 2 (count b (list a b c)))
          (= 2 (count c (list a b c))))
      "Yes"
      "No"))

#-swank
(let* ((a (read))
       (b (read))
       (c (read)))
  (format t "~A~%" (solve a b c)))


Measured memory_bytes: 10852
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <istream>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <climits>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long LL;

typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define X first
#define Y second

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

	transform(s.begin(), s.end(), s.begin(), [](char c) -> char { return (c - 'A' - 3 + 26) % 26 + 'A'; });

	cout << s << endl;

	return 0;
}

Measured memory_bytes: 1184
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}
#define trace1(x)			 	 cerr<<#x<<": "<<x<<endl
#define trace2(x, y)		 	 cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)		 	 cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)	 	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)	 cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}


int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin >> n;
	ll h[n];
	for(ll i=0; i<n; i++) cin >> h[i];

	vector<ll> dp(n,inf);
	dp[0]=0;
	for(ll i=0; i<n; i++){
		for(ll j=i+1; j<=i+2; j++){
			dp[j]=min(dp[j],dp[i]+abs(h[j]-h[i]));
		}
	}
	cout << dp[n-1];
	return 0;
}
/* The judge is never wrong! Your code is buggy
   Look for:
 * * Read the problem carefully.
 * * Don't forget to sort(), mod, ll!!!!
 * * Initial value = +/- infinity instead of zero!!!
 * * an easier and alternate approach
 * * read the problem statement carefully
 * * if concept is correct and still WA, try with a different implementation
 * * special cases (n=1?)
 * * if you have no idea just guess the appropriate well-known algorithm instead of doing nothing :/
 */


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
class Program{
    public static void Main(){
        int n = int.Parse(Console.ReadLine());
        var num = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToList();
        var temp = new List<int>();
        int q = int.Parse(Console.ReadLine());
        for(int i=0; i<q; i++){
            int[] line = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            temp = num
                .Take(line[0])
                .Concat(num.Skip(line[0]).Take(line[1]-line[0]).Reverse())
                .Concat(num.Skip(line[1]).Take(n-line[1])).ToList();
            Swap(ref num, ref temp);
            temp.Clear();
        }
        Console.WriteLine(string.Join(" ",num));
    }
    public static void Swap<T>(ref T a, ref T b){
        var t = a;
        a = b;
        b = t;
    }
}



Measured memory_bytes: 26560
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let mut t: Vec<i32> = vec![0; n + 1];
    let mut x: Vec<i32> = vec![0; n + 1];
    let mut y: Vec<i32> = vec![0; n + 1];

    t[0] = 0;
    x[0] = 0;
    y[0] = 0;
    for i in 1..n+1 {
        t[i] = read();
        x[i] = read();
        y[i] = read();
    }

    let mut succeeded = true;

    // その場に留まることができないことが考慮に入っていない
    for i in 0..n {
        if (t[i+1] - t[i]) < (x[i+1] - x[i]).abs() + (y[i+1] - y[i]).abs()
            || (t[i+1] - t[i]) % 2 != ((x[i+1] - x[i]).abs() + (y[i+1] - y[i]).abs()) % 2 {
            succeeded = false;
            break;
        }
    }

    println!("{}", if succeeded { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

struct polygonalLine {
	vector<int> x, y;
	int m;
	
	polygonalLine();
	polygonalLine(int _m) : m(_m) { x.assign(_m, 0); y.assign(_m, 0); }
};

void rotate90(polygonalLine& p) {
	int m = p.m;
	for (int i=0; i<m; i++) {
		int _x = p.x[i], _y = p.y[i];
		p.x[i] = -_y;
		p.y[i] = _x;
	}
}

bool isSame(polygonalLine& s, polygonalLine& p) {
	int ms = s.m, mp = p.m;
	if (ms != mp) return false;
	
	int m = ms;
	int sx = s.x[0], sy = s.y[0], px = p.x[0], py = p.y[0];
	int dx = sx - px, dy = sy - py;
	
	bool same1 = true;
	for (int i=1; i<m; i++) {
		sx = s.x[i]; sy = s.y[i]; px = p.x[i]; py = p.y[i];
		int _dx = sx - px, _dy = sy - py;
		if (_dx != dx || _dy != dy) same1 = false;
	}
	
	bool same2 = true;
	sx = s.x[0], sy = s.y[0], px = p.x[m-1], py = p.y[m-1];
	dx = sx - px; dy = sy - py;
	for (int i=m-2; i>=0; i--) {
		sx = s.x[m - i - 1]; sy = s.y[m - i - 1]; px = p.x[i]; py = p.y[i];
		int _dx = sx - px, _dy = sy - py;
		if (_dx != dx || _dy != dy) same2 = false;
	}
	
	return (same1 || same2);
}

bool isSameShape(polygonalLine& s, polygonalLine& p) {
	for (int i=0; i<4; i++) {
		rotate90(p);
		if (isSame(s, p)) return true;
	}
	return false;
}

int main() {
	while (1) {
		int n; cin >> n; if (n == 0) break;
		
		int m;
		cin >> m;
		polygonalLine source(m);
		for (int i=0; i<m; i++) cin >> source.x[i] >> source.y[i];
		
		for (int i=1; i<=n; i++) {
			cin >> m;
			polygonalLine p(m);
			for (int j=0; j<m; j++) cin >> p.x[j] >> p.y[j];
			if (isSameShape(source, p)) cout << i << endl;
		}
		
		cout << "+++++" << endl;		
	}	
	
	return 0;
}

Measured memory_bytes: 1196
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;

int main(void)
{
	int ans = 0, n = 0, tmp = 0, count1 = 0,count2 = 0;
	cin >> n;
	if (n == 1) { cout << 1 << endl; return 0; }
	for (int i = 1; i <= n; i++)
	{
		tmp = i;
		for (;;)
		{
			if (tmp % 2 == 0) { count1++; tmp /= 2; }
			else
			{
				if (count2 < count1) { count2 = count1;  ans = i; }
				count1 = 0;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
/* AOJ 0049
 *
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0049
 *
 */

#include <stdio.h>

#define DEBUG 0


int main(){
    int n, i;
    char input[30];
    int data[4]; /* A, B, AB, O */

    for(i=0;i<4; i++)
        data[i] = 0;

    while(scanf("%d,%s", &n, input)==2){
        if(DEBUG)
            printf("%s\n", input);
        if(input[0] == 'A'){
            if(input[1] == 'B'){
                data[2]++;
            }else{
                data[0]++;
            }
        }else if(input[0] == 'B'){
            data[1]++;
        }else if(input[0] == 'O'){
            data[3]++;
        }
    }
    for(i=0;i<4; i++)
        printf("%d\n", data[i]);
    return 0;
}

Measured memory_bytes: 0
#include<cmath>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<set>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const double pi=4*atan(1.0);
const int N = 1e5+5;
const ll mod = 998244353;

int main()
{
    int a,b,c,d;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    while(1)
    {
        c-=b;
        if(c<=0)
        {
            printf("Yes\n");
            break;
        }
        a-=d;
        if(a<=0)
        {
            printf("No\n");
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 3684
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pll pair<ll,ll>
#define v vector<ll>
#define st stack<ll>
#define pq  priority_queue <int>
#define q queue<ll>
#define mod 1000000005
using namespace std;
 char ch[1000000];
int main(){
    int n;
    cin>>n;
    cout<<n/3<<endl;
    return 0;
   }


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
 
long long int INF = 3e18;
const ll fact_table = 1200008;
double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

// インタラクティブ問題の時はこのdefineを外してください
#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
 
const ll mod = 998244353ll;
// const ll mod = 1000000007ll;
  
ll mypow(ll number1,ll number2, ll mod){
    if(number2 == 0){
        return 1ll;
    }else{
        ll number3 = mypow(number1,number2 / 2, mod);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
/*

ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    assert(n >= r);
    assert(n >= 0);
    assert(r >= 0);
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/
bool multicase = false;

ll n,m,num,a,b,c,d,e,q, ans;
ll x[500005], y[500005], z[500005];;

void solve(){
    cin >> n;
    n %= 10;
    if(n == 3){
        p("bon");
    }else if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9){
        p("hon");
    }else{
        p("pon");
    }
    return;
}

int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
    if(multicase){
        cin >> q;
    }else{
        q = 1; 
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    // solve();
    return 0;
}
















Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  vector<string>vec(H);
  for (int i = 0; i < H; i++) {
    cin >> vec.at(i);
  }
  
  vector<vector<char>> game(H,vector<char> (W) );
  
  for (int i=0; i < H; i++){
  for (int j=0; j < W; j++){
  game.at(i).at(j) = vec.at(i)[j];
  }
  }
  
  vector<int>gyou(0);
  vector<int>retsu(0);
  
  for (int i=0; i < H; i++){
    bool clear = true;
  for (int j=0; j < W; j++){
  if (game.at(i).at(j) == '#'){
  clear = false;
    break;
  }  
  }
    if(clear){
    continue;
    }
    
    gyou.push_back(i);
  }
  
  for (int j=0; j < W; j++){
    bool clear = true;
  for (int i=0; i < H; i++){
  if (game.at(i).at(j) == '#'){
  clear = false;
    break;
  }  
  }
    if(clear){
    continue;
    }
    
    retsu.push_back(j);
  }
  
  int m = gyou.size();
  int n = retsu.size();
  
  for (int i = 0; i < m; i++){
  for (int j = 0; j < n; j++){
  cout << game.at( gyou.at(i) ).at( retsu.at(j) );
  }
    cout << endl;
  }
  
}

Measured memory_bytes: 3612
#include <iostream>

typedef long long ll;

using namespace std;

ll gcd ( ll x, ll y ) {
  while( y != 0 ) {
    ll tmp1;
    tmp1 = ( x % y );
    x = y;
    y = tmp1;
  }

  return x;
}

ll lcd ( ll x, ll y ) {
  ll g = gcd(x,y);
  return x*(y/g);
}


int main()
{
  ll tmp1,tmp2,n;

  cin >> n;
  cin >> tmp1; --n;

  while(n--) {
    cin >> tmp2;
    tmp1 = lcd(tmp1,tmp2);
  }

  cout << tmp1 << "\n";

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
using ll = long long;
int main() {
    ll n;
    cin >> n;
    pair <pair<string,ll>,ll> pr[n];
    for (ll i = 0; i < n; i++) {
        string s;
        ll p;
        cin >> s >> p;
        p *= -1;
        pr[i] = make_pair(make_pair(s, p), i + 1);
    }
    sort(pr, pr + n);
for(auto i:pr){
    cout << i.second << endl;
}
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

int main() {

    int N;
    cin >> N;

    vector<int> A(N);
    for (int i = 0; i < N; i++)cin >> A[i];

    map<int, int> M;
    for (int i = 0; i < N; i++) M[A[i]]++;

    int ans = 0;
    for (auto x: M) if (x.second % 2 == 1) ans++;

    int even = 0;
    for (auto x: M) if (x.second % 2 == 0) even++;

    ans += even;
    if (even % 2) ans--;

    cout << ans << endl;

}
















































Measured memory_bytes: 5376
#include<vector>
#include<iostream>
using namespace std;
#define df 0
#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define MOD 1000000007
typedef long int li;



void make_fact(vector<li>& fact,vector<li>& ifact,int n){
  vector<li> inv(n+1,1);
  fact.resize(n+1,1);
  ifact.resize(n+1,1);
  repa(i,2,n+1){
    fact.at(i)=fact.at(i-1)*i%MOD;
    inv.at(i)=(MOD-(MOD/i))*(inv.at(MOD%i));
    inv.at(i)%=MOD;
    ifact.at(i)=ifact.at(i-1)*inv.at(i)%MOD;
  }
}

void print(vector<li> vec){
  for(li x:vec) printf("%ld ",x);
  printf("\n");
}
void print(vector<int> vec){
  for(int x:vec) printf("%ld ",x);
  printf("\n");
}

int main(){
  if(df) printf("*debug mode*\n");
  int n; cin >>n;
  vector<int> vec(n+1),cnt(n,0);
  for(int& x:vec) {
    cin >>x;
    cnt.at(x-1)++;
  }
  if(df)print(vec);
  if(df)print(cnt);
  int dup;
  for(int i=0;i<n;i++){
    if(cnt.at(i)==2){
      dup=i+1;
      break;
    }
  }
  if(df)printf("dup:%d",dup);
  int pre=0,post=0;
  for(int i=0, flag=0;i<n+1;i++){
    if(flag and vec.at(i)==dup){
      post=vec.size()-i-1;
    }
    if(!flag and vec.at(i)==dup){
      flag=1;
      pre=i;
    }
  }
  if(df)printf(" pre:%d,post:%d\n",pre,post);
  vector<li> fact,ifact;
  make_fact(fact,ifact,n+1);
  if(df){
    print(fact);
    print(ifact);
  }
  auto binom=[&](int n,int k){
	       if(n<0 or k<0 or k>n) return 0;
	       li s=1;
	       s=fact.at(n)*ifact.at(k)%MOD;
	       (s*=ifact.at(n-k))%=MOD;
	       return (int)s;
	     };

  printf("%d\n",n);
  repa(i,1,n+1){
    int k=i+1;
    li s=binom(n+1,k)-binom(pre+post,k-1);
    s%=MOD;
    (s+=MOD)%=MOD;
    cout << s << "\n";
  }
}

/// confirm df==0 ///


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> inline T bis(T ok, T ng, function<bool(T)> f, T eps = 1) { while (abs(ok - ng) > eps) { T mi = (ok + ng) / 2; (f(mi) ? ok : ng) = mi; } return ok; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int ma = 1e9;
  int ans = 0;
  int n;
  cin >> n;
  rep(i, n) {
    int a;
    cin >> a;
    if (ma > a) ans++, ma = a;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#define MX 505

using namespace std;

char r[MX][MX], b[MX][MX];
char str[MX][MX];
int n, m;

int main()
{
	scanf("%d%d", &n, &m);
	for(int i=1; i<=n; i++) scanf("%s", str[i]+1);
	for(int i=1; i<=n; i++)
	{
		if(i&1) for(int j=2; j<m; j++) r[i][j] = '#', b[i][j] = '.';
		else for(int j=2; j<m; j++) b[i][j] = '#', r[i][j] = '.';
		r[i][1] = b[i][m] = '#';
		r[i][m] = b[i][1] = '.';
	}
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			if(str[i][j] == '#')
				r[i][j] = b[i][j] = '#';
	for(int i=1; i<=n; i++) printf("%s\n", r[i]+1);
	putchar('\n');
	for(int i=1; i<=n; i++) printf("%s\n", b[i]+1);
	return 0;
}

Measured memory_bytes: 1536
n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
ans = 0
number = 0

for i in range(n):
  for j in range(i+1, n):
    for k in range(d):
      number += abs(x[i][k]- x[j][k])**2
    number = number**(1/2)
    if number.is_integer():
      ans += 1
    number = 0
print(ans)

Measured memory_bytes: 3064
n,p,i,a[51];main(){for(;~scanf("%d",&n),n;){for(a[n]=p=i=0;i<n;i++)scanf("%d",a+i);for(i=1;i<=n;i++)if(a[i-1]-a[i]+1)printf(i-p-1?(n-i?"%d-%d ":"%d-%d\n"):(n-i?"%d ":"%d\n"),a[p],a[i-1]),p=i;}exit(0);}

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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define maxn 30001
#define int long long int
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

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

int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0) {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

signed main() {
    int N, M, K;
    cin >> N >> M >> K;
    for (int i = 0; i <= N; i++) {
        for (int j = 0; j <= M; j++) {
            if ((i * M + j * N - 2 * (i * j)) == K) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}


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

#define pb push_back
#define mp make_pair
#define inside sl<=l&&r<=sr
#define outside r<sl||sr<l
#define INF 1000000009
using namespace std;
typedef long long ll;

ll dp[102][100005];

int main(){
	//freopen("stl.gir", "r", stdin);
	
	ll n, W;
	cin >> n >> W;
	vector<ll> w(n), v(n);
	for (int i = 0; i < n; i++) cin >> w[i] >> v[i];
	
	// dp[i][j] = ilk i elemanı kullanarak ve en az j değerinde elde etmek
	// için gereken en az yük miktarı
	
	// dp[i][j] = dp[i+1][j];
	// dp[i][j] + w[i] = dp[i+1][j+v[i]];
	
	for (int i = 0; i < n; i++){
		for (int j = 0; j < 100005; j++){
			if (i == 0){
				if (j == 0) dp[i][j] = 0;
				else if (j <= v[i]) dp[i][j] = w[i];
				else dp[i][j] = INF;
			} else {
				dp[i][j] = dp[i-1][j];
				if (j >= v[i]) dp[i][j] = min(dp[i][j], dp[i-1][j-v[i]]+w[i]);
			}
		}
	}
	
	ll ans = 0;
	for (int i = 0; i < 100005; i++){
		if (dp[n-1][i] <= W) ans = i;
	}
	
	cout << ans << endl;
	
}

Measured memory_bytes: 78336
//#include <bits/stdc++.h>
#include <iostream>
#include <climits>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include<math.h>
#include <set>
#include <time.h>
#include <map>
#include <fstream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <numeric>
#include <unordered_map>
using namespace std;
#define sz(a) int((a).size())
#define ll long long
#define pb push_back
#define ld long double
#define mp make_pair
#define vi vector<ll>
#define all(c) (c).begin(),(c).end()
#define allr(c) (c).rbegin(),(c).rend()
#define For(i,n) for(ll i=0;i<n;i++)
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define input(a,n) for(long long i=0;i<n;i++)cin>>a[i]
#define output(a,n) for(long long i=0;i<n;i++)cout<<a[i]<<" "
#define max3(a,b,c) max(max(a,b),c)
#define max4(a,b,c,d) max(max3(a,b,c),d)
#define min3(a,b,c) min(min(a,b),c)
#define min4(a,b,c,d) min(min3(a,b,c),d)
#define     she_taught_me_to_code cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ep 1e-10
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}
ll gcd(ll a,ll b)
{
    if (b == 0)
    return a;
    return gcd(b, a % b);
}
ll lcm(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}
ll pow2(ll n)
{
    ll x=1;
    for(ll i=1;i<=n;i++)
    {
        x*=2;
    }
    return x;
}
#define N 1000000
vector<ll> adj[N];
vector<ll> v(N);
vector<bool> visited(N,0);
void DFSUtil(ll u)
{
    visited[u] = true;
    for (ll i=0; i<adj[u].size(); i++)
    {
        if (visited[adj[u][i]] == false)
        {
            DFSUtil(adj[u][i]);
        }
    }
}
void DFS(ll n)
{
    for (ll u=0; u<n; u++)
    {
        if (visited[u] == false)
        {
            DFSUtil(u);
        }
    }
}
void aE(ll u, ll v)
{
    adj[u].push_back(v);
}
int main()
{
    she_taught_me_to_code


    ll n;
    cin>>n;
    vector<pair<ll,ll> > v(n);
    for(ll i=0;i<n;i++)
    {
        cin>>v[i].first;
    }
    for(ll i=0;i<n;i++)
    {
        cin>>v[i].second;
    }
    ll sum=0,ans=0;
    for(ll i=0;i<n;i++)
    {
        if(v[i].second>v[i].first)
        {
            sum+=(v[i].second-v[i].first);
            ans++;
        }
    }
    vector<ll> k;
    for(ll i=0;i<n;i++)
    {
        if(v[i].first>v[i].second)
        {
            k.pb(v[i].first-v[i].second);
        }
    }
    sort(allr(k));
    for(ll i=0;i<k.size();i++)
    {
        if(sum<=0)
        {
            cout<<ans;
            return 0;
        }
        sum-=k[i];
        ans++;
    }
    if(sum<=0)
    {
        cout<<ans;
    }
    else
    {
        cout<<-1;
    }
}


Measured memory_bytes: 33788
from heapq import heappush, heappop
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N, Q = map(int, input().split())
STX = [[int(x) for x in input().split()] for _ in range(N)]
EVENT = []
for s, t, x in STX:
    EVENT.append((s-x, 1, x))
    EVENT.append((t-x, 0, x))

for i in range(Q):
    d = int(input())
    EVENT.append((d, 2, i))

ans = [-1] * Q

EVENT.sort()


STOP = set()
h = []
for t, op, x in EVENT:
    if op == 2 and STOP:
        while h and h[0] not in STOP:
            heappop(h)
        ans[x] = h[0]
    elif op == 1:
        STOP.add(x)
        heappush(h, x)
    elif op == 0:
        STOP.remove(x)

print("\n".join(map(str, ans)))


Measured memory_bytes: 143672
n, t = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
a.push 0
h = Hash.new(0)
min = a[0]
max = a[0]
a.each do |e|
  max = e if max < e
  if e < min
    h[max - min] += 1
    max = e
    min = e
  end
end
sh = h.sort
puts sh[-1].last


Measured memory_bytes: 8708
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <ctype.h>
#include <cstdlib>
#include <string.h>
#include <cmath>
#include <cstdio>

using namespace std;

int main()
{
	int n, q, cnt = 0, input;;
	vector<int> S, C;

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> input;
		S.push_back(input);
	}

	cin >> q;

	for (int i = 0; i < q; i++)
	{
		cin >> input;
		C.push_back(input);
	}

	sort(S.begin(), S.end());
	S.erase(unique(S.begin(), S.end()), S.end());
	
	for (auto a : C)
	{
		auto itr = find(S.begin(), S.end(), a);
		if (itr != S.end())
			cnt++;
	}

	cout << cnt << endl;
	
}

Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;
#define forr(x,n) for(int x = 0; x < n; ++x)
#define pr pair<int,int>
#define ll long long int
const int mod=1e9+7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int x;
    cin>>x;
    int ans=0;
    int y=x/500;
    ans+=y*1000;
    x%=500;
    y=x/5;
    ans+=y*5;
    cout<<ans;
}


Measured memory_bytes: 256
// AtCoder-Template.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second
#define FOR(i,N) for(auto i=0; i<N; ++i)
#define FORREV(i,N,_cnt) for(auto i=N-1,cnt=_cnt; cnt > 0; --i, --cnt)
#define ALL(x) x.begin(), x.end()

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T& a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T& a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
	ifstream ifs("in.txt");
	cin.rdbuf(ifs.rdbuf());
#endif
  ll x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  auto dx = x2 - x1;
  auto dy = y2 - y1;
  auto x3 = x2 - dy;
  auto y3 = y2 + dx;
  auto x4 = x3 - dx;
  auto y4 = y3 - dy;
  cout << x2 - dy << " " << y2 + dx << " " << x4 << " " << y4 << endl;

	return 0;
}


Measured memory_bytes: 256
from collections import Counter
N, K, L = map(int, input().split())


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
            self.size[x] = 0
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            self.size[y] = 0
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # すべての頂点に対して親を検索する
    def all_find(self):
        for n in range(len(self.par)):
            self.find(n)


UF_road = UnionFind(N)
UF_train = UnionFind(N)
for k in range(K):
    p, q = map(int, input().split())
    p, q = p - 1, q - 1
    UF_road.union(p, q)
for l in range(L):
    r, s = map(int, input().split())
    r, s = r - 1, s - 1
    UF_train.union(r, s)
UF_road.all_find()
UF_train.all_find()


Count = Counter([(pr, pt) for pr, pt in zip(UF_road.par, UF_train.par)])
ans = []
for i in range(N):
    ans.append(Count[(UF_road.par[i], UF_train.par[i])])
print(*ans, sep=' ')


Measured memory_bytes: 56324
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
constexpr int MOD=1000000007;
//constexpr int MOD=998244353;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;

int main(void){
    string S;
    cin >> S;
    cout << S[0] << S[1] << S[2] << endl;
}


Measured memory_bytes: 3608
#include<cstdio>
#include<cstring>
#include<iostream>
#define cri const int
#define ll long long
#define re register
using namespace std;
int N,K,mod;
int f[152][152];
inline int mo(cri x){ return x>=mod?x-mod:x; } 
inline void solve2(){
	f[0][0]=f[1][0]=f[1][1]=f[2][0]=f[2][1]=1;
	K=(K>>1)+1;
	for(int i=3;i<=N;i++){
		for(int j=0;j<K;j++) f[i][0]=mo(f[i][0]+f[i-2][j]);
		for(int j=0;j<K-1;j++) f[i][j+1]=f[i-2][j];
	}
	int tmp1=0,tmp2=0;
	for(int i=0;i<K;i++) tmp1=mo(tmp1+f[N][i]),tmp2=mo(tmp2+f[N-1][i]);
	cout<<1ll*tmp1*tmp2%mod<<endl;
}
int dp[152][152][152];
inline void solve1(){
	dp[0][0][0]=1;
	for(int i=1;i<=N+K>>1;i++){//cout<<"i="<<i<<endl;
		if(i<=K/2) for(int j=0;j<i;j++) dp[i][0][j+1]=dp[i-1][0][j],dp[i][0][0]=mo(dp[i][0][0]+dp[i-1][0][j]);
		else if(i<=N/2){
			for(int j=0;j<=i;j++) 
				for(int k=0;k<i;k++){
					//cout<<j<<" "<<k<<endl;
					dp[i][0][0]=mo(dp[i][0][0]+dp[i-1][j][k]);
					if(j>=2) dp[i][j+1][0]=mo(dp[i][j+1][0]+dp[i-1][j][k]);
					else dp[i][0][0]=mo(dp[i][0][0]+dp[i-1][j][k]);
					dp[i][0][k+1]=mo(dp[i][0][k+1]+dp[i-1][j][k]);
					dp[i][max(j+1,k+2)][k+1]=mo(dp[i][max(j+1,k+2)][k+1]+dp[i-1][j][k]);
				}
		}
		else{
			for(int j=0;j<=i;j++) for(int k=0;k<i;k++) {
				dp[i][0][0]=mo(dp[i][0][0]+dp[i-1][j][k]);
				if(j>=2) dp[i][j+1][0]=mo(dp[i][j+1][0]+dp[i-1][j][k]);
				else dp[i][0][0]=mo(dp[i][0][0]+dp[i-1][j][k]);
			}
		}
		for(int j=K+2;j<=i+1;j++) memset(dp[i][j],0,sizeof dp[i][j]); 
	}
	int ans=0;
	for(int i=0;i<=N;i++)for(int k=0;k<=N;k++) ans=mo(ans+dp[N+K>>1][i][k]);
	cout<<ans<<endl;
}
int main(){
	cin>>N>>K>>mod;
	if(K&1) solve1();
	else solve2();
}

Measured memory_bytes: 8680
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include<cstdio>
#include <vector>
#include<queue>
#include<limits.h>
#include<string.h>
#include<functional>
#include<map>
#include<set>
#include<list>
#include<unordered_map>
#include<queue>
#define int long long
using namespace std;

signed main(){
	int a; cin >> a;
	int b = 0, c = 1;
	for (int d = 0; d < a; d++) {
		int e = b + c;
		b = c;
		c = e;
	}
	cout << c << endl;
}

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

long long ans,n;
void fun(long long x, int san,int wu,int qi)
{
	if(x>n)
		return;

	if(san && wu && qi)
		ans++;
	fun(x*10+3, 1,wu,qi);
	fun(x*10+5, san,1,qi);
	fun(x*10+7, san,wu,1);

}
int main()
{
	ans=0;
	int i,j,k,l,m;
	cin>>n;
	fun(0,0,0,0);
	cout<<ans;

	return 0;
}

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

int main() {
  int N,X,bound=0; cin >> N >> X;
  int D[N+1];
  D[0]=0;
  
  for(int i=0; i<N; i++) {
    int x; cin >> x;
    D[i+1] = D[i] + x;
  }
  for(int i =0; i<= N; i++) if(D[i] <= X) bound++;
  
  cout << bound << endl;
}

Measured memory_bytes: 3628
import math

def plot(x,y):
    print(f"{x:.8f} {y:.8f}")

def koch(n,x1,y1,x2,y2):
    if n==0:
        plot(x1,y1)
        return
    sx=(2*x1+x2)/3
    sy=(2*y1+y2)/3
    tx=(x1+2*x2)/3
    ty=(y1+2*y2)/3
    ux=(tx-sx)*math.cos(math.pi/3)-(ty-sy)*math.sin(math.pi/3)+sx
    uy=(tx-sx)*math.sin(math.pi/3)+(ty-sy)*math.cos(math.pi/3)+sy
    koch(n-1,x1,y1,sx,sy)
    koch(n-1,sx,sy,ux,uy)
    koch(n-1,ux,uy,tx,ty)
    koch(n-1,tx,ty,x2,y2)
    
n=int(input())
koch(n,0,0,100,0)
plot(100,0)


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	string s; cin >> s;
	cout << s.front() << SZ(s) - 2 << s.back() << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int m,fm;
int main()
{
	string a;
	cin>>a;
	for(int i=1;i<=a.size();i++)
	{
		if(a[i-1]=='C')m=1;
		if(a[i-1]=='F'&&m)fm=1;
	}
	if(fm)cout<<"Yes";
	else cout<<"No";
}

Measured memory_bytes: 256
object Main extends App {
  import scala.io.StdIn._
  val Array(p, q) = readLine.trim.split(' ').map(_.toLong)
  val g = gcd(p, q)
  println(
    primeFactors(q / g).foldLeft(1L){case (r, n) ⇒ r * n}
  )
  def primeFactors(num: Long): List[Long] = {
    var n = num
    var res = Nil: List[Long]
    var count = 2
    while (n != 1 && count * count <= num){
      if (n % count == 0){
        res ::= count
        while (n % count == 0){
          n /= count
        }
      }
      count += 1
    }
    if (n == 1) res
    else n::res
  }
  def gcd(a: Long, b: Long): Long = {
    b match {
      case 0 ⇒ a
      case _ ⇒ gcd(b, a % b)
    }
  }
  implicit class ScopeFunc[T](private val value: T) {
    def let[A](func:T ⇒ A): A = func(value)
    def also(func:T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}



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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<int> A(N), B(N + 1);
    B[0] = 1 << 28, B[N] = 1 << 28;
    for (int i = 1; i < N; i++) {
        cin >> B[i];
    }
    int res = 0;
    for (int i = 1; i <= N; i++) {
        res += min(B[i], B[i - 1]);
    }
    cout << res << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <cstring>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <numeric>
#include <stack>

using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);
typedef unordered_map<ll, ll> ump;
typedef pair<ll, ll> P;

ump mp;

int main() {
#ifdef MY_DEBUG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
    while (true) {
        mp = ump();
#pragma clang diagnostic pop
#endif
        ll n;
        cin >> n;
        vector<ll> a(n);
        rep(i, n) cin >> a[i];
        ll ans = 0;
        for (int i = 1; i < n; ++i) {
            if (a[i] == a[i - 1]) ans++, i++;
        }
        cout << ans << endl;


#ifdef MY_DEBUG
    }
#endif
    return 0;
}

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

#define fs first
#define se second
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb emplace_back

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

int main() {
	int n = in();
	vi a;
	rep(i, n) a.pb(in());

	lint s0 = 0, s1 = 0;
	lint c0 = 0, c1 = 0;
	rep(i, n) {
		s0 += a[i];
		s1 += a[i];

		if (i & 1) {
			if (s0 >= 0) {
				c0 += s0 + 1;
				s0 = -1;
			}
			if (s1 <= 0) {
				c1 += -s1 + 1;
				s1 = 1;
			}
		}
		else {
			if (s0 <= 0) {
				c0 += -s0 + 1;
				s0 = 1;
			}
			if (s1 >= 0) {
				c1 += s1 + 1;
				s1 = -1;
			}
		}
	}

	cout << min(c0, c1) << endl;
}


Measured memory_bytes: 892
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};

int main(void){
    string S;
    cin >> S;
    int N=S.length();
    bool ans=true;
    int left=(N-1)/2;
    int right=(N+3)/2;
    rep(i,N) if(S[i]!=S[N-1-i]) ans=false;
    rep(i,left) if(S[i]!=S[left-1-i]) ans=false;
    for(int i=right-1;i<N;i++) if(S[i]!=S[N-1-(i-(right-1))]) ans=false;
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
A, B, C, X = [int(input().rstrip()) for _ in range(4)]
count = 0

for a in range(A+1):
    sum_a = 500 * a
    for b in range(B+1):
        sum_b = 100 * b
        for c in range(C+1):
            sum_c = 50 * c
            total_sum = sum([sum_a, sum_b, sum_c])
            if total_sum == X:
                count += 1

print(count)


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

int adja[101][101];
int stamp1[101], stamp2[101];
int n, cur = 1;

void dfs(int u) {
    stamp1[u] = cur++;
    for (int i = 1; i <= n; ++i) {
        if (adja[u][i] && stamp1[i] == 0)
            dfs(i);
    }
    stamp2[u] = cur++;
}

int main() {
    int u, k, v;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> u >> k;
        while (k--) {
            cin >> v;
            adja[u][v] = 1;
        }
    }
    for (int i = 1; i <= n; ++i) {
        if (stamp1[i] == 0)
            dfs(i);
        cout << i << " " << stamp1[i] << " " << stamp2[i] << endl;
    }

    return 0;
}



Measured memory_bytes: 3124
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val v = Vector.fill(n)(sc.nextInt)
    val c = Vector.fill(n)(sc.nextInt)

    val answer = v.zip(c).filter(x => x._1 > x._2)
      .map(x => x._1 - x._2)
      .sum

    println(answer)
  }
}


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

// Define
using ll = int64_t;
using ul = uint64_t;
using ld = long double;
using pii = pair<int, int>;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ul MAX = ULONG_MAX;
const char nl = '\n';

#define elif else if
#define def inline auto
#define run __attribute__((constructor)) def _

// Debug
#define debug(x) cerr << (x) << " (L:" << __LINE__ << ")" << '\n'

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i < _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i > _##i; --i)
#define rep(i, n) inc(i, 0, n)
#define be(c) begin(c), end(c)

// Stream
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("-O3")
#pragma GCC target("avx")

signed main(){
    map<int, int> path;
    rep(i, 3) {
        int a, b;
        cin >> a >> b;
        path[a]++;
        path[b]++;
    }
    bool ans = true;
    for(auto& p: path) {
        if(p.second > 2)
            ans = false;
    }
    cout << (ans ? "YES" : "NO") << nl;
}


Measured memory_bytes: 256
import math
a,b,h,m = map(int, input().split())
thetah = h * 30 + m * 0.5
thetam = m * 6
#print(thetah, thetam)
#thetah = 90 - thetah
#thetam = 90 - thetam
radh = math.radians(thetah)
radm = math.radians(thetam)
#print(thetah, thetam)
x1, y1 = a * math.sin(radh), a * math.cos(radh)
x2, y2 = b * math.sin(radm), b * math.cos(radm)
#print(x1, y1, x2, y2)
print(math.sqrt( (x1-x2)**2 + (y1-y2) ** 2))


Measured memory_bytes: 9568