akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll = long long;

int main(){
  int k; cin >> k;

  vector<vector<int>> v(10,vector<int>(10, 1));
  for(int i = 1; i < 10; i++){
    for(int j = 0; j < 10; j++){
      if(j == 0){v[i][j] = v[i-1][j] + v[i-1][j+1];}
      else if(j == 9){v[i][j] = v[i-1][j] + v[i-1][j-1];}
      else{v[i][j] = v[i-1][j] + v[i-1][j+1] + v[i-1][j-1];}
    }
  }
  
  string s;
  int sum = 0;
  int memo;
    bool f = false;
    for(int i = 0; i < 10; i++){
      for(int j = 1; j < 10; j++){
        sum += v[i][j];
        if(sum >= k){s.push_back(j+48); 
        memo = i-1; f = true; k -= sum - v[i][j]; break;
        }
      }
      if(f){break;}
    }

  while(memo >= 0){
    if(s[s.size()-1] == '0'){
      k -= v[memo][0];
      if(k <= 0){s.push_back('0'); k += v[memo][0]; memo--; continue;}
      k -= v[memo][1];
      if(k <= 0){s.push_back('1'); k += v[memo][1]; memo--; continue;}
    }

    if(s[s.size()-1] == 9){
      k -= v[memo][8];
      if(k <= 0){s.push_back('8'); k += v[memo][8]; memo--; continue;}
      k -= v[memo][9];
      if(k <= 0){s.push_back('9'); k += v[memo][9]; memo--; continue;}
    }

    else{
      int num = s[s.size()-1] - 48;
      k -= v[memo][num-1];
      if(k <= 0){s.push_back(num-1 + 48); k += v[memo][num-1]; memo--; continue; }
      k -= v[memo][num];
      if(k <= 0){s.push_back(num +48); k += v[memo][num]; memo--; continue; }
      k -= v[memo][num+1];
      if(k <= 0){s.push_back(num+1 +48); k += v[memo][num+1]; memo--; continue; }
    }

  }
  cout << s << endl;
}   

Measured memory_bytes: 256
import math
x = 0
y = 0
r = 90
while True:
    d,t=map(int, input().split(','))
    if d==0 and t==0:
        print(int(x),int(y),sep='\n')
        exit()
    x += math.cos(math.radians(r)) * d
    y += math.sin(math.radians(r)) * d
    r -= t

Measured memory_bytes: 7920
#include <bits/stdc++.h>
//登録しよう！→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
const string YES = "Yes";
const string NO = "No";

void solve(long long A, long long B, long long C){
  cout << (A==B && B==C && C==A ? "Yes" : "No") << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    solve(A, B, C);
}


Measured memory_bytes: 768
package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

const (
	BUFSIZE   = 10000000
	MOD       = 1000000007
	INF_INT   = math.MaxInt32
	INF_INT64 = math.MaxInt64
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
	var N, M int
	fmt.Scanf("%d %d", &N, &M)
	A := readIntSlice(N)
	h := &IntHeap{}
	for _, a := range A {
		heap.Push(h, -a)
	}

	for i := 0; i < M; i++ {
		item := heap.Pop(h)
		heap.Push(h, item.(int)/2)
	}

	ans := 0
	for h.Len() != 0 {
		ans -= heap.Pop(h).(int)
	}
	fmt.Println(ans)
}

