akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second
#define ok(x) (0 <= x && x < s.size() && s[x] == 'Y')

using namespace std;

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

string ch[] = {
	"",
	"',.!?",
	"abcABC",
	"defDEF",
	"ghiGHI",
	"jklJKL",
	"mnoMNO",
	"pqrsPQRS",
	"tuvTUV",
	"wxyzWXYZ",
	"",
};

int main(){
	string s;
	while (cin >> s){
		int num = 0, run = 0;
		s.push_back('x');
		int n = s.size();
		rep(i, n){
			if (s[i]-'0' != num){
				if (num){
					cout << ch[num][run%ch[num].size()];
				}
				else{
					cout << string(run, ' ');
				}
				num = s[i] - '0';
				run = 0;
			}
			else{
				++run;
			}
		}
		cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1200
import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    for (int i=0; i<n; i++){
      switch (sc.next()){
        case "insert":
          Node.insert(sc.nextInt());
          break;
        case "print":
          Node.print();
          break;
        case "find":
          System.out.println(Node.find(sc.nextInt())?"yes":"no");
          break;
        case "delete":
          Node.delete(sc.nextInt());
          break;
      }
    }
  }
}

class Node{
  private int key=-1;
  private Node p=null;
  private Node l=null;
  private Node r=null;
  private static Node root=null;

  public void pre(){
    System.out.print(" "+key);
    if (l!=null) l.pre();
    if (r!=null) r.pre();
  }

  public void in(){
    if (l!=null) l.in();
    System.out.print(" "+key);
    if (r!=null) r.in();
  }

  public void post(){
    if (l!=null) l.post();
    if (r!=null) r.post();
    System.out.print(" "+key);
  }

  public int childNum(){
    int c=0;
    if (l != null) c++;
    if (r != null) c++;
    return c;
  }

  private Node(int key, Node l, Node r){
    this.key = key;
    this.l = l;
    this.r = r;
  }

  public static void insert(int v){
    insert(new Node(v,null,null));
  }

  private static void insert(Node z){
    Node y = null;
    Node x = root;
    while (x != null){
      y = x;
      if (z.key < x.key){
        x = x.l;
      } else {
        x = x.r;
      }
    }
    z.p = y;
    if (y==null){
      root = z;
    } else if (z.key<y.key){
      y.l = z;
    } else {
      y.r = z;
    }
  }

  public static boolean find(int k){
    Node x = root;
    while (x != null){
      if (k == x.key) return true;
      else if (k < x.key){
        x = x.l;
      } else {
        x = x.r;
      }
    }
    return false;
  }

  public static void delete(int k){
    Node x = root;
    Node z = null;
    while (x != null){
      if (k == x.key) {
        z = x;
        break;
      }
      else if (k < x.key){
        x = x.l;
      } else {
        x = x.r;
      }
    }
    if (z==null) return;
    if (z.p==null){
      root = null;
      return;
    }
    switch(z.childNum()){
      case 0:
        if (z.p.l == z) z.p.l = null;
        else z.p.r = null;
        break;
      case 1:
        Node c;
        if (z.l != null) c = z.l;
        else c = z.r;
        if (z.p.l == z) z.p.l = c;
        else z.p.r = c;
        c.p = z.p;
        break;
      case 2:
        Node y = z.r;
        while (y.l!=null) y = y.l;
        z.key = y.key;
        if (y.childNum()==0){
          if (y.p.l == y) y.p.l = null;
          else y.p.r = null;
        } else {
          Node yc;
          if (y.l != null) yc = y.l;
          else yc = y.r;
          if (y.p.l == y) y.p.l = yc;
          else y.p.r = yc;
          yc.p = y.p;
        }
        break;
    }
  }

  public static void print(){
    root.in();
    System.out.println();
    root.pre();
    System.out.println();
  }
}



Measured memory_bytes: 201392
#include<stdio.h>
int main()
{
    int m,n,i,j,a,b,sum=0;
    scanf("%d%d",&m,&n);
    a=m-1;
    b=n-1;
    for(i=1;i<=n;i++)
    {
        sum=sum+b;
        b=b-1;
    }
    for(j=1;j<=m;j++)
    {
        sum=sum+a;
        a=a-1;
    }
    printf("%d\n",sum);
}


Measured memory_bytes: 128
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

N, M = MI()
SC = LRI(M)

sets = [-1] * (N+1)
flag = True

for sc in SC:
    s = sc[0]
    c = sc[1]

    if sets[s] == c or sets[s] == -1:
        sets[s] = c
    else:
        flag = False

if sets[1] == -1:
    sets[1] = 1

for i in range(N+1):
    if sets[i] == -1:
        sets[i] = 0

sets = sets[1:]
sets = [str(i) for i in sets]
ans = str(int("".join(sets)))

if len(ans) != N:
    flag = False

# print(ans if flag else "-1")
print("0" if M == 0 and N == 1 else ans if flag else "-1")


Measured memory_bytes: 45124
#include "bits/stdc++.h"
#define YES "YES"
#define NO "NO"
#define Yes "Yes"
#define No "No"
#define DEFAULT LL ans=solve();\
 	if(ans==NONE){\
 	}else{\
 		cout << ans << endl;\
 	}
