akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ll long long
#define ll_MAX LONG_LONG_MAX
#define ll_MIN LONG_LONG_MIN
#define pi pair<int,int>
#define endl "\n"
#define MAXN 100005
using namespace std;

string s,t;

void solve()
{
	cin>>s>>t;
	int n=s.size();
	if(t.substr(0,n)==s) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;	
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(NULL);
    solve();
}


Measured memory_bytes: 3616
#include <iostream>
#include <stdio.h>
using namespace std;
const int up=2e7+5;
int main()
{
    int k;
    scanf("%d",&k);
    if((k&1)==0)
    {
        puts("-1");
        return 0;
    }
    int num=7%k;
    int cnt=1;
    while(num!=0&&cnt<up)
    {
        num=(num*10+7)%k;
        cnt++;
    }
    if(cnt==up)
    puts("-1");
    else
    printf("%d\n",cnt);
    return 0;
}

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

int main()
{
    int n,ans;
    cin>>n;
    long long a[n],b[n],c[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        cin>>b[i];
    }
    for(int i=0;i<n;i++){
        c[i]=a[i]-b[i];
    }
    long long sum=0;
    for(int i=0;i<n;i++){
        sum+=c[i];
    }
    if(sum<0){
          ans=-1;
    }
    else{
        sort(c, c + n);
        long long beh=0;
        int count=0;
        for(int i=0;i<n;i++){
            if(c[i]<0){
                beh+=c[i];
                count++;
            }
        }
        for(int i=n-1;i>0;i--){
            if(beh<0){
                beh+=c[i];
                count++;
            }
        }
        ans=count;
    }
    cout<<ans;
}


Measured memory_bytes: 2560
from math import sqrt
from statistics import mean

while True:
    s = input()
    if s == "0":
        break

    l = list(map(int, input().split()))
    length = len(l)
    m = mean(l)
    print("{:.8f}".format(sqrt(sum(map(lambda i: (i-m) ** 2, l)) / length)))

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

int main(){
    int N;cin>>N;
    vector<int> count(100005);
    rep(i,N){
        int a;cin>>a;
        count.at(a)++;
    }
    int ans=0,now;
    rep(i,100000){
        now=0;
        if(i>0)now+=count.at(i-1);
        now+=count.at(i)+count.at(i+1);
        ans=max(ans,now);
    }
    cout<<ans<<endl;
    return 0;
}

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

# AtCoder Grand Contest
# Problem A


if __name__ == '__main__':
    from collections import deque

    x = input()
    n = len(x)
    d = deque()

    for i in range(n):
        d.append(x[i])

        if len(d) >= 2 and d[-2] + d[-1] == 'ST':
            d.pop()
            d.pop()

    print(len(d))


Measured memory_bytes: 5092
#include  <stdio.h>

void p(int A[], int N){
    int i;
    for (i=0;i<N;i++){
        if(i>0)printf(" ");
        printf("%d" ,A[i]);
    }
    printf("\n");
}

void insertionSort( int A[], int N){
    int i,j,v;
    for(i=1;i<N;i++){
        v=A[i];
        j=i-1;
        while (j>=0 && A[j]>v){
            A[j+1]=A[j];
            j--;
        }
        A[j+1]=v;
	p(A,N);
    }
}

int main() {
    int N,i,j;
    int A[100];
    
    scanf("%d", &N);
    for(i=0;i<N;i++)  scanf("%d",&A[i]);
    p(A,N);
    insertionSort(A,N);
    
    return 0;
}




Measured memory_bytes: 2036
//22:15から
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
using namespace std;

signed main() {
	string s;
	cin >> s;
	
	if (s[0] == s[1] && s[1] == s[2]) { cout << "Yes" << endl; }
	else if (s[1] == s[2] && s[2] == s[3]) { cout << "Yes" << endl; }
	else { cout << "No" << endl; }
	return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define fi first
#define se second
#define  pb push_back
#define  pob pop_back
#define mp make_pair
#define db long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define all(a) (a).begin(),(a).end()
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define sz(x) (int)x.size()
#define endl '\n'
#define mod 1000000007
#define MAX 100005
using namespace std;

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

    // freopen("in.txt","r",stdin);
    // freopen("out.txt","w",stdout);

    ll n,x,y;
    cin >> n >> x >> y;
    ll ans[n+1]={0};
    rep(i,1,n+1){
    	rep(j,i+1,n+1){
    		if(j < x) ans[j-i]++;
    		else if(i > y) ans[j-i]++;
    		else{
    			ll d = min(j-i,abs(x-i)+abs(j-y)+1);
    			ans[d]++;
    		}
    	}
    }
    rep(i,1,n) cout << ans[i] << endl;


    return 0;

}


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n,m; cin>>n>>m;
	vector<int>a(n+1); a.at(0)=a.at(1)=1;
	vector<bool>v(n+1,true);
	for(int i=0;i<m;++i){
		int A; cin>>A;
		v.at(A)=false;
	}
	for(int i=2;i<=n;++i){
		if(v.at(i-2))a.at(i)+=a.at(i-2);
		if(v.at(i-1))a.at(i)+=a.at(i-1);
		a.at(i)%=1000000007;
	}
	cout<<a.back()<<"\n"s;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#define INF 1e9