func readline() string {
	buf := make([]byte, 0, BUFSIZE)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readIntSlice(size int) []int {
	slice := make([]int, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i(v)
	}
	return slice
}

func readInt64Slice(size int) []int64 {
	slice := make([]int64, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i64(v)
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint64() int64 {
	return s2i64(readline())
}

// For int64
func b2i64(b bool) int64 {
	if b {
		return 1
	}
	return 0
}

func abs64(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func min64(values ...int64) int64 {
	ret := int64(INF_INT64)
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max64(values ...int64) int64 {
	ret := -int64(INF_INT64)
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i64(s string) int64 {
	v, ok := strconv.ParseInt(s, 10, 64)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int64")
	}
	return v
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func min(values ...int) int {
	ret := INF_INT
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INF_INT
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }


Measured memory_bytes: 16304
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#define  go return 0
#define pb push_back
#include<utility>
#include <algorithm>
#include<iterator>
typedef long long ll;
typedef double db;
#define lp1(i, n)  for(int i=0; i<(int)(n); ++i)
#define lp2(i, n)  for(int i=1; i<=(int)(n); ++i)
#define lp3(j, m)  for(int j=0; j<(int)(m); ++j)
#define all(v)   ((v).begin()), ((v).end())
#define sz(v)    ( (int)((v).size()) )
typedef vector<int> vi;
const int N=1e5+5;
int arr[N];
int main(){

int n;
cin>>n;
 for(int i=1 ; i<=9 ; i++)
 {
     for(int j=1 ; j<=9 ; j++)
     if(i*j==n)
     {
         cout<<"Yes";
         go;
     }
 }
cout<<"No";
go;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[3];
        for(int i = 0; i < 3; i++)
        	nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int cost = 0;
        for(int i = 1; i < 3; i++)
        	cost += nums[i] - nums[i - 1];

        System.out.println(cost);
    }
}


Measured memory_bytes: 23252
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <functional>
using namespace std;

int main() {
 int A,B;
  cin >> A >> B;
  if (A>12) cout << B << endl;
  else if (A>5) cout << B/2 << endl;
  else cout << 0 << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define N 10000

int main(){
  int i,j,n,a,flag=0,count=0;
  int array[N];
  int limit=0;

  scanf("%d",&n);
  for(i=0;i<=n-1;i++){
    scanf("%d",&array[i]);
    limit=sqrt(array[i]);
    if(array[i]==2) count++; 
    if(array[i]<2 || array[i]%2==0) continue;
    for(j=3;j<=limit;j+=2){
      if(array[i]%j==0){ flag=1; break; }
    }
    if(flag==0) count++;
    flag=0;
  }   
  printf("%d\n",count);
  return 0;
}



Measured memory_bytes: 2040
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    string s;
    cin >> n;
    cin >> s;
        int flag=0;
    if(n&1){
        cout << "No";
        return 0;
    }
    else{
        for(int i=0; i<n/2; i++){
            if(s[i]!=s[i+n/2]){
                flag=1;
            }
        }
        if(flag){
            cout << "No";
        }
        else
            cout << "Yes";
    }


}


Measured memory_bytes: 256
/*
AizuOnline A0009
Prime Number
*/
#include <stdio.h>


int primes[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,
	      101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,
	      211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,
	      307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,
	      401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,
	      503,509,521,523,541,547,557,563,569,571,577,587,593,599,
	      601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,
	      701,709,719,727,733,739,743,751,757,761,769,773,787,797,
	      809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,
	      907,911,919,929,937,941,947,953,967,971,977,983,991,997};


main()
{
  int cnt;
  long limit;
  long i,j;

  while(EOF != scanf("%ld",&limit) && limit)
    {
      if(limit==1)
	{
	  cnt = 0;
	  printf("0\n");
	  continue;
	}
      cnt = 0;
      for(i=3;i<=limit;i+=2)
	{
	  for(j=1;j<sizeof(primes)/sizeof(primes[0]);j++)
	    {
	      if((i % primes[j])==0 && (i != primes[j]))
		goto NEXT;
	    }
        PRIME:
	  /* printf("%ld:",i);*/
	  cnt++;
	NEXT:
	  ;
	}

  printf("%d\n",cnt+1);
    }
return(0);
}

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

int n;
vector<int> v;
bool ch[1005] = {0};

int solve();

int main() {
  cin >> n;
  v.resize(n);
  for(int i = 0; i < n; ++i) cin >> v[i];
  cout << solve() << endl;
  return 0;
}

int solve() {
  for(int i = 0; i < n; ++i) {
    ch[v[i]] = 1;
    if(i != 0) ch[v[i] + v[i - 1] * 10] = 1;
    if(i > 1) ch[v[i] + v[i - 1] * 10 + v[i - 2] * 100] = 1;
  }
  for(int i = 0; i < 1000; ++i)
    if(!ch[i]) return i;
  assert(0);
}


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

int main() {
  int N;
  cin >> N;
  int cou = 0;
  for (int i = 0; i < N; i++) {
    int A, B;
    cin >> A >> B;
    if (A == B) {
      cou++;
    }
    else {
      cou = 0;
    }
    if (cou >= 3) {
      break;
    }
  }
  if (cou >= 3) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3620
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
    r = i * R
    for j in range(N // G + 1):
        g = j * G
        rest = N - (r + g)
        if rest >=  0 and rest % B == 0:
            ans += 1

print(ans)



Measured memory_bytes: 40812
#include <iostream>
using namespace std;
int main()
{
    int x = 0;
    for(int a = 0; a < 10000; a++){
        cin >> x;
        cout << "Case " << a + 1 << ": " << x << endl;
        if(x == 0) break;
    }
    return 0;
}


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

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    for (int i = 0; i < h; i++) {
        cin >> a[i];
    }

    for (int i = 0; i < h - 1; i++) {
        for (int j = 0; j < w - 1; j++) {
            if (a[i][j+1] == '#' && a[i+1][j] == '#') {
                cout << "Impossible" << endl;
                return 0;

            }
        }
    }
    cout << "Possible" << endl; 
}


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


void solve(){
    int a,b,c;
    int k;
    cin >> a >> b >> c;
    cin >> k;
    rep(i,k){
        if(a>=b&&a>=c) a = a*2;
        else if(b>=c) b = b*2;
        else c = c*2;
    }
    cout << a+b+c << endl;
}

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


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

//#[allow(unused_must_use)]
//#[allow(unused_variables)]
//#[allow(unused_mut)]
fn main() {
    input!{
        n: usize,
        d: [usize; n]
    }
    //let n: usize = 4;
    //let d: Vec<usize> = vec!(5, 6, 6, 8);
    let mut num = [0; 110];
    for i in 0..n {
        num[d[i]] = num[d[i]] + 1;
    }
    let mut res: i32 = 0;
    for i in 0..110 {
        if num[i] > 0 {
            res = res + 1;
        }
    }
    println!("{}", res);
}

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

using namespace std;

int main()
{
  int n, result;
  cin >> n;
  if(n < 10)
  {
    result =  n;
  }
  else if(n >= 10 && n < 100)
  {
    result =  9;
  }
  else if(n >= 100 && n < 1000)
  {
    result =  9 + (n - 100 + 1);
  }
  else if(n >= 1000 && n < 10000)
  {
    result =  909;
  }
  else if(n >= 10000 && n < 100000)
  {
    result =  909 + (n - 10000 + 1);
  }
  else
    result =  90909;
  
  cout << result << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>

using namespace std;

int main()
{
	int x, y, z;
	cin >> x >> y >> z;
	cout << (x - z) / (y + z) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <limits>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
#define fi(i,n) for( ll i=0 ; i<n ; i++ )
#define f(i, a, b) for( ll i=a ; i<b ; i++ )
#define vi vector<int>
#define pb push_back
#define MOD 1000000007
ll n,m,k;
ll digits(ll n)
{
    return floor(log10(double(n))) + 1;
}
ll SieveOfEratosthenes(ll n)
{
    vector<bool>prime(n+1);
    int ans = 0;
    for(int i =0; i<=n; i++)
        prime[i] = true;
    prime[1] = false;
    for (ll p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (ll i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for(int i = 2; i<=n; i++)
    {
        if(prime[i])
        {
            ans++;
        }
    }
    return ans;
}
void permute(string a, int l, int r)
{
    if (l == r)
    {
        cout<<a<<endl;
    }
    else
    {
        for (int i = l; i <= r; i++)
        {
            swap(a[l], a[i]);
            permute(a, l+1, r);
        }
    }
}
ll modularExponentiation(ll x,ll n,ll M)
{
    ll result = 1;
    ll ans = 1;

    while(n>0)
    {
        if(n % 2 ==1)
        {
            result = (result*x)%MOD;
            ans = (ans + result)%MOD;
        }
        n = n/2;
        if(n>0)
        {

            x = x*x;
        }
    }
    return ans;
}
int d, x, y;
void extendedEuclid(int A, int B)
{
    // for computing modular inverse
    // make b as Mod such that gcd of mod and a is 1
    // also the coeff x here will denote the modular inverse of a
    if(B == 0)
    {
        d = A;
        x = 1;
        y = 0;
    }
    else
    {
        extendedEuclid(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
        // x = y1
        // y = x1 - y1*(a/b);
    }
}
ll fact(ll n)
{
    ll ans = 1;
    for(ll i = 1; i<=n; i++)
        ans = (ans%MOD * i%MOD)%MOD;
    return ans%MOD;
}
ll maxpower(ll n,ll k)
{
    ll count = 0;
    while(n>0)
    {
        n = n/k;
        if(n>0)
            count++;
    }
    return count;
}
ll countpillow(ll x, ll y)
{
    ll nums ;
    if(y > x - 1)
    {
        nums = x*(x  - 1)/2;
    }
    else
    {
        nums = x*y - y*(y + 1)/2;
    }
    return nums;
}
bool check(ll x)
{
    ll nums = countpillow(x, k - 1) + countpillow(x, n - k) + x;
    if(nums <= m - n)
        return true;
    return false;
}

int32_t main()
{
    string s = "ACL";
    string ans = "";
    int n;
    cin>>n;
    fi(i,n)
    {
        ans += s;
    }
    cout<<ans;
}
// (n - k)*x - (n - k)*(n - k + 1)/2;


Measured memory_bytes: 3544
#include <iostream>
#include <vector>
using namespace std;
 
const int mod = 1e+9 + 7;

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

    long long res = 0;
    for(int d = 0; d < 60; ++d){
        long long n0 = 0, n1 = 0;
        for(int i = 0; i < N; ++i){
            if((A[i] >> d) & 1) ++n1;   // d 桁目が 1
            else    ++n0;               // d 桁目が 0
        }
        long long tmp = (1ll << d) % mod;   // 2^d
        // B の要素 (xor 演算を施した数) で d 桁目が 1 である個数
        long long n = n0 * n1 % mod;
        // B の要素 (xor 演算を施した数) の d 桁目の総和 (= 2^d * n0 * n1)
        tmp = tmp * n % mod;
        res = (res + tmp) % mod;
    }
    cout << res << endl;
}

Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits.h>
#include <climits>
#include <map>
#include <unordered_map>
#define _USE_MATH_DEFINES
#include <cmath>
#include <set>
#include <unordered_set>
#include <iterator>
#include <deque>
#include <assert.h>
#include <cstdlib>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
ull min(ull x, ull y){ if (x<y) return x; return y;}
ull max(ull x, ull y){ if (x<y) return y; return x;}
ll min(ll x, ll y){ if (x<y) return x; return y;}
ll max(ll x, ll y){ if (x<y) return y; return x;}
double min(double x, double y){ if (x<y) return x; return y;}
double max(double x, double y){ if (x<y) return y; return x;}
ull gcd(ull x, ull y){
    if (!x) return y;
    if (!y) return x;
    if (x>y) swap(x,y);
    return gcd(x, y%x);
}
ull inv(ull a, ull c){ // a,c are coprime and a<c
    if (a==1){
        return 1;
    }
    return ((c-(c/a))*inv(c%a,c))%c;
}

ll n, m, k, M = 998244353, fact[200005] = {0}, ifact[200005] = {0}, mp[200005] = {0}, ans = 0;
ll mul(ll a, ll b){
    return (a*b)%M;
}
void add(ll &a, ll b){
    a+=b;
    if (a>=M) a-=M;
}
ll nCr(ll n, ll r){
    return mul(fact[n],mul(ifact[n-r],ifact[r]));
}

int main(){
 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    cin>>n>>m>>k;
    fact[0] = 1;
    ifact[0] = 1;
    for (int i = 1; i <= n; i++){
        fact[i] = mul(fact[i-1],(ll)i);
        ifact[i] = mul(ifact[i-1],inv(i,M));
    }
    mp[0] = 1;
    for (int i = 1; i <= n; i++){
        mp[i] = mul(mp[i-1],m-1);
    }
    for (int p = n - k; p <= n; p++){
        add(ans, mul(nCr(n-1,p-1),mul(m,mp[p-1])));
    }
    cout<<ans<<"\n";
    return 0;
}
 

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

int main(){
  vector<char> c(9);
  for(int i=0;i<9;i++){
    cin>>c.at(i);
  }
  cout<<c.at(0)<<c.at(4)<<c.at(8)<<endl;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
using ll = long long;

int main(){
  string s;
  cin>>s;
  rep(i,s.size())if(i%2==0)cout<<s.at(i);
  cout<<endl;
  return 0;
}

Measured memory_bytes: 512
N, M = map(int, input().split())

def step(step_num, n, path, reachable):
    reachable[n] = 1
    step_num += 1

    if step_num > 2:
        return
    if not n in path:
        return

    for b in path[n]:
        if reachable[b]:
            continue
        step(step_num, b, path, reachable)

path = {}
for i in range(M):
    a, b = map(int, input().split())
    if a in path:
        path[a].append(b)
    else:
        path[a] = [b]

reachable = [0] * (N + 1)
step(0, 1, path, reachable)

if reachable[N] == 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Measured memory_bytes: 32312
n, x = gets.chomp.split(" ").map(&:to_i)
array = gets.chomp.split(" ").map(&:to_i)
sum = 0
answer = 0

array.each_with_index do |number, idx|
  sum += number

  if sum > x
    answer = idx + 1
    break
  end
end

answer = n + 1 if answer == 0

puts answer


Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	string S; cin >> S;
	bool ok = false;

	if (S[0] == 'A'){
		int n = (int)S.length();
		int c = 0;
		int cind = -1;
		for (int i = 2; i < n - 1; ++i){
			if (S[i] == 'C'){
				if (cind == -1){
					cind = i;
				} // end if
				++c;
			} // end if
		} // end for
		if (c == 1){
			ok = true;
			for (int i = 1; i < n; ++i){
				if (i == cind) continue;
				if (S[i] >= 'a' && S[i] <= 'z') continue;
				ok = false;
				break;
			} // end for
		} // end if
	} // end if

	cout << (ok ? "AC" : "WA") << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int n;
int dp[30];
int main(){
    dp[0]=1;
    dp[1]=2;
    dp[2]=4;
    for(int i=3;i<30;i++){
        dp[i]=dp[i-3]+dp[i-2]+dp[i-1];
    }
    while(1){
        scanf("%d",&n);
        if(n==0) return 0;
        printf("%d\n",(int)((dp[n-1]+9)/10+364)/365);
    }
}

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

using namespace std;

int main(){
    int A, B, C, D;
    cin >> A >> B  >> C >> D;

    vector<int> time(110, 0);


    for (int i=A; i<=B; i++)
        time[i] += 1;

    for (int i=C; i<=D; i++)
        time[i] += 1;


    int T;
    T = count(time.begin(), time.end(), 2);


    if (T==1 || T==0)
        T = 0;

    else
        T = T - 1;


    cout << T << endl;
}

Measured memory_bytes: 764
#include <iostream>
#include <sstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<string> vs;
#define sz(a) int((a).size()) 
#define pb push_back 
#define all(c) (c).begin(),(c).end() 
#define rep(i, n) for(int i = 0; i < n; ++i) 
#define foreach(it, c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) 

#define TRACE(x...) x
#define watch(x) TRACE(cout << #x" = " << x << endl)
#define watcharr(i, x) TRACE(cout << #x" = "); rep(i, sz(x)) cout << x[i] << " "; cout << endl

int main() {
	
	int n;
	cin >> n;
	
	set<string> s;
	string s1;
	rep(i, n) cin >> s1, s.insert(s1);
	
	cout << sz(s) << endl;
	
	return 0;
	
}



Measured memory_bytes: 19248
#include<bits/stdc++.h>
using namespace std;
class activity{
  public:
  int a,b,c;
};
int solve(vector<activity> v,int n){
    int dp[n+1][3];
    dp[1][0]=v[0].a;
    dp[1][1]=v[0].b;
    dp[1][2]=v[0].c;
    for(int i=2;i<=n;i++){
        dp[i][0]=v[i-1].a+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=v[i-1].b+max(dp[i-1][2],dp[i-1][0]);
        dp[i][2]=v[i-1].c+max(dp[i-1][1],dp[i-1][0]);
    }
    return max(dp[n][0],max(dp[n][1],dp[n][2]));
}
int main(){
  int n;
  cin>>n;
  vector<activity> v(n);
  for(int i=0;i<n;i++){
    cin>>v[i].a;
    cin>>v[i].b;
    cin>>v[i].c;
  }
  cout<<solve(v,n)<<endl;
}
  

Measured memory_bytes: 3712
#include <iostream>
#include <cstring>

using namespace std;

int main(void)
{
    int n, verdict[4] = {0};
    string str;

    cin >> n;

    while(n--)
    {
        cin >> str;
        if(str == "AC")
            verdict[0]++;
        else if(str == "WA")
            verdict[1]++;
        else if(str == "TLE")
            verdict[2]++;
        else
            verdict[3]++;
    }

    cout << "AC x " << verdict[0] << "\nWA x " << verdict[1] << "\nTLE x " << verdict[2] << "\nRE x " << verdict[3] << "\n";

    return 0;
}


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


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=1000;
    rep(y,1,P){
        ll x=mod(y*k);
        if(x+P>=i_7){
            x-=i_7;
        }
        if(abs(x)<=P){
            cout<<x<<"/"<<y<<endl;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
//////////////////////////

#define N 1000005
ll c[N];
int main(){fastio
    
    ll n;cin>>n;
    rep(i,1,n){
        ll a;cin>>a;
        c[a]++;
    }
    ll ans=0;
    rep(i,1,N-1){
        if(c[i]>=1){
            for(ll j=i*2;j<=N-1;j+=i){
                c[j]=0;
            }
            if(c[i]==1)ans++;
        }
    }
    cout<<ans;
    
    return 0;
}


Measured memory_bytes: 11460
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
#define sz(x) (ll)x.size()
#define lnt(s) (ll)s.length()
#define mt(cnt) cnt.empty()
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> osSet;

using pll = pair<ll, ll>;
using pl = pair<ll, pll>;
using tll = tuple<ll, ll, ll>;

const ll maxN = 1e5;
const ll INF = 1e17;
const ll MOD = 1e9 + 7;

ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1};
ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1};

ll segtree[maxN << 2];
ll lazy[maxN << 2];
ll A[maxN];

inline ll left(ll x){
	return x << 1;
}

inline ll right(ll x){
	return (x<<1) + 1;
}

ll func(ll x){
	return (x*(x+1))/2;
}

ll _pow(ll b, ll p){
	if(p == 0) return 1;
	if(p == 1) return b;
	ll exB = b*b;
	if(p&1) return b*_pow(exB, p/2);
	return _pow(exB, p/2);
}

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	string st;
	cin >> st;
	bool ns = true;
	for(ll i=lnt(st); i>0;){
		if(st.substr(i-5,5) == "dream" or st.substr(i-5,5) == "erase")
			i -= 5;
		else if(st.substr(i-6,6) == "eraser")
			i -= 6;
		else if(st.substr(i-7,7) == "dreamer")
			i -= 7;
		else{
			ns = 0;
			break;
		}
	}
	cout << (ns ? "YES" : "NO");
	return 0;
}

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

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n{0};
	cin>>n;
	cin.ignore();
	string str1="";
	string str2="";
	cin>>str1;
	cin>>str2;
	string str3="";
	for(int i=0;i<n;++i)
	{
		str3+=str1[i];
		str3+=str2[i];
	}
	cout<<str3<<"\n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n) / gcd(n, m)*abs(m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;

void func(int n){
  set<int>st;
  st.emplace(2);st.emplace(3);
  int num=4;
  while(st.size()<n-1){
      if((num%2==0)||(num%3==0))st.emplace(num),++num;
      else ++num;
  }
  ll sum=0;
  for(auto x:st){
    sum+=x;
  }
  while(1){
    ++num;
    if(gcd(sum,num)!=1){
      if((num%2==sum%2)&&(num%3==(3-sum%3)%3)){
        st.emplace(num);
        break;
     }
    }
  }
  for(auto x:st){
    cout<<x<<" ";
  }
  cout<<endl;
}

void solve(){
  int n;
  cin>>n;
  set<int>st;
  st.emplace(2);st.emplace(3);st.emplace(5);
  if(n==3){
    cout<<2<<" "<<3<<" "<<25;
    return;
  }
  int num=4;
  while(st.size()<n-1){
      if((num%2==0)||(num%3==0)||(num%5==0))st.emplace(num),++num;
      else ++num;
  }
  ll sum=0;
  for(auto x:st){
    sum+=x;
  }
  while(1){
    ++num;
    if(gcd(sum,num)!=1){
      if((num%2==sum%2)&&(num%3==(3-sum%3)%3)&&(num%5==(5-sum%5)%5)){
        st.emplace(num);
        break;
     }
    }
    if(num>30000){
      func(n);
      return;
    }
  }
  for(auto x:st){
    cout<<x<<" ";
  }
  cout<<endl;
}

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


Measured memory_bytes: 2304
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int main()
{
	ios_base::sync_with_stdio(0);
	int N, Q;
	while (cin >> N >> Q, N ){
		map<int,int> date; date.clear();
		rep (i, N ){
			int M; cin >> M;
			rep (j, M ){
				int d; cin >> d;
				date[d]++;
			} // end rep
		} // end rep

		int maxq = 0, max_id = 0;
		map<int,int>::iterator it = date.begin();
		for (; it != date.end(); it++ ){
			int d = (*it).first;
			int c = (*it).second;
			if (c >= Q ){
				if (c > maxq ){
					maxq = c;
					max_id = d;
				} // end if
			} // end if
		} // end for
		cout << max_id << endl;
	} // end while
	
	return 0;
}

Measured memory_bytes: 1208
import Control.Applicative ((<$>))
import Data.List       (foldl')

type Dice    = [(Int, Int)]
type Command = Char

fromList :: [Int] -> Dice
fromList [a, b, c, d, e, f] = [(a, f), (b, e), (c, d)]
fromList _ = error "Invalid dice."

rev :: (a,a) -> (a,a)
rev (x,y) = (y,x)

roll :: Dice -> Command -> Dice
roll [a, b, c] com =
    case com of
        'N' -> [b, rev a, c]
        'E' -> [rev c, b, a]
        'S' -> [rev b, a, c]
        'W' -> [c, b, rev a]
        _   -> error "Invalid command."
roll _ _ = error "Invalid command."

top :: Dice -> Int
top [(a,_),(_,_),(_,_)] = a
top _ = error "Invalid dice."

main :: IO ()
main = do
    dice <- (fromList . map read . words) <$> getLine
    print . top . foldl' roll dice =<< getLine

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

#if defined(DEBUG)

#include <unistd.h>
#include <sys/fcntl.h>
#define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
#define DCALL(func, ...) func(__VA_ARGS__)

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#else  // defined(DEBUG)

#define DLOG(...)
#define DCALL(func, ...)

#endif // defined(DEBUG)
// ----------------------------------------------------------------------

// ----------------------------------------------------------------------
int main(int argc, char *argv[]) {
#if defined(DEBUG)
  // GDB on Cygwin ignores redirection at run command.
  if (argc == 2) dup2(open(argv[1], 0), 0);
#else
  // For performance.  We should not use C-style stdio functions
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cout << setprecision(20);

  int N, M; cin >> N >> M;
  vector<vector<int>> nxt(N);
  for (int i = 0; i < M; i++) {
    int s, t; cin >> s >> t; s--; t--;
    nxt.at(s).push_back(t);
  }
  vector<double> orig(N);
  for (int i = N-2; i >= 0; i--) {
    double s = 0;
    for (int j : nxt.at(i)) s += 1.0 + orig.at(j);
    orig.at(i) = s / nxt.at(i).size();
  }
  double answer = orig.at(0);
  for (int k = 0; k < N-1; k++) {
    int br = nxt.at(k).size();
    if (br <= 1) continue;
    vector<double> alter = orig;
    double m = -100.0;
    for (int j : nxt.at(k)) m = max(m, 1.0 + orig.at(j));
    alter.at(k) = (orig.at(k) * br - m) / (br - 1);
    for (int i = k-1; i >= 0; i--) {
      double s = 0;
      for (int j : nxt.at(i)) s += 1.0 + alter.at(j);
      alter.at(i) = s / nxt.at(i).size();
    }
    answer = min(answer, alter.at(0));
  }
  cout << answer << endl;

  return 0;
}



Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a=0,b,c,d,i,j;
    string s,ss;
    cin>>s;
    for(i=0; i<s.size(); i++)
    {
        if(s[i]=='7')
        {
            a=1;
            break;
        }
    }
    if(a==1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3628
def main(n: int):
    lc = [2, 1]

    if n < 2:
        print(1)
        return

    for i in range(1, n):
        lc.append(lc[i - 1] + lc[i])

    print(lc[-1])


if __name__ == "__main__":
    n = int(input())

    main(n)


Measured memory_bytes: 3064
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N-1)]

graph = [[] for _ in range(N+1)]
graph[0] = [0]
edct = {}
par = [-1] * (N+1)
par[1] = 0

for a, b in ab:
    graph[a].append(b)
    graph[b].append(a)
    edct[(a, b)] = 0

nmax = 0

for i, g in enumerate(graph[1:], 1):
    nmax = max(nmax, len(g))
    clr = 1
    for j in g:
        if par[j] != -1: continue
        if clr == par[i]:clr += 1
        edct[(min(i, j), max(i, j))] = clr
        par[j] = clr
        clr += 1

print(nmax)
for a, b in ab:
    print(edct[(a, b)])

Measured memory_bytes: 50288
import sys
read = sys.stdin.buffer.read#全部読み込むやつ
readline = sys.stdin.buffer.readline#1行読み込むやつ
readlines = sys.stdin.buffer.readlines#リストで読み込むらしい


N,*L = map(int,read().split())
ans = 0
Pj = L[0]
for i in L:
    Pj = min(Pj,i)    
    if Pj >= i:
        ans += 1
print(ans)


Measured memory_bytes: 64772
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int t;

	while (cin >> t){
		while (t / 39 != 0) {
			t = t - 39;
		}

		if (t == 0) {
			t = 39;
		}

		printf("3C%02d\n",t);
	}
	return 0;
}

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

using ll = long long int;

const int MAX_N = (int)(2000 + 5);
const ll INF = (ll)(1e10 + 5);

ll answer, a[MAX_N];
ll n, z, w;

ll memo[MAX_N][2][MAX_N];

ll ans(int il, int f, ll cx, ll cy) {
  ll opp = (f == 0) ? cy : cx;

  if (opp >= 2 && memo[il][f][opp] != -1) return memo[il][f][opp];

  if (il == n + 2) {
    return abs(a[cx] - a[cy]);
  }

  ll tmp;
  if (f == 1) {
    tmp = INF;
    for (int i = il; i < n + 2; ++i) {
      tmp = min(tmp, ans(i + 1, 0, cx, i));
    }
  }
  else {
    tmp = -1;
    for (int i = il; i < n + 2; ++i) {
      tmp = max(tmp, ans(i + 1, 1, i, cy));
    }
  }

  if (opp >= 0) memo[il][f][opp] = tmp;

  return tmp;
}

int main(void){
    // Here your code !
    scanf("%d %lld %lld", &n, &z, &w);
    for (int i = 2; i < n + 2; ++i) {
      scanf("%lld", &(a[i]));
    }
    a[0] = z;
    a[1] = w;

    memset(memo, -1, sizeof(memo));

    answer = ans(2, 0, 0, 1);
    printf("%lld\n", answer);
    return 0;
}


Measured memory_bytes: 63232
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, e) for (int i = s; i < e; ++i)
#define sort_(a) stable_sort(a.begin(), a.end())
#define rsort(a) stable_sort(a.rbegin(), a.rend())
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define __lcm(a, b) std::__detail::__lcm(a, b)
typedef long long ll;
const long mod = 1e9 + 7;

int main(void) {
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
#endif

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

  int N;
  cin >> N;
  pair<pair<string, int>, int> S[100];
  rep(i, 0, N) {
    cin >> S[i].first.first >> S[i].first.second;
    S[i].second = i + 1;
    S[i].first.second *= -1;
  }

  sort(S, S+N);
  rep(i, 0, N) {
    cout << S[i].second << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
   
int i,a,b,c,d,e;
   while(scanf("%d", &a)!= EOF) {
   b=600/a;
   int sum=0;
           for(i=1;i<b;i++){
           e=i*a;
           d=e*e;
           c=a*d;
           sum+=c;
       }
       printf("%d\n",sum);
       if(a == 0) {
   break;
   }
       }
   return 0;
   }


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

int main() {
    int N;
    cin >> N;
    long long L[N+1];
    L[0] = 2;
    L[1] = 1;

    if(N == 1) {
        cout << 1;
    }
    else {
        for(int i = 2; i <= N; i++) {
            L[i] = L[i-1] + L[i-2];
        }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
#define REP(i,j,n) for (int i=j;i<(n);i++)
#define RREP(i,n) for (int i = n; 0<i;i--)
#define print(out) cout<< out  << "\n";
#define mod 1000000007
const int INF = 1e9;

int main(){
  int N,X;cin>>N>>X;
  int cnt=1,l,d_1=0,d;
  REP(i,0,N){
    cin>>l;
    d=d_1+l;
    if(d<=X)cnt++;
    d_1=d;
  }
  print(cnt)
}


Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
cumlsum=[0]*N
su=0
for i in range(N):
    su=su+A[N-1-i]
    cumlsum[N-1-i]=su
#print(A,cumlsum)
cnt=1
for i in range(1,N,1):
    #print(A[i-1],cumlsum[i])
    if A[i-1]/2<=cumlsum[i]:
        cnt=cnt+1
    else:
        break
print(cnt)

Measured memory_bytes: 63856
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ok = False
if a < b:
    if a + v*t >= b + w*t:
        ok = True
else:
    if a - v*t <= b - w*t:
        ok = True

if ok:
    print('YES')
else:
    print('NO')


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

using namespace std;

int main()
{
    int h,n;
    cin >> h >> n;
    int a, sum=0;
    for(int i=0; i<n; i++){
        cin >> a;
        sum += a;
    }
    if(sum>=h){ cout << "Yes" << endl;}
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef set<int> si;
typedef queue<int> qi;
const int inf = 1e9;
const int mod = 1e9+7;
const int Nc = 2e5;

int N, K, L, p, q;
vi r[Nc], t[Nc];
map<int, int> rc, tc, tcc[Nc];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> N >> K >> L;
  FOR(i, 0, K){
    cin >> p >> q;
    p--;q--;
    r[p].pb(q);
    r[q].pb(p);
  }
  si y;
  qi tmp;
  int e, h;
  FOR(i, 0, N){
    if (y.find(i) != y.end()) continue;
    y.insert(i);
    tmp.push(i);
    while(!tmp.empty()){
      h = tmp.front();
      rc[h] = i;
      tmp.pop();
      FOR(j, 0, r[h].size()){
        e = r[h][j];
        if (y.find(e) != y.end()) continue;
        y.insert(e);
        tmp.push(e);
      }
    }
  }
  FOR(i, 0, L){
    cin >> p >> q;
    p--;q--;
    t[p].pb(q);
    t[q].pb(p);
  }
  y.clear();
  FOR(i, 0, N){
    if (y.find(i) != y.end()) continue;
    y.insert(i);
    tmp.push(i);
    while(!tmp.empty()){
      h = tmp.front();
      tc[h] = i;
      tcc[i][rc[h]]++;
      tmp.pop();
      FOR(j, 0, t[h].size()){
        e = t[h][j];
        if (y.find(e) != y.end()) continue;
        y.insert(e);
        tmp.push(e);
      }
    }
  }
  FOR(i, 0, N){cout << (i == 0 ? "" : " ") << tcc[tc[i]][rc[i]];}
  cout << endl;
}


Measured memory_bytes: 60928
// Package main provides
//
// File:  b.go
// Author: ymiyamoto
//
// Created on Fri Dec 28 23:15:31 2018
//
package main

import "fmt"

func main() {
	var N, D, X int
	fmt.Scan(&N, &D, &X)

	ans := 0
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		ans += (D-1)/a + 1
	}

	fmt.Println(ans + X)
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    string a,b;
    cin>>a>>b;
    string s;
    while(a!=""){
        s+=a[0];
        a=a.substr(1,a.size()-1);
        swap(a,b);
    }
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long answer = 0;
		if(A%2 == 1){
            answer^=(A-1);
            A--;
        }
        while((B-A)%4!=3){
            answer^=(B+1);
            B++;
        }
        System.out.println(answer);
    }

}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
#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 all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main() {
    int n;
    cin >> n;
    cout << (n + 1) / 2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<ctype.h>
int main(void){
    char x[20],y[20],z[20];
    scanf("%s %s %s",&x,&y,&z);
    printf("%c%c%c\n",toupper(x[0]),toupper(y[0]),toupper(z[0]));
    return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<62;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n,m;

int main(){
	cin>>n>>m;
	cout<<2*(m-n)+n<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict

n,k = map(int,input().split())
a = list(map(int,input().split()))
cum_sum = [0]*(n+1)#累積和 - i （要素すう）modk
for i in range(n):
  cum_sum[i+1] = (cum_sum[i]+a[i]-1) % k#cum_sum[i]-iが一定
D = defaultdict(int)

count = 0
for i in range(n+1):
  count += D[cum_sum[i]] #key が場所、val がcum_sumの値
  D[cum_sum[i]] += 1
  if i-k+1 >= 0:#区間の長さがあまりよりも小さいなら
    D[cum_sum[i-k+1]] -=1
print(count)

Measured memory_bytes: 111564
#include <iostream>

using lint = long long;

void solve() {
    lint x;
    std::cin >> x;

    lint m = 100;
    for (int i = 0;; ++i) {
        if (m >= x) {
            std::cout << i << std::endl;
            break;
        }
        m += m / 100;
    }
}

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

    solve();

    return 0;
}


Measured memory_bytes: 3640
// AOJ 0529 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0529)
#include<cstdio>
#include<algorithm>
#define rep(i,a) for(int i=0;i<(a);++i)

const int MAX_N = 1001;

int N, M;
int P[MAX_N], S[MAX_N*MAX_N];

int main()
{
	while( scanf( "%d%d", &N, &M ), N|M )
	{
		rep( i, N )
			scanf( "%d", P+i+1 );
		++N;

		rep( i, N ) rep( j, N )
			S[i*N+j] = P[i]+P[j];

		std::sort( S, S+N*N );

		int ans = 0;
		rep( i, N*N )
		{
			int t = S[i]+*(std::upper_bound( S, S+N*N, M-S[i] )-1);

			if( t <= M )
				ans = std::max( ans, t );
		}

		printf( "%d\n", ans );
	}

	return 0;
}

Measured memory_bytes: 4960
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int a,b; cin>>a>>b;
	if(a%b==0)cout<<0<<endl;
	else cout<<1<<endl;
	return 0;
}

Measured memory_bytes: 3588