#define YESNO three(solve(),OUT(YES),OUT(NO))
#define YesNo three(solve(),OUT(Yes),OUT(No))
#define ECHO OUT(solve())
#define three(A,B,C) ((A)?(B):(C))
#define FOR(i,a,b)  for(LL i=(a);i< (LL)(b);i++)
#define EFOR(i,a,b) for(LL i=(a);i<=(LL)(b);i++)
#define RFOR(i,a,b) for(LL i=(b-1);i>=(LL)(a);i--)
#define REP(i,b) FOR(i,zero,b)
#define rep REP
#define EREP(i,b) EFOR(i,zero,b)
#define RREP(i,b) RFOR(i,zero,b)
#define ALL(c) c.begin(),c.end()
#define UNIQUE(c) sort(ALL(c));c.erase(unique(ALL(c)),c.end())
#define MAX(c) (*max_element(ALL(c)))
#define MIN(c) (*min_element(ALL(c)))
#define MP make_pair
#define FI first
#define SE second
#define SI(x) (LL(x.size()))
#define PB push_back
#define DEBUG(a) OUT(a)
#define DEBUG2(a,b) OUT2(a,b)
#define cat cout << __LINE__ << endl
#define OUT(a) cout << (a) << endl
#define OUT2(a,b) cout << (a) <<" "<<(b) << endl
#define zero 0LL
#define all ALL
#define pb emplace_back
#define eb pb
#define int long long
using namespace std;
template<typename T> inline void maximize(T &a, T b) { a = max(a, b); }
template<typename T> inline void minimize(T &a, T b) { a = min(a, b); }
template<typename T> inline bool middle(T a, T b, T c) { return b <= a && a <= c; }
template<class T> inline bool MX(T &l, const T &r) { return l < r ? l = r, 1 : 0; }
template<class T> inline bool MN(T &l, const T &r) { return l > r ? l = r, 1 : 0; }
typedef int LL;
typedef double ld;
typedef int ut;
typedef vector<ut> VI;
typedef vector<VI> VII;
typedef pair<ut, ut> pr;
typedef pair<ut, pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef tuple<int, int, int, int> tapu;
typedef vector<tapu> Vtapu;
typedef priority_queue<pr, Vpr > PQ;
inline void outputVI(VI x) { REP(i, SI(x)) { cout << three(i, " ", "") << x[i]; }OUT(""); }
const int SIZE1 = 5e5 + 1000;
const int SIZE2 = 2010;
const int SIZE3 = 430;
const int SIZE = SIZE1;
const int MAPSIZE = 40;
const LL p = 998244353;
const LL INF = 1LL << 60;
const long double EPS = 1e-7;
const LL NONE=-2;
#define endl "\n"
ut N, M,K,  Q, D, H, W;
VI edges[SIZE];
LL vals[SIZE], answer = zero;
LL A[SIZE],B[SIZE],C[SIZE];
LL DP[SIZE];
LL last[SIZE];

LL solve(){
	cin >> N;
	REP(i,N+1){
		int c=i*1.08;
		if(c==N){
			return i;
		}
	}
	cout << ":(" << endl;
	return NONE;
}
 signed main() {
 
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	string s;
	LL T;
	DEFAULT;
	
	
//	YesNo;
//	YESNO;
//	three(solve(),OUT("First"),OUT("Second"));
	//cin >> N;
	return 0;
 
}