#define eps 1e-6
typedef long long ll;
using namespace std;

inline int max(int a, int b){
	return a > b ? a : b;
}

inline int min(int a, int b){
	return a < b ? a : b;
}

int a, b, c;

int main(){

	cin >> a >> b;
	if(a != 1 && b != 1) puts("1");
	if(a != 2 && b != 2) puts("2");
	if(a != 3 && b != 3) puts("3");

	return 0;
}


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

using namespace std;
 
int main()
{
    int N;
    string s, t;
    cin >> N;
    while (N--) {
        cin >> s;
        t = s;
        sort(s.begin(), s.end(), greater<char>());
        sort(t.begin(), t.end());
        cout << stoi(s) - stoi(t) << endl;
    }
    return 0;
}

Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 1000000000


int main() {
	
	string S;
	cin>>S;
	
	if(S[0]=='7'||S[1]=='7'||S[2]=='7')cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	
    return 0;
}


Measured memory_bytes: 3628
N, M = map(int,input().split())
sp = []
cp = []
move = [0] * N
min_dis = 10**9

for i in  range(N):
    a, b = map(int, input().split())
    sp.append([a,b])

for j in range(M):
    c, d = map(int, input().split())
    cp.append([c,d])

for i in range(N):
    for j in range(M):
        distance = abs(sp[i][0]-cp[j][0]) + abs(sp[i][1]-cp[j][1])
        if distance < min_dis:
            move[i] = j + 1
            min_dis = distance
    min_dis = 10**9

for i in range(N):
    print(move[i])

Measured memory_bytes: 3064
from collections import defaultdict
n = int(input())
neighbors = defaultdict(list)
for i in range(n):
    s = list(map(int, list(input())))
    for j in range(n):
        if s[j] == 1:
            neighbors[i].append(j)

def dfs(v0):
    dist = {}
    dist[v0] = 0
    visited = {}
    f = [v0]
    while len(visited) != n:
        nxt_f = []
        for v in f:
            for nn in neighbors[v]:
                if nn in visited:
                    continue
                if nn in dist:
                    if dist[nn] != dist[v] + 1:
                        # contradiction
                        return False
                else:
                    dist[nn] = dist[v] + 1
                    nxt_f.append(nn)
        for v in f:
            visited[v] = True
        f = nxt_f
    return max(dist.values()) + 1

kmax = -1
for v0 in range(n):
    k = dfs(v0)
    if k:
        kmax = max(kmax, k)
print(kmax)

Measured memory_bytes: 3700
N,M = map(int,input().split())
s = [list(map(int, input().split())) for _ in range(M)]
p = list(map(int, input().split()))
ans = 0

for i in range(2**N):
    ptn = bin(i)[2:].rjust(N,'0')
    light = True
    for j in range(M):
        tmp = 0
        for n in range(1,s[j][0] + 1):
            if ptn[s[j][n]-1]=='1':
                tmp += 1
        if tmp % 2 != p[j] % 2:
            light = False
    if light:
        ans += 1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

ll d;
int main() {
    cin>>d;

    if(d==25) cout<<"Christmas"<<endl;
    else if(d==24) cout<<"Christmas Eve"<<endl;
    else if(d==23) cout<<"Christmas Eve Eve"<<endl;
    else cout<<"Christmas Eve Eve Eve"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
const int maxn=605;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
vector<int> g[maxn];
long double dp[maxn];
int n,m;
long double cal(int x)
{
    for(int i=0;i<=n;i++) dp[i]=0;
    for(int i=n-1;i>=1;i--)
    {
        long double sum=0,Max=0;
        for(int j=0;j<g[i].size();j++) sum+=dp[g[i][j]],Max=max(Max,dp[g[i][j]]);
        if(i==x&&g[i].size()>=2)
        {
            sum-=Max;
            dp[i]=sum/(g[i].size()-1);
        }
        else dp[i]=sum/g[i].size();
        dp[i]+=1;
    }
    return dp[1];
}
int main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int u,v;
        cin>>u>>v;
        g[u].pb(v);
    }
    long double ans=cal(1);
    //cout<<ans<<'\n';
    for(int i=2;i<=n-1;i++)ans=min(ans,cal(i));
    cout<<fixed<<setprecision(8)<<ans<<'\n';
    return 0;
}



Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main() {
	string s, t; cin >> s >> t;
	vector<int> scnt(26), tcnt(26);
	for (int i = 0; i < s.size(); ++i) {
		scnt[s[i] - 'a']++;
		tcnt[t[i] - 'a']++;
	}
	sort(scnt.begin(), scnt.end());
	sort(tcnt.begin(), tcnt.end());

	bool flag = true;
	for (int i = 0; i < 26; ++i) {
		if (scnt[i] != tcnt[i]) flag = false;
	}
	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 776
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		sc.nextInt();
		String[] strs = new String[num];
		for(int i=0; i<num; i++) {
			strs[i] = sc.next();
		}
		Arrays.sort(strs);
		StringBuffer sb = new StringBuffer();
		for(int i=0; i<num; i++) {
			sb.append(strs[i]);
		}
		System.out.println(sb.toString());
	}
}


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