Measured memory_bytes: 12928
#include <vector>
#include <iostream>
using namespace std;
int N, K;
int main() {
	cin >> K >> N;
	if (K % 2 == 0) {
		cout << K / 2;
		for (int i = 1; i < N; i++) {
			cout << ' ' << K;
		}
		cout << endl;
	}
	else {
		vector<int> ret(N, (K + 1) / 2);
		int tail = N - 1;
		for (int i = 0; i < N / 2; ++i) {
			if (tail == N - 1) {
				--ret[tail];
				if (ret[tail] == 0) --tail;
			}
			else {
				--ret[tail];
				if (ret[tail] != 0) {
					for (int j = tail + 1; j < N; ++j) {
						ret[j] = K;
					}
					tail = N - 1;
				}
				else --tail;
			}
		}
		for (int i = 0; i < N; i++) {
			if (ret[i] == 0) break;
			if (i) cout << ' ';
			cout << ret[i];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3456
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;


public class Test
{	
    public static void Main()
	{
	    int[] n = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        if(Math.Abs(n[0]-n[2]) <= n[3]) Console.WriteLine("Yes");
        else if (Math.Abs(n[0]-n[1]) <= n[3] && Math.Abs(n[1]-n[2]) <= n[3])
        {
            Console.WriteLine("Yes");
        }
        else Console.WriteLine("No");
	} 
}

Measured memory_bytes: 13396
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());
    vector<bool> v(A[N-1]+ 1, true);
    int ans = 0;
    REP(i, N){

        if (!v[A[i]]) continue;
        int tmp = A[i];
        while(tmp <= A[N-1]){
            v[tmp] = false;
            tmp += A[i];
        }
        if ((i < N - 1 && A[i] == A[i+1]) || (i > 0 && A[i] == A[i-1])) {
            continue;
        }
        //cout << A[i] << endl;
        ans++;
    }
    cout << ans << endl;




    return 0;
}

Measured memory_bytes: 3684
#include <algorithm>
#include <bitset>
#include <cfloat>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define ll long long
#define eps DBL_EPSILON
#define mod (ll)1000000007
#define INF LLONG_MAX/10
#define P pair<int,int>
#define prique priority_queue
using namespace std;
int v, e, s, t, d, edge[15][15];;
int dp[100000][15];
signed main() {
	cin >> v >> e;
	rep(i, v) {
		rep(j, v)edge[i][j] = INF;
	}
	rep(i, e) {
		cin >> s >> t >> d;
		edge[s][t] = d;
	}
	int ans = INF;
	rep(s, v) {
		rep(i, ((ll)1 << v)) {
			rep(j, v)dp[i][j] = INF;
		}
		dp[((ll)1 << v) - 1 - ((ll)1 << s)][s] = 0;
		for (int i = ((ll)1 << v) - 1; i > 0; i--) {
			rep(j, v) {
				if (((i >> j) & 1) == 0)continue;
				rep(k, v) {
					if (edge[k][j] != INF) {
						dp[i - ((ll)1 << j)][j] = min(dp[i - ((ll)1 << j)][j], dp[i][k] + edge[k][j]);
					}
				}
			}
		}
		rep(i, v) {
			ans = min(ans, dp[0][i] + edge[i][s]);
		}
	}
	if(ans!=INF)cout << ans << endl;
	else cout << -1 << endl;
	return 0;
}


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

int main() {
   long long  int x=0,y=0,r=0,z=0;
    cin>>r;
   x=r/500;
  z=r%500;
   y=x*1000;
    y+=(z/5)*5;
    cout<<y;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define forr(i,a,n)	for(long long int i=a; i<n; i++)
#define loop(i,a,n)	for(long long int i=a; i>=n; i--)

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

	int a;
	cin>>a;
	int b[a];
	map<int,int> m;
	forr(i,0,a-1)
	{
		cin>>b[i];
		m[b[i]]++;
	}
	vector<int> v(a+1);
	for(auto const x: m)
		v[x.first]=x.second;
	forr(i,1,a+1)
		cout<<v[i]<<'\n';
	
	return 0;	
}

Measured memory_bytes: 14244
#include <cstdio>
using namespace std;
int n;
char cond[3005];
long long arr[3005],pre[3005];
const long long mod=1000000007;
int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for (int x=1;x<=n;x++) cond[x]=getchar();
    arr[1]=1;
    for (int x=1;x<=n;x++) pre[x]=1;
    for (int x=2;x<=n;x++){
        for (int y=1;y<=x;y++){
            if (cond[x]=='<') arr[y]=pre[y-1];
            else arr[y]=(pre[n]-pre[y-1]+mod)%mod;
        }
        for (int y=1;y<=n;y++) pre[y]=(pre[y-1]+arr[y])%mod;
        //for (int y=1;y<=n;y++) printf("%d ",arr[y]);
        //printf("\n");
    }
    printf("%d\n",pre[n]);
}


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

int main()
{
    long long n, m;
    cin >> n >> m;

    // n<=mにする
    if (n > m)
        swap(n, m);

    long long answer = -1;
    if (n == m)
    {
        answer = 1;
        for (long long i = n; i > 1; i--)
        {
            answer = (answer * i) % 1000000007;
            answer = (answer * i) % 1000000007;
        }
        answer = (answer * 2) % 1000000007;
    }
    else if (n + 1 == m)
    {
        answer = 1;
        for (long long i = n; i >= 1; i--)
        {
            answer = (answer * i) % 1000000007;
        }
        for (long long i = m; i >= 1; i--)
        {
            answer = (answer * i) % 1000000007;
        }
    }
    else
    {
        answer = 0;
    }

    cout << answer << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using vect=vector<double>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
#define gcd(x,y) __gcd(x,y)
#define erase(s) s.erase(s.end()-1) //文字列sの末尾削除
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*y/z;
}
ll primejudge(ll n){
  if(n<2)return 0;
  else if(n==2)return 1;
  else if(n%2==0)return 0;
  double sqrtn=sqrt(n);
  Loop(i,3,sqrtn+1){
     if(n%i==0){
        return 0;
     }
     i++;
  }
  return 1;
}
string RLE(string s){
  ll n=s.size();
  char now='.';
  ll count=1;
  string press;
  loop(i,n){
    if(s[i]!=now){
      if(i){
        press+=now;
        press+=to_string(count);
      }
      now=s[i];
      count=1;
      continue;
    }
    else count++;
  }
  press+=now;
  press+=to_string(count);
  return press;
}
int main() {
  cout << fixed << setprecision(30);
  string s;
  cin>>s;
  if(s[0]==s[1]&&s[1]==s[2]){
    putout("No");
  }
  else putout("Yes");
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int x[3001], y[3001];
	int i = 0;

	while (1) {
		cin >> x[i] >> y[i];
		if (x[i] == 0 && y[i] == 0) {
			break;
		}
		i++;
	}

	for (int j = 0;j < i;j++) {
		if (y[j] < x[j]) {
			int box;
			box = y[j];
			y[j] = x[j];
			x[j] = box;
		}
		cout << x[j] << " " << y[j] << endl;
	}


	return 0;
}