int main() {

    int w, a, b, ans;
    cin >> w >> a >> b;

    if ((b > a) && (a + w) < b) {
        ans = b - (a + w);
        cout << ans << endl;
    }
    else if ((a > b) && (b + w) < a) {
        ans = a - (b + w);
        cout << ans << endl;
    }
    else
        cout << "0" << endl;        
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int divisible2 = 0;
    int divisible4 = 0;
    for(int i=0;i<n;i++){
      int a = sc.nextInt();
      if(a%2==0) divisible2++;
      if(a%4==0) divisible4++;
    }
    int even_odd = n%2;
    if(even_odd==0 && (n-divisible2)<=divisible4){
      System.out.println("Yes");
    }else if(even_odd==1 && (n-divisible2-1)<=divisible4){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 47972
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>

using namespace std;

struct node{
	int x,y;
}a[100009];
vector<int>ve[100009];

bool cmp(node x,node y)
{
	if(x.y !=y.y) return x.y >y.y ;
	else return x.x>y.x ;
}

int main()
{
	int m,n,x,y;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		//cin>>a[i].x>>a[i].y ;
		if(x<=m)
		{
			ve[m-x+1].push_back(y);
		} 
	}
	//sort(a,a+n,cmp);
	priority_queue<int>q;
	int j=m;
	long long sum=0;
	for(int i=m;i>=1;i--)
	{
		for(int v:ve[i]) q.push(v);
		if(!q.empty())
		{
			sum+=1ll*q.top();
			q.pop();
		}
	}
	cout<<sum<<endl;
	return 0;
} 

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

int main() {
    int n, k;
    cin >> n >> k;
    n = (n + 1) / 2;
    if (n >= k) puts("YES");
    else
        puts("NO");
}

Measured memory_bytes: 3608
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	m := scanInt()

	es := make([][]edge, n)
	for i := 0; i < m; i++ {
		a, b := scanInt()-1, scanInt()-1
		es[a] = append(es[a], edge{b, 1})
		es[b] = append(es[b], edge{a, 1})
	}
	_, ans := dijkstra(es, 0)
	fmt.Fprintln(wr, "Yes")
	for i := 1; i < n; i++ {
		fmt.Fprintln(wr, ans[i]+1)
	}
}

const inf = 1<<63 - 1

type edge struct{ to, co int }
type vert struct{ d, v int }
type pqForDijkstra []vert

func (pq pqForDijkstra) Len() int            { return len(pq) }
func (pq pqForDijkstra) Swap(i, j int)       { pq[i], pq[j] = pq[j], pq[i] }
func (pq pqForDijkstra) Less(i, j int) bool  { return pq[i].d < pq[j].d }
func (pq *pqForDijkstra) Push(x interface{}) { *pq = append(*pq, x.(vert)) }
func (pq *pqForDijkstra) Pop() interface{} {
	x := (*pq)[len(*pq)-1]
	*pq = (*pq)[0 : len(*pq)-1]
	return x
}

func dijkstra(es [][]edge, s int) ([]int, []int) {
	d := make([]int, len(es))
	arr := make([]int, len(es))
	for i := 0; i < len(es); i++ {
		d[i] = inf
	}
	d[s] = 0
	pq := &pqForDijkstra{vert{0, s}}
	heap.Init(pq)
	for len(*pq) != 0 {
		p := heap.Pop(pq).(vert)
		if p.d > d[p.v] {
			continue
		}
		for _, e := range es[p.v] {
			cost := d[p.v] + e.co
			if cost < d[e.to] {
				d[e.to] = cost
				arr[e.to] = p.v
				heap.Push(pq, vert{d[e.to], e.to})
			}
		}
	}
	return d, arr
}


Measured memory_bytes: 29700
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)