Measured memory_bytes: 3088
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}
use input::*;

use std::cmp;

fn dfs(
    v: &Vec<isize>,
    n: usize,
    a: isize,
    b: isize,
    c: isize,
    x: isize,
    y: isize,
    z: isize,
) -> isize {
    if n == v.len() {
        if a == 0 || b == 0 || c == 0 {
            return 99999999;
        }
        return (a - x).abs() + (b - y).abs() + (c - z).abs() - 30;
    }

    let mut ans = 99999999;
    ans = cmp::min(ans, dfs(v, n + 1, a, b, c, x, y, z));
    ans = cmp::min(ans, dfs(v, n + 1, a + v[n], b, c, x, y, z) + 10);
    ans = cmp::min(ans, dfs(v, n + 1, a, b + v[n], c, x, y, z) + 10);
    ans = cmp::min(ans, dfs(v, n + 1, a, b, c + v[n], x, y, z) + 10);
    ans
}

fn main() {
    let (n, a, b, c): (usize, isize, isize, isize);
    input!(n, a, b, c);
    let mut v = Vec::new();

    for _ in 0..n {
        let buf: isize;
        input!(buf);
        v.push(buf);
    }

    p(dfs(&v, 0, 0, 0, 0, a, b, c));
}

Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

int main() {
    ll N;
    cin >> N;
    vector<int>prime = {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};

    vector<ll> num(prime.size()+1,0);
    for(int i=1;i<=N;i++){
        ll tmp=i;
        for(int i=0;i<prime.size();i++){
            while(tmp%prime[i]==0){
                tmp/=prime[i];
                //num[prime[i]]++;
                num[i]++;
            }
        }
    }
    ll ans=0;
    ll n = prime.size();
    //75=3*5*5のとき
    for(int i=0;i<=n;i++){
        ll tmp1=0;
        if(num[i]-2>=0){
            tmp1++;
        }
        for(int j=0;j<=n;j++){
            ll tmp2=0;
            if(num[j]-4>=0)tmp2=1;
            for(int l=j+1;l<=n;l++){
                if(i==j || i==l || j==l) continue;
                ll tmp3=0;
                if(num[l]>=4) tmp3=1;
                ans+=tmp1*tmp2*tmp3;
            }
        }
    }
    //75=15*5
    for(int i=0;i<=n;i++){
        ll tmp1=0;
        if(num[i]-4>=0){
            tmp1++;
        }
        for(int j=0;j<=n;j++){
            if(i==j)continue;
            ll tmp2=0;
            if(num[j]-14>=0){
                tmp2++;
            }
            ans+=tmp1*tmp2;
        }
    }
    //75=3*25
    for(int i=0;i<=n;i++){
        ll tmp1=0;
        if(num[i]-2>=0){
            tmp1++;
        }
        for(int j=0;j<=n;j++){
            if(i==j) continue;
            ll tmp2=0;
            if(num[j]-24>=0){
                tmp2++;
            }
            ans+=tmp1*tmp2;
        }
    }
    //75=75
    for(int i=0;i<=n;i++){
        ll tmp1=0;
        if(num[i]-74>=0){
            tmp1++;
        }
        ans+=tmp1;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

n, m = inm()
sc = [tuple(inm()) for i in range(m)]


def digits(x):
    if x < 10:
        return 1
    if x < 100:
        return 2
    return 3


def solve():
    for x in range(1000):
        if digits(x) != n:
            continue
        sx = str(x)
        ok = True
        for i in range(m):
            s, c = sc[i]
            if sx[s - 1] != str(c):
                ok = False
                break
        if ok:
            return x

    return -1


print(solve())


Measured memory_bytes: 9128
// https://atcoder.jp/contests/abc169/tasks/abc169_e

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline ll len(V<T> arr) {
  return arr.size();
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  ll N;
  cin >> N;

  VL ls(N), rs(N);
  rep(i, N) cin >> ls[i] >> rs[i];

  sort(all(ls));
  sort(all(rs));

  ll res;

  if (N % 2 == 1) {
    ll mi = ls[N / 2];
    ll ma = rs[N / 2];
    res = ma - mi + 1;
  } else {
    ll mi_doubled = ls[N / 2 - 1] + ls[N / 2];
    ll ma_doubled = rs[N / 2 - 1] + rs[N / 2];
    res = ma_doubled - mi_doubled + 1;
  }

  cout << res << "\n";
}


Measured memory_bytes: 6348
a,b,c,k = map(int, input().split())
'''
#  = list(map(int, input().split()))
'''
'''
n = input()
a = [int(input()) for i in range(n)]
'''
'''
n,m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
'''
 
#-------------------------------#
#len(t)==len(s)+1
#print(a,b,c,k)
if a>=k:
    print(k)
elif a+b>=k:
    print(a)
elif a+b+c>=k:
    print(a-(k-a-b))

Measured memory_bytes: 9180
import scala.collection.mutable.Stack


object Main {
  def main(args: Array[String]) = {
    val lst = io.StdIn.readLine.split(" ")

    val num = "\\d+".r

    // println(lst.toList)

    val stack = new Stack[Int]

    lst map {
      case "+" =>
        val lft = stack.pop
        val rgt = stack.pop
        stack push rgt + lft
      case "-" =>
        val lft = stack.pop
        val rgt = stack.pop
        stack push rgt - lft
      case "*" =>
        val lft = stack.pop
        val rgt = stack.pop
        stack push rgt * lft
      case other => stack push other.toInt
    }

    println(stack.pop)
  }
}



Measured memory_bytes: 43852
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <bitset>
#include <numeric>
#include <cmath>
#include <tuple>
#include <queue>
#include <set>

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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


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

    int N;

    cin >> N;

    for(int i = 0; i < 1000; i++){
        if((N + i) % 111 == 0){
            cout << (N+i) << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 256
n, y = map(int, input().split())
a = b = c = -1
state = False
i = j = k = 0
for p in range(n+1):
    j = 0
    for q in range(n+1-i):
        k = n - i - j
        if 10000 * i + 5000 * j + 1000 * k == y:
             state = True
             a,b,c = i,j,k
             break
        j += 1
    if state:
        break
    i += 1

print(a, b, c)



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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<char, ll> pcl;

#define m0(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define asort(x) sort(all(x));
#define dsort(x, t) sort(x.begin(), x.end(), greater<t>());
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define MINS(m, s) m.insert(mp(s, 1));
#define MFIN(m, s) m.find(s) != m.end()
#define mp make_pair
#define pb push_back
#define INF (1 << 29)
const int mod = 1000000007;

void solved(int a, int b, int c, int k) {
    if(b > a && c > b) {
        cout << "Yes" << endl;
        exit(0);
    }
    if(k <= 0) {
        return;
    }
    solved(a * 2, b, c, k - 1);
    solved(a, b * 2, c, k - 1);
    solved(a, b, c * 2, k - 1);
}

int main() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    solved(a, b, c, k);
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3628
from collections import deque

INF = -1

nVertices, nEdges = map(int, input().split())
edges = [[] for _ in range(nVertices + 1)]
for _ in range(nEdges):
    u, v = map(int, input().split())
    edges[u].append(v)
s, t = map(int, input().split())

dist = [[INF for _ in range(3)] for _ in range(nVertices + 1)]
dist[s][0] = 0
q = deque()
q.append((s, 0))
while q:
    curVertex, curDist = q.popleft()
    for nextVertex in edges[curVertex]:
        nextDist = curDist + 1
        if dist[nextVertex][nextDist % 3] == INF:
            dist[nextVertex][nextDist % 3] = nextDist
            q.append((nextVertex, nextDist))

print(dist[t][0] // 3 if dist[t][0] != INF else INF)


Measured memory_bytes: 71328
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    string s; cin>>s;
    stack<char> st;
    for(auto c:s){
        if(c=='B'){
            if(st.size()) st.pop();
        }
        else st.push(c);
    }
    string ans;
    while(st.size()){
        ans+=st.top();
        st.pop();
    }
    reverse(all(ans));
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 
 
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
 
int gcd(int a, int b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
 
long long lcm (int a, int b){
    return  (long long) a*b /gcd(a,b);
}

long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }


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

    vector<long long>L(N);
    rep(i,N)cin >> L[i];

    sort(L.begin(),L.end());

    int ans = 0;
    for(int i = 0; i<N; i++){
        for(int j = i+1; j<N; j++){
            for(int k = j+1; k<N; k++){
                if(L[i] != L[j] && L[j]!= L[k] && L[k]!= L[i]){
                    if(L[k]-L[j] < L[i])ans++;
                }
            }
        }
    }

    cout << ans << endl;

}



Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=m-1; i>=n; i--)
#define SORT(v,n) do{sort(v,v+n);reverse(v,v+n);}while(0)
#define all(x) (x).begin(),(x).end()
#define EPS (1e-7)
#define INF (1e18)
#define PI (acos(-1))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
typedef pair<ll, ll> LP;

ll POW(ll x,ll n){
  if(n==0)return 1;
  if(n%2==0)return POW(x*x,n/2)%MOD;
  return x%MOD*POW(x,n-1)%MOD;
}

ll POW2(ll x,ll n){
  if(n==0)return 1;
  if(n%2==0)return POW2(x*x,n/2);
  return x*POW2(x,n-1);
}

ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}

ll lcm(ll u, ll v) {
  return u*v/gcd(u,v);
}
 
ll KAI(ll m)
{
  if(m<0) return 0;
  if(m==0) return 1;
  return m*KAI(m-1)%MOD;
}
 
ll KAI2(ll m)
{
  if(m<0) return 0;
  if(m==0) return 1;
  return m*KAI2(m-1);
}

ll extGCD(ll a, ll b, ll &x, ll &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a / b * x;
    return d;
}
 
inline ll mod(ll a, ll m) {
    return (a % m + m) % m;
}
 
ll modinv(ll a) {
    ll x, y;
    extGCD(a, MOD, x, y);
    return mod(x, MOD);
}
 
ll COM(ll m,ll n)
{
  if(m<n) return 0;
  if(n<0) return 0;
  if(n==0) return 1;
  if(m==n) return 1;
  return KAI(m)%MOD*modinv(KAI(n)%MOD*KAI(m-n)%MOD)%MOD;
}

ll COM2(ll m,ll n)
{
  if(m<n) return 0;
  if(n<0) return 0;
  if(n==0) return 1;
  if(m==n) return 1;
  return KAI2(m)/KAI2(n)/KAI2(m-n);
}

ll DEC(ll x,ll m,ll n)
{
  return x%POW(m,n+1)/POW(m,n);
}

ll keta(ll x,ll n)
{
  if(x==0)return 0;
  return keta(x/n,n)+1;
}

ll DIV(ll x,ll n)
{
  if(x==0)return 0;
  return x/n+DIV(x/n,n);
}

ll ORD(ll x,ll n)
{
  if(x==0)return INF;
  if(x%n!=0)return 0;
  return 1+ORD(x/n,n);
}

int main()
{
  ll r,d,x;
  cin >> r >> d >> x;
  rep(i,10){
    x=r*x-d;
    printf("%lld\n",x);
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for(i = a; i < b; i++)
#define per(i, a, b) for(i = a; i >= b; i--)
#define all(x) x.begin(), x.end()
#define trav(x, it) for(auto it = x.begin(); it != x.end(); it++)
#define pr(x) cout << #x << " = " << x << endl
#define fill(x,y) memset(x,y,sizeof(x))
#define endl "\n"
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector< pii > vpii;
typedef vector< pll > vpll;
double eps = 1e-7;
ll mod = 1000000007;
ll N = 998244353;

ll binpow(ll b, ll p){ ll ans = 1; while(p > 0){if(p & 1) ans = (ans * b) % mod; b = (b * b) % mod; p >>= 1;}return ans;}
ll modinv(ll x){return binpow(x, mod - 2);}

void solve()
{
	int a, b;
	cin >> a >> b;
	cout << a * b << endl;
}

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

	int t = 1;
	//cin >> t;
	while(t--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 3620
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P	  = pair<ll, ll>;
using mat = vector<vector<ll>>;
typedef string::const_iterator State;
class ParseError {};

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

constexpr ll INF = 1e16;
constexpr ll INM = 114514;
constexpr ll MOD = 1e9 + 7;
constexpr ld EPS = 1e-12;

template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}
ll powm(ll a, ll b, ll c) {
	if (b == 0)
		return 1;
	else if (b % 2 == 0) {
		ll d = powm(a, b / 2, c);
		return (d * d) % c;
	} else
		return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll dx[4] = {1, 0, -1, 0};
ll dy[4] = {0, 1, 0, -1};

ll g[200][200];
ll d[200][200];

int main() {
	IOS();
	ll x, y;
	cin >> x >> y;
	ll a = (x + y) / 3;
	ll b = (2 * y - x) / 3;
	ll c = (2 * x - y) / 3;
	if ((x + y) % 3 != 0 || b < 0 || c < 0) {
		dump(0);
		return 0;
	}
	vector<ll> p(1e6, 1);
	for (int i = 2; i < 1e6;i++) {
		p[i] = i * p[i - 1];
		p[i] %= MOD;
	}
	ll ans = ((p[a] * powm(p[b], MOD - 2, MOD)) % MOD) * powm(p[c], MOD - 2, MOD);
	ans %= MOD;
	dump(ans);
}

Measured memory_bytes: 8064
def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    """
    6 5 6 5
    """
    x = read_int()
    answer = (x//11)*2
    if x%11 > 6:
        answer += 2
    elif x%11 > 0:
        answer += 1
    return answer


if __name__ == '__main__':
    print(solve())


Measured memory_bytes: 61864
import std.stdio;
import std.string;
import std.conv;
import std.algorithm.searching;

void main(){
	auto l = readln.chomp;
	auto x = l.to!long;
	long u = 0;
	while(x >= 500)
	{
		u += 1000;
		x -= 500;
	}
	while(x >= 5)
	{
		u+= 5;
		x -= 5;
	}
	u.writeln;

}

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

int main(){
    int a,b;
    vector<int>x,y;
    while(1){
        cin>>a>>b;
        if(a==0&&b==0)break;
        if(a<b)x.push_back(a),y.push_back(b);
        else x.push_back(b),y.push_back(a);
    }
    for(int i=0; i<x.size(); ++i){
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3096
def a_handler(a, b, c, result)
  router = 0
  for i_a in 0..a
    for i_b in 0..b
      for i_c in  0..c
        total = 500*i_a + 100*i_b + 50*i_c
        if total == result
          router += 1
        end
      end
    end
  end
  return router
end

a = gets.to_i
b = gets.to_i
c = gets.to_i
result = gets.to_i
p a_handler(a, b, c, result)

Measured memory_bytes: 1788
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
using namespace std;
using ll = long long;

const ll p=1e9+7;

int main(){
  string S;
  cin >> S;
  int N=S.size();
  int r=0;
  int k=1;
  vector<int> que;
  for(int i=0;i<N;i++){
    if(S[N-i-1]!='?'){
      r=((S[N-i-1]-'0')*k+r)%13;
    }
    else{
      que.push_back(k);
    }
    k=k*10%13;
  }
  int M=que.size();
  vector<ll> num(13,0);
  num[r]++;
  for(int i=0;i<M;i++){
    int q=que[i];
    vector<ll> curnum(13,0);
    for(int j=0;j<13;j++){
      if(num[j]==0){
        continue;
      }
      for(int k=0;k<=9;k++){
        curnum[(j+q*k)%13]=(curnum[(j+q*k)%13]+num[j])%p;
      }
    }
    for(int j=0;j<13;j++){
      num[j]=(curnum[j])%p;
    }
  }
  cout << num[5] << endl;
}

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

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	if (a + b > 2 * c) {
		int z = min(x, y);
		x -= z;
		y -= z;
		int sum = 2 * z * c;
		if (x > 0) {
			if (a > 2 * c) sum += 2 * x * c;
			else sum += x * a;
		}
		if (y > 0) {
			if (b > 2 * c) sum += 2 * y * c;
			else sum += y * b;
		}
		cout << sum << '\n';
	} else cout << a * x + b * y << '\n';
	return 0;
}


Measured memory_bytes: 256
s=input()
t=s
s_list=list(s)
for i in range(len(t)):
    if s_list[i]=='?':
        
        
        if s_list[i-1]=='D':
            if i==len(t)-1:
                s_list[i]='D'
            elif s_list[i+1]=='P':
                s_list[i]='D'
            elif s_list[i+1]=='D':
                s_list[i]='P'
            else:
                s_list[i]='P'
          
        else:
            s_list[i]='D'
    
s_cha="".join(s_list)            
print(s_cha)            


Measured memory_bytes: 10960
n = int(input())
f = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
ans = -10**9
for bit in range(1,2**10):
  t = [0]*10
  for k in range(10):
    if bit&(2**k):
      t[k] = 1
  pat = [0]*n
  for a in range(10):
    for b in range(n):
      if f[b][a]&t[a]:
        pat[b] += 1
  ben = 0 
  for x in range(n):
    ben += p[x][pat[x]]
  if ans < ben:
    ans = ben
print(ans)

Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

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

  string s;
  cin >> s;
  cout << ((s.back() == 's') ? s + "es" : s + "s") << endl;

  return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>

int fib(int);
int num[45];

int main(void){
  int n;
  scanf("%d",&n);
  printf("%d\n",fib(n));
  return 0;
}

int fib(int x){
  int i;

  num[0] = 1;
  num[1] = 1;

  for( i = 2 ; i <= x ; i++ ){
    num[i] = num[i-1] + num[i-2];
  }
  return num[x];
}

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

typedef long long ll;

const ll most = 1e9;

bool query(ll val){
	std::cout << "? " << val << std::endl;
	
	char c;
	std::cin >> c;
	
	return (c == 'Y');
}

int main(){
	ll length = 1;
	
	if(!query(9)){
		for(ll i = 10; i <= most; i *= 10){
			if(query(i * 10 - 1)){
				length = i;
				break;
			}
		}
	}
	
	if(!query(most)){
		for(ll i = most; i >= 1; i /= 10){
			if(query(i)){
				length = i;
				break;
			}
		}
	}
	
	ll l = length;
	ll r = length * 10 - 1;
	
	ll best = r;
	
	while(l <= r){
		ll mid = (l + r) / 2;
		
		if(query(mid * 10)){
			r = mid - 1;
			best = mid;
		} else {
			l = mid + 1;
		}
	}
	
	std::cout << "! " << best << std::endl;
}

Measured memory_bytes: 684
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        int[] h = new int[n];

        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
            h[i] = sc.nextInt();
        }

        int cx = 0;
        int cy = 0;
        int ch = -1;
        label:
        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                boolean isAns = true;
                cx = i;
                cy = j;
                ch = -1;

                for (int k = 0; k < n; k++) {
                    if (h[k] == 0)
                        continue;
                    if (ch == -1) {
                        ch = Math.abs(x[k] - cx) + Math.abs(y[k] - cy) + h[k];
                    } else {
                        int tmp = Math.abs(x[k] - cx) + Math.abs(y[k] - cy) + h[k];
                        if (ch != tmp) {
                            isAns = false;
                            break;
                        }
                    }
                }

                if (isAns) {
                    for (int k = 0; k < n; k++) {
                        if (h[k] > 0)
                            continue;
                        int tmp = Math.abs(x[k] - cx) + Math.abs(y[k] - cy);
                        if (ch > tmp) {
                            isAns = false;
                            break;
                        }
                    }
                }

                if (isAns && ch > 0)
                    break label;
            }
        }

        System.out.println(cx + " " + cy + " " + ch);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

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

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

Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll H,W,h,w;
    cin>>H>>W;
    cin>>h>>w;
    cout<<H*W-(h*W+H*w-h*w)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;

string a, b, c, d, e, f;

int main() {
	

	cin >> a >> b >> c;

	d = toupper(a[0]);
	e = toupper(b[0]);
	f = toupper(c[0]);
	cout << d << e << f << endl;
	return 0;
}


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

void fnInput(int& rnMaxNum)
{
  cin >> rnMaxNum;
}

int64_t fnConvInt(const vector<char>& cnrvcNum)
{
  const vector<int> cnvnNum = {0, 3, 5, 7};

  vector<char> vcRevNum(cnrvcNum);
  reverse(begin(vcRevNum), end(vcRevNum));

  int64_t nNum = 0;
  for (int i = 0; i < vcRevNum.size(); i++)
  {
    if (vcRevNum[i] == '0') break;
    nNum += cnvnNum[ vcRevNum[i] - '0' ] * pow(10, i);
  }

  return nNum;
}

int fnDgt753_Check(const vector<char>& cnrvcNum)
{
  int nDig3 = 0, nDig5 = 0, nDig7 = 0;

  for (int i = 0; i < cnrvcNum.size(); i++)
    if      (cnrvcNum[i] == '1') nDig3++;
    else if (cnrvcNum[i] == '2') nDig5++;
    else if (cnrvcNum[i] == '3') nDig7++;

  if (nDig3 && nDig5 && nDig7)
    return 1;
  else
    return 0;
}

int fnDgt753_Count(int nMaxNum)
{
  vector<char> vcNum(10, '0');
  int nDgt753Cnt = 0;

  while (true)
  {
    vcNum[vcNum.size() - 1]++;
    for (int i = vcNum.size() - 1; i >= 1; i--)
      if (vcNum[i] > '3')
      {  
        vcNum[i - 1]++;
        vcNum[i] = '1';
      }
      else
        break;

    if (!fnDgt753_Check(vcNum)) continue;
    if (fnConvInt(vcNum) > nMaxNum) break;
    nDgt753Cnt++;
  }

  return nDgt753Cnt;
}

int main()
{
  int nMaxNum;

  fnInput(nMaxNum);
  cout << fnDgt753_Count(nMaxNum) << endl;

  return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
cnta = [0]*(n+1)
cntb = [0]*(n+1)
ta = 0
tb = 0
s = [0]*(n+1)
for i in range(n):
    cnta[a[i]] += 1
    cntb[b[i]] += 1
    s[a[i]] += 1
    s[b[i]] += 1
if max(s) > n:
    print("No")
    exit()
print("Yes")
m = 0
for i in range(1,n+1):
    cnta[i] += cnta[i-1]
    cntb[i] += cntb[i-1]
for i in range(1,n+1):
    m = max(m,cnta[i]-cntb[i-1])
# print(m)
# print(cnta)
# print(cntb)
print(*b[-m:]+b[0:-m])

Measured memory_bytes: 120760
N = int(input())
n_dict = {}
for i in range(N):
  s = input()
  if s in n_dict.keys():
    n_dict[s] = n_dict[s] + 1
  else:
    n_dict[s] = 1

max_n = max(n_dict.values())

max_s = [s for s in n_dict.keys() if n_dict[s] == max_n]

max_s.sort()

for s in max_s:
  print(s)

Measured memory_bytes: 32096
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<map>
#include<set>

using namespace std;

typedef long long ll;
typedef vector<int> VI;

#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR1(i,n) for(int (i)=1;(i)<(n);(i)++)
#define eFOR(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define eFOR1(i,n) for(int (i)=1;(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())

int main() {

	int n, ans = 0;
	cin >> n;
	set<int> a;
	map<int, int> m;
	FOR(i, n) {
		int A;
		cin >> A;
		a.insert(A - 1);
		a.insert(A);
		a.insert(A + 1);
		m[A - 1]++;
		m[A]++;
		m[A + 1]++;
	}
	auto itr = a.begin();
	FOR(i, a.size()) {
		ans = max(ans, m[*itr]);
		itr++;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 9088
function main(arg) {
  const _a: string[] = arg.split("\n")
  const _n: number = Number(_a[0])
  const _m: string[] = _a[1].split(" ")
  let list: number[] = []

  for (let i = 0; i < _m.length;i++) {
    list.push(Number(_m[i]))
  }

  while (list.length != 1){
    let min: number = list.reduce((a, b) => a < b ? a : b)
    // console.log(min)
    if (min == 1) return console.log(min)

    for (let j = 0; j < list.length; j++) {
      let div: number = list[j] - Math.floor(list[j] / min) * min 
      if (list[j] == min) {
        list[j] = min
      } else if (div > 0){
        list[j] = div
      } else {
        list[j] = min
      }
    }

    list = list.filter(function (x, i, self) {
      return self.indexOf(x) === i;
    });
  }

  return console.log(list[0])
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 28256
n = int(input())
s = []
for i in range(n):
    s.append(input())

dicts = {}
for i in s:
    if i not in dicts:
        dicts[i] = 1
    else:
        dicts[i] += 1

max_v = max(dicts.values())
a = [k for k, v in dicts.items() if v == max_v]
b = sorted(a)
[print(i) for i in b]

Measured memory_bytes: 35596