int N;
int imos[101010];
//-----------------------------------------------------------------
int main() {
	cin >> N;

	int t = 0;
	rep(i, 0, N) {
		int a, b;
		scanf("%d %d", &a, &b);

		t = (t + a) % 86400;

		int l = (86400 - t) % 86400;
		int r = (l + 10800) % 86400;

		if (l < r) {
			imos[l]++;
			imos[r + 1]--;
		}
		else {
			imos[0]++;
			imos[r + 1]--;
			imos[l]++;
		}
		
		t = (t + b) % 86400;
	}

	rep(i, 1, 86401) imos[i] += imos[i - 1];

	int ans = 0;
	rep(i, 0, 86401) ans = max(ans, imos[i]);
	cout << ans << endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int m = sc.nextInt();
		int l, r, tmpl, tmpr;
		l = sc.nextInt();
		r = sc.nextInt();
		boolean b = true;
		for (int i = 1; i < m; i++) {
			tmpl = sc.nextInt();
			tmpr = sc.nextInt();
			if (l <= tmpl) {
				l = tmpl;
			}
			if (r >= tmpr) {
				r = tmpr;
			}
		}
		if (r - l >= 0) {
			System.out.println(r - l + 1);
		} else {
			System.out.println(0);
		}
	}
}


Measured memory_bytes: 62892
#include <cstdio>
#include <algorithm>
const int maxn = 105;
using namespace std;
int n, m, ex, ey; char str[maxn][maxn]; 
short f[maxn][maxn][maxn][maxn], p[maxn][maxn], q[maxn][maxn];
short max(short x, int y){
	if (x < y) return y;
	return x;
}
int main(){
//	freopen("1.in", "r", stdin);
//	freopen("1.out", "w", stdout);
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%s", str[i] + 1);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++){
			p[i][j] = p[i][j - 1]; q[i][j] = q[i - 1][j];
			if (str[i][j] == 'E') ex = i, ey = j;
			else if (str[i][j] == 'o') p[i][j]++, q[i][j]++;
		}
	for (int i = 0; i <= ex - 1; i++)
		for (int j = 0; j <= ey - 1; j++)
			for (int x = 0; x <= n - ex; x++)
				for (int y = 0; y <= m - ey; y++){
					int L = max(ex - i, x + 1), R = min(n - i, ex + x);
					if (L <= R){
						f[i][j + 1][x][y] = max(f[i][j + 1][x][y], f[i][j][x][y] + (ey - j - 1 >= y + 1) * (q[R][ey - j - 1] - q[L - 1][ey - j - 1]));
						f[i][j][x][y + 1] = max(f[i][j][x][y + 1], f[i][j][x][y] + (m - j >= ey + y + 1) * (q[R][ey + y + 1] - q[L - 1][ey + y + 1]));
					}
					L = max(ey - j, y + 1), R = min(m - j, ey + y);
					if (L <= R){
						f[i + 1][j][x][y] = max(f[i + 1][j][x][y], f[i][j][x][y] + (ex - i - 1 >= x + 1) * (p[ex - i - 1][R] - p[ex - i - 1][L - 1]));
						f[i][j][x + 1][y] = max(f[i][j][x + 1][y], f[i][j][x][y] + (n - i >= ex + x + 1) * (p[ex + x + 1][R] - p[ex + x + 1][L - 1]));
					}
				}
	printf("%d\n", f[ex - 1][ey - 1][n - ex][m - ey]);
	return 0;
}

Measured memory_bytes: 227968
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll X, A, B;

int main()
{
  std::cin >> X >> A >> B;

  X -= A;
  X %= B;

  std::cout << X << std::endl;

  return 0;
}

Measured memory_bytes: 3524
n = int(input())
tri = [1]
for i in  range(2, 450):
    tri.append(i * (i + 1) // 2)
if not n in tri:
    exit(print("No"))
print("Yes")
ind = tri.index(n) + 2
ans = [[] for i in range(ind)]
cur = 1
print(ind)
for i in range(ind):
    for j in range(i + 1, ind):
        ans[i].append(cur)
        ans[j].append(cur)
        cur += 1
for i in ans:
    print(len(i), *i)

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

long long lucas[87];

long long calc(int N)
{
    if (N == 0) return 2;
    else if (N == 1) return 1;
    else if (lucas[N] == 0) return lucas[N] = calc(N-1) + calc(N-2);
    else return lucas[N];
}

int main()
{
  int N;
  cin >> N;
  cout << calc(N) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef set<int> si;
typedef set<ld> sd;
typedef set<ll> sl;
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define Plabs     ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
    Plabs;
    int n;
    cin>>n;
    cout<<n*n*n;
}

Measured memory_bytes: 3664
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int x = in.nextInt();
		int counter = 0;
		for(int i = 0, suma = 0; i <= a && suma < x; i++){
			suma = 500 * i;
			if (suma == x) { counter++; break;}
			for(int j = 0, sumb = 0; j <= b && sumb < x; j++){
				sumb = suma + 100 * j;
				if (sumb == x) { counter++; break;}
				for(int k = 0, sumc = 0; k <= c && sumc < x; k++){
					sumc = sumb + 50 * k;
					if (sumc == x) { counter++; break;}
							
				}
			}
		}
		
		System.out.println(counter++);
	}

}


Measured memory_bytes: 21716
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

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

using namespace std;

int main()
{
	int n;
	while(cin >> n && n)
	{
		vector<int> v;

		rep(i,n)
		{
			int temp;
			cin >> temp;
			v.push_back(temp);
		}

		int p;
		cin >> p;
		
		int l = 0;
		int r = n-1;
		int count = 0;

		while(true)
		{
			int mid = (l + r) / 2;

			if(l > r) break;

			count++;

			if(v[mid] == p) break;

			if(v[mid] < p)
			{
				l = mid + 1;
			}
			else
			{
				r = mid - 1;
			}
		}

		cout << count << endl;
	}
	return 0;
}

Measured memory_bytes: 1216
#include "bits/stdc++.h"
using namespace std;


int main()
{
	int64_t n;
	cin >> n;

	int64_t ans = 0;
	for (int64_t i = 1; i <= n; i++) {
		if (i % 3 != 0 && i % 5 != 0) {
			ans += i;
		}
	}

	cout << ans << endl;
}

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

using namespace std;

typedef long long ll;

string s;
int n;

bool isEvenStr(int x){
	for(int i = 0; i < x; i++){
		if(s[i] != s[i + x]) return false;
	}

	return true;
}

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

	int n, k;
	cin >> n >> k;

	vector<int> l(n);
	rep(i, n) cin >> l[i];

	sort(l.begin(), l.end(), greater<int>());

	int ans = 0;
	rep(i, k) ans += l[i];
	cout << ans << endl;

}


Measured memory_bytes: 256
object Main extends App {
  val nk = scala.io.StdIn.readLine()
  val nkArray = nk.split(" ").map(_.toInt).toVector
  val n = nkArray(0)
  val k = nkArray(1)
  val h = scala.io.StdIn.readLine()
  val hArray = h.split(" ").map(_.toLong).toVector.sorted.reverse
  if(k >= n) {
    println(0)
  } else {
    val countArray = hArray.drop(k)
    println(countArray.sum)
  }
}

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

// iterator
#define REP(i,init, n) for(lli i=init;i<n;i++)
#define REPE(i,init, n) for(lli i=init;i<=n;i++)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) {cin1(x[i]);}
#define ncin2(n, x, y)      REP(i, 0, n) {cin2(x[i], y[i]);}
#define ncin3(n, x, y, z)   REP(i, 0, n) {cin3(x[i], y[i], z[i]);}

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

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

#define MOD (998244353)


lli mul(lli a, lli b) {
    return a * b % MOD;
}

int main() {
    lli n;
    cin1(n);
    string s;
    cin1(s);

    lli ans = 1;

    lli r, b, g, rb, rg, bg;
    r = b = g = rb = rg = bg = 0;
    REP(i, 0, 3*n) {
        if (s[i] == 'R') {
            if (bg > 0) {
                ans = mul(ans, bg);
                bg--;
            }
            else if (b > 0) {
                ans = mul(ans, b);
                rb++;
                b--;
            }
            else if (g > 0) {
                ans = mul(ans, g);
                rg++;
                g--;
            }
            else {
                r++;
            }
        }
        else if (s[i] == 'B') {
            if (rg > 0) {
                ans = mul(ans, rg);
                rg--;
            }
            else if (r > 0) {
                ans = mul(ans, r);
                rb++;
                r--;
            }
            else if (g > 0) {
                ans = mul(ans, g);
                bg++;
                g--;
            }
            else {
                b++;
            }
        }

        else if (s[i] == 'G') {
            if (rb > 0) {
                ans = mul(ans, rb);
                rb--;
            }
            else if (r > 0) {
                ans = mul(ans, r);
                rg++;
                r--;
            }
            else if (b > 0) {
                ans = mul(ans, b);
                bg++;
                b--;
            }
            else {
                g++;
            }
        }
    }
    REPE(i, 1, n) {
        ans = mul(ans, i);
    }
    cout << ans << endl;
}


Measured memory_bytes: 900
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<55)+1e9; // ~ 3.6 * 1e16
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
using T = tuple<Int,Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){
  return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> &a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
template<class T>void prArr(T a,string s=" "){Int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

template<typename T>
class CumulativeSum{
public:
  Int n;
  vector<T> sum;
  vector<T> A;
  Int added;
  CumulativeSum():n(-1),added(0){}
  CumulativeSum(Int n):n(n), sum(n+1), A(n+1),added(0){}
  CumulativeSum(const vector<T> &B):n(B.size()), sum(n+1), A(n+1),added(0){
    for(Int i=1;i<=n;i++) sum[i] = sum[i-1] + B[i-1];
  }

  void apply(){
    for(Int i=1;i<=n;i++) A[i] = A[i] + A[i-1];
    for(Int i=1;i<=n;i++) A[i] = A[i] + A[i-1];
    for(Int i=1;i<=n;i++) sum[i] = sum[i] + A[i-1];
    added = 0; A.clear(); A.resize(n+1);
  }

  //[l, r)にxを加算
  T add(Int l, Int r, T x){
    added = 1;
    assert(l <= r && 0 <= l && r <= n);
    A[l] = A[l] + x;
    A[r] = A[r] - x;
  }

  //[l, r)の和を得る
  T get(Int l,Int r){
    assert(l<=r && 0<=l && r<=n);
    if(added) apply();
    return sum[r] - sum[l];
  }
};


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  Int N, X;
  cin>>N>>X;
  
  vector<Int> A(N);
  cin>>A;
  
  CumulativeSum<Int> S(A);

  auto calc = [&](Int k){
    Int res =  N * X + k * X;
    Int l = N - k, r = N; 
    res += S.get(l, r);
    Int cost = 4, cost2 = 5;
    while(r > 0){
      res += cost * S.get(l, r);
      res = min(res, INF);
      r = l; l = max(0LL,l - k);
      cost = cost2;
      cost2 += 2;
    }
    return res;
  };

  Int ans = INF;
  for(Int k=1;k<=N;k++) Min(ans, calc(k));
  cout<<ans<<endl;

  return 0;
}


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

int desc(const void *a, const void *b) {
  return *(long *)b - *(long *)a;
}

int main(){
    int n, i, j, k, work;
    long *a,*b,*sum, SB=0,ans; 

    scanf("%d",&n);

    a = (long*)malloc(sizeof(long)*n);
    b = (long*)malloc(sizeof(long)*n);
    sum = (long *)malloc(sizeof(long)*n);
    
    for(i=0;i<n;i++){
        scanf("%ld %ld",&a[i],&b[i]);
        SB +=b[i];
        sum[i] = a[i] + b[i];
    }
    qsort(sum,n,sizeof(long),desc);
    ans = -SB;
    for(i=0;i<n;i++){
        if(i%2==0){
            ans +=sum[i];
        }
    }
    printf("%ld",ans);
    free(a);
    free(b);
    free(sum);

    return 0;
}

Measured memory_bytes: 3324
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>  // https://boostjp.github.io/tips/math.html
#include <boost/dynamic_bitset.hpp>  // https://boostjp.github.io/tips/dynamic_bitset.html

constexpr int64_t DIV1097 = 1000000007LL;

using namespace std;

int main()
{
    std::string S;
    std::cin >> S;

    int64_t K;
    std::cin >> K;
    // 5000 0000 0000 0000
//    5*10^15

    // std::cout.precision(20);
    for (int64_t i = 0; i < K; ++i) {
        if (S[i] != '1') {
            std::cout << S[i] << std::endl;
            return 0;
        }
    }
    std::cout << S[K-1] << std::endl;

    return 0;
}


Measured memory_bytes: 256
//g++ t.cpp -o t && t < p.txt
//d>p.txt&&t<p.txt&&t2<p.txt

#include <iostream> // プログラムの耳と口
#include <vector> // 超有能配列秘書
#include <algorithm> // みんな大好きソートと二分探索
#include <queue> // きゅーちゃん、だいすき
#include <string> // to_string
#include <functional> // 関数を変数に入れる子
#include <set> // 値の取得・挿入・削除を高速に
#include <map> // setの妹 これまた優秀
#include <random> // 乱択さん
#include <ctime>

#define DB cerr<<"D"<<endl
using namespace std; using ll=long long; using ld=long double; const int INF=1e9; const ll LINF=1e18; const double dINF = 1e18; const ld ldINF = 1e18; const double EPS = 1e-6;
template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";} template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";} template<typename T> void caut(T a){cout<<"("<<a<<") ";};
using P=pair<ll,ll>;
const ll M = 1e9+7;
ll mod_pow(ll x, ll a) { ll an = 1; while(a > 0) { if (a&1) an = an * x % M; x = x * x % M; a >>= 1;} return an;}
void add(ll& x, ll y) {x+=y; x%=M;}; void mul(ll& x, ll y) {x*=y; x%=M;}; template<typename T, typename U> void chmax(T& x, U y) {if (x<y) x=y;}; template<typename T, typename U> void chmin(T& x, U y) {if (x>y) x=y;}
bool vaild(int x, int y, int hh, int ww){return 0<=x&&x<hh&&0<=y&&y<ww;}
int keta(ll a) {int res=0; while(a>0) res+=a%10, a/=10; return res;}

int main() {
  int x; cin>>x;
  if (x >=30)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
// ・配列の大きさok？　・priority_queueはgreater？　・debug消した？
// ・落ち着いて。提出まで4分待ってね……WJ……1/10……2/10……

// Thank you for making problems and running the contest


Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i=0;i < (int)(n);i++)

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = 0;
  int x = 0;
  rep(i,n){
    if (s[i] == 'I') x++;
    else x--;
    res = max(res,x);
  }
  cout << res << endl;


    
  return 0;
}


Measured memory_bytes: 3588
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
    	int N = ni();

    	int[] T = new int[N];
    	int[] A = new int[N];

    	for (int i=0; i<N; i++) {
			T[i] = ni();
			A[i] = ni();
		}

    	long t = T[0];
    	long a = A[0];

    	for (int i=1; i<N; i++) {
    		long x = (t%T[i]==0)? t/T[i] : (t/T[i] + 1);
    		long y = (a%A[i]==0)? a/A[i] : (a/A[i] + 1);
    		t = T[i] * Math.max(x, y);
    		a = A[i] * Math.max(x, y);
    	}

    	out.println(t + a);
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}


Measured memory_bytes: 8908
#include<bits/stdc++.h>
using namespace std;
const int maxn=3010;
int mod;
void plusle(int &a,int b){
    a+=b;if(a>=mod)a-=mod; return;
}
void minun(int &a,int b){
    a-=b; if(a<0)a+=mod; return;
}
int add(int a,int b) {
  a+=b;
  return a>=mod?a-mod:a;
}
int sub(int a,int b) {
  a-=b;
  return a<0?a+mod:a;
}
int mul(int a,int b) {
  return (int)((long long)a*b%mod);
}
int power(int a,int b) {
  int res=1;
  while (b>0) {
    if (b&1) {
      res=mul(res,a);
    }
    a=mul(a,a);
    b>>=1;
  }
  return res;
}
int inv(int x){
    return power(x,mod-2);
}
vector<int> mul(const vector<int> &p,int j){
    ///c[0]+(c[1]*x)+(c[2]*(x^2)+...)c[n-1]*(x^(n-1))
    ///(x-j)
    int n=(int)p.size();
    vector<int> s(n+1,0);
    for(int i=0;i<n;i++){
        plusle(s[i+1],p[i]);
    }
    for(int i=0;i<n;i++){
        plusle(s[i],mul(p[i],j));
    }
    return s;
}
vector<int> d( vector<int> p,int j){
    ///c[0]+c[1]*x+...+c[n-1]*(x^(n-1))
    ///x-j
    int n=(int)p.size();
    vector<int> s(n-1,0);
    for(int i=n-1;i>0;i--){
        plusle(p[i-1],mul(j,p[i]));
        s[i-1]=p[i];
    }
    return s;
}
int get(const vector<int> &g,int x){
    int res=0;
    int now=1;
    for(int i=0;i<(int)g.size();i++){
        plusle(res,mul(g[i],now));
        now=mul(now,x);
    }
    return res;
}
int a[maxn];

int main(){
    int p;
    scanf("%d",&p);
    mod=p;
    for(int i=0;i<p;i++){
        scanf("%d",&a[i]);
    }
    vector<int> t={0,1};
    for(int i=1;i<p;i++){
        t=mul(t,i);
    }
    vector<int> aa(p,0);
    for(int i=0;i<p;i++){
        if(a[i]==0)continue;
        vector<int> s=d(t,i);
        int cur=get(s,i);
        cur=inv(cur);
        for(int i=0;i<(int)s.size();i++){
            plusle(aa[i],mul(s[i],cur));
        }
    }
    for(int i:aa){
        printf("%d ",i);
    }
}
/*
    Good Luck
        -Lucina
*/


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

using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1,p2;
    p1 = mp(l1,r1); p2 = mp(l2,r2);
    if(p1>p2)swap(p1,p2);
    if(p2.fi <= p1.se)return true;
    else return false;
}
ll fexp (ll num1, ll num2, ll MOD){
    if(num2==0)return 1;
    else if(num2==1)return num1;
    else{
        ll temp = fexp (num1,num2/2,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2%2==1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return fexp (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/gcd(num1,num2))*num2;}
// end of Template
ll ans,n;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    n--;
    ans = (n*(1+n))/2;
    cout<<ans<<newl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< long long > vll;
typedef pair< int,int > ii;
typedef long long ll;
#define fast_cin() ios_base::sync_with_stdio(0); cin.tie(0);
#define F first
#define S second
#define rep(i,n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = n-1; i>=0 ; i--)
#define mem(a) memset(a,0,sizeof(a))
#define sz(a) int(a.size())
#define pb push_back
#define all(c) c.begin(),c.end()
#define tr(container,it) for(auto it=container.begin();it!=container.end();it++)
#define present(container, element) (container.find(element) != container.end())
#define vpresent(container, element) (find(all(container),element) != container.end()) //for vectors

int main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout); 
    //#endif
    fast_cin();
    string s,t;
    cin>>s>>t;int c=0;
    rep(i,3)
    {
    	if(s[i]==t[i])
    		c++;
    }
    cout<<c;
    return 0;
}

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

int main(){
  int y;
  cin>>y;
  queue<long long>x;
  for(int i=1;i<=9;i++){
  x.push(i);
  }
  for(int j=0;j<y;j++){
  if(j==y-1){
  cout<<x.front()<<endl;
  return 0;
  }
  if(x.front()%10!=0){
  x.push(10*x.front()+x.front()%10-1);
  }
  x.push(10*x.front()+x.front()%10);
  if(x.front()%10!=9){
  x.push(10*x.front()+x.front()%10+1);
  }
  x.pop();
  }
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
 #define rep(i, n) for (int i = 0; i < (int)(n); i++)
 #define big 1000000007
int main(){
    int64_t n,a,b;
    cin >> n >> a>>b;
    int64_t tmp;
    int64_t s = 0;
    if((a-b)%2==0){
        cout << abs((a-b)/2) << endl;
    }
    else{
        if(a>b){
            tmp = a;
            a = b;
            b = tmp;
            //bが大きくなるようにする
        }
        s = min(a-1,n-b);
        s += 1 + abs(b-a-1)/2;
        cout << s << endl;
    }
}


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

using namespace std;

int main()
{
    int n,m,flag=0;
    double num;
    cin >> n;
    for(int i=1;i<=9;i++)
    {
        num=n*1.0/i;
        m=n/i;
        if(num<10 && m==num)
        {
            flag=1;
            break;
        }
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##_len=(int)(n);i<i##_len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define REPW(i,n) for(i=0;i<(int)(n);++i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : " "); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
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;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

int n;
string s;
bool hoge(string &t) {
    REPF(i,1,n-1) {
        if((t[i]=='S' && s[i]=='o') || (t[i]=='W' && s[i]=='x')) {
            t+=t[i-1];
        }
        else {
            t+=(t[i-1]=='S'?'W':'S');
        }
    }
    if((t[0]=='S' && s[0]=='o') || (t[0]=='W' && s[0]=='x')) {
        if(t[1]!=t[n-1]) {
            return false;
        }
    }
    else {
        if(t[1]==t[n-1]) {
            return false;
        }
    }
    if((t[n-1]=='S' && s[n-1]=='o') || (t[n-1]=='W' && s[n-1]=='x')) {
        if(t[n-2]!=t[0]) {
            return false;
        }
    }
    else {
        if(t[n-2]==t[0]) {
            return false;
        }
    }
    return true;
}
signed main() {
    cin>>n;
    cin>>s;
    vector<string> t={"SS","SW","WS","WW"};
    REP(i,4) {
        if(hoge(t[i])) {
            cout<<t[i]<<endl;
            return 0;
        }
    }
    cout<<-1<<endl;
    return 0;
}


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

int main() {
    int a, b, c, t;
    cin >> a >> b >> c;

    if (a > b) {
        t = a; a = b; b = t;
    }
    if (b > c) {
        t = b; b = c; c = t;
    }
    if (a > b) {
        t = a; a = b; b = t;
    }
    cout << a << " " << b << " " << c << endl;
    return 0;
}



Measured memory_bytes: 3120
//g++ -std=c++14 test.cpp -o test.out

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

string S;

string ans = "ABC";

void solve(){
	if(S=="ABC") ans = "ARC";
}
 
int main(){
    cin >> S;

    solve();

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

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int n, W;
    cin >> n >> W;
    vector<ll> w(n), v(n);
    REP(i,n) cin >> w[i] >> v[i];

    vector<vector<ll>> dp(n+1,vector<ll>(W+1));
    ll ans = 0;
    REP(i,n) {
        REP(j,W+1){
            dp[i+1][j] = dp[i][j];
            if (j - w[i] >= 0) {
                dp[i+1][j] = max(dp[i][j-w[i]]+v[i],dp[i+1][j]);
                ans = max(ans,dp[i+1][j]);
            }
        }
        //cerr << ans << endl;
    }

    cout << ans << '\n';


    return 0;
}

Measured memory_bytes: 